Posts

Powershell magnling ascii text -

i'm getting characters , lines when trying modify hosts files. example, select string not take out, 2 files different: get-content -encoding ascii c:\windows\system32\drivers\etc\hosts | select-string -encoding ascii -notmatch "thereisnolinelikethis" | out-file -encoding ascii c:\temp\testfile ps c:\temp> (get-filehash c:\windows\system32\drivers\etc\hosts).hash c54c246d2941f02083b85ce2774d271bd574f905babe030cc1bb41a479a9420e ps c:\temp> (get-filehash c:\temp\testfile).hash ac6a1134c0892ad3c5530e58759a09c73d8e0e818ec867c9203b9b54e4b83566 i can confirm commands inexplicably result in line breaks in output file, in start , in end. powershell converts tabs in original file 4 spaces instead. while cannot explain why, these commands same thing without these issues: try code instead: get-content -path c:\windows\system32\drivers\etc\hosts -encoding ascii | where-object { -not $_.contains("thereisnolinelikethis") } | out-file -fil...

html - Why is the text being transparent? -

html: <!doctype html> <html> <head> <link rel="stylesheet" type="text/css" href="style.css"> <script src="script.js"></script> <title>cool effect</title> </head> <body> <div class="imageholder"> <span class="note">hello!</span> <img src="picture1.jpeg"> </div> </body> </html> css: .imageholder { position: relative; border: 1px solid black; width: 300px; height: 250px; text-align: center; overflow: hidden; background-color: black; } .note { position: absolute; top: 50%; left: 50%; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); border: 2px solid white; padding: 8px; color: white; opacity: 1; font-size: 24px; display: inline-block; } img { width: 300; opacity: 0.4...

css - Remove Blue highlighting of option -

i've got select options: <select style="display: inline-block;" class="shs-select form-select shs-select-level-1" size="10" id="edit-shs-term-node-tid-depth-select-1"> <option value="0">- none -</option> <option value="87">a</option> <option value="88">b</option> <option value="89">c</option> <option value="95">d</option> <option value="90">e</option> </select> hohe can remote blue highlighting of option, in 1 selected? thanks answers. some browsers chrome use outline default. can disable removing it. select { outline: none; } .no-outline { outline: none; } <div> <strong> outline </strong> <select> <option> </option> <option> b </option> <option> c </option>...

android - Phonegap- Facebook connect. Api calls doesn't fire any callback -

i'm using phonegap build. first of all, need error doesn't happen if try administrator account of app. happen if normal user tries login in app. this code far. var facebookpermissions = ['public_profile', 'email', 'user_about_me', 'user_website']; $(document).on('click', '#btnfacebook', function() { //click facebookconnectplugin.login(facebookpermissions, onfacebookloginsuccess, onfacebookloginerror) }); function onfacebookloginsuccess(userdata) { alert("userdata: " + json.stringify(userdata)); facebookconnectplugin.api('me', facebookpermissions, function(result) { alert("result: " + json.stringify(result)); }); }; i'm app's administrator , every work expected... no trouble @ all. if user tries login, login works well, there no response api request. first alert displayed i tried parameters facebookconnectplugin.api("/?fields=id,email...

javascript - How to get dynamic value from URL -

Image
i studying on angularjs there want load content mysql in reference url value. the angularjs routeprovider used this: $routeprovider.when('/page/pages=:pages', { templateurl: 'page.html', reloadonsearch: false }); my dynamic url is: "<a class='list-group-item' href='#/page/pages=" + slug + "'>" + title + " <i class='fa fa-chevron-right pull-right'></i>" + "</a>" after that, tried alert url location on phonegap (screenshot attached) now, want pass pages value ajax result query mysql. $(function () { //----------------------------------------------------------------------- // 2) send http request ajax http://api.jquery.com/jquery.ajax/ //----------------------------------------------------------------------- jquery.ajax({ url: 'http://keralapsctuts.com/app/index.php', //the script call data data: ...

jquery post() response not comparing to string -

in advance help, i'm having problem response of post(), when trying compare string, code is: $.post( "cand.php?id=<?php echo $user_id; ?>", { accion: "eliminar"}) .done(function(data) { console.log ($.type(data)); console.log (data); console.log (data === 'ok'); }); and console answers are: string ok false as cas see data var string value of "ok" when compare string, it's false

escaping - Removing new lines and escape characters introduced when reading file in PHP -

{ "elements": [ { "cardtype": "textcard", "title": "final fantasy", "titlesize": "medium" } ] } the above content of file. want return in response. use file_get_contents read contents, however, this: {\n \"elements\": [\n {\n \"cardtype\": \"textcard\",\n \"title\": \"final fantasy\",\n \"titlesize\": \"medium\",\n ... the new lines , escaping not want. there way avoid that? use following code removing \n data. $filedata = str_replace(array("\r", "\n"), '', file_get_contents($filename));