Posts

Invalid sed --transform expression in shell script using gtar -

i'm running shell script in solaris 10, besides run in ubuntu (obviously making little changes) , same error. want change name of path when execute tar command indicate time done. have special case when pathname has spaces. use following command fails: $ /usr/sfw/bin/gtar --transform=s/"virtualbox vm"/"virtualbox vm_04_04_2013_14:14"/ \ --show-transformed-names -clvmspf /dev/cintarmt0n /new_vdi/"virtualbox vm" /usr/sfw/bin/gtar: invalid transform expression $ could give me tip?

asp.net mvc 3 - mvc3 cookie value not setting in ViewData page -

i have textbox , submit button people put in there enter 5 number pin , safed inside cookie 4 months not working im getting nothing out of it.. wrong.. first time trying cookies read view public actionresult index() { //read cookie , send view model var mycookie = request.cookies["mypreference"]; viewdata["prefvalue"] = mycookie.value; return view(); } httppost [httppost] public actionresult index(formcollection ss) { // create cookie httpcookie preference = new httpcookie("mypreference"); preference.value = ss["preffer"]; preference.expires = datetime.now.adddays(120d); response.cookies.add(preference); return view(); } the view @using (html.beginform("seotips", "home", formmethod.post)) { @html.textbox("preffer") <input type="submit" value="submit" /> } @viewdata["prefvalue"] you have try public actionres...

how to serialize AMF body and send it with Ruby RocketAMF -

Image
i trying serialized amf body , send restclient.post. from charles proxy, can deserialized request body , show follows: # s raw binary request body pp rocketamf::envelope.new.populate_from_stream(s).messages however, cannot figure out how serialize such object , send (with restclient.post) in body. you'll want change url it's using, below correct way it. require 'rubygems' require 'rocketamf' require 'rest-client' data = [] # whatever data want env = rocketamf::envelope.new :amf_version => 3 env.messages << rocketamf::message.new('batchcontroller.authenticate_iphone', '/1', data) res = restclient.post "http://localhost:9292/amf", env.to_s, :content_type => 'application/x-amf' puts rocketamf::envelope.new.populate_from_stream(res).inspect

How to clear token using the facebook-ios-sdk v3.2.1? -

i using sample program learn facebook-ios-sdk, found problem: if logged facebook on device , run sample app, fine, however, when delete facebook account device , run sample app again, can still pass login process , scviewcontroller can still seen (there fast-app-switch facebook app process, need click "okey" button, don't need fill email/password information log facebook). i checked code , found after account removed device, token in fbsession.activesession.accesstoken still considered valid. there problem? , how can clear token , make log in dialog pop up? have invoked [fbsession.activesession closeandcleartokeninformation] when log out, token should cleared, according facebook sdk document, not case. the environment use: xcode 4.6.1, ipad 6.1 simulator , facebook-ios-sdk v3.2.1. updated: paste code here: in scappdelegate.m, added 3 functions, not in sample code in sdk online document: - (void)showloginview { uiviewcontroller* topviewcontroller = [self...

osx - how to correctly setup credential-osxkeychain for git -

i have followed instructions on how set git integrate os x keychain git command. instructions password prompt should come once more, , keychain access window come up. password prompt up, keychain window did not. also, subsequent commands requiring authentication (to https:// url) came password prompt. none of these commands raised kind of error or warning went foul. my question how can git command use keychain https:// requests, dont have retype username , password? some useful command output follows: $ ls $(dirname $(which git)) | grep git git git-credential-osxkeychain git-cvsserver git-receive-pack git-shell git-upload-archive git-upload-pack gitk $ git credential-osxkeychain usage: git credential-osxkeychain <get|store|erase> $ git config --global credential.helper osxkeychain $ uname -a darwin mac-alex 11.4.2 darwin kernel version 11.4.2: thu aug 23 16:25:48 pdt 2012; root:xnu-1699.32.7~1/release_x86_64 x86_64 $ git --version git version 1.7.5.4 you nee...

Image upload, ajax, php, mysql -

i have 1 question. possible upload image file input mysql ajax post , php? like this: <script type="text/javascript"> $(document).ready(function(){ $("button").click(function(){ $("#form_id").submit(function(){ $.ajax({ type:"post", data:image_data, url:"/path_to_php/imagesave.php", success: function(msg){ alert("ok"); } }); return false; }); }); }); </script> <form name="form_name" id="form_id" action="#" method="post"> <input type="file" name="image" id="image" /> <button>save</button> </form> upload file , store on database can done several ways. this 1 tutorial doing this. . problem if want using ajax, possible, check out common b...

regex - Need to split a string with line breaks by finding PHP tags -

i'm trying split string line breaks finding php tags. here code have far: $contents = ' test more test test 1 <?php test 2 , test 4 test 6 ?> test 7 test 9 <?php test 10 test 12 >? test 13 <?php test 14 test 16 ?> test 17 '; as can tell, php code test examples, , odd test examples outside php tags. what looking extract array every iteration of php code: expected result: array( [0] => <?php test 2 , test 4 test 6 ?> [1] => <?php test 10 test 12 >? [2] => <?php test 14 test 16 ?> ) i have tried preg_split end tags, , capturing $explode[1] beginning tags code wrong... $ends = preg_split("/[?>]/s", $contents, preg_split_no_empty, preg_split_delim_capture ); print_r($ends); foreach($ends $flufcode){ $trimcode = explode('<?php', $flufcode); echo $trimcode . " next:...