Posts

ios - How do I set Content-type using Bubblewrap HTTP? -

ios - How do I set Content-type using Bubblewrap HTTP? - i'm trying post request content-type: application/x-www-form-urlencoded. when view request charles (or fiddler) says application/json. http.post(url, { :headers => {"content-type" => "application/x-www-form-urlencoded"} }) |response| puts response puts response.body.to_str end bw::http.post("http://foo.bar.com/", {payload: data, headers: {"content-type": "application/x-www-form-urlencoded"} }) |response| ios ruby http-headers rubymotion

html - css, float alternative -

html - css, float alternative - in web app have toolbar, it's div: the div has 3 spans. contents of 3 spans filled later. and size of individual spans differ every time. <div> <span id="ab1" style="display: inline-block;"></span> <span id="ab2" style="display: inline-block;"></span> <span id="ab3" style="display: inline-block;"></span> </div> now, want, span "ab1" should placed on left, "ab2" , "ab3" on right side on div. is possibe without float right/left? use position:absolute , text-align:right css div{background:red; text-align:right; position:relative} #ab1{ position:absolute; left:0; background:yellow;} #ab2{background:yellow; } #ab3{background:yellow; } demo html css

c# - list property inside of a struct -

c# - list property inside of a struct - how write property list within of struct? my code: public struct config { list<int> ipaddress = new list<int>(); } if want create auto-property (which default null reference types , cannot initialized) can @scartag suggests. public struct config { // default null list<int> ipaddress {get; set;} } however, if you're trying what's in code , initialize actual reference, run issues because can't initialize fields in struct . can have defaults. create matters worse, can't override default constructor you. generally speaking, struct tends best small, preferably immutable types. there reason don't want utilize class this? now, if did want create struct "initialized" field, can fool lazy logic: public struct config { private list<int> _ipaddress; private bool _isassigned; public list<int> { { if ...

perl - How to pass environment variable to an AutoLoaded mod_perl handler, to be used at module load time? -

perl - How to pass environment variable to an AutoLoaded mod_perl handler, to be used at module load time? - i have http request handler mod_perl needs read environment variable, %env , @ module load time. environment variable passed apache config mod_perl using perlsetenv directive. this worked fine, until changed apache configuration autoload handler @ startup time, performance reasons. when module autoloaded this, the perlsetenv not take effect @ module load time, , variable need available %env @ request time within handler method. is there way go on using autoload, still set environment variable in apache config available in perl's %env @ module load time? minimal example: here's stripped downwards test-case illustrate problem. the apache config without autoload enabled: perlswitches -i/home/day/modperl <location /perl> sethandler modperl perlsetenv test_perlsetenv 'does work?' perlresponsehandler modperl::test allow ...

c# - Get angle of rotation after rotating a view -

c# - Get angle of rotation after rotating a view - let's rotate view using next method: cgaffinetransform t = cgaffinetransform.makeidentity(); t.rotate (angle); cgaffinetransform transforms = t; view.transform = transforms; how can current rotation angle of view without keeping track of set in angle variable when did cgaffinetransform? related view.transform.xx/view.transform.xy values? not sure these xx , xy , other similar members mean exactly, guess* won't able trace applied transformations using solely values (it tracing 1+2+3+4 knowing started off 1 , ended 10 - i think*). in case suggestion derive cgaffinetransform , store desired values, since it's construction cannot that, in sentiment best selection write wrapper class, so: class mytransform { //wrapped transform construction private cgaffinetransform transform; //stored info rotation public float rotation { get; p...

iphone - how to eliminate the blank frame while flipping over to the next view -

iphone - how to eliminate the blank frame while flipping over to the next view - i using this(afkpageflipper) to produce desired flipboard animation in application ,there 4 static html pages named 1.html,2..so on loadview - (void) loadview { [super loadview]; self.view.autoresizessubviews = yes; self.view.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight; flipper = [[afkpageflipper alloc] initwithframe:self.view.bounds] ; flipper.autoresizingmask = uiviewautoresizingflexiblewidth | uiviewautoresizingflexibleheight; nsurlrequest *urlreq=[nsurlrequest requestwithurl:[nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:@"1" oftype:@"html"]isdirectory:no]]; ; //[web loadrequest:urlreq]; nsurlrequest *urlreq1=[nsurlrequest requestwithurl:[nsurl fileurlwithpath:[[nsbundle mainbundle] ...

matlab - Ghostscript postscript pswrite is encoding text -

matlab - Ghostscript postscript pswrite is encoding text - why ghostscript pswrite encoding text in output? consider next mwe: %!ps-adobe-3.0 %%title: mwe.ps %%pages: 001 %%boundingbox: 0 0 595 842 %%endcomments %%page: 1 1 %%pageboundingbox: 0 0 595 842 0 0 1 setrgbcolor 0 0 595 842 rectfill 1 0 0 setrgbcolor 247 371 100 100 rectfill /times-roman findfont 72 scalefont setfont newpath 247 300 moveto (chris) show showpage saving mwe file , viewing in gsview display bluish page reddish square , name underneath. run file through ghostscript 9.06 next command line: "c:\program files\gs\gs9.06\bin\gswin64c.exe" ^ -dsafer -dbatch -dnopause ^ -sdevice=pswrite -spapersize=a4 -r72 -soutputfile=mwe_gs.ps mwe.ps see ghostscript output below. can please explain happening here. whilst 2 rectfill commands still apparent, text (chris) has been encoded , no longer distinguishable. is there alternative postscript device retain text please? <snip> %%pa...

osx - Parse Issue: Expected Expression (Objective C) -

osx - Parse Issue: Expected Expression (Objective C) - for ever reason xcode has decided doesn't me... i'm getting error stated in title on line - (void)tableviewselectiondidchange:(nsnotification *)notification { nsinteger row = [_tableview selectedrow]; if (row == –1) //<---- line { return; } nsstring *selectedvoice = [_voices objectatindex:row]; [_speechsynth setvoice:selectedvoice]; nslog(@"new voice = %@", selectedvoice); } i believe has _tableview beingness befuddled because when attempted ide help me type (you know when guesses might finish word doing api lookup of available functions) doesn't show selectedrow possibility :( incase it's needed i've set .m , .h in pastebin save space on screens... fyi i'm next coca programming mac osx 4th edition chapter 6.10 in line if (row == –1) the minus-sign not real minus-sign, "en dash" (unicode u+2013). perhaps accidentally pre...

c# - Using Web API for a Windows Service to Receive Commands and Perform Tasks via Polling? -

c# - Using Web API for a Windows Service to Receive Commands and Perform Tasks via Polling? - i have project need create windows service that, when instructed via command, perform various tasks. server run on multiple servers , perform same kind of tasks when requested. for example, have web api service listens requests servers. the service running on server send query web api every 25 secs or , pass servername. web api logic servername , status updates various tasks... i.e., if status delete command 1, service delete folder containing log files... if status zip command 1, service zip folder containing log files , ftp them centralized location. this concept seems simple enough, , think need nudge tell me if sounds design. i'm thinking of using .net 4.5 windows service, can utilize httpclient object and, of course, .net 4.5 web api/mvc project. can please me started on basic web api woudld provide status updates windows services running , issue commands them... ...

c - Please Explain Comma Operator in this Program -

c - Please Explain Comma Operator in this Program - please explain me output of program: int main() { int a,b,c,d; a=10; b=20; c=a,b; d=(a,b); printf("\nc= %d",c); printf("\nd= %d",d); } the output getting is: c= 10 d= 20 my uncertainty "," operator here? compiled , ran programme using code blocks. the , operator evaluates series of expressions , returns value of last. c=a,b same (c=a),b . why c 10 c=(a,b) assign result of a,b , 20, c . as mike points out in comments, assignment ( = ) has higher precedence comma c comma

ios - Why set retain on @property for subviews? -

ios - Why set retain on @property for subviews? - fairly straightforward question in 2 parts. if view retains subviews, , create view hierarchy in interface builder views nested within others, why iboutlet property nested subviews need set retain? wouldn't assign acceptable parameter subview properties? i have uiview subclass adds few subviews upon initialization. capture references specific subviews, @property (nonatomic, assign) suffice need, correct? example, main uiview adds player score subview, later wants talk player score update it. reference needs assigned, view proper automatically retain uiview class, right? 1) doesn't need be. assign fine. made think have utilize retain ? 2) yes by way, using arc? if so, utilize weak instead of assign (please don't inquire why, explained in every corner of stack overflow , net in general). ios cocoa properties retain assign

mysql - Securepay payment received but Magento Order not created -

mysql - Securepay payment received but Magento Order not created - we have had issue securepay received payment client order not created in magento. order id skipped in magento when next order came through, cannot see in grid. can shed lite on over might have happened? you can see if order in sales_flat_order table. otherwise can enable error logging , php error happened after request payment gateway made or user didn't came response payment gateway. mysql magento

oracle - SQL Custom selection -

oracle - SQL Custom selection - i want write sql gives next result. possible? tried union works 1 record. col1 | col2 | col3 | col4 --------------------------- | 10 | | | 2 | val1 | val2 | 5 | val3 | val4 | 3 | val5 | val6 b | 11 | | | 3 | val7 | val8 | 5 | val9 | val10 | 3 | val0 | val12 here query : select a.val1, null val2, a.val3 table1 a.val1 = 'a' union select null val1, b.val2, b.val3 table2 b b.val1 = 'a' ; maybe create question more clear. imagine if run query: select a.val1, null val2, a.val3 table1 union select null val1, b.val2, b.val3 table2 b ; i want result set figure above. col1 | col2 | col3 | col4 --------------------------- | 10 | | | 2 | val1 | val2 | 5 | val3 | val4 | 3 | val5 | val6 b | 11 | | | 3 | val7 | val8 | 5 | val9 | val10 | 3 | val0 | val12 ...

php - What is the best way to sanitize user inputs? -

php - What is the best way to sanitize user inputs? - i need prevent xss attacks much possible , in centralized way don't have explicitly sanitize each input. my question improve sanitize inputs @ url/request processing level, encode/sanitize inputs before serving, or @ presentation level (output sanitization)? 1 improve , why? there 2 areas need aware: anywhere utilize input part of script in language, notably including sql. in particular case of sql, only recommended way of dealing things utilize of parameterized queries (which result in unescaped content beingness in database, strings: that's ideal). involving magic quoting of characters before substituting them straight sql string inferior (because it's easy wrong). can't done parameterized query service secured against sql-injection should never allow user specify. anywhere nowadays input output. source of input direct (including via cookie) or indirect (via database or file). in case, defa...

java - how to put a programmattic menu inside a menubar? -

java - how to put a programmattic menu inside a menubar? - i want create menu programmatically within menubar not working. this code doesn't work: class="lang-html prettyprint-override"> <p:menubar id="menubase"> <p:menu model="#{indicadormanager.indicadoresmenu}" /> <p:menuitem type="button" action="#{identity.logout}" value="logout" /> </p:menubar> this 1 does: class="lang-html prettyprint-override"> <p:menubar id="menubase" model="#{indicadormanager.indicadoresmenu}"> </p:menubar> but want button logout user, first example. can that? java jsf primefaces

replace - C# Word Document - How to clean formatting? -

replace - C# Word Document - How to clean formatting? - the dilemma rather simple. need create little app clear font background colors (leave table cell background colours unchanged), , remove text strikethrough in word document, , save document folder. otherwise document's formatting should remain untouched. below large-ish illustration scraped random examples available in google showing how apply specific kinds of formatting random strings found using find.execute(). have no clue however, on how described above. public static string searchdoc(string filenameref) { microsoft.office.interop.word._application word = new microsoft.office.interop.word.application(); ; microsoft.office.interop.word._document doc = new microsoft.office.interop.word.document(); object missing = system.type.missing; seek { system.io.fileinfo executablefileinfo = new system.io.fileinfo(system.reflection.assembly.gete...

typo3 - snowbabel extension tag displayed in frontend -

typo3 - snowbabel extension <br /> tag displayed in frontend - i've problem typo3 snowbabel extension. need insert line break in frontend. in manual, specified "if want have line break visible in front end end, you'll have insert html line break tag. i've added it. html br tag displayed in frontend.also line break not working. there configurations this? thanks, arun chandran this handy quick solution problem. can utilize <section> tags instead of " <br/> " tags. though purpose might different, still gives output. or just utilize <br></br> instead of </br> . works fine. typo3 typoscript

ruby on rails - Failing to bundle install tiny_tds on Mac OS X 10.8 with Homebrew FreeTds -

ruby on rails - Failing to bundle install tiny_tds on Mac OS X 10.8 with Homebrew FreeTds - my question surefire steps can take 100% working? need real instructions, not 1 liner answers or vague conceptual descriptions of process. let's bottom of this. appear there conflicts somewhere , i've had subpar assistance gem developer on github in relation experience ruby / rails / bundler / homebrew it's not fault :p need figure out how working asap here goes current state of problem. update: 2/25/2013 updated gcc / xcode version 4.6 (4h127) , downloaded latest version of xcode command-line tools , iconv_open() showing in extconf checker. i'm getting these errors: i believe issues tiny_tds , compatibility latest xcode paths. gem::installer::extensionbuilderror: error: failed build gem native extension. /system/library/frameworks/ruby.framework/versions/1.8/usr/bin/ruby extconf.rb checking iconv_open() in iconv.h... yes checking sybfron...

Setting Up Android Development Env requires a reinstall of Java on Mac, Why? -

Setting Up Android Development Env requires a reinstall of Java on Mac, Why? - i'm setting android development environment on macbook air running os x 10.8 mount lion. i have installed jdk mac downloading oracle website. run java -version shows java version "1.7.0_13" then downloaded adt bundle mac http://developer.android.com/sdk/index.html then ran eclipse , shows install dialog install java. says to open “eclipse,” need java se 6 runtime. install 1 now? why asking java, when installed java? and java included in path too. went wrong? jdk - java development kit jre - java runtime environment java se - java standard edition se defines set of capabilities , functionalities; there more complex editions (enterprise edition - ee) , simpler ones (mobile edition - me - mobile environments). the jdk includes compiler , other tools needed develop java applications; jre not. so, run java application else provides, need jre; develop java application...

ios6 - What is a common way to access a service that is running on an iPad from an iPhone without having internet access? -

ios6 - What is a common way to access a service that is running on an iPad from an iPhone without having internet access? - is there reference app, or best practices how set 1 ios device "server or backend service" cashier service , utilize other ios devices access service/server, iphone "electric order notebook"? i found out 3 options: - write own webserver runs on 1 device (ios devices web server) - utilize bonjour allows server-app provide services in network (https://developer.apple.com/library/mac/documentation/cocoa/conceptual/netservices/articles/about.html) - utilize gamekit allows utilize 'multiplayer' functionality non-game apps (https://developer.apple.com/library/mac/documentation/networkinginternet/conceptual/gamekit_guide/introduction/introduction.html#//apple_ref/doc/uid/tp40008304) ios6