Posts

.net - Saving files in Windows Store apps -

my program handles files specified user. after preferable retain modified file directory of source file. storagefolder.getfolderfrompathasync method returns "access denied" . file type associations in manifest can not added because after processing files retain extension. , kind of file (with extension), user chooses impossible. code in error occurs. internal async static void setfile(list<byte> bytearray , storagefile file) { try { string path = path.getdirectoryname(file.path); storagefolder newfolder = await storagefolder.getfolderfrompathasync(path); storagefile newfile = await newfolder.createfileasync(string.format(@"crt{0}", path.getfilename(file.name)), creationcollisionoption.failifexists); stream stream = await file.openstreamforwriteasync(); binarywriter writer = new binarywriter(stream); writer.write(bytearray); writer.flush(); ...

compression - Get compressed and uncompressed page size with PHP -

http://www.gidnetwork.com/tools/gzip-test.php great tool, need test site behind walls , want find similar results: compression type, markup size, compressed page size, , compression ratio. how can both compressed , uncompressed page sizes? better method fetching data ( file_get_contents() or curl )? the response headers contain else needed - i'm not sure sizes. you have use curl there 2 reasons so: as need headers of request , can have through curl easily file_get_contents() used internally include things , not external source fetch data. if used external purposes there issue memory limit, size etc. have taken great care of.

ios - Simple NSData's category to parse XML with cyrillic -

i have parse nsdata xml string, know simple category it? have such json, forced use xml. tried use xmlreader, it's interface looks clean, found issues: mysterious new line characters , spaces everywhere: "comment_count" = {text = "\n \n 21";}; my cyrillic symbols looks so: "description_text" = {text = "\n \u041f\u0438\u043a\u0430\u0431\u0443\u0448}; example: <?xml version="1.0" encoding="utf-8" ?> <news> <xml_count>43</xml_count> <hot_count>449</hot_count> <item type="text"> <id>1469845</id> <rating>147</rating> <pluses>171</pluses> <minuses>24</minuses> <title> <![cdata[Обновление огромного архива Пикабу!]]> </title> <comment_count>26</comment_count> <com...

arrays - Echo only info - Session PHP -

how can echo information in session people added them self? script: <?php session_start(); $array = $_session["wenslijst"]; if (isset($_post["item"]) && (int)$_post["item"] > 0) { if (!isset($_session["wenslijst"])) { $_session["wenslijst"] = array(); $_session["aantal"] = array(); } $i = 0 ; while ($i < count($_session["wenslijst"]) && $_session["wenslijst"][$i] != $_post["item"]) $i++; if ($i < count($_session["wenslijst"])) { $_session["aantal"][$i]++; } else { $_session["wenslijst"][] = $_post["item"]; $_session["aantal"][] = 1; } } ?> when add product array looks this, echo bold message: (see long code spefic number product) array ( [0] => ar...

vba - Access Excel parameter passing -

i have table in access has accessed in excel. set macro dumps whole table , filters based on particular cell within vba since have 20,000 records slows sheet. is there faster way of passing parameter? the method tried 1 of answers posted previously •in excel go data ribbon , click other sources icon •click microsoft query •select ms access database* •browse , select database. •in wizard select columns need import •on next page select column want filter on •select type of filter need, i.e. equals •instead of selecting value in next box enter [parameter please bob] •enter sort on next page •select return data microsoft excel , finish but somehow not able pass excel cell parameter. trying running in vba trying figure out how works out manually. any appreciated. thanks aprough, followed through procedure not selects parameters field once have set up, right-click anywhere in returned data , choose parameters. select parameter on left, , choose "get value fol...

ruby on rails 3 - Will CSRF token warning prevent devise from having a current user? -

i use jquery ajax update timeslot model page showing campaign. campaign signup sheet columns of days , rows of time_slots. user can join timeslot clicking correct checkbox. when implemented feature several months ago wasn't getting errors. now, i'm getting 500 error saying there internal server error. did digging , appears error caused devise's current_user method not returning value. there csrf warning in log. causes nilclass returned , mismatched type exception thrown. causes 500 error. do need supply csrf token information in ajax call? if do, best way it? you can skip csrf check controller action ajax calling with: skip_before_filter :verify_authenticity_token, :only => :some_action

osx - How do I programmatically move Spaces' focus to a particular Space a window I want to focus on lives on Mac OS X with Objective-C? -

in osx menubar application, user can open particular application nswindow dropdown menu item. being menubar application, accessible any desktop (a desktop in mission control 'space' ). i've got reference window programmatically. say user has clicked menu item while on desktop 1 , active desktop. naturally, nswindow created, opened, brought front. lives on desktop 1 the user browses desktop 2 , it's active desktop. the user clicks on menu item again. since window open on desktop 1 , i'd spaces automatically bring set active desktop desktop 1 again, user can see window he/she wanted see. how programmatically achieve objective-c cocoa in osx?