Posts

Showing posts from September, 2012

How do I pause/play/seek a silverlight video using javascript -

a little bit of context. want able programmatically control silverlight video player on amazon instant video javascript. using developer console. have found video player element in dom. <div id="player_container" style="display: block;"> <object type="application/x-silverlight" data="data:application/x-silverlight," id="player_object" width="50%" height="100%"> <param name="color" value="#ffffff"> <param name="background" value="#000000"> <param name="minruntimeversion" value="5.1"> <param name="autoupgrade" value="false"> ... elided several <param>'s here ... </object> </div> i enter following in js repl in developer console: > var silver = document.getelementbyid("player_object"); i at

OpenGL GLKit : rendering different size vertices objects together. ios opengl draw call exceeded array buffer bounds -

i doubt can me on hey ho. i have 3d framework have been working on things in world cubes (36 vertices). i followed great tutorial bringing blender objects in opengl : http://www.raywenderlich.com/48293/how-to-export-blender-models-to-opengl-es-part-1 i brought cube in , good, tried bring sphere in, cube, cylinder etc , blows ios opengl draw call exceeded array buffer bounds i know objects fine work demo app renders 1 object , has no binding of arrays , vertex's etc anyway i sure code junk have tried everything - (void)setupsphere; { glgenvertexarraysoes(1, &_vertexarray); glbindvertexarrayoes(_vertexarray); ////// glgenbuffers(1, &_vertexbuffer); glbindbuffer(gl_array_buffer, _vertexbuffer); glbufferdata(gl_array_buffer, sizeof(&spherevertices), &spherevertices, gl_static_draw); //// glgenbuffers(1, &_position); glbindbuffer(gl_array_buffer, _position); glbufferdata(gl_array_buffer, sizeof(spherepositions),spher

php - Contact form not uploading to database (MySQL) -

i have contact form trying input information website designated table in database. know need code run correctly? can input information in textfields on website , hit submit, reason, first name, last name, email, etc not show in database @ all. when click submit, "thank you" message show up. include contact form, php, , database like, perhaps help. contact form contactus.php <!doctype html> <html> <head> <meta charset = "utf-8"> <title>contact</title> <style type = "text/css"> em { font-weight: bold; color: black; } p { font-size: 12pt; font-family: times new roman, sans-serif; color: black; } </style> </head> <body> <?php include ('menu.html'); ?> <? include ("form_process.php"); ?> <br> please fill out form below contact info

.net - How To Make My Form Respond to Ctrl-Alt, in C#? -

i have simple form in c#, has grid , several buttons. i want form change gui bit, when ctrl-alt pressed, , have gui reverted original when ctrl-alt released. i know how check if ctrl+alt pressed - 1 way via control.modifierkeys. what ask this: for button press, have event handler respond it. keyboard regular keys have event handler respond it. ctrl-alt not regular key - not raise event when pressed. so should do? one way thought about, enable timer run, , check every 200ms if ctrl-alt pressed. is there better way timer? thank you you can override form's method pick keystroke. protected override bool processcmdkey(ref message msg, keys keydata) { if (keydata == (keys.control | keys.alt ) { //do stuff here } return base.processcmdkey(ref msg,keydata); }

audio - getting an installable package from an Applicaton in linux -

i don't know possible or not, here's question: i have alsa installed on system , not have installation files , dependencies of it, want copy alsa system same hardware, how can installable package (or that) of alsa , of it's dependencies? hardware cubieboard1 , both have linaro, kernels versions diffrent (3.0.57 mine,and 3.4.67 other)

c++ - Boost.TTI not working with Clang -

boost 1.54 added new library, boost.tti type traits introspection . following code using has_template functionality, works on g++ not on clang #include <boost/tti/has_template.hpp> boost_tti_has_template(template1) boost_tti_has_template(template2) boost_tti_has_template(template3) struct top { template <class x> struct template1 { }; template <typename a,typename b,typename c> class template2 { }; template <typename a,typename b,typename c,int d> class template3 { }; }; int main() { static_assert( has_template_template1<top>::value, ""); // true static_assert( has_template_template2<top>::value, ""); // true static_assert(!has_template_template3<top>::value, ""); // false, not typename/class template parameters } live example . question : why doesn't code compile on clang? according boost.tti docs, support variadic macros required, clang has been supporting since 2.9.

php - automatic updating of timestamps in tables with no model -

doesn't laravel automatically update timestamps of tables have no model , 'pivot' table? have tried doing doesn't update timestamps . and if doesn't update it, there way can using laravel ? or way update them manually updating columns 'created_at' or 'updated_at' ? laravel updates fields when you're using modal. if want update them manually can so. db::table('table')->where('id', '=', '1')->update(array( 'created_at' => date('y-m-d h:i:s'), 'updated_at' => date('y-m-d h:i:s') ));

swing - Java documentlistener - program stop working after input -

hi have problem documentlistener. program stop working after insert value textfield. program should xor 1st row of textfields 2nd row of textfields , put result 3rd row of textfields package opa.beta1; import java.awt.borderlayout; import java.math.biginteger; import javax.swing.jframe; import javax.swing.jpanel; import javax.swing.jtextfield; import javax.swing.swingutilities; import javax.swing.event.documentevent; import javax.swing.event.documentlistener; public class textfieldevent { jtextfield arrayiv[] = new jtextfield[8]; jtextfield plaintextarray[] = new jtextfield[8]; jtextfield ciphertextarray[] = new jtextfield[8]; jframe frame = new jframe("opa"); jpanel panel1 = new jpanel(); jpanel panel2 = new jpanel(); jpanel panel3 = new jpanel(); public void setjpanel(jtextfield array[], jpanel container, string s) { (int = 0; < 8; i++) { array[i] = new jtextfield(s, 4); array[i].getdocument().add

Dynamically assigning a Regex pattern in Javascript -

how dynamically assign pattern? i've tried: var str = "hebbbbllo"; var patt = new regexp; patt =("b", "g"); console.log(str.match(patt).length); but code produces error: uncaught typeerror: cannot read property 'length' of null i've tried use pattern "/b/g" doesn't work you should this: var patt = new regexp("pattern","flags"); so, this: var str = "hebbbbllo"; var patt = new regexp("b","g"); console.log(str.match(patt).length); read more @ mdn update: if want in way, can do: var str = "hebbbbllo"; var patt = regexp; var regex = patt("b", "g"); console.log(str.match(regex).length);

ios - NSRunLoop issues with NSURLConnection and Keyboard input -

i have nsurlconnection carries out task of uploading images me. how initialize , start connection: _connection = [[nsurlconnection alloc] initwithrequest:request delegate:self startimmediately:no]; [_connection scheduleinrunloop:[nsrunloop mainrunloop] ormode:nsdefaultrunloopmode]; [_connection start]; i call method somewhere else dispatch_async on own dispatch_queue. problem when image uploading , start typing in app keyboard, sometimes, freezes application. after bit of digging came understanding mainrunloop handles input requests such keyboard button press. wanted know if right , causing problem freezing app. regarding issue appreciated. thank in advance. p.s: tried running connection on currentrunloop doesnt work unless manually start currentrunloop. the asynchronous nsurlconnection meant run inside runloop. have 2 choices: use main thread/main runloop or spawn thread , start sep

c - Determine the largest prime factor -

i'm trying run brute force algorithm determine highest prime factor of number. here's code in c #include <stdio.h> #include <stdlib.h> long checkforhighestprime(long param); int main(){ printf("%ld",checkforhighestprime(600851475143l) ); return exit_success; } long checkforhighestprime(long param){ long d= 0; long h = 0; long i; (i = 1; <param; i++){ //check if it's factor d = param%i; // if it's factor determine whether prime if(d == 0){ for(long j = 0; j<i ; j++){ if (d%j == 0){ break; }else{ h = d; } } } } return h; } however end following error floating point exception: 8 what missing? in inner for loop, initialize j 0. causes d % j == 0 throw exception because attempting divide zero. also, appears d should

java - Showing and hiding SettingsFragment in an activity -

so followed this guide on android developers . suggest use fragments showing settings user. i created xml , strings , fragment: public class settingsfragmentapp extends preferencefragment{ @override public void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); addpreferencesfromresource(r.xml.preferences_app); } } i want show on mainactivity page without creating activity hosts fragment (i think later optioon recommended google kills point...why should create activity fragment?). added option menu , handle in mainactivity : //inside onoptionsitemselected(menuitem item) case (r.id.action_settings_user): getfragmentmanager().begintransaction().replace(android.r.id.content, new settingsfragmentuser()).commit(); return true; this way setting fragments shows expected, user hits button application exits because still on mainactivity . so question how can handle bu

javascript - Bubbling action event with custom Object from component to controller using Morris.js graph in Ember component -

i'm implementing basic ember component render morris.js line graph. need listen click event on morris , pass action. app.progressgraphcomponent = ember.component.extend( { graph: null, tagname: 'div', rendergraph: function() { this.graph.setdata(this.get('progress')); }.observes('progress'), didinsertelement: function() { var element = this.get('element').id; var self = this; this.graph = new morris.line( { element: element, xkey: 'date', ykeys: ['amount', 'increase'], labels: ['amount', 'increase'], resize: true, smooth: false, parsetime:false }).on('click', function(i, row){ self.set('clicked', row); self.sendaction('gotosession'); }); } }); in controller, when gotosession e

php - Simple Wordpress Plugin PayPal -

how can create simple plugin wordpress button, when have made ​​the purchase, 1 function write mysql id_user, purchase date , txn_id? i recommend using instant payment notification (ipn) that. post transaction data listener script have on server in real-time can automatically update database, send out email notifications, etc. you'll ipn's sorts of transactions payments, refunds, disputes, pending payments have cleared or failed, subscription profiles, subscription payments, etc. can use ipn handle of them need to. as wordpress plugin development need familiar plugin development in general , creating ipn listener wordpress won't big deal you.

c# - How to Get Asp.net Application Instance Name on IIS -

how application instance name on iis performance monitor counters? this: _lm_w3svc_16_root short answer, use: system.web.hosting.hostingenvironment.applicationid

javascript - Bootstrap popover, strage underscore -

Image
i using bootstrap api. have font-awesome icon spins when hover on it, easy enough. added popover when hover, icon has popover , spins when hover mouse on it. however, getting strange underscore character right of icon this... it happens on every icon except far right, there no underscore, works intended. has ever had problem, coming from? html: <a class="popover-icon" data-trigger="hover" data-placement="bottom" data-content="let hard work you."> <i class="hoverable fa fa-code fa-2x"></i> </a> javascript: <!-- javascript --> <script src="js/jquery-1.10.2.js"></script> <script src="js/bootstrap.js"></script> <script src="js/bootstrap-hover-dropdown.js"</script> <script src="js/bootstrap-popover.js"</script> <script> $(".hoverable").mouseover(function(){ $(this).ad

mysql - Simple form multiple select with checkboxes -

i've been trying build search form allows users search selection multiple checkbox selections in drop down list. problem when submit form, values getting passed in array 1 empty value @ end , when check logs query looks this update `searches` set `ethnicity` = '---\n- pacific islander\n- white\n- other\n- \'\'\n', `updated_at` = '2014-04-21 18:24:03' `searches`.`id` = 1 i dont understand why have characters around each form value. using simple form , form this <%= simple_form_for(:search, :url => {:controller => 'searches', :action => 'update', :slug => session[:username]}) |f| %> <%= f.error_notification %> <%= f.input :ethnicity, :label => "ethnicity", :collection => ["asian","black", "hispanic/latino", "indian", "middle eastern", "native american", "pacific islander", "white", "other&quo

java - Run method for all values in Array at once -

i trying run multiple methods of same method @ same time. right doing 1 @ time , sleeping once loops through of them. need values in array @ same time via method. here current code: public static void checktimer(ts3api api) { (string keys : admins) { //what need: check groups values in string @ same time checkgroup(api, keys); } try { //sleep 10 second thread.sleep(10000); } catch (interruptedexception e) { // nothing } } thread.sleep(10000) causes current thread sleep 10 seconds. primary thread. have not split off threads primary one, working wrote it. take through java documentation http://docs.oracle.com/javase/7/docs/api/java/lang/thread.html there examples of splitting off threads. should on way solution.

java - Android app crashes upon replacing fragment: -

i followed tutorial here on how make fragment transactions whenever hit button transact fragment app crashes. code: public class mainactivity extends activity { public fragmenttransaction transaction = getfragmentmanager().begintransaction(); public fragment loginfragment = new loginfragment(); public fragment mainfragment = new mainfragment(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); if (savedinstancestate == null) { getfragmentmanager().begintransaction().add(r.id.container, loginfragment).commit(); } else { getfragmentmanager().begintransaction().add(r.id.container, mainfragment).commit(); } } @override public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.main, menu); return true; } public void login() { transacti

php - Binding Columns in Laravel / PDO -

tl;dr: have create white-list of column names (to compare when sanitizing user input) in order let user sort dataset? that's insane amount of overhead , there really no way in modern php world accomplish variable instead? full story: i'd let user choose column , direction sort results in data set. i've accomplished following code: $sort = input::get('sort'); // column name sort $direction = input::get('direction'); // 'asc' / 'desc' $paginator = db::table('master') ->select('style_id', db::raw('max(?) `sort`')) ->setbindings(array($sort)) ->orderby('sort', $direction) ->groupby('style_id') ->paginate(20); $masters = $paginator->getcollection(); this runs no errors, resulting 20 rows seem totally ignore aggregate max requested. here output of query log on code: ( [query] =

sockets - How can I detect what program is listening to a tcp/ip port in Windows? -

i have application inherited listens on port 7001 udp broadcasts our in-house test equipment, , updated application needs same thing. both applications must able coexist on same computer. currently, when updated application attempts bind port listen udp broadcasts , fails reports port not available , suggests inherited app running. how can application detect application listening on port? i've done google search , have searched site far have been unable find except use task manager, tcpview, or netstat @ command line. i prefer technique either uses windows api or windows system com component, since both applications written in vb6. (i know, know, must maintain these applications since mission critical.) however, .net solution would useful in case need in new development efforts. netstat -n -o that show process id , there can either in task manager's process viewer, goto view -> columns... , check process id (pid). can see name of process listening on

java - Android won't allow the transition of more than one fragment: -

following tutorial here , stackoverflow able make button switch replace current fragment another. elaborate can replace current fragment if wish replace 1 after button app crashes. code: mainactivity: public class mainactivity extends activity { public fragmenttransaction transaction = getfragmentmanager().begintransaction(); public fragment loginfragment = new loginfragment(); public fragment mainfragment = new mainfragment(); public fragment settingsfragment = new settingsfragment(); @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); if (savedinstancestate == null) { getfragmentmanager().begintransaction().add(r.id.container, loginfragment).commit(); } else { getfragmentmanager().begintransaction().add(r.id.container, mainfragment).commit(); } } public void gotomain(view v) { t

php - Yii2: Common Assets with Advanced Configuration -

i use yii2's advanced configuration separate frontend, backend, common , console applications. i've got many common assets, including stylesheets, js files, , fonts used in both frontend , backend applications. makes sense put assets in assets folder in common. then, quandry starts. seems need separate appasset.php file manage assets in frontend , backend portions of overall application because things different between two. (i'm not sure whether refer frontend, backend, etc. separate applications within overarching something, or call them sub-applications of big overarching application.) anyway, appears need 2 appasset managers. handle file conversions (scss→css example) , file compression myself, have no need configure asset manager that. unfortunately, documentation on appasset , asset bundles not clear @ on how include specific files or directories in bundle. thing see how specify destinations using $css , $js , variables. input directories, see $sourcepath. me

tsql - Concatenating BINARY value to NVARCHAR string -

i have variable of binary type , sending value function create dynamic query want value concatenated , facing error- here code - declare @bin binary =0x000002a2000001bc0001 ,@sql nvarchar(max) select @sql = 'select ' + @bin + 'from test' select @sql i following error when run above code - msg 402, level 16, state 1, line 3 data types varchar , binary incompatible in add operator. i need concatenation , don't want binary converted string rather value itself. have searched extensively , haven't been able proper result. closest came link http://www.sqlservercentral.com/forums/topic613703-338-1.aspx . any on how this? have tried cast , convert no avail. please change code following , check hope helps. sql: declare @bin binary(10)=0x000002a2000001bc0001,@sql nvarchar(max) select @sql = 'select ' + convert(nvarchar(max), @bin, 1) + ' test' select @sql this returns original values of binary in query.

python - Django's prefetch_related for count only -

i have situation (the actual code bound in template, , omitted brevity). threads = thread.objects.all() thread in threads: print(thread.comments.count()) print(thread.upvotes.count()) i've managed considerably reduce total number of queries using django's awesome prefetch_related method. threads = thread.objects.prefetch_related('comments').prefetch_related('upvotes') however i'm wondering if situation further optimized. understand prefetch_related retrieves of data associated related models. seeing care amount of related models, , not models themselves, seems query optimized further doesn't retrieve bunch of unnecessary data. there way in django without dropping down raw sql? you're right, it's wasteful fetch data database if want count. suggest annotation: threads = (thread.objects.annotate(count('comments', distinct=true)) .annotate(count('upvotes', distinct=true))) thre

unix - Find - replace - Update string using shell script -

i have file containing line like https://abcdefgh.com/123/pqrst/456/xyz.html so want search line in file , replace end part i.e. xyz.html mno.html will take mno.html input in shell script. how ? $ awk 'begin{fs=ofs="/"} index($0,"https://abcdefgh.com/123/pqrst/456/xyz.html"){$nf="mno.html"} 1' file https://abcdefgh.com/123/pqrst/456/mno.html or if both values stored in shell variables: $ old="https://abcdefgh.com/123/pqrst/456/xyz.html" $ new="mno.html" $ awk -v old="$old" -v new="$new" 'begin{fs=ofs="/"} index($0,old){$nf=new} 1' file https://abcdefgh.com/123/pqrst/456/mno.html

ios - Core Data - NSManagedObjectContext returns nil in Master-Detail Application -

i'm working on alarm clock app, use core data stack apple's master-detail application template, worked fine core data, until i'm calling in - (void)applicationdidenterbackground:(uiapplication *)application method masterviewcontroller work during app in background , should tableview [self.tableview reloaddata] . and point error +entityforname: nil not legal nsmanagedobjectcontext parameter searching entity name 'myentity' everything works fine when app running when tableview should reload when application in background error. knows how solve problem? in appdelegate.m - (nsmanagedobjectcontext *)managedobjectcontext { if (_managedobjectcontext != nil) return _managedobjectcontext; nspersistentstorecoordinator *coordinator = [self persistentstorecoordinator]; if (coordinator != nil) { _managedobjectcontext = [[nsmanagedobjectcontext alloc] init]; [_managedobjectcontext setpersistentstorecoordinator:coordinator]; } return _managedobjectcont

jquery - FlotChart 0.8.2 Time mode requires the flot.time plugin -

i'm working flotchart make custom linechart (which call in ajax) i'm doing wrong because not displayed , error : uncaught error: time mode requires flot.time plugin. but jquery.flot.time.js included don't understand why got error. i found link : https://github.com/flot/flot/issues/1016 explain why flot throwing error don't understand everything... can explain me more or check wrong in code ? $(function() { var data = [ { label: "a0-p1-m1 10cm", data: [ [1388538000000, 29.8848], [ // .. data] ] } ]; var options = { legend: { nocolumns: 1 }, xaxis: { mode: "time", timeformat: "%d/%m %h:%m", ticklength: 10 }, yaxis: { show: false } }; var plot = $.plot("#placeholder13", data, options); }); thank tim

ios - Alert view on UINavigationBar in iOS7? -

is there suitable custom view can put above navigation bar? usually using uialertview giving alert. want view on navigation bar show infront of navigation bar , hide after 5 second.? is there component of build-in feature? thanks there way -- through can show view on navbar or tabbbar whereever need.. https://github.com/ecstasy2/toast-notifications-ios https://github.com/filipstefansson/uinavigationbaralert

java - Why can I write to "mnt/sdcard" and not to "mnt/extsd"? -

Image
i'm trying store file external storage (android 4.2.2). i'm using correct permission in manifest.xml: <manifest ...> ... <uses-permission android:name="android.permission.write_external_storage" /> <uses-permission android:name="android.permission.read_external_storage"/> ... the external sd card available, can prove using other app read , write files. path /mnt/extsd/ valid, @ picture below. external sd card writable because can copy/paste files it. the code: try { string path = "/mnt/extsd/file.dat" file f = new file(path); f.createnewfile(); return true; } catch (exception e) { e.printstacktrace(); return false; } i error on f.createnewfile(); : w/system.err(2172): java.io.ioexception: open failed: eacces (permission denied) w/system.err(2172): @ java.io.file.createnewfile(file.java:948) w/system.err(2172): @ solarapp.activities.settings.application.activitybackup

java ee - wicket - text field with formate that support 1,000 instead of 1000 -

i show in client string 1,000 acutall value int x = 1000 integer how can achive ? i trying genrating new class mytextfiels have @override public <c> iconverter<c> getconverter(class<c> type) { iconverter<c> converter = super.getconverter(type); if (converter instanceof abstractdecimalconverter<?>) { ((abstractdecimalconverter<?>) converter).getnumberformat(getlocale()).setgroupingused(true); } else { ((abstractintegerconverter<?>) converter).getnumberformat(getlocale()).setgroupingused(true); } return converter; } but not seem work , missing when getnumberformat() on converter, doesn't return reference numberformat instance converter use, rather clone of instance: @override public numberformat getnumberformat(final locale locale) { numberformat numberformat = numberformats.get(locale); if (numberformat == null) { numberformat = newnumberformat(locale);

sql server - How to format date to a certain way in SQL -

i have following query: select dateadd(day, 0 - (datepart(weekday, getdate()) % 7), getdate()) which displays: 2014-04-19 10:47:46.790 how can modify query displays 04/19/2014 or 04-19-2014 select convert(varchar, dateadd(day, 0 - (datepart(weekday, getdate()) % 7), getdate()), 101) outputs 04/19/2014 and select convert(varchar, dateadd(day, 0 - (datepart(weekday, getdate()) % 7), getdate()), 110) outputs 04-19-2014 alternately, format in consuming application (in case, ssrs). done =format(date_column, "mm/dd/yyyy") or =format(date_column, "mm-dd-yyyy")

css - Columns are overlapping in bootstrap 2 layout -

Image
i using codeigniter , trying set bootstrap 2 column layout using in controller: $data['form'] = $this->load->view('sellers/form7','',true); $data['data1'] = $this->load->view('sellers/lorem','',true); $this->load->view('sellers/twocolumnlayout', $data); my layout view : <div class="container-fluid"> <div class="row-fluid"> <div class="span5"> <?php echo $form ?> </div> <div class="span2"> </div> <div class="span5"> <?php echo $text1 ?> </div> </div> </div> unfortunately columns overlapping (please see attached pic). can show me how fix this?

How to modify the root parent selector in sass -

this question has answer here: modifying middle of selector in sass (adding/removing classes, etc.) 1 answer how can modify root element of parent selector chain? (using sass 3.3.x) like... =prepend($prefix) @at-root .#{$prefix}#{&} // note there no dot (.) separating @content .foo .bar +prepend(baz) background: red and return .baz.foo .bar { background: red; } or better... explicit way target root element (or nth element)? =prepend($prefix) &.#{$prefix} @content .foo +prepend("baz") .bar background: red returns this: .foo.baz .bar { background: red; } on right track?

How to use LZMA SDK in C++? -

i have difficulties in using lzma sdk in application. i create kind of single file compression tool. dont need directory support, need lzma2 stream. have no idea on how lzma sdk used this. please can give me little example on how lzma sdk can used under c++? i think it's little example use lzma sdk. /* lzmautil.c -- test application lzma compression 2008-08-05 igor pavlov public domain */ #define _crt_secure_no_warnings #include <stdio.h> #include <stdlib.h> #include <string.h> #include "../lzmadec.h" #include "../lzmaenc.h" #include "../alloc.h" const char *kcantreadmessage = "can not read input file"; const char *kcantwritemessage = "can not write output file"; const char *kcantallocatemessage = "can not allocate memory"; const char *kdataerrormessage = "data error"; static void *szalloc(void *p, size_t size) { p = p; return mya

JQuery AJAX to PHP issue with CORS -

i trying build php api can use jquery post in order make phonegap app. keep running problem cors (i think) when try use ajax call here ajax call: $.ajax({ type: 'post', url: "http://xxx.xxx.xxx.xxx/v1/login", data: { user: username, pass: password } }).done(function( msg ) { console.log(msg); }); and here headers i'm setting in php file: header('access-control-allow-origin: *'); header('access-control-allow-methods: get, post, put, delete, options'); header('access-control-max-age: 604800'); header('access-control-allow-headers: x-requested-with'); every time run ajax call same errors returned in console: post http://xxx.xxx.xxx.xxx/v1/login 500 (internal server error) l.cors.a.crossdomain.send o.extend.ajax login onclick the ajax call inside function called 'login' being run on button click, think accounts last 2 lines of error message, don't understand rest. also

java - Apache Camel: keeping filtered messages -

say have queue containing messages a , a , b , a , b , a . i'd log+drop b messages, i'd keep a messages untouched. need type of ignore functionality, rather discarding filter. if that's not available need similar to: from("jms:queue:from") .filter(header("head").isequalto("b")).to("log:com.acme?level=info").end() .to("jms:queue:from"); this type of thing seems common pattern? how people type of thing? i think choice better option filter from("jms:queue:from") .choice() .when(header("head").isequalto("b")).to("log:com.acme?level=info") .otherwise().to("jms:queue:from") .end()

ios - Should we define a position to CCAnimation? -

well, asking question ccanimation example in book " learn cocos2d ". in example (ch6), don't see code define position ccanimation , see ccsprite-derived class, called "ship", given position. why? ccanimation knows animate? thanks ccanimation has no position. animation changes sprite frames (textures) of sprite (the ship). therefore ship's position determines animation played.

c# - wpf binding not updating -

using mvvm, have view contains dependencyproperty, , listbox bound viewmodel: public static readonly dependencyproperty selectedserverproperty = dependencyproperty.register("selectedserver",typeof(object), typeof(serverview), new frameworkpropertymetadata(test)); public object selectedserver { { return getvalue(selectedserverproperty); } set { setvalue(selectedserverproperty, value); } } public serverview() { setbinding(selectedserverproperty, "selectedserver"); initializecomponent(); } public static void test(dependancyobject sender, dependancypropertychangedeventargs e) { ... } xaml: <listbox itemssource="{binding servers}" displaymemberpath="name" selecteditem="{binding selectedserver}" /> and viewmodel implements inotifypropertychanged: servermodel _selectedserver; public servermodel selectedserver { { return _selectedserver; } set { _selectedserver = value;

java - Clojure Reflection warning - call to write can't be resolved -

i'm struggling correct type hints avoid warn on reflection while writing text-file-output database query. i've tried put ^string type hints before each function being called, output going hit text file on disk. the reflection warning occurs on :row-fn line towards end of function. have comment reflection warning, dbdump/dbdump.clj:157:44 - call write can't resolved. on same line. how can rid of warning? i'm thinking there performance cost when working large datasets. (defn run-job [job-time-string db-spec config] (let [; {{{ source-sql (str "select * " (:source-base-name config)(:table-name config)) max-rows (:max-rows config) fetch-size (:fetch-size config) working-dir (:working-dir config) output-name (str working-dir "/" job-time-string ".pipe" ) field-delim (:field-delim config)