Sunday, 15 August 2010

jquery - How to stop image target page jumping to image -



jquery - How to stop image target page jumping to image -

i have searched improve part of 2 days reply , nil working. have little image gallery on page. when selecting 1 of little images, jumps big image on page, causes page scroll downwards , creates disjointed experience. trying stop page jump. research far seems not possible stop css. total noob java script, have attempted of solutions proposed on site. however, none of them working.

i have tried sourcing http://code.jquery.com/jquery-latest.js creating own .js file source without success. must doing wrong. here illustration of code working with. help!

<!--plant images--> <div class="imageright"> <a href="#one" class="menucontrol"><img src="plantpics/abeliaxgrandiflorasmall1.jpg"></a> <a href="#two" class="menucontrol"><img src="plantpics/abeliaxgrandiflorasmall2.jpg"></a> <a href="#three" class="menucontrol"><img src="plantpics/abeliaxgrandiflorasmall3.jpg"></a> </div> </div> <script> var anchors = document.getelementsbytagname("a"); for(var = 0; < anchors.length; i++) { if ( anchors[i].classname == "menucontrol" ) { anchors[i].setattribute("onclick", "return false"); } } ​ </script> <!--preview image--> <section class="gallery"> <article id="one" class="target"> <figure> <a href="abeliaxgrandiflora2.html"><img src="plantpics/abeliaxgrandifloralarge1.jpg" alt="abelia x grandiflora"></a> </figure> </article> <article id="two" class="target"> <figure> <a href="abeliaxgrandiflora3.html"><img src="plantpics/abeliaxgrandifloralarge2.jpg" alt="abelia x grandiflora"></a> </figure> </article> <article id="three" class="target"> <figure> <a href="abeliaxgrandiflora4.html"><img src="plantpics/abeliaxgrandifloralarge3.jpg" alt="abelia x grandiflora"></a> </figure> </article> </section>

jquery css

android - Performance/memory consumption for saving infos in DB or prefs -



android - Performance/memory consumption for saving infos in DB or prefs -

i need store lot , variable number of checkboxes status of android application. every 5-10 mins need retrieve status of single checkbox (that should changed user interaction in other activity). know can store them on sharedpreferences or in sqlite db. number or checkboxes variable 10 (infinite-1).

my first thought store statuses in 1 single string:

chk1:true,chk2:false,chk3:false,chk4:false,chk5:true

delimited : , ,. can retrieve in 1 single getstring() call, checkboxes stasus.

i left solution because checkboxes growing in number , think it's not performing have single string one thousand of data.

my sec thought store every chk in separate preferences. left solution because cause need retrieve may times checkboxes status.. imagine getstring() called 10000 or more times it's waste of resource.

my 3rd thought store single status in sqlite db.

id status 1 t 2 f 3 f 4 f 5 t

in solution don't need access db lots of time.

what's best solution (performance , memory consumption) if need retrieve checkbox status every 5 mins infinite? db or sharedpref? if db, need open every time db , instantiate cursor, or should instantiate @ origin of activity?

i'd go sqlite.

both shared preferences , sqlite have cache mechanisms, sqlite designed retrieval , storage of big amounts of info whereas shared preferences more suited simple application... well... preferences.

moreover sqlite particularly useful if info model ever changes (and believe me, happens time). sqlite cache used fragments of info (technically: pages of database) - adapt actual usage pattern of data.

as opening db - i'd recommend opening 1 time , reuse created connection multiple times - save overhead of opening database each time (which costly operation) , allow sqlite larn (adapt) how cache info based on how utilize (e.g. order of access, particular sql statement cache, etc.)

android performance sqlite sharedpreferences

mysql - Security implications of storing email attachments on Centos Server -



mysql - Security implications of storing email attachments on Centos Server -

there application working on requires processing incoming mails cs@company.com. company.com mail service accounts beingness run via google apps business. fetch incoming mails via imap , store attachments on server filesystem. attachments downloadable users of application. server centos 6.3 , web interface of application based on apache/php/mysql.

my questions : 1. kind of security risks exposed storing attachments on server filesystem? 2. safer store attachments external storage (for e.g. amazon s3)? 3. safer store attachments in db?

mysql apache security centos email-attachments

c# - VS2008 debugs old ASP.NET web service -



c# - VS2008 debugs old ASP.NET web service -

i'm writing asp.net web service, in c#. before yesterday if wanted debug press f5, , asp.net development server start hosting service. breakpoints enabled , work. functionality gone. when start debugging, development server started old version of web service hosted, , breakpoints not work. warning versions not match.

it not help if rebuild everything, or alter assembly version, or alter file name of dll. it not help if delete whole temp folder %temp%\temporary asp.net files. old web service pulled out knows where, , stored in temp folder again.

major alter before yesterday had installed iis. web service installed there works expected, need debug well. thought problem installed web service (with vdproj), uninstalled it, did not help either.

how prevent scheme caching old version of web service. old version stored anyway?

check web settings on asp.net project. using asp.net development server f5 debugging create sure "use visual studio development server" radio button selected under server heading. specify specific port other projects in solution can consistently reference (in case i'm dealing web service). there's chance find "user local iis web server" radio button selected.

hope helps.

edit: problem here not iis, changing target build output folder of web service. must bin\, or development server cannot find it. rebuild did not help because alter dll file in new folder, old file remain undisturbed in bin folder.

c# asp.net visual-studio

Excel Ranking tie issue -



Excel Ranking tie issue -

does 1 know how deal tie records issue in excel? want show record 1 time on first occurrence. if same number found twice, not show show above.

to results shown can utilize "array formula" in aa2

=if(or(z2=0,countif(z$2:z2,z2)>1),"",sum(if(frequency(if(z$2:z$19>z2,z$2:z$19),z$2:z$19),1))+1)

confirm ctrl+shift+enter , re-create formula downwards column

see sample file

excel ranking tie

Oracle Streams: ORA-0001 on dequeue? -



Oracle Streams: ORA-0001 on dequeue? -

in production every , ora-0001 error when dequeuing message. use:

solaris 10 oracle 10g c++ application proc*c dbms_aq bundle queuing operations queues xml payload we handle big volume of messages (1k/min).

any clue why dequeue result in ora-0001 (unique constraint) error?

update: adding code per request.

exec sql execute declare message_properties dbms_aq.message_properties_t; dequeue_options dbms_aq.dequeue_options_t; message_payload xmltype; tmpclob clob; dynamic_sql_string varchar2(512); begin dequeue_options.wait := :ireadtimeout; dequeue_options.dequeue_mode := dbms_aq.remove; dequeue_options.visibility := dbms_aq.on_commit; if :ibuffered = 1 dequeue_options.delivery_mode := dbms_aq.buffered; dequeue_options.visibility := dbms_aq.immediate; :inavigationmode := 0; end if; if :idequeueonly = 1 , :iqueuetype <> 1 dequeue_options.dequeue_mode := dbms_aq.remove_nodata; dequeue_options.wait := dbms_aq.no_wait; dequeue_options.msgid := hextoraw(:pszdequeuemsgid); else if :inavigationmode = 0 dequeue_options.navigation := dbms_aq.first_message; else dequeue_options.navigation := dbms_aq.next_message; end if; end if; dequeue_options.deq_condition := :pszdeqcondition; dbms_aq.dequeue(queue_name => :pszqueuename, message_properties => message_properties, dequeue_options => dequeue_options, payload => message_payload, msgid => :msgid ); if dequeue_options.dequeue_mode <> dbms_aq.remove_nodata execute immediate dynamic_sql_string using out tmpclob, in message_payload; :gpoxmlclob := tmpclob; else :gpoxmlclob := message_payload.getclobval(); end if; end;

oracle stream queue

javascript - How can I set this Input Box with KeyUp to load HTML5 Audio source? -



javascript - How can I set this Input Box with KeyUp to load HTML5 Audio source? -

i have forked couple of jsfiddles have found on here come next 2 scripts:

http://jsfiddle.net/m555r/ - javascript web browser key input box load new page

$('input#url').on('propertychange paste keyup',function(){ var url = this.value; $('#frame').attr('src', "http://"+url); }); $('input#url').keyup();

http://jsfiddle.net/z3vrv/ - html5 sound player hover on box alter source

function changeaudio(song){ sound = document.getelementbyid("sound1"); audio.src = song; audio.load(); audio.play(); } $("#changemytune").mouseenter(function () { changeaudio("http://jeffrey-way.s3.amazonaws.com/zelda.ogg"); }) .mouseleave(function () { changeaudio("http://www.jezra.net/audio/skye_boat_song.ogg"); });

with limited experience have tried, unsuccessfully, combine these 2 examples. acheive sound player type in source , player source updates automatically, per iframe example.

any advice appreciated, particularly if can show me working illustration in jsfiddle.

thank you!

edit: have tried scripting such as:

function changeaudio(song){ sound = document.getelementbyid("sound1"); audio.src = song; audio.load(); audio.play(); } $('input#url').on('propertychange paste keyup',function(){ changeaudio(url); }) }); $('input#url').keyup();

which in head makes sense, unsure of right syntax etc

to set in answer:

here code:

html:

<input type="text" id="url" name="url" value="" /> <br><br> <audio id="sound1" preload="auto" src="http://www.jezra.net/audio/skye_boat_song.ogg" autoplay controls></audio> <div id="status">status</div>

js:

$('input#url').on('propertychange paste keyup',function(){ var url = this.value; $("#status").html(url); changeaudio(url); }); function changeaudio(song){ sound = document.getelementbyid("sound1"); audio.src = song; audio.load(); audio.play(); }

see here

javascript html5

stdcall - Assembly language - Calling convention -



stdcall - Assembly language - Calling convention -

can give me real illustration help me understand callee , caller in assembly language? have been through of sources, still can't how distinguish between callee , caller. give thanks in advance. (i adding explanation - give thanks again! sorry code new here , not know how insert code display properly) trying understand piece of code - learning basics of assembly. trying add together comment each command (i sure else me need too:

sub_401040 proc near .text:00401040 .text:00401040 .text:00401040 000 force ebp ; force content of ebp register onto stack .text:00401041 004 mov ebp, esp ;allocating 8 bytes of storage ; move esp register content ebp register .text:00401043 004 force ecx .text:00401044 008 mov eax, [ebp+8] .text:00401047 008 force eax ; force eax contents onto stack .text:00401048 00c phone call ds:lstrlena .text:0040104e 008 add together eax, [ebp+0ch] .text:00401051 008 mov edx, eax .text:00401053 008 mov ecx, 1 ;set buffer address .text:00401058 008 phone call sub_401000 .text:0040105d 008 mov [ebp-4], eax .text:00401060 008 mov ecx, [ebp-4] .text:00401063 008 shl ecx, 2 .text:00401066 008 mov [ebp-4], ecx .text:00401069 008 mov edx, [ebp-4] .text:0040106c 008 force edx .text:0040106d 00c force offset aresultd ; "result: %d\n" .text:00401072 010 phone call ds:printf .text:00401078 010 add together esp, 8 ; clean stack adding size of argument esp register .text:0040107b 008 mov eax, 539h .text:00401080 008 mov esp, ebp .text:00401082 004 pop ebp ;restore old frame pointer .text:00401083 000 retn ; homecoming near .text:00401083 sub_401040 endp

i read that, in order define calling convention need figure out caller , callee :) spent much time understand logic: phone call ds:lstrlena means callee? , sub_401040 caller? , can have more 1 calling convention in 1 program? cdecl along stdcall? not programmer, , not writing code, want understand how works help analysing viruses.

the caller 1 relevant call (or rcall/blx/jalr/etc. function calling instruction), , callee function beingness called.

func: do_stuff func2: phone call func

in example, when func2 calls func, func2 referred caller , func callee.

any function can either caller or callee (or both in different contexts), unless contains no call instructions. in latter case, called "leaf function", , optimizations may apply.

assembly stdcall cdecl

reading pdf from url using pdfViewer library in android app -



reading pdf from url using pdfViewer library in android app -

i made android app viewing pdf file fetched url integrating pdfviewer library in code.firstly app downloading file web external sd card there app getting opened pdfviewer library.it working fine if file size little if pdf file contains images , size more , downloaded file size shown in sdcard 0kb. can help me out why so?

following java code :

public class mainactivity extends activity { static context applicationcontext; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); applicationcontext = getapplicationcontext(); string extstoragedirectory = environment.getexternalstoragedirectory().tostring(); file folder = new file(extstoragedirectory, "pdfdownloads"); folder.mkdir(); file file = new file(folder, "android.pdf"); seek { if(!file.exists()) { file.createnewfile(); } } grab (ioexception e1) { e1.printstacktrace(); } boolean downloadfile = downloadfile("http://www.irs.gov/pub/irs-pdf/fw4.pdf", file); if (file!=null && file.exists() && file.length() > 0){ intent intent = new intent(this, com.example.soniapdf.second.class); intent.putextra(pdfvieweractivity.extra_pdffilename, file.getabsolutepath()); startactivity(intent); } } public static boolean downloadfile(string fileurl, file directory) { seek { fileoutputstream f = new fileoutputstream(directory); url u = new url(fileurl); httpurlconnection c = (httpurlconnection) u.openconnection(); c.setrequestmethod("get"); c.setdooutput(true); c.connect(); inputstream in = c.getinputstream(); byte[] buffer = new byte[1024]; int len = 0; // int filelength = c.getcontentlength(); long total = 0; // toast.maketext(applicationcontext, "downloading pdf...", 2000).show(); while ((len = in.read(buffer)) > 0) { total += len; //toast.maketext(applicationcontext, "downloading pdf: remaining " + (filelength / total )+ "%", 1).show(); f.write(buffer, 0, len); } f.close(); homecoming true; } grab (exception e) { e.printstacktrace(); homecoming false; } } }

this way showing pdf in android app embedding pdf document android webview using back upwards http://docs.google.com/viewer

pseudo

string doc="<iframe src='http://docs.google.com/viewer?url=+location pdf file+' width='100%' height='100%' style='border: none;'></iframe>";

a sample is shown below

string doc="<iframe src='http://docs.google.com/viewer?url=http://www.iasted.org/conferences/formatting/presentations-tips.ppt&embedded=true' width='100%' height='100%' style='border: none;'></iframe>";

code

webview wv = (webview)findviewbyid(r.id.webview); wv.getsettings().setjavascriptenabled(true); wv.getsettings().setpluginsenabled(true); wv.getsettings().setallowfileaccess(true); wv.loadurl(doc); //wv.loaddata( doc, "text/html", "utf-8");

and in manifest provide

<uses-permission android:name="android.permission.internet"/>

see answer

edit

if pdf document accessible online, utilize google docs viewer open pdf in webview

refer

wv.loadurl("https://docs.google.com/gview?embedded=true&url=http://www.irs.gov/pub/irs-pdf/fw4.pdf");

don't know how stable these are

here list of other open sources pdf readers running on top of android

android pdf viewer apdfviewer droidreader android-pdf

please note these , other project derived mupdf bound terms of gpl , may not suitable commerical use.

the next list of sdks suitable commerical use:

pdftron adobe qoppa radaee

android

ios - How to get the Size (KB) of UIImage -



ios - How to get the Size (KB) of UIImage -

i getting image didfinishpickingmediawithinfo.

uiimage *originalimage = (uiimage*)[info valueforkey:uiimagepickercontrolleroriginalimage];

i want size of image in kb.

uiimage *originalimage = (uiimage*)[info valueforkey:uiimagepickercontrolleroriginalimage]; nsdata *imgdata = uiimagejpegrepresentation(originalimage, 1); //1 represents quality of image. nslog(@"size of image(bytes):%d",[imgdata length]); originalimage = nil;

ios objective-c xcode uiimage

php - How to get extended attributes thought magento's REST API? -



php - How to get extended attributes thought magento's REST API? -

i start using magento rest api , after dancing oauth it's working good. however, i'd know how extended attributes of product. can basic info none of extended attributes created.

i'd prefer them in 1 go rather having create rest call, product product, in order additional information. way i'd modify default products api phone call

i think solved it: seems created rest role before creating new extended attributes, hence extended attributes not assigned role! solution go scheme > web services > rest attributes, , modify acl attributes in order assign right fields role. after extended attributes appeared on request without problem :-)

php api magento-1.7

auto-close flash with embed html5 tag? -



auto-close flash with embed html5 tag? -

i found out embed tag html5, , utilize it.

<embed src="example.swf" />

however, haven't found thorough tutorials subject... or maybe i'm looking in wrong places.

my first question, since looks quite simple tag...

http://www.w3schools.com/tags/tag_embed.asp

http://www.w3resource.com/html5/embed-element.php

... how flash autoclose when it's finished played? or expected behaviour of tag?

best practice including swfs in html utilize swfobject - javascript library (it utilize embed).

there's no way flash auto-close when finished playing - can done manually, need amend swf phone call javascript function when has finished - close or hide flash content within javascript function.

html5 flash embed

Android java.lang.IllegalStateException on ListView -



Android java.lang.IllegalStateException on ListView -

i utilize listactivity specialadapter show log information. not utilize background thread error when scroll list:

java.lang.illegalstateexception: content of adapter has changed listview did not receive notification. create sure content of adapter not modified background thread, ui thread. [in listview(16908298, class android.widget.listview) adapter(class ru.foxgsm.ui.debugactivity$specialadapter)]

please, help me.

(foxlog static class log information, perhaps thread. in list want show foxlog snapshot)

public class debugactivity extends listactivity { private class specialadapter extends baseadapter { private layoutinflater minflater; public specialadapter(context context) { super(); // cache layoutinflate avoid asking new 1 each time. minflater = layoutinflater.from(context); } public int getcount() { homecoming foxlog.count(); } public long getitemid(int index) { homecoming index; } public object getitem(int index) { homecoming foxlog.get(foxlog.count()-index-1); } // type of view public view getview(int position, view convertview, viewgroup parent) { textview text; if (convertview == null) { convertview = minflater.inflate(r.layout.debug_list, null); text = (textview)convertview.findviewbyid(r.id.text); convertview.settag(text); } else text = (textview) convertview.gettag(); string s = (string) getitem(position); if (s==null) homecoming convertview; text.settext(s); boolean iserror = false; if (s!=null && s.length()>0) { string prefix = s.substring(0, 1); if (prefix.equals("e") || prefix.equals("w")) iserror = true; } if (iserror) text.setbackgroundresource(r.color.red); else text.setbackgrounddrawable(null); homecoming convertview; } } private void refreshdata() { foxlog.reinit(this); specialadapter adapter = (specialadapter)this.getlistadapter(); adapter.notifydatasetchanged(); } @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.debug); foxlog.reinit(this); specialadapter adapter = new specialadapter(this); setlistadapter(adapter); button mexit = (button)findviewbyid(r.id.exit); mexit.setonclicklistener(new view.onclicklistener() { public void onclick(view v) { finish(); } }); } }

java android

android - prevent achartengine and textview reset after and application sent to background -



android - prevent achartengine and textview reset after and application sent to background -

i receivng info bluetooth , display in textview , plot using achartengine. plot displays right when first start activity. display same info in notification (textview). when press home button can see activity still running because info in notification beingness updated. when go activity, graph won't plot, , textview remains empty (the layout reset).

i have read on topic, , believe need save state of layout each time. not sure how achartengine plot , textview.

i read need track changes, , save layout on each alter onpause or onstop. have read need utilize onconfigurationchanged.

could please explain me how save state on achartengine , textview? confuses me, because graph should "updating" when application running in backgroud, , when restore layout, restore old info in graph? or display recent data?

thanks

update (1): added next code (using sample @dan suggested):

@override protected void onsaveinstancestate(bundle outstate) { //todo super.onsaveinstancestate(outstate); // save current data, instance when changing screen orientation outstate.putserializable("datasethr", mdatasethr); outstate.putserializable("datasetrr", mdatasetrr); outstate.putserializable("dataseto2", mdataseto2); outstate.putserializable("rendererhr", mrendererhr); outstate.putserializable("rendererrr", mrendererrr); outstate.putserializable("renderero2", mrenderero2); outstate.putserializable("current_serieshr", hrcurrentseries); outstate.putserializable("current_seriesrr", rrcurrentseries); outstate.putserializable("current_serieso2", o2currentseries); outstate.putserializable("current_rendererhr", hrrenderer); outstate.putserializable("current_rendererrr", rrrenderer); outstate.putserializable("current_renderero2", o2renderer); outstate.putserializable("current_tv_hr", tvhr); outstate.putserializable("current_tv_rr", tvrr); outstate.putserializable("current_tv_o2", tvo2); } @override protected void onrestoreinstancestate(bundle savedstate) { super.onrestoreinstancestate(savedstate); // restore current data, instance when changing screen orientation mdatasethr = (xymultipleseriesdataset) savedstate.getserializable("datasethr"); mdatasetrr = (xymultipleseriesdataset) savedstate.getserializable("datasetrr"); mdataseto2 = (xymultipleseriesdataset) savedstate.getserializable("dataseto2"); mrendererhr = (xymultipleseriesrenderer) savedstate.getserializable("rendererhr"); mrendererrr = (xymultipleseriesrenderer) savedstate.getserializable("rendererrr"); mrenderero2 = (xymultipleseriesrenderer) savedstate.getserializable("renderero2"); hrcurrentseries = (xyseries) savedstate.getserializable("current_serieshr"); rrcurrentseries = (xyseries) savedstate.getserializable("current_seriesrr"); o2currentseries = (xyseries) savedstate.getserializable("current_serieso2"); hrrenderer = (xyseriesrenderer) savedstate.getserializable("current_rendererhr"); rrrenderer = (xyseriesrenderer) savedstate.getserializable("current_rendererrr"); o2renderer = (xyseriesrenderer) savedstate.getserializable("current_renderero2"); tvhr = (textview) savedstate.getserializable("current_tv_hr"); tvrr = (textview) savedstate.getserializable("current_tv_rr"); tvo2 = (textview) savedstate.getserializable("current_tv_o2"); }

but still not help. textview , graphs still restored original state. issue more that. receiving info bluetooth. plot info in achartengine, , display comes-in in textview. after activity resumes after went through onpause , onstop, info not beingness updated.

it updates when handler receives message_read, , runs method. in method update textview using:

textview tvhr = (textview) findviewbyid(r.id.hrdisplay); // update textview textview tvrr = (textview) findviewbyid(r.id.rrdisplay); // update textview textview tvo2 = (textview) findviewbyid(r.id.o2display); // update textview tvhr.settext(hr); tvrr.settext(rr); tvo2.settext(o2);

after activity sent background (goes through onpause , onstop), , resumes back, textview won't update. know info comes in, , go through code above, because same method updates notifications, , can see incoming info on there updates time.

update #2: added next code within onresume:

if (savedinstancestate != null) { //then application beingness reloaded onrestoreinstancestate(savedinstancestate); }

but still not restored previous state, , display textview , graph still not beingness updated.

you need override onsaveinstancestate , onrestoreinstancestate , store , retrieve dataset , renderer chart , textview value. please see illustration here.

android graph bluetooth achartengine

arm - How to access PWM back light driver? -



arm - How to access PWM back light driver? -

i using imx6q sd board. , have access lite driver command lite contrast. how can access user space or kernel space? (back lite pwm driver path drivers/video/backlight/pwm_bl.c). in advance.

sysfs interface misc drivers.

arm embedded-linux

objective c - Getting 404 Error when trying to share from my custom iOS app with Google+ -



objective c - Getting 404 Error when trying to share from my custom iOS app with Google+ -

i installed google+ sdk ios , implemented share function:

- (void)customuiasview:(customuiasview *)customuiasview didclickgoogle:(uibutton *)sender{ static nsstring * const kclientid = @"122385832599-2mcvobo565un3ab7d6d06m6fjemocto9.apps.googleusercontent.com"; share = [[gppshare alloc] initwithclientid:kclientid]; share.delegate = self; [[[[share sharedialog] seturltoshare:[nsurl urlwithstring:myurl]] setprefilltext:opin.sname] open]; }

and works fine, no errors in console, when safari mobile opened link (which works fine desktop browsers), got 404 error!

https://plus.google.com/share?client_id=122385832599-2mcvobo565un3ab7d6d06m6fjemocto9.apps.googleusercontent.com&continue=com.pinstyle.pinstyle%3a%2f%2fshare%2f&text=neu%20h%26m%20divided%20grey%20blogger%20trend%20urban%20leder%20biker%20jacke%20nieten%2034%20s%20xs%2036&url=http%3a%2f%2fpinboard.maryme.lan.s3.amazonaws.com%2f1%2f25607-neuhmdividedgreybloggertrendurbanlederbikerjackenieten34sxs36.jpg&bundle_id=com.pinstyle.pinstyle&gpsdk=1.0.0

someone had same error: https://groups.google.com/forum/#!msg/google-plus-developers/zscxgntqrjy/jidpj076bfyj

but solution changing bundleid 1 @ to the lowest degree 1 dot. bundleid have 2 dots, don´t know do. have clue of how solve this? thanks!

it seems bundle id authentication error, if changed bundle id without corresponding alter in apps service on google server,you should error.

so,try revise bundle id , modify 1 entered on google server.

ios objective-c http-status-code-404 share google-plus

objective c - How to build Unity3d Plugin for iOS -



objective c - How to build Unity3d Plugin for iOS -

i have tiny objective-c library built ios , want export unity. understand basic process of writing csharp wrapper marshals invocations native library, have no thought start. please explain step-by-step how create unity bundle library distribute other developers.

unity3d documentation pretty brief , not explain anything.

thanks.

okay, after playing few days unity3d on mac figured out. code in guide dummy. have written stuff in 15 minutes or so, don't bothered mistakes , typos.

1) open unity, create new project (file -> new project) , save somewhere

2) when project generated has next structure:

projectname/assets (that's need) projectname/library (nevermind what's there) projectname/projectsettings (you don't care it) projectname/projectname.sln (monodevelop project)

3) go projectname/assets , create next folders: plugins/ios, in end you'll have folder construction this: projectname/assets/plugins/ios

4) set compiled library (.a) file , necessary headers within of projectname/assets/plugins/ios or re-create source code of library there (.mm, .h, .m, etc..). remember, can access c-functions c#, you'll have wrap objective-c stuff in c-code somehow, in case objective-c objects implemented in form of singleton wasn't hard create c-style wrapper around, instance:

cwrapper.h:

extern "c" void mysdkfoobarcfunction();

cwrapper.mm

#import "cwrapper.h" #import "myobjectiveclibrary.h" // actual ios library header void mysdkfoobarcfunction() { [myobjectiveclibrary dosomestuff]; }

5) go projectname/assets , create folder csharp wrapper class(es), phone call whatever want, example: projectname/assets/mysdk

6) within of mysdk folder create mysdk.cs file, dummy illustration of c# wrapper this:

using unityengine; using system; using system.runtime.interopservices; public class mysdk { // import single c-function our plugin [dllimport ("__internal")] private static extern void mysdkfoobarcfunction(); // wrap imported c-function c# method public static void foobarcfunction() { // won't work in editor, don't run there if(application.platform != runtimeplatform.osxeditor) { mysdkfoobarcfunction(); } } }

7) create shell script pack stuff .unitypackage , set next project folder (not inside). adjust export_path , project_path variables in script needs.

#!/bin/sh workdir="$( cd "$( dirname "${bash_source[0]}" )" && pwd )" unity_bin="/applications/unity/unity.app/contents/macos/unity" export_path="${workdir}/projectname.unitypackage" project_path="${workdir}/projectname" assets_path="assets" $unity_bin -batchmode -quit \ -logfile export.log \ -projectpath $project_path \ -exportpackage $assets_path $export_path

8) run created bash script bundle build. stuff assets included in xcode project unity project when generate via file -> build settings in unity editor. can utilize generated bundle distribute code other developers can include library unity projects double clicking on bundle file.

don't forget shutdown unity editor when run script, otherwise may fail build package.

if have issues , bundle not show up, script prints log export.log

next steps create sense if want create demo unity project library (good testing @ least)

9) can set created unity project (projectname.unity) assets/mysdkdemo have demo within of package.

10) create simple script demo unity3d scene @ assets/mysdkdemo/mysdkdemo.cs, example:

using unityengine; using system; using system.collections; public class mysdkdemo : monobehaviour { private guistyle labelstyle = new guistyle(); private float centerx = screen.width / 2; // utilize initialization void start () { labelstyle.fontsize = 24; labelstyle.normal.textcolor = color.black; labelstyle.alignment = textanchor.middlecenter; } void ongui () { gui.label(new rect(centerx - 200, 20, 400, 35), "mysdk demo", labelstyle); if (gui.button(new rect(centerx - 75, 80, 150, 35), "dostuff")) { mysdk.foobarcfunction(); } } }

11) go unity editor. find "main camera" in left sidebar in unity editor, select , in bottom of inspector panel (right sidebar) click on addcomponent, select scripts -> mysdkdemo script

12) build xcode project , run on device.

few notes

1) plugins don't work in unity editor, because they're not compiled in real-time, well, not sure until utilize c# in plugins, c# stuff gets linked immidiately , works in editor environment.

2) post not cover marshaling, or data/memory management between native <-> managed code, documented.

interop native libraries @ mono project

3) callbacks c# c can passed using c# delegates, on c-side utilize standard functions declarations, on c# side declare delegates same signature. seems booleans, integers , strings (c: char*) marshalled flawlessly (i don't talk memory management policy , who's responsible release memory or homecoming value policies).

however not work on ios builds out-of-box due platform limitations, c#-to-c callbacks still can implemented using monopinvokecallbackattribute, useful links on topic:

reverse callbacks @ xamarin docs monopinvokecallbackattribute illustration @ xamarin forums

actually in unity 4 there's aot.monopinvokecallbackattribute implemented, it's limited static delegates can passed unmanaged code, still improve nothing.

4) there's way unity rootviewcontroller using unitygetglviewcontroller function. declare function in implementation file, i.e.:

extern uiviewcontroller *unitygetglviewcontroller();

and utilize unitygetglviewcontroller() whenever need access rootviewcontroller.

5) there's much more magic , ugly stuff in details, maintain c interfaces simple possible otherwise marshalling can become nightmare , maintain in mind managed-to-unmanaged expensive.

6) utilize frameworks in native code , don't want linker problems. example, if utilize keychain in library need include security.framework xcode project.

i suggest give seek xuporter, helps unity integrate additional dependencies xcode project.

good luck!

ios objective-c unity3d

backbone.js - UI hash problems with Backbone Marionette Layout -



backbone.js - UI hash problems with Backbone Marionette Layout -

in next layout, adding collectionview display select list within onrender. after that, using ui hash enable or disable controls within view. not work select generated new app.view.categories.

should it? or ui hash not work on regions within layout?

app.view.uploadfile = backbone.marionette.layout.extend({ template: '#upload-file-template', regions:{ category: 'td:nth-child(4)' }, ui:{ inputs: 'textarea, select, .save' }, onrender: function(){ this.category.show( new app.view.categories({ collection: app.collection.categories }) // generates select list ); console.log(this.ui.inputs); // length 2. missing select. console.log(this.$('textarea, select, .save')); // length 3 this.ui.inputs.prop( 'disabled', (this.model.get('upload_status')!='staged') ); } });

this should working way expect work. code in question in marionette source here: https://github.com/marionettejs/backbone.marionette/blob/master/src/marionette.itemview.js#l49-l51

the phone call binduielements() converts ui hash in jquery selector objects, , called right before onrender method called.

are seeing errors? or selector returning nothing, , having no impact on elements?

update:

ah! of course... wasn't paying attending code close enough. you're right in ui element selectors happen before you're adding the sub-view region. i've never run in situation before... seems want prepare / support.

for now, best workaround can suggest phone call 'this.binduielements();' @ end of onrender method. forcefulness ui elements re-bind selectors.

i'll add together issue github issues list, in improve solution this. don't know when i'll able this, @ to the lowest degree on list of things fix.

backbone.js marionette

actionscript 3 - retrieve variables from php and send to a js function via AS3 -



actionscript 3 - retrieve variables from php and send to a js function via AS3 -

can tell me how retrieve response php file im posting , send them js function please.

i have animated gif image in script doesnt show animation. can working too?

the php response in format variable1=blabla&varaibale2=blabla

function sendpixeldata(e:mouseevent):void { capture_mc.visible = false; send_mc.visible = false; txtreturn.htmltext="uploading image......<img src="loading.gif" /><br/> please wait!"; var output:string = ""; var col = ""; (var i:number=0; i<bitmapdata.height; i++) { (var j:number=0; j<bitmapdata.width; j++) { col = bitmapdata.getpixel(j,i).tostring(16); // in cases, color truncated (e.g. "00ff00" becomes "ff00") // adding missing zeros. while (col.length<6) { col = "0" + col; } output += col; } } var request:urlrequest = new urlrequest("getpixeldata.php"); var variables:urlvariables = new urlvariables(); var myurlloader:urlloader = new urlloader(); variables.pixels=output;// image pixel //trace("output" + output) variables.width=videopreviewwidth;// video width variables.height=videopreviewheight;// video height request.data=variables; request.method=urlrequestmethod.post; myurlloader.addeventlistener ("complete", onc); myurlloader.load (request); function onc (e) { var result:string = externalinterface.call( "redirecttourl(send variables here)" ); trace ("save complete"); } }

the result php stored in info property of urlloader, retrieve use:

function onc (e:event) { var result:string = string(e.target.data); ...etc

for part 2 of question, flash doesnt back upwards gif file format - need utilize jpg or png.

btw, dont utilize strings event types - utilize event type constant, eg:

myurlloader.addeventlistener (event.complete, onc);

php actionscript-3 flash

javascript - Scroll to top in a lightbox -



javascript - Scroll to top in a lightbox -

i have created customized menu. see here. on click of link have shadowbox popping has long list of items. want have "back top" anchor link takes me top of menu list.

i've set lightbox #box id.

html

<div id="box"> ... <!-- long content there --> <a href="#" id="totop">to top</a> </div>

css (setting width of elements)

#box { position:relative; width:200px; height:250px; overflow:auto; } #box #totop { position:absolute; display:none; left:150px; top:10px; }

jquery

$('#box').bind('scroll', function(e) { if ($(this).scrolltop() > 100) { $('#totop').fadein(); $('#totop').css({'top' : $(this).scrolltop() + 100}); } else { $('#totop').fadeout(); } }); $(document).on('click', '#totop', function(e) { e.preventdefault(); //$('#box').scrolltop(0); //just go top $('#box').animate({scrolltop : 0},'slow'); //animate });

fiddle

javascript

Hidden scrollbars do not allow page scrolling. (CSS) -



Hidden scrollbars do not allow page scrolling. (CSS) -

this question has reply here:

how can disable browser or element scrollbar, still allow scrolling wheel or arrow keys? 7 answers

after using code:

body{ overflow:hidden; }

the scrollbar disappears right-hand side of page consequence, can no longer scroll or downwards page unless click scroll wheel on mouse , drag in direction wish scroll. ideas on how combat this?

the purpose of overflow: hidden; not hide scroll bars - consequence of happening, - content exceeds "visible" area clipped (hidden).

you looking (hiding scrollbars) not purpose of overflow: hidden;

css scrollbar

mysql - Solr 4.0 Delta-import 3 tables join -



mysql - Solr 4.0 Delta-import 3 tables join -

i using solr 4.0 dih(jdbc connector) on ubuntu. trying create next mysql bring together query work solr on delta-import:

select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id

here c, u, g aliases of tables customer, user , group respectively.

below data-config.xml file total , delta import:

<entity name="cust" pk="id" query="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id" deltaimportquery="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id c.id='${dih.delta.c.id}'" deltaquery="select id client last_modified &gt; '${dih.last_index_time}'"> <entity name="grp" pk="dt_id" query="select * grouping dt_id='${cust.c.id}'" deltaquery="select dt_id grouping last_modified > '${dih.last_index_time}'" parentdeltaquery="select id client id=${grp.dt_id}" > <entity name="usr" pk="bus_grp_id" query="select * user" deltaquery="select bus_grp_id user last_modified > '${dih.last_index_time}'" parentdeltaquery="select dt_grp_id grouping dt_grp_id=${usr.bus_grp_id}" > </entity> </entity> </entity>

the full-import ok delta-import not working(i'm getting no results after delta import). it's been 1 month since i'm trying create work couldn't.

any help? please!

if query in main entity element i.e.

select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id

is giving fields need index in solr, don't think need other 2 sub-entities. guess there typo in deltaimportquery. should utilize dih.delta.id , not dih.delta.c.id.

i guess if maintain this, should work fine:

<entity name="cust" pk="id" query="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id" deltaimportquery="select c.*,u.*,g.* user u inner bring together grouping g on u.bus_grp_id = g.dt_grp_id inner bring together client c on c.id = g.dt_id c.id='${dih.delta.id}'" deltaquery="select id client last_modified &gt; '${dih.last_index_time}'" />

as total import, check file dataimport.properties. 1 time total import completes, create sure got documents in customer table last_modified greater time find in dataimport.properties delta has info run on. seek delta import , see if docs re-indexed. can find out how many got indexed delta import looking @ http://host:port/solr/core/dataimport

mysql join solr dih

iphone - Unable to programmatically add an image of the right size to UIBarButtonItem -



iphone - Unable to programmatically add an image of the right size to UIBarButtonItem -

i having terrible time trying utilize images instead of titles uibarbuttonitems. under understanding setting image uibarbuttonitem automatically scales image right size uibarbuttonitem. create sense, there doesn't seem way resize image (you can't set imageview, or add together subview, or anything). when utilize 2 different images of exact same dimensions (24x24), different results:

myaddbutton = [[uibarbuttonitem alloc]initwithimage:[uiimage imagenamed:@"plus.png"] style:uibarbuttonsystemitemadd target:self action:@selector(addbuttontapped)]; self.navigationitem.rightbarbuttonitem = myaddbutton; myleftbutton = [[uibarbuttonitem alloc]initwithimage:[uiimage imagenamed:@"gear.png"] style:uibarbuttonsystemitemadd target:self action:@selector(settingsbuttontapped)]; self.navigationitem.leftbarbuttonitem = myleftbutton;

leads following:

again, gear.png , plus.png same size, 24x24. have confirmed in photoshop.

now if take exact same lines of code, replace gear plus:

myaddbutton = [[uibarbuttonitem alloc]initwithimage:[uiimage imagenamed:@"plus.png"] style:uibarbuttonsystemitemadd target:self action:@selector(addbuttontapped)]; self.navigationitem.rightbarbuttonitem = myaddbutton; myleftbutton = [[uibarbuttonitem alloc]initwithimage:[uiimage imagenamed:@"plus.png"] style:uibarbuttonsystemitemadd target:self action:@selector(settingsbuttontapped)]; self.navigationitem.leftbarbuttonitem = myleftbutton;

i this:

the difference in color beingness due 1 beingness enabled , other not.

i create them uibuttons, utilize imageviews , manually set myself, except background using uibarbuttonitem gives me, , don't want recreate in photoshop.

any ideas what's happening here, , how can prepare it?

thanks in advance.

edit:

turns out issue caused because needed clear build , delete app off of simulator, pulling 48x48 image had used earlier.

make sure have right image in project. and, yeah, seek cleaning project sometimes. removing app device/simulator can helpful.

iphone ios objective-c

c# - Windows +D disabled but not working -



c# - Windows +D disabled but not working -

i have 2 windows form mainform , minimizedmainform. want disable windows+d both forms. parent of both forms 3rd form formbase. have used next code disabling windows+d

private const in gwl_hwndparent =-8 intptr hprog = nativemethods.findwindowex(nativemethods.findwindowex(nativemethods.findwindow("progman", "program manager"), intptr.zero, "shelldll_defview", ""), intptr.zero, "syslistview32", "folderview"); nativemethods.setwindowlong(this.handle, gwl_hwndparent, hprog);

problem facing mainform never getting minimized if press win+d. , first launch of minimizedform if i press win+d doesnt minimized. second+ time load of minimizedmainform if press win+d , form gets minimized. have added above code on formload event of both forms. minimizedmainform opened when click on panel on mainform , vice versa. mainform starting form of project.

what should stop form minimizing on 2nd+ loadform events?

maybe instead of preventing minimizing of window can minimized, have create window can't minimized instead: minimizebox = false ? (it can't simple bet, can't write comments, here comes solution =d)

c# winforms

bash - Node.js: Watching a process in Linux for state changes -



bash - Node.js: Watching a process in Linux for state changes -

are there files in linux filesystem watch changes on monitor process' status? in other words, there file can watched fast process state alter detection?

i assume it'd in /proc directory, , i'd utilize use node.js , filesystem function fs.watch() instant changes on process' status. (such running, frozen, nonexistent, etc)

is there file can find process' status in?

the current process state can found in /proc/$pid/stat. 3rd field man proc:

state %c 1 character string "rsdztw" r running, s sleeping in interrupt‐ ible wait, d waiting in uninterruptible disk sleep, z zombie, t traced or stopped (on signal), , w paging.

whether can utilize file scheme watch functions on matter, /proc files aren't real files, rather handles generate info on demand.

linux bash node.js process

python - How to create sqlalchemy to json -



python - How to create sqlalchemy to json -

i have sqlalchemy result

labels = session.query( labelsdata, labelsdata.id, labelsdata.name, labelsdata.color ).filter(labelsdata.deleted==false).all()

and want convert result json, how can it?

it looks labelsdata object sqlalchemy model. need serialize before dumping json. here's short illustration extracts columns labelsdata object , converts results of query json:

from json import dumps sqlalchemy.orm import class_mapper def serialize(model): """transforms model dictionary can dumped json.""" # first names of columns on model columns = [c.key c in class_mapper(model.__class__).columns] # homecoming values in dict homecoming dict((c, getattr(model, c)) c in columns) # can utilize particular illustration serialized_labels = [ serialize(label) label in session.query(labelsdata).filter(labelsdata.deleted == false) ] your_json = dumps(serialized_labels)

python json sqlalchemy

Google app engine's ndb: using id or key name? -



Google app engine's ndb: using id or key name? -

this google app engine's ndb. according observations, if create entity without providing key, entity have integer, starting 1 , beingness incremental, in id field shown in datastore viewer. however, if create entity providing string id, entity have string in key name field. example:

model:

class member(ndb.model): ...

program:

member1 = member() # --> id 1, key name none member2 = member(id='abc') # --> id empty, key name 'abc'

in addition, in html file, if utilize

<input ... name="id" value={{member1.key.id}} ... />

as parameter homecoming server-side programme (python), none of next 2 statements work member1:

member.get_by_id(self.request.get('id')) member1 = member.get_by_id(int(self.request.get('id')))

however, next html , programme codes:

<input ... name="id" value={{member2.key.id}} ... /> member2 = member.get_by_id(self.request.get('id'))

will work member2.

there seems no problem entities created providing string id's (i.e., member2). same doesn't work member1. questions: a) observations correct? b) how fetch member1 using get_by_id()?

a) correct, though should able member1 through sec method showed. can't verify integer ids start @ 1 , incremental. i've seen mixed results in regards that.

b) member1 = member.get_by_id(int(self.request.get('id'))) should work

you seek using key.urlsafe() dont have worry key id conversions:

<input ... name="id" value={{member.key.urlsafe()}} ... />

member_key = self.request.get('id') fellow member = ndb.key(urlsafe=member_key).get()

google-app-engine

xslt - BaseX: where to declare the XML document on which to perform a query -



xslt - BaseX: where to declare the XML document on which to perform a query -

with programme basex able utilize xpath , xquery in order query xml document located @ home directory, have problem doing same in xslt.

the document i'm querying bookstoreq.xml.

xpath version, running totally fine:

doc("/home/ioannis/desktop/bookstoreq.xml")/bookstore/book/title

xslt code want execute:

<xsl:stylesheet version = "2.0" xmlns:xsl = "http://www.w3.org/1999/xsl/transform"> <xsl:output method= "xml" indent = "yes" omit-xml-declaration = "yes" /> <xsl:template match = "book"></xsl:template> </xsl:stylesheet>

i read basex' documentation on xslt, didn't manage find solution. how can run given xslt?

basex has no direct back upwards xslt, have phone call using xquery functions (which easy, though). there 2 functions doing this, 1 returning xml nodes (xslt:transform(...)), 1 returning text string (xslt:transform-text(...)). need sec one.

xslt:transform-text(doc("/home/ioannis/desktop/bookstoreq.xml"), <xsl:stylesheet version = "2.0" xmlns:xsl = "http://www.w3.org/1999/xsl/transform"> <xsl:output method= "xml" indent = "yes" omit-xml-declaration = "yes" /> <xsl:template match = "book"></xsl:template> </xsl:stylesheet> )

both can either called xslt nodes (used here), passing string or giving path file containing xslt code.

xslt xquery basex

Unable to create a new app on foursquare -



Unable to create a new app on foursquare -

i trying create app on foursquare. fill required fields. submitting app form result in 400 bad request no message in browser.

however response looks this:

{"meta":{"code":400,"errortype":"param_error","errordetail":"value invalid pushversion"},"response":{}}

can bug on side, or missing something?

thanks

was getting error.... pushversion beingness posted /v2/apps/create blank , there no visible user input field. field in markup though if utilize chrome dev tools or firebug can find version input's div wrapper , remove style="display: none;", fill in field. entered "20130115" , chose didn't want pushes , app created successfully.

foursquare

TypeScript: Convert interface to class -



TypeScript: Convert interface to class -

i have next code:

interface x { type : string; val : number; } class x1 implements x { type : string; val : number; } var p1 : x[] = [{type:'a', val:8}]; (var n in p1) { var p2 : x1 = p1[n]; } var p3 : x1 = p1[0];

both p2 , p3 declared having type x1 , initialized value of type x.

the compiler happily accepts declaration of p2, complains p3 saying "cannot convert 'x' 'x1'".

why difference?

everything implements x should convertible x, not convertible x1.

here more detail. code below shows simple example. essentially, if have of type x (interface) implemented either x1 (class) or x2 (class).

while can downgrade type (from implementation downwards interface) can't upgrade type (from interface specific implementation) because can't guarantee have compatible.

another way of looking @ can create less specific is, can't create more specific is.

interface x { type : string; val : number; } class x1 implements x { type : string; val : number; } class x2 implements x { type: string; val: number; mymethod() { } } var x1 = new x1(); var x2 = new x2(); var examplea: x = x1; // happy var exampleb: x = x2; // happy var examplec: x1 = examplea; // not happy...

the upshot of of need cast it:

var examplec: x1 = <x1>examplea; // happy...

but cautious, because this, wouldn't work:

var examplec: x2 = <x2>examplea; // seems happy... examplec.mymethod(); // oh dear!

update

in respect of piece of code...

for (var n in p1) { var p2 : x1 = p1[n]; }

in javascript isn't equivalent foreach loop. used iterating on properties in object , when utilize on array show explicitly set indexes (not items). iterate on array, should using:

for (var = 0; < p1.length; i++) { var p2 : x1 = p1[i]; // same warning before }

so how come typescript allows p1[n] allocated x1 variable? interesting question , reply lies here...

if hover on p1[n] you'll see type of x[] - type of p1, not type of p1[n]. if check example, you'll find p1[n] of type any:

var illustration = p1['test']; // used 'test' because n string.

because of type any compiler allows tell treat x1. converting any x1 not x x1 might have thought.

typescript

r - How to handle conditional data.frame subscripts that contain NAs? -



r - How to handle conditional data.frame subscripts that contain NAs? -

is there way have conditional subscripts if conditional vector contains nas? assume have data.frame this

dframe <- data.frame(a=c(1,32,4,5,8),b=c(1,2,3,4,5),d=c(na,5,5,10,9)) dframe[dframe$d > 9,"a"] <- na

if not na in dframe$d straight forward. have seen %in% syntax here around nas, not know how manage conditions. can see of general problem, since not quite sure whether want obtain na missing value in status or else. interested larn how people handle situation.

in specific situation in helpful when na treated false in condition.

you can restrict indexing non na values

dframe[dframe$d > 9 & !is.na(dframe$d),"a"] <- na

r condition missing-data na

Eclipse IDE Delete Key Woes -



Eclipse IDE Delete Key Woes -

i have done exhaustive searching , have been unable find direction. time seek type delete delete proceeding text in ide, or seek paste menu pops in lower right corner of page. i'm not sure how got turned on, or how turn off. makes deleting text , re-create , pasting laborious. here illustration of eclipse looks when nail delete key...

again, note little menu appears in lower right corner. help appreciated.

it sure plugin have installed, has clipboard ... moreclipboard, seek remove plugin, 1 time removed popup should disappear .

eclipse ide key

Java Swing resizing UI overlap elements -



Java Swing resizing UI overlap elements -

i have created gui netbeans gui builder , manually wrote additional code. don't know how describe problem, please have @ image below.

this default view, can notice jtable has been created within jpanel manually:

jpanel1.setlayout(new borderlayout()); tablemodel model = db.populatejtable(); jtable jtable1 = new jtable(model); jtable1.setmodel(model); jscrollpane tablecontainer = new jscrollpane(jtable1); jpanel1.add(tablecontainer); view.super.getcontentpane().add(jpanel1); //view.super.pack(); view.super.setvisible(true);

when seek resize window horizontally, components react resizing specified, jtable remain rendered before, overlapping other elements:

can please tell me happening , how should proceed? many thanks

a powerful solution: utilize layouts. job while resizing.

a 1 gridbaglayout. if need more complex layout, can utilize powerful boxlayout

that if want design layout manually. me, prefer using netbeans 7.2.1 designer. automatically configures layout while designing them in design window.

java swing jtable jframe jpanel

iphone - Variable memory address attribution EXEC_BAD_ACESS -



iphone - Variable memory address attribution EXEC_BAD_ACESS -

i have allocated object attributes store in next memory places:

when create simple attribution of nsdate attribute variable gives me exec_bad_acess. can see first image date attribute , filedate variable have different addresses.

am making pointer related error? other 2 attributes assigned correctly variables, happens nsdate maybe i'm missing detail nsdate.

edit1

downloadfile definition:

edit2

init function:

edit3 date parameter:

is there reason why not using arc? there quite few memory management errors there causing leaks , 1 should cause crash.

nsdate *datefromstring = [dateformatter datefromstring:receiveddate];

returns autoreleased nsdate when phone call additional

[datefromstring autorelease];

you overreleasing nsdate hence crash.

[pfile setdate:[[nsdate alloc] init]];

is memory leak. going through setter setdate: cause pfile take +1 retain on date, should release in it's dealloc. [[nsdate alloc] init] phone call returns date object +1 never released elsewhere.

you can prepare either with

[nsdate date]

or

[[[nsdate alloc] init] autorelease];

the first alternative preferred

iphone objective-c pointers nsdate exc-bad-access

php - Codeigniter Force download files -



php - Codeigniter Force download files -

by going through codeigniter documentation, using next code forcefulness download files server.

function download($file_id){ $file = $this->uploadmodel->getbyid($file_id); //getting file details //for $file_id (all details stored in db) $data = file_get_contents($file->full_path); // read file's contents $name = $file->file_name;; force_download($name, $data); }

the code working file images, when comes case of pdf files, not working. have not tested file extensions, since not working pdf, might not work other various file types. solution?

i've had similar problems, think problem resides in mime's , headers sent browsers. i've end using code found here http://taggedzi.com/articles/display/forcing-downloads-through-codeigniter. utilize function below instead of force_download. has worked me far.

function _push_file($path, $name) { // create sure it's file before doing anything! if(is_file($path)) { // required ie if(ini_get('zlib.output_compression')) { ini_set('zlib.output_compression', 'off'); } // file mime type using file extension $this->load->helper('file'); $mime = get_mime_by_extension($path); // build headers force out file properly. header('pragma: public'); // required header('expires: 0'); // no cache header('cache-control: must-revalidate, post-check=0, pre-check=0'); header('last-modified: '.gmdate ('d, d m y h:i:s', filemtime ($path)).' gmt'); header('cache-control: private',false); header('content-type: '.$mime); // add together mime type code igniter. header('content-disposition: attachment; filename="'.basename($name).'"'); // add together file name header('content-transfer-encoding: binary'); header('content-length: '.filesize($path)); // provide file size header('connection: close'); readfile($path); // force out exit(); }

hope helps.

php codeigniter

How do I find the length (or dimensions, size) of a numpy matrix in python? -



How do I find the length (or dimensions, size) of a numpy matrix in python? -

this question has reply here:

numpy array dimensions 2 answers

for numpy matrix in python

from numpy import matrix = matrix([[1,2],[3,4]])

how can find length of row (or column) of matrix? equivalently, how can know number of rows or columns?

so far, solution i've found is:

len(a) len(a[:,1]) len(a[1,:])

which returns 2, 2, , 1, respectively. i've gathered len() homecoming number of rows, can transpose, len(a.t), number of columns. however, feels unsatisfying , arbitrary, when reading line len(a), isn't obvious should homecoming number of rows. works differently len([1,2]) 2d python array, homecoming 2.

so, there more intuitive way find size of matrix, or best have?

shape property of both numpy ndarray's , matrices.

a.shape

will homecoming tuple (m, n), m number of rows, , n number of columns.

in fact, numpy matrix object built on top of ndarray object, 1 of numpy's 2 fundamental objects (along universal function object), inherits ndarray

python matrix numpy

data.frame - python pandas transform timeseries into multiple column DataFrame -



data.frame - python pandas transform timeseries into multiple column DataFrame -

i have timeseries of intraday day info looks below

ts =pd.series(np.random.randn(60),index=pd.date_range('1/1/2000',periods=60, freq='2h'))

i hoping transform info dataframe, columns each date, , rows time in date.

i have tried these,

key = lambda x:x.date() grouped = ts.groupby(key)

but how transform groups date columned dataframe? or there improve way?

import pandas pd import numpy np index = pd.date_range('1/1/2000', periods=60, freq='2h') ts = pd.series(np.random.randn(60), index = index) key = lambda x: x.time() groups = ts.groupby(key) print pd.dataframe({k:g k,g in groups}).resample('d').t

out:

2000-01-01 2000-01-02 2000-01-03 2000-01-04 2000-01-05 2000-01-06 \ 00:00:00 0.109959 -0.124291 -0.137365 0.054729 -1.305821 -1.928468 03:00:00 1.336467 0.874296 0.153490 -2.410259 0.906950 1.860385 06:00:00 -1.172638 -0.410272 -0.800962 0.568965 -0.270307 -2.046119 09:00:00 -0.707423 1.614732 0.779645 -0.571251 0.839890 0.435928 12:00:00 0.865577 -0.076702 -0.966020 0.589074 0.326276 -2.265566 15:00:00 1.845865 -1.421269 -0.141785 0.433011 -0.063286 0.129706 18:00:00 -0.054569 0.277901 0.383375 -0.546495 -0.644141 -0.207479 21:00:00 1.056536 0.031187 -1.667686 -0.270580 -0.678205 0.750386 2000-01-07 2000-01-08 00:00:00 -0.657398 -0.630487 03:00:00 2.205280 -0.371830 06:00:00 -0.073235 0.208831 09:00:00 1.720097 -0.312353 12:00:00 -0.774391 nan 15:00:00 0.607250 nan 18:00:00 1.379823 nan 21:00:00 0.959811 nan

python data.frame group pandas

Codeigniter updating session userdata -



Codeigniter updating session userdata -

i have these session data:

"user_id"=>4545, "user_firstname"=>"jhon", "user_email"=>"jhon@myfakeemail.com"

if update example:

$this->session->set_userdata("user_email","mynewemail@fakeemail.com");

will enteire session updated?

will session new session id?

the point of session persist user data. if updating usedata created new session id purpose of session defeated. changing email address stored going alter email address in session nil else

codeigniter session updates

asp.net - Specified cast is not valid error using C# -



asp.net - Specified cast is not valid error using C# -

i trying store select statement result in c# variable getting error

"specified cast not valid"

when run it. not sure how resolve please help

sqlconnection con1 = new sqlconnection(configurationmanager.connectionstrings["myconnectionstring"].connectionstring); sqlcommand cmd1 = new sqlcommand("select cast(round(sum(cast(avgnumbers numeric(12,2))),2) decimal(12,2)) [average days] maintable ", con1); cmd1.connection = con1; con1.open(); int32 result = (int32)cmd1.executescalar(); con1.close();

cmd1.executescalar() not returning boxed integer. assign object , @ in debugger see is.

i'm guessing it's going returning decimal or double, , need do:

int32 result = (int32)(double)cmd1.executescalar();

or:

int32 result = (int32)(decimal)cmd1.executescalar();

[edit in response question in commments below]

to maintain decimal value, this:

decimal result = (decimal) cmd1.executescalar();

if needed to, cast decimal double:

double result = (double)(decimal) cmd1.exectutescalar();

c# asp.net sql-server-2008

php - Google Calendar Events Change MySQL DB -



php - Google Calendar Events Change MySQL DB -

i'll straightforward , inquire i'm trying , if help me out great know whether i'm trying possible or not. using yii framework mysql database in back. want integrate multiple different user's calender's in google calendar. also, know if it's possible, either google calendar api, using yii, or gdata library in zend (if can since i'm using yii framework) have changes made calender performs changes mysql database.

for example, if user changes calendar of appointment 2 hours 1 hour, alter needs reflect in database appointment lengths stored.

i want able create changes database every time appointment/event added, deleted, or edited.

thank help, appreciate it!

i have used extension egcal problem before.

php mysql yii

AsyncTask HttpConnection in Android -



AsyncTask HttpConnection in Android -

i want create httpconnection using asyntask.three parameters posted server username,password , search item.the search provided user in edittext such when user clicks button,the search item sent server.i want execute doinbackground() method in onclicklistener , display response server on listviews.this asynctask class

public class posttoserver extends asynctask<string, void, string> { @override protected void onpostexecute(string result) { } @override protected string doinbackground(string... arg0) { seek { httpclient client = new defaulthttpclient(); string posturl = "url"; string username ="username"; string password = "password"; httppost post = new httppost(posturl); list<namevaluepair> params = new arraylist<namevaluepair>(); params.add(new basicnamevaluepair("user", username)); params.add(new basicnamevaluepair("pass", password)); urlencodedformentity ent = new urlencodedformentity(params,http.utf_8); post.setentity(ent); httpresponse responsepost = client.execute(post); httpentity resentity = responsepost.getentity(); if (resentity != null) { log.i("response",entityutils.tostring(resentity)); } } grab (exception e) { e.printstacktrace(); } homecoming null; }

this class click event called

public class startpost extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.result_page); } button submit = (button) findviewbyid(r.id.btn_search); edittext textvalue = (edittext)findviewbyid(r.id.searchedittext); string value = textvalue.gettext().tostring(); posttoserver post = new posttoserver(); checkinternetconnection check = new checkinternetconnection(null); private onclicklistener click = new onclicklistener() { @override public void onclick(final view v) { switch(v.getid()){ case r.id.btn_search: post.execute(); break; } } }; }

questions 1.what doing wrong because seems post not working , how can display server results onpostexecute()? give thanks you.

create onpostexecute method display results on textview.

protected onpostexecute (string result){ textview tv = (textview) findviewbyid(r.id.textview1); if(result != null){ tv.settext(result); } }

android-asynctask

drop down menu - How to toggle twitter bootstrap jquery dropdown by clicking on svg-path? -



drop down menu - How to toggle twitter bootstrap jquery dropdown by clicking on svg-path? -

i want utilize svg -element "toggle" dropdown (jquery twitter bootstrap) clicking within -element. of import because of complexe shaped dashboard elements. toggle event should available if mouse within path element. i've build jsfiddle example illustrate problem. because i'm javasript newbie, nice hooks started. give thanks in advance!

<html><head><title></title> <link href="http://twitter.github.com/bootstrap/assets/css/bootstrap.css" rel="stylesheet" media="screen"></head> <body> <div class="dropdown"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> want action <span class="caret"></span> </a> <ul class="dropdown-menu" role="menu" aria-labelledby="dlabel"> <li><a tabindex="-1" href="#">action</a> </li> <li><a tabindex="-1" href="#">another action</a> </li> <li><a tabindex="-1" href="#">something else here</a> </li> <li class="divider"></li> <li><a tabindex="-1" href="#">separated link</a> </li> </ul> </div> <div class="dropdown"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="150" height="30" id="test"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <g transform="translate(0,-850)" id="layer1"> <rect class="dropdown-toggle" width="150" height="30" ry="4" x="0" y="850" id="rect3013" style="fill:#ff0000;fill-opacity:1;stroke:none" /> </g> </a> <text x="60.42905" y="18.798733"> <tspan sodipodi:role="line" id="tspan3852" x="20" y="18.798733">toggle here </tspan> </text> </svg> <ul class="dropdown-menu" role="menu" aria-labelledby="dlabel"> <li><a tabindex="-1" href="#">action</a> </li> <li><a tabindex="-1" href="#">another action</a> </li> <li><a tabindex="-1" href="#">something else here</a> </li> <li class="divider"></li> <li><a tabindex="-1" href="#">separated link</a> </li> </ul> </div> <script src="http://code.jquery.com/jquery-latest.js"></script> <script src="http://twitter.github.com/bootstrap/assets/js/bootstrap-dropdown.js"></script> </body>

you seek this:

html structure:

<div class="dropdown"> <svg xmlns="http://www.w3.org/2000/svg" version="1.1" width="150" height="30" id="test"> <a class="btn dropdown-toggle" data-toggle="dropdown" href="#"> <g transform="translate(0,-850)" id="layer1"> <rect class="dropdown-toggle" width="150" height="30" ry="4" x="0" y="850" id="rect3013" style="fill:#ff0000;fill-opacity:1;stroke:none" /> </g> <text x="60.42905" y="18.798733"> <tspan sodipodi:role="line" id="tspan3852" x="20" y="18.798733">toggle here</tspan> </text> </a> </svg> <ul class="dropdown-menu" role="menu" aria-labelledby="dlabel"> <li><a tabindex="-1" href="#">action</a> </li> <li><a tabindex="-1" href="#">another action</a> </li> <li><a tabindex="-1" href="#">something else here</a> </li> <li class="divider"></li> <li><a tabindex="-1" href="#">separated link</a> </li> </ul> </div>

then, when click on svg:

$("svg").on("click", function () { $("ul").fadein(200); });

also, close dropdown-menu when click outside of add together this:

$(document).on("click", ":not(svg *)", function (e) { $("ul").fadeout(200); e.stoppropagation(); });

here demo

jquery drop-down-menu svg

scala - Could not find implicit Marshaller in Spray.io when using Jackson -



scala - Could not find implicit Marshaller in Spray.io when using Jackson -

i have spray.io directive handles post , want utilize jerkson (scala interface jackson) parse incoming json appropriate class.

post { path("") { entity(as[string]) { stuff => finish { parse[user](stuff) } } } }

the issue when go compile, spray goes looking marshaller:

[error] c:\project\src\main\scala\com\project\accountservice\controllers\users.scala:53: not find implicit value evidence parameter of type spray.httpx.marshalling.marshaller[com.project.accountservice.models.user] [error] parse[user](stuff) [error] ^ [error] 1 error found

do need write custom marhsaller this? or directive not written properly? , if need one, examples out there?

thanks!

this managed job done:

post { path("") { entity(as[string]) { body => val user = parse[user](body) complete(generate(user)) } } }

looks since wasn't returning string in complete started looking marshaller marshall user object.

scala spray spray-json jerkson

node.js - What "streams and pipe-capable" means in pkgcloud in NodeJS -



node.js - What "streams and pipe-capable" means in pkgcloud in NodeJS -

my issue image uploading amazon working. looking solution doesnt save file on server , then upload amazon.

googling found pkgcloud , on readme.md says:

special attending has been paid methods streams , pipe-capable.

can explain means , if looking for?

yupp, means you've found right kind of s3 library.

what means library exposes "streams". here api defines stream: http://nodejs.org/api/stream.html

using node's stream interface, can pipe readable stream (in case post's body) writable stream (in case s3 upload).

here illustration of how pipe file upload straight kind of library supports streams: how handle posted files in express.js without doing disk write

edit: here example

var pkgcloud = require('pkgcloud'), fs = require('fs'); var s3client = pkgcloud.storage.createclient({ /* ... */ }); app.post('/upload', function(req, res) { var s3upload = s3client.upload({ container: 'a-container', remote: 'remote-file-name.txt' }) // pipe image info straight s3 req.pipe(s3upload); });

edit: finish answering questions came in chat:

req.end() automatically phone call s3upload.end() stream magic. if op wants else on req's end, can easily: req.on('end', res.send("done!"))

node.js amazon-s3 pkgcloud

html - How To Wrap A Div When Parent Container Shrinks Using CSS -



html - How To Wrap A Div When Parent Container Shrinks Using CSS -

i have css issue can't figure out. here markup.

<!doctype html> <html> <head> <meta charset="utf-8" /> <style type="text/css"> .container { position: relative; background-color: purple; padding: 0; margin: 0; } .first { float: left; width: 10%; min-width: 100px; background-color: yellow; } .second { float: left; width: 10%; min-width: 100px; background-color: orange; } .third { float: left; width: 80%; background-color: lime; } .clear { clear: both; } </style> </head> <body> <div class="container"> <div class="first">first</div> <div class="second">second</div> <div class="third">third</div> <div class="clear"></div> </div> </body> </hmtl>

the issue i'm having want wrap 3rd div when shrink browser window, have expanded (100%) 1 time wraps new line. i'm close, when 3rd div wraps, 80% property kicks in , doesn't allow expand. i have fiddle ready tweaking here. below images visualize problem. can see in sec image 3rd div isn't 100% expanded when wrapping takes place.

sorry, no pure css solution. utilize jquery...

you want attach event window.resize. caution window.resize refreshes constanstanly, little function needed wait resize remain constant half sec before fire method.

markup

<div> <div id="firstcont" style="float:left; display:inline-block;"> <select></select> <select></select> </div> <div id="secondcont" style="margin-left:80px;"> <input id="note" style="width: 99%;" /><br /> </div> </div>

javascript:

$(window).resize(function() { //wait half sec consant resize reading before executing waitforfinalevent(function(){ var $textbox = $("#note"); var textboxwidth = $textbox.width(); //alert(textboxwidth); if(textboxwidth < 400) { //alert("resizing"); $('#firstcont').css('float', 'none'); $('#secondcont').css("margin-left", "0px"); } else { $('#firstcont').css('float', 'left'); $('#secondcont').css("margin-left", "80px"); } }, 500, "some unique string"); }); var waitforfinalevent = (function () { var timers = {}; homecoming function (callback, ms, uniqueid) { if (!uniqueid) { uniqueid = "don't phone call twice without uniqueid"; } if (timers[uniqueid]) { cleartimeout (timers[uniqueid]); } timers[uniqueid] = settimeout(callback, ms); }; })();

see jsfiddle here: http://jsfiddle.net/eastonharvey/nsgf8/2/

html css html5 css3

Importing Specific Column to Excel from Web page using VBA code (URL changes) -



Importing Specific Column to Excel from Web page using VBA code (URL changes) -

i'm new guy in vba , know how can import specific column web site , re-create year's info of specific column in excel using vba code. difference page has calendar , url changes, means want re-create 1st of june 2012 until nowadays specific column fron whole table using vba code.

sub websitee() websitee x = 1 x = 1 25 activesheet.querytables.add(connection:= _ "url;http://www.epexspot.com/en/market-data/intraday", destination:=range( _ "$a$1")) .name = "intraday" .fieldnames = true .rownumbers = false .filladjacentformulas = false .preserveformatting = true .refreshonfileopen = false .backgroundquery = true .refreshstyle = xlinsertdeletecells .savepassword = false .savedata = true .adjustcolumnwidth = true .refreshperiod = 0 .webselectiontype = xlspecifiedtables webtables = "315" .webformatting = xlwebformattingnone .webpreformattedtexttocolumns = true .webconsecutivedelimitersasone = true .websingleblocktextimport = false .webdisabledaterecognition = false .webdisableredirections = false .refresh backgroundquery:=false end next x end sub

url vba table import website

java how to make a JLabel with vertical text? -



java how to make a JLabel with vertical text? -

this question has reply here:

how nowadays text vertically in jlabel ? (java 1.6) 4 answers

i need create vertical jlabel- jlabel shows it's text vertically- searched google didn't find answer. how that?

you utilize class verticallabelui created dev: http://tech.chitgoks.com/2009/11/13/rotate-jlabel-vertically/

java jlabel

php - Localhost rendering pages are very slow -



php - Localhost rendering pages are very slow -

my localhost rendering pages slow. simple html rendering taking around 2-5 seconds. researched on , got fixed replacing:

new \pdo(... ':host=localhost' ...);

to

new \pdo(... ':host=127.0.0.1' ...);

can explain me or give me link read why localhost slowing downwards , how changing ip made fast. right renders complex queries less sec when taking around 5-10 seconds before.

and there security issue replacing localhost ip? mean if host project live , replace localhost ip of host have impact on kind of security?

thanks alot

i reckon have ipv6 beingness enable on server run script. i'm not strong on network topics, such issue has been discussed several times.

i looked article give improve explanation, think found one: mysql , localhost performance (it's 2011, still applies in many cases).

php apache pdo localhost

c# - Generics - can I write T based on a variable? -



c# - Generics - can I write T based on a variable? -

i'm writing game , have crate class holds item-s of type t varying crate. i've set generics this:

public class crate<i> : item : item { private list<i> contents = new list<i>(); //... }

i'm writing "buy" screen take items, , crates of items delivered. depending on stage player in game, items are/aren't available. hence have list of available items in array.

what want create crates based on array.

for example, array might be

public static list<item> currentlyavailableitems= new list<item>() { new linen(), new food() };

from here, want create buttons generate crates of items. @ moment way can think giant if loop needs updating every time create new items this:

for (int = 0; < gv.currentlyavailableitems.count; i++) { item item = null; if (gv.currentlyavailableitems[i] linen) item = new crate<linen>(); else if (gv.currentlyavailableitems[i] food) item = new crate<food>(); add(new buybutton(item)); }

what want able like:

for (int = 0; < gv.currentlyavailableitems.count; i++) { type t = gv.currentlyavailableitems[i].gettype(); crate<t> crate = new crate<t>(); add(new buybutton(cratetobuy )); }

is possible?

you can reflection:

// todo: consider using foreach loop on gc.currentlyavailableitems type itemtype = gv.currentlyavailableitems[i].gettype(); type cratetype = typeof(crate<>).makegenerictype(t); item crate = (item) activator.createinstance(cratetype); add(new buybutton(crate));

note won't terribly efficient - may enough. if it's not, may want dictionary<type, func<item>> or that.

c# generics

regex - Proper order of PHP input validation -



regex - Proper order of PHP input validation -

obviously should validate user input info on server side. i'm curious considered "proper" input validation , order of should done.

as of right (and recent projects past) have done way:

get user input, instantiate object, , phone call method:

if(isset($_post['addcat'])) { $db = new dbconnection; $categories = new category($db); if($categories->insert_cat($_post['name']) === true) { echo "category inserted successfully!"; } }

the method called instantiated object which:1. escapes user input2. istantiates data_validation object (see validation object below)

class categories { public function insert_cat($catname) { $catname = $this->mysqli->real_escape_string($catname); $validate = new data_validation; if(!($validate->validate_string($catname))) { echo "invalid characters found in category name"; die(); } $query = $this->mysqli->query("insert categories(name) values ('".$catname."')"); if($query === false) { printf("error: %s\n", $this->mysqli->error); die(); } else { homecoming true; } } }

data_validation class which:1. trims data2. matches info regular expression3. returns info insert_cat method database insertion

class data_validation { public function validate_string($data) { // remove excess whitespace $data = trim($data); if ( preg_match("/^[0-9a-za-z \.\-\'\"]+$/", $data) ) { homecoming true; } else { //return 'not valid string'; homecoming false; } } }

so in short question is: proper first escape data, trim it, compare regular expression, add together htmlentites() or of sorts preserve formatting or should done in different order?

any tips improve security habits more welcome!

on the open web application security project you'll find if not info need validation , security in general.

php regex validation

apache - ISPConfig SOAP Remote API add web domain with php enabled -



apache - ISPConfig SOAP Remote API add web domain with php enabled -

i using remote api of ispconfig create ispconfig user, web site , ftp user , working okay, creates ispconfig user, website , ftp user, can access them through ispconfig , ftp , web site works doesn't enable php if have activated on params.

here necessary code:

$domain = 'domain.example.com'; $params = array( 'domain' => $domain, 'ip_address' => '', 'type' => 'vhost', 'parent_domain_id' => 0, 'vhost_type' => '', 'hd_quota' => 100, 'traffic_quota' => 4000, 'cgi' => 'n', 'ssi' => 'n', 'suexec' => 'n', 'errordocs' => 1, 'is_subdomainwww' => 1, 'subdomain' => '', 'php' => 'y', /* activated nothing*/ 'ruby' => 'y', /*this activated , works*/ 'redirect_type' => '', 'redirect_path' => '', 'ssl' => 'n', 'ssl_state' => '', 'ssl_locality' => '', 'ssl_organisation' => '', 'ssl_organisation_unit' => '', 'ssl_country' => '', 'ssl_domain' => '', 'ssl_request' => '', 'ssl_cert' => '', 'ssl_bundle' => '', 'ssl_action' => '', 'stats_password' => '', 'stats_type' => 'webalizer', 'allow_override' => 'all', 'apache_directives' => '', 'php_open_basedir' => '/', 'custom_php_ini' => '', 'backup_interval' => '', 'backup_copies' => 1, 'active' => 'y', 'traffic_quota_lock' => 'n' );

i don't think need write in 'custom_php_ini' , correct?

i have class utilize ispconfig, , method create website is:

public function addwebsite($clientid, $params) { $params['server_id'] = $this->server_id; utf8_encode_array($params,'utf8_decode_array'); seek { homecoming $this->soapclient->sites_web_domain_add($this->session_id, $clientid, $params, $readonly = false); } grab (soapfault $e) { throw new ispcfgexception($e->getmessage(), 500); } }

in creation of ispconfig user set param ''web_php_options' => 'mod' doesn't work...

can help me? give thanks much help in advance!

i think there parameter don't know indicate php engine don´t find right documentation.

i solved it.

i looking @ documentation provided when download zip the website , can here.

if @ documentation says param 'php' enum values 'n' , 'y' works ipconfig version 2. in ispconfig3 can edit php engine (mod-php, cgi...) not enable it.

so works writing in $params:

'php' => 'mod',

php apache website webserver web-hosting

json - using jquery ui autocomplete in wordpress search form -



json - using jquery ui autocomplete in wordpress search form -

with using jquery ui autocomplete can suggest items when user fill textbox form remote source. in remote source have file this:

<?php sleep( 3 ); // no term passed - exit no response if (empty($_get['term'])) exit ; $q = strtolower($_get["term"]); // remove slashes if magically added if (get_magic_quotes_gpc()) $q = stripslashes($q); $items = array( "great bittern"=>"botaurus stellaris", "little grebe"=>"tachybaptus ruficollis", "black-necked grebe"=>"podiceps nigricollis", "heuglin's gull"=>"larus heuglini" ); $result = array(); foreach ($items $key=>$value) { if (strpos(strtolower($key), $q) !== false) { array_push($result, array("id"=>$value, "label"=>$key, "value" => strip_tags($key))); } if (count($result) > 11) break; } // json_encode available in php 5.2 , above, or can install pecl module in before versions echo json_encode($result); ?>

and it's o.k. , useful, want utilize in wordpress site since output of remote file json, want utilize wordpress plugin json api create json version of wordpress contents in remote source. utilize plugin can search in wordpress website , receive json results, example:

http://sushiant.com/?json=1&s=mysearchterm

but question how can utilize in remote source?

<?php if (empty($_get['term'])) exit ; $q = strtolower($_get["term"]); $s = file_get_contents("http://sushiant.com/?json=1&s=".$q); //some code here echo $s ?>

as mentioned here, wordpress json api returns many attributes each post listed in page. example, in mentioned case, have search results, homecoming attributes url, title, ... each post. after getting file content of results page in json (as have done), seems should decode php, select want via php , homecoming them through json_encode.

json wordpress wordpress-plugin jquery-ui-autocomplete

php - accessing a class from another class -



php - accessing a class from another class -

i have thought requires loading in class. let's have index.php includes 1 time (database.php). in class, is acceptable create new object not extended class? in otherwords, brining in content globally instead? here's mean...

index.php: ---------------------- include_once ('./core/dataaccess.php'); .... class home { private function getusers() { $dataaccess = new dataaccess(); } }

it's acceptable , used practice, in cases not best solution. advanced way using dependency injection, means other objects needed class " injected" outside, making them interchangeable. happen in constructor, in setter method or straight parameter needed.

the methods utilize new keyword mill methods nil else creating objects.

php oop class