Posts

Showing posts from March, 2015

Radius Search Results function in php -

i have search function on site takes city state , zip , searches radius , displays results found have tested breaks @ line of coding: if ($origin_id[0] != -1) $sql .= " , " . $prefix . ".originlocationid in (" . implode(",", $origin_id) . ") "; the globals defined , display correctly... if not put in radius display results city.. radius inputted breaks... i have included radius function well... function getlocationsearchcriteria(&$sql, &$urlappend, $prefix) { $origin_id = location::getlocationid($globals["originstate"], $globals["origincity"], $globals["originzip"]); if (!is_array($origin_id)) { $o = $origin_id; $origin_id = array(); $origin_id[0] = $o; } if (!empty($globals["originradius"])) { $origin = new location($origin_id[0]); ----------->>>>>> $origin_i

javascript - Ember.js - Can't use this.transitionTo -

i've combined ember.js phonegap, here see confirm api. problem can't execute this.transitionto('index') event driven function onconfirm .. any ideas ? app.mainroute = ember.route.extend({ actions:{ abort: function(){ navigator.notification.confirm( 'sind sie sicher ? ', onconfirm, 'abbrechen', ['nein','ja'] ); function onconfirm(buttonindex) { if (buttonindex == 2){ this.transitionto('index'); } } //this.transitionto('index'); } } }) variable scope. this scoped onconfirm function, need scoped outer context: function onconfirm(buttonindex) { if (buttonindex == 2){ this.transitionto('

android - Type mismatch: cannot convert from void to Integer -

i have t1 text view. want store value of t1 in variable getting "type mismatch: cannot convert void integer" error integer res=t1.settext(integer.tostring(result)) ; you can use see value t1.settext(integer.tostring(result)); string result= t1.gettext().tostring(); and if want alert result: new alertdialog.builder(this) .settitle("result") .setmessage("this textview value : "+ result) .setpositivebutton(android.r.string.yes, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // can want when user press yes } }) .setnegativebutton(android.r.string.no, new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { // can want when user press no } }) .seticon(r.drawable.ic_dialog_alert) .show();

serial port - Floating point value not being displayed using printf function -

i have been trying display floating point value using printf function using serial port of atmega8 instead of displaying floating point value, '?' character displayed. output is float: ? here code #include <stdio.h> #include <float.h> #include <avr/io.h> int printchar(char character, file *stream) { while(!(ucsra&0x20)); udr=data; return 0; } file uart_str = fdev_setup_stream(printchar, null, _fdev_setup_rw); int main(void) { float fl = 1.3; stdout = &uart_str; ucsrb=0x18; // rxen=1, txen=1 ucsrc=0x06; // no parit, 1-bit stop, 8-bit data ubrrh=0; ubrrl=71; //9600 baud rate while(1) { printf("\r\nfloat: %f",fl); } } by default, minimalistic printf library used, doesn't support floating point numbers , results in "?" placeholder value. have tell linker use floating point library. for example (from gnu makefile) printf_li

android - Filter alpha with ColorMatrixColorFilter -

i want filter color colormatrixcolorfilter. have code working but... doesn't work alpha. static private colormatrixcolorfilter getfilter(int backgroundcolor, int foregroundcolor) { float rb = (float) (color.red(backgroundcolor)) / 255; float gb = (float) (color.green(backgroundcolor)) / 255; float bb = (float) (color.blue(backgroundcolor)) / 255; float rf = (float) (color.red(foregroundcolor)) / 255; float gf = (float) (color.green(foregroundcolor)) / 255; float bf = (float) (color.blue(foregroundcolor)) / 255; float[] colortransform = { rb - rf, 0, 0, 0, rf * 255, 0, gb - gf, 0, 0, gf * 255, 0, 0, bb - bf, 0, bf * 255, 0, 0, 0, 1, 0 }; colormatrix colormatrix = new colormatrix(colortransform); return new colormatrixcolorfilter(colormatrix); } how can alpha ? because here, alpha "1". thanks.

c# - Updating EF model created using code first approach -

i working on project uses ef created code first approach. model created else. in database table there no primary key , fields mandatory. need column auto incremented primary key , column optional. have made these changes in database table getting 'entity validation error' since not passing "id"(probably reason). changes , should written? here class created: public int id { get; set; }//this needs auto incremented primary key. public int userid{ get; set; } public string name { get; set; } public string address { get; set; } public bool isactive { get; set; } public bool deleted { get; set; } public int modifiedby { get; set; } public system.datetime datecreated { get; set; } public system.datetime datemodified { get; set; }//this field needs optional. you need set key , databasegenerated attributes new id property. [key] [databasegenerated(databasegeneratedoption.identity)] public int id { get; set; }

c# - Datetime Format to Date -

how convert this? public datetime date { get; set; } i need display date. please 1 convert date only i need display date. the datetime structure has numerous ways accomplish this, commonly .toshortdatestring() , .tolongdatestring() : var displaydate = date.toshortdatestring(); for further customizations, can supply a formatting string the .tostring() method .

using Classic ASP INCLUDE VIRTUAL in ASP.NET page -

i maintain classic asp intranet site. i've developed new page in asp.net has link old site. use include intranet puts header menus on each page. compile error when run new page in debugger. include file contains nested include files. error says can't find nested includes. it's looking them in c:\xxxxxx when actual physical path on d:\ drive. apparently it's resolving include virtual top level include, because it's looking nested includes. why resolve first include, finding on d:\ drive, looking nested includes on c:\ drive? here's code top level include < !--#include virtual="/includes/page2header.asp"--> here's code nested includes < !-- #include virtual="/inc/menustyles.txt" --> < !-- #include virtual="/inc/config.asp" --> the site running on iis 7.5. the site located on server on default website in virtual directory in path d:\inetpub\wwwroot the compiler looking nested includes in pa

php - Log into Joomla 3 without a Password -

does have insight how accomplished? i figure may possible mess session unless there built in function used this. if need more information let me know, happy provide it. thanks! the following code snippet should load user based on id database , log them in visitor making request. not require password. being said, hope authenticating in way. (and have tested on front-end of site.) $db = jfactory::getdbo(); $q = "select * `#__users` id = ".$id; $user = $db->setquery($q)->loadassoc(); jpluginhelper::importplugin( 'user' ); $dispatcher = jdispatcher::getinstance(); // initiate log in $options = array('action' => 'core.login.site', 'remember' => false); $results = $dispatcher->trigger('onuserlogin', array($user, $options));

layout - Android view draws cover status bar -

device: htc sensation os: 4.0.3 resolution: problem: 1 on bottom see gray part of screen 2 progress bar cover part of status bar here image layout <?xml version="1.0" encoding="utf-8"?> <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" > <imageview android:id="@+id/background" android:layout_width="match_parent" android:layout_height="match_parent" /> <ru.freecode.archmage.android.view.gameprogressbar android:id="@+id/progress" android:layout_width="match_parent" android:layout_height="match_parent" /> <ru.freecode.archmage.android.view.surface.networkgamesurface android:id="@+id/surface" android:layout_width="match_parent" andro

android - Detailed debug logs with Volley -

in restkit on ios there verbose debug option. rklogconfigurebyname("*", rklogleveltrace); . know if there equivalent volley. going straight errorlistener no additional info in logcat. both: volleylog.e("error: ", error.tostring()); and: volleylog.e("error: ", error.getmessage()); prints: 2.onerrorresponse: error: if want verbose log volley library, have use adb adb -s 42f63b0de7318fe1 shell setprop log.tag.volley verbose where " 42f63b0de7318fe1 " device id by adb devices if want persist setting use adb -s 42f63b0de7318fe1 shell setprop persist.log.tag.volley verbose if have 1 device can omit -s argument see how set adt system property in eclipse runs kill , restart app apply setting.

Laravel 4 permissions not showing -

im getting blank page while using laravel, gave perms folder with find app/storage -type d -exec chmod 777 {} \; but still blank page. another thing can try... run php artisan serve projects root dir, , see if browser comes if go http://localhost:8000 and give feedback in run... because can guess.

Using variables in javascript array? -

this short question using chart.js library , code is: javascript totalcost = (inputwatts * price + varservicefees + inputservicetrips).tofixed(0); totalfactor = (totalcost / (inputwatts * price)).tofixed(2); if (selected === 'bservice') { totalcostservice = totalcost; } else if (selected === 'bmicro') { totalcostmicro = totalcost; } else { totalcosttypical = totalcost; } var data = [ { value: totalcostservice, color: '#f7464a' }, { value: totalcostmicro, color: '#46bfbd' }, { value: totalcosttypical, color: '#fdb45c' } ], graph = new chart(document.getelementbyid('canvas').getcontext('2d')).doughnut(data); my problem when using totalcost variable nothing happens, if replace these numbers such 30 though working fine. know variable working because displaying on web page , shows valid number. have code check isnan === false . wonderful, t

Facebook page tab prompting for login, but it shouldn't -

Image
when user not logged in , navigate page tab made our app, obtrusive dialog asking them log in: this has nothing http vs https, app not in sandbox mode, there nothing in tab asking login or user information, etc. i've gone through app settings @ least half dozen times now, , nothing wrong there. aside of urls, settings identical app have not suffer problem. i'm stumped! edit: here affected tab: https://www.facebook.com/statichtmlthunderpenny/app_203351739677351 this message not login to app , facebook in general. so guess page app installed page tab app on restricted in way – age, location, or having alcohol-related content. , of course facebook asks login, because otherwise can not determine whether or not (as of still “anonymous”) user qualifies see page. so go check page settings.

url - Codeigniter load different site content foreach possible filter selection -

i have 2 input fields. in first filter user can select category, subcategory , in second filter user can choose product. upon submitting form, user gets redirected site based on selection in input fields. $category = $this->input->post('category', true); $product = $this->input->post('product', true); if(isset($category) && $sub_category == ''){ redirect(base_url().'/category/'.$category); }elseif(isset($category) && isset($product)){ redirect(base_url().'/category/'.$category.'/product/'.$product); }else{ $this->session->set_flashdata('error', 'you must select category'); redirect($_server['http_referer']); } creating urls , redirecting them based on user's input selection works fine. cannot head around how different view-content each site. each possible combination of category , product has own content. how can

css3 - Backbone jquery-mobile app - is jqm still worth using without using changepage -

i have started building app using backbone , jquery mobile. wanted jqm widgets , css styling, , used "changepage method", because allowed me use css3 transitions, , backbone didn't. i've discovered plugin backbone css3 transitions i'm wondering if worth use jquery pagechange, , if not, if still useful use jqm's js @ all, , not jquery css. what jqm javascript useful if have css3 page transitions in backbone router , jqm css styling ?

MS Access VBA code editor character encoding and copy/paste -

Image
what actual encoding used in access' vba editor? have been searching concrete answer quite while no luck. i thought utf-8 i'm not certain. my main issue when writing query in vba need test in access' query editor. when copy-pasting however, lose native characters (greek in case) turn gibberish. i have tried pasting in text editor , saving different encodings can never recover original characters. thanks in advance. edit let me explain bit further: as can see can write greek characters in vba editor normally: however, copying first line in access' query editor, following: same goes simple text editor: so inclined think problem lies inside clipboard, due encoding used greek characters. guess not unicode, indeed have make change in system locale non-unicode characters. how these characters saved/copied? in encoding? answer actually problem solved switching keyboard input language greek (el), when copying actual test string. i still not s

android - FragmentManager from application context -

is there way fragmentmanager application context? want use imageloader or bitmapfun store bitmaps download server. both class require fragmentmanager use retain cache on configuration changes such orientation change. in case want pre-download images before "need" them. is there way fragmentmanager application context? no, because fragments part of activity. in case want pre-download images before "need" them. then use different library, 1 not have dependency upon fragments.

How do I fix a "Found duplicate file for APK" error in eclipse Android project -

i have java project a, depends on junit 4.11 android project b depends on java project a, , hence gets these hamcrest.jar , junit4.11.jar. generates "found duplicate file apk" error since there 2 license.txt files. in gradle add: packagingoptions { pickfirst 'meta-inf/license.txt' } how accomplish same in eclipse? possible exclude license.txt 1 of jars using eclipse configuration?

android - how to prevent navigation to previous screen and show exit confirm message on back button tap -

i creating quiz app in witch: when use choose answer user navigate next screen. what want begins here: i want prevent user go previous screen, if user try go previous screen taping button, exit confirm message should appear. if user choose "ok" app should close , if user choose "cancel / (continue quiz)" app should continue current screen. you need override in activity onbackpressed in way @override public void onbackpressed() { alertdialog dlg = new alertdialog.builder(youractivity.this).create(); dlg.setcancelable(false); dlg.settitle("close"); dlg.setmessage("are sure?"); dlg.setbutton(dialoginterface.button_negative, "cancel", new dialoginterface.onclicklistener() { public void onclick(dialoginterface dialog, int which) { dialog.cancel(); } }); dlg.setbutton(dialoginterface.button_positive, "close app", new dialoginterface.onclicklistener(

c++ - Get output from libexpect -

i trying output produced command entered through libexpect, not skilled @ c style of doing things, , i'm not sure how proceed. the problem seems while popular program python users, can find few basic examples of using libexpect in c/c++ , none seem mention getting output. example program: // g++ t.cpp -lexpect -ltcl -o t #include <iostream> #include <tcl8.5/expect.h> int main(){ file *echo = exp_popen(const_cast<char *>("telnet google.com 80")); std::cout << char(fgetc(echo)) << std::endl; std::cout << std::string(80, '=') << std::endl; char c; do{ c = fgetc(echo); std::cout << "'" << c << "'"; }while(c != eof); return 0; } while partially works, fails first character. actually, showed link on side right after posted showing correct answer, guess did not hard enough: #include <stdio.h> #include

android - GPS Co-ordinates app -

i'm trying write simple gps co-ordinate app android keeps on crashing due nullpointerexception. code app looks code other gps co-ordinate apps , i'm struggling find error in code. nullpointerexception seems appear in onlocationchanged method when use following code: longtext.settext("longitude is: " + location.getlongitude()). the message logcat "onlocationchanged entered" displayed in logcat therefore there location, in other words, (location != null) = true. see below full code: public class mainactivity extends activity implements locationlistener { public locationmanager locationmgr; private static final int min_time = 5000; private static final int min_distance = 10; public location currentlocation; textview longtext; textview lattext; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); longtext = (te

paypal - android java.security.NoSuchAlgorithmException: KeyManagerFactory SunX509 implementation not found -

i trying process paypal preapproval payment. i use following code, found in paypal integration guides: requestenvelope requestenvelope = new requestenvelope("en_us"); preapprovalrequest preapprovalrequest = new preapprovalrequest(); preapprovalrequest.setrequestenvelope(requestenvelope); preapprovalrequest.setcurrencycode("usd"); preapprovalrequest.setstartingdate("2014-03-22"); preapprovalrequest.setendingdate("2015-03-22"); preapprovalrequest.setmaxamountperpayment(1.0); preapprovalrequest.setmaxnumberofpayments(5); preapprovalrequest.setmaxtotalamountofallpayments(5.0); preapprovalrequest.setsenderemail("platfo_1255077030_biz@gmail.com"); preapprovalrequest.setcancelurl("https://devtools- paypal.com/guide/ap_preapprove_payment?cancel=true"); preapprovalrequest.setreturnurl("https://devtools- paypal.com/guide/ap_preapprove_payment?success=true"); preapprovalrequest.setipnnotificationurl("http://

multithreading - Java Multi-Threading Performance Improvement -

my application taking around 200 milliseconds complete task using single thread.we have listener attached mq pick message , process it. when increasing number of mdb threads 5 processing time should take process 5 message in queue should around 200 milliseconds taking around 600 milliseconds .what can issue or suggestion improve it. we have file i/o ,db insert update operation involved in between process. if tasks cpu limited, might near linear scaling numbers of cpus (cores) in system. said you're using shared resources, , reason of issue. try profiling application see happening there.

usability - Why doesn't svn import put the imported folder under version control? -

this has driven me insane in past. i'm more or less on now, in far i've figured out how import files, delete them (a true leap of faith - more cautious among may prefer move them), , check out repository same place. i'm still baffled why have every time decide put project under version control. from http://svnbook.red-bean.com/en/1.7/svn.tour.importing.html note after import finished, original local directory not converted working copy. begin working on data in versioned fashion, still need create fresh working copy of tree. ... why? every time i've ever used import command it's been local directory was, point, personal 'working copy'. unusual? i totally aggree on that, design decision: svn tried keep clean concept in initial design. import moves data into repository checkout creates working copy update updates working copy commit send changes working copy repository these 4 basic operations strictly separated informati

unicode - Python BeautifulSoup string to float -

i have downloaded data set in xml format online webpage. have extracted values tag using beautifulsoup library of python. gives me unicode values. graphs = soup.graphs c = 0 q in graphs: name = q['title'] data = {} r in graphs.contents[c]: print float(str(unicode(r.string))) data[r['xid']] = unicode(r.string) c = c + 1 result[name] = [data[k] k in key] the source http://charts.realclearpolitics.com/charts/1171.xml and want make r.string float type so did print float(str(unicode(r.string))) print float(unicode(r.string)) but met err file "<ipython-input-142-cf14a8845443>", line 73 print float(unicode(r.string))) ^ syntaxerror: invalid syntax how do? first error imbalanced round brackets. print float(str(unicode(r.string)))) ^ 4th here second error, check value whether none or not before making operation. otherwise you

html - How to remove border arround image -

so have problem. i'm using sprites first time , around them appear border, tried set border:none didn't work. demo <div class="service"> <img href="image/icons.png" style="background-image:url('image/icons.png'); background-position:0 0; height:59px; width:59px; border:none"/> </div> .service { position:relative; float:left; clear:left; border:none; } html: <div class="service"> <img href="image/icons.png" style="background-image:url('image/icons.png'); background-position:0 0; height:59px; width:59px; border:none"/> </div> css: .service { position:relative; float:left; clear:left; border:0; }

python - How to split with multiple bracket -

so want "(1.0)" returns ["1","0"] "((1.0).1)" returns ["(1.0)", "1") how do python? so want break string "(1.0)" list [1,0] dot separator. some examples ((1.0).(2.0)) -> [(1.0), (2.0)] (((1.0).(2.0)).1) -> [((1.0).(2.0)), 1] i hope more clear. here version: def countpar(s): s=s[1:-1] openpar=0 (i,c) in enumerate(s): if c=="(": openpar+=1 elif c==")": openpar-=1 if openpar==0: break return [s[0:i+1],s[i+2:]]

Java calling method from Superclass and changing the return statement -

i'm calling method superclass called getstringrepresentation returns " ". fine. problem want change return statement in subclass symbol such s or o example. currently code looks this: public emptyspace(position position) { super(position); super.getstringrepresentation() return "es"; //this doesn't work. } i understand string can override system.out, java tutorials don't explain or have example return statements. java tutorials don't explain or have example return statements. main class public class sector { private position position; /** * returns string containing " " (whitespace). * * @return returns string containg " " */ public string getstringrepresentation() { return " "; } override method in emptyspace class: public emptyspace(position position) { super(position); } @override public string getstringrepresentation() { return

objective c - iOS background audio not playing -

Image
i have app uses corebluetooth background modes. when event happens need play alarm sound. works fine in foreground , bluetooth functionality works fine in background. have working schedules uilocalnotification 's in background sound alarm, don't lack of volume control these want play alarm sound using avaudioplayer. i've added background mode audio .plist file can't sound play properly. i using singleton class alarm , initialise sound this: nsurl *url = [nsurl fileurlwithpath:[[nsbundle mainbundle] pathforresource:soundname oftype:@"caf"]]; player = [[avaudioplayer alloc] initwithcontentsofurl:url error:nil]; player.numberofloops = -1; [player setvolume:1.0]; i start sound this: -(void)startalert { playing = yes; [player play]; if (vibrate) [self vibratepattern]; } and use vibration: -(void)vibratepattern { if (vibrate && playing) {

How to update a MongoDB from Java with the current DB time? -

i want update mongo db java application current db time ( not jvm's time). if had shell, execute following command: db.colletion.update({_id : 'doc'}, {$set : { last_update : isodate()}}, true, false); i'm not sure how translate java: object lastupdate = ???; dbobject q = new basicdbobject("_id", "doc"); dbobject o = new basicdbobject("$set", new basicdbobject("last_update", lastupdate)); collection.update(q, o, true, false); i'm trying figure out should lastupdate object. a new date instance not option, because represent jvm's time , not db's time. thought using eval time db , cost query each update. other ideas? the way use eval . eval documentation : if want use server’s interpreter, must run eval . otherwise, mongo shell’s javascript interpreter evaluates functions entered directly shell. even command posted use client's time , not server time, because isodate construct

java - Variables in POM dependencies. How maven knows artifact id of SWT? -

the dependencies of piccolo2d-swt described here as group: ${swt.groupid} artifact: ${swt.artifactid} version: [3.3.0-v3346,) how can resolved? take values of variables? if run empty project dependency, displays error message, mentions org.eclipse.swt.win32 . where did took value? if printout value of these variables, nothing. the pom here <project xmlns="http://maven.apache.org/pom/4.0.0" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xsi:schemalocation="http://maven.apache.org/pom/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> <modelversion>4.0.0</modelversion> <groupid>test_displaymavenvariables</groupid> <artifactid>test_displaymavenvariables</artifactid> <version>0.0.1-snapshot</version> <properties> <testproperty>this test property</testproperty> </properties> <!-- <dependencies>

html5 - How to change Javascript audio object src? -

i'm creating custom html5 audio player. have following snippet in script. var curaudio = new audio('audio.mp3'); $("#play").on("click", function(e) { e.preventdefault(); curaudio.play(); }); $("#next").on("click", function(e) { e.preventdefault(); [update curaudio src here] curaudio.play(); }); this snippet highly simplified , isn't practical enough question is, how update src of audio object dynamically? if use var curaudio = $("#audio"); i can change src using curaudio.attr("src", "newaudio.mp3"); but how do former method? you can set different source element's src property : curaudio.src = 'http://.../newaudio.mp3'; this .prop() accomplishes jquery collections: $("#audio").prop('src', 'http://.../newaudio.mp3');

Multi-page forms in Node.js -

i'm working on project i'd split form on multiple pages. we're using express node.js. would possible store variable 1 page , continue pass along subsequent pages? the first page called "signup" directs "instructions." code snippit instructions follows: app.post('/instructions', function(req, res){ res.render('instructions.ejs', {book-code=req.body.book-code, pages=req.body.pages, author=req.body.author, title=req.body.title}); }); the hidden form on instructions.ejs page looks like: <form action = "record" method="post"> <input type="hidden" name="iauthor" value="author"> <input type="hidden" name="ipages" value="pages"> <input type="hidden" name="ibook-code" value="book-code"> <input type="hidden" name="ititle" values="title"> </for

linux - How to compile a modified kernel which is different from the one installed on our computer? -

i working on linux kernel 3.11.0-12. adding system call modifying source code downloaded kernel.org of linux-2.6.26. want compile modified 2.6.26 kernel test new system call. how should it? 1)if want build kernel same architecture on working then.. go linux source folder , fire below commands.... to clean: make distclean to write config: make defconfig to build kernel: make uimage or make vmlinux image want build 2)for arm architecture... to clean: make arch=arm cross_compile=arm-linux-gnueabihf- distclean to write config: make arch=arm cross_compile=arm-linux-gnueabihf- defconfig to build kernel: make arch=arm cross_compile=arm-linux-gnueabihf- uimage 3) using second step can build linux kernel platform toolchain use arch= cross_compile= macro per requirement......

c# - WPF formatting labels with StringFormat -

i have wpf application. have labels , datagrids bound public properties. of these properties numerical values. in datagrids have been using line below ensure values display 2 decimal places, works. when use same line below label appears have no effect on display number shows 9 decimal places. don't understand why works datagrid not label? stringformat={}{0:0.##} <label grid.row="3" grid.column="1" content="{binding obs.tstat, stringformat={}{0:0.#}}" horizontalalignment="center" foreground="{staticresource brushlinfont}" fontsize="13" fontweight="bold"/> updated code <label grid.row="3" grid.column="1" content="{binding obs.tstat}" contentstringformat="{}{0:0.#}}" horizontalalignment="center" foreground="{staticresource brushlinfont}" fontsize="13" fontweight="bold&q

c# - Create MVC 3 ASPXAUTH cookie from MVC 5.1 application - Single Sign on -

i have 2 seperate websites, main 1 running .net 4.5 mvc 5.1 other on subdomain running .net 4.0 mvc3. i want single sign-in when user logs main site need set cookie subdomain read if user logged in there too. problem calling formsauthentication.setauthcookie same paramters 2 application results in different cookie. need create mvc 3 aspxauth cookie from mvc 5.1 application simply using mvc 5.1 generated cookie doesn't log user mvc 3 application. i've set machine key same both application 1 generated mvc3 50 characters longer 1 set (total 150+ characters). actually here's 2 cookies: using system.web.security.cryptography; byte[] binarymvc3cookie = cryptoutil.hextobinary("0b406403c8fb8de06fbf43291c48bed31c41fc2dcdfb81541a65a2b842e63b609fa6d146f3cf68968240ed5d5ef75a2fec2c0d4b4ff99cd4daf974d264a08d794bbf75eb6c4f40f08f9a6a97b1a4e130b9fc9cc9e5c55e93d06d9a9d56427110637874da4059d18d0d4929de04360df72e13db09"); byte[] binarymvc5cookie = cryptoutil.hextobinary

angularjs - Breezejs - why don't changes to non-scalar or complex data properties trigger change events? -

i'm using non-scalar , complex data properties in breeze. work fine, except entitychanged , propertychanged events aren't triggered when items added or removed non-scalar property, or when properties changed on complex property. how can notified when non-scalar or complex properties change? manager.metadatastore.addentitytype({ shortname: 'thing', namespace: namespace, dataproperties: { id: { datatype: breeze.datatype.guid, ispartofkey: true }, strings: { datatype: breeze.datatype.string, isscalar: false }, object: { datatype: new breeze.complextype({ shortname: 'object', namespace: namespace, dataproperties: { a: { datatype: breeze.datatype.string }, b: { datatype: breeze.datatype.string } } }) } } }); change

StackView like gallery in android -

Image
i want create view stack-view shown in below image.can buddy know how implement type of custom gallery view ? thanks there library can give date https://github.com/blipinsk/flippablestackview nb: see post quite old if got desired, please share all.

machine learning - Stemming in Text Classification - Degrades Accuracy? -

i implementing text classification system using mahout. have read stop-words removal , stemming helps improve accuracy of text classification. in case removing stop-words giving better accuracy, stemming not helping much. found 3-5% decrease in accuracy after applying stemmer. tried porter stemmer , k-stem got same result in both cases. i using naive bayes algorithm classification. any appreciated in advance. first of all, need understand why stemming improve accuracy. imagine following sentence in training set: he played below-average football in 2013, viewed ascending player before , can play guard or center. and following in test set: we’re looking @ number of players, including mark first sentence contains number of words referring sports, including word "player". second sentence test set mentions player, but, oh, it's in plural - "players", not "player" - classifier distinct, unrelated variable. stemming tries c

jquery - WCF restful service: Error the server responded with a status of 405 (Method Not Allowed) -

i know it's looks duplicate question. here want call wcf rest service using jquery ajax , want pass country object have countryname parameter in rest service. whenever calling rest service using jquery ajax html page.but giving me error 405 method not allowed .i tried lots of time solve it.but enable solve error.and trying pass data in json object. iservice.cs: [operationcontract] [webinvoke(uritemplate = "/addcountry", responseformat = webmessageformat.json,requestformat=webmessageformat.json)] string addcountry(tablecountry country); service.cs public string addcountry(tablecountry country) { //do code. } web.config <system.servicemodel> <bindings> <webhttpbinding> <binding name="webhttpbinding" crossdomainscriptaccessenabled="true"> <security mode="none"/> </binding> </webhttpbinding>

Error in Nokia In- App purchase for Android -"Something went wrong with your Payment" -

Image
i trying implement "nokia in- app purchase" in android application. i referred sample project**"sample pepper firm"** provided nokia. when enter product-id , click on "buy" button gives error "something went wrong payment" i attached 1 screen shot of error also. please me out of this,i went through nokia's developer site confused. screen shot of error you not seem have network connectivity @ moment. wifi not connected (missing wifi icon) , not have sim card inserted (two red lines).

java - Binary data to text/string in XQuery -

when xml converted through mfl(message format language) xml binary, comes following in logs of oracle service bus. <soap-env:body xmlns:soap-env = "http://schemas.xmlsoap.org/soap/envelope/"> <ctx:binary-content ref="cid:69b63814:144d49f1544:-6cba" xmlns:ctx="http://www.bea.com/wli/sb/context"/> </soap-env:body> can body tell me how print log in text/string in xquery or osb. there function or method of xquery can use ? used java call out convert .

drupal 7 - Add CSS class on text align -

i'd add css class or set style image when click align right, left or center in "ckeditor" in drupal 7. what should do? can make plugin, don't know how catch text align operation add class/set style on image. there ckeditor configurations allow use class-based alignment images , text justification paragraphs instead of using inline css added style attribute. you'll need paste "custom javascript configuration" of "advanced options" section of ckeditor profile(s) you're working in drupal admin ui: // image alignment , text justification. config.justifyclasses = [ 'rteleft', 'rtecenter', 'rteright', 'rtejustify' ]; if you're ok giving old image properties dialog, enhanced image plugin ckeditor has ability use classes image alignment instead of inline css on <img> tag's style attribute, non-default configuration must added "advanced options" section hand, , you'll

encryption - AES - simple encrypt in Java, decrypt with openssl -

i trying simple aes encryption in java, using java cryto, can decrypted in objectivec, using openssl. as not doing objectivec side, want make sure works, using openssl command line, "bad magic number" here java code public class encryptionutils { private static final string aes_cipher_method = "aes"; private static final int aes_key_size = 128; public static byte[] generateaeskey() throws nosuchalgorithmexception { keygenerator keygenerator = keygenerator.getinstance(aes_cipher_method); keygenerator.init(aes_key_size); secretkey key = keygenerator.generatekey(); return key.getencoded(); } public static secretkeyspec createaeskeyspec(byte[] aeskey) { return new secretkeyspec(aeskey, aes_cipher_method); } public static void aesencryptfile(file in, file out, secretkeyspec aeskeyspec) throws invalidkeyexception, nosuchalgorithmexception, nosuchpaddingexception, ioexception { cipher aescipher = cipher.getinstance(aes_cipher_method);

assembly - ASM x86_64 Hello world program -

i new asm, , i'm trying create basic hello world program, using function : section .text global main print_msg: push rbp mov rbp, rsp mov rax, 1 mov rdi, 1 mov rsi, buffer ;to change mov rdx, buffersize ;to change syscall mov rsp, rbp pop rbp ret main: mov rdi, buffer mov rsi, buffersize call print_msg mov rax, 60 mov rdi, 0 syscall section .rodata buffer: db 'hello, world !', 0x0a buffersize: equ $-buffer this code work, because directly copied buffer in rsi , buffersize in rdx, in "print_msg" function, want copy received arguements in these 2 registers, saw : mov rsi, [rsp + 8] mov rdx, [rsp + 12] but doesn't work here. x86-64 uses registers pass arguments, code illustrates: mov rdi, buffer mov rsi, buffersize call print_msg if loaded rdi , rsi arguments, why expect them on stack in called function? call doesn't regist

html - CSS change style of different element upon active -

trying change content of image clicking image (image gallery viewer), using pure html/css. i using gumby.css framework , have following html: <section id="sect"> <div class="three columns"> <img src"/images/help.png"> </div> <div class="one column"> <img src"/images/help.png"> </div> </section> and following css: #sect .three.columns img:hover { content:url("/images/about.png"); border: 5px solid red; } #sect .one.column img:active ~ #sect .three.columns img { content:url("/images/about.png"); border: 5px solid red; } the first css rule #sect .three.columns img:hover works perfectly, indicating have selected right element. second 1 #sect .one.column img:active ~ #sect .three.columns img nothing upon active. refer here meaning of ~ . anyone have ideas? thanks. as noted in comments, isnt po

itunes JSON request in iOS returns an XML object -

i want access information itunes within ios app. i doing regular http request (sending parameters both post or directly in url) the url works, because if use browser, expected result (in json format). { "resultcount":0, "results": [] } but within ios, jsonobjectwithdata returns null object. after inspecting data object, found object returned xml object (that not contain required info, instead bunch of xml keys/values] nsdata *data = [nsdata datawithcontentsofurl:[nsurl urlwithstring:@"http://itunes.apple.com/search"]]; nserror *directerror; nsdictionary *jsondict = [nsjsonserialization jsonobjectwithdata:data options:kniloptions error:&directerror]; if (!directerror) { nslog(@"%@", jsondict); } else { nslog(@"json error: %@", directerror.localizeddescription); } i looked possible post parameter force response json, didn't find anything. attached sample of info contained in data object (

php - Adding a record from html form to oracle database -

i have html form want add record oracle database when hits submit. table hooking somewhat, problem when submits information come null values in database table. html: <form name="myform" action="/add_file.php" onsubmit="return validateform()" method="post"><!--form--> <fieldset> <label class ="label1" "name">first name: </label> <input type="text" name="fname"><br /> <label class ="label1" "name">surname: </label><input type="text" name="sname"><br/> <label for="email">e-mail address: </label><input type="text" name="email"><br /> <label "address">address: </label> <input type="text" name="address"><br /> <label class="label" "password">sel

objective c - Get info user Facebook SDK iOS -

i followed little 'guides online, can not figure out how username of user such facebook. login , session work properly. can not take values ​​of current user. working code if (!appdelegate.session.isopen) { // create fresh session object appdelegate.session = [[fbsession alloc] init]; // if don't have cached token, call open here cause ux login // occur; don't want happen unless user clicks login button, , // check here make sure have token before calling open if (appdelegate.session.state == fbsessionstatecreatedtokenloaded) { // though had cached token, need login make session usable [appdelegate.session openwithcompletionhandler:^(fbsession *session, fbsessionstate status, nserror *error) { nslog(@"session facebook ok"); // how username ? thanks in advance learn

version control - hg: Change root of named branch -

i created named branch in our repository feature - however, against better judgement, branched off of our head revision instead of earlier 1 (where branched off multiple feature branches). i've made commits branch - local only, not yet pushed - i'd move branch root earlier revision on default branch. don't want make changes commits (as there won't conflicts); want change parent revision branch came from, if that's possible. how can in mercurial? just want change parent revision branch came from just rebase: hg rebase -s moved_root -d new_parent_of_moved_root --keepbranches

Text + variable in qDebug -

i want combine text , variable in qdebug: qstring city_name = "london"; qdebug() << qstring("you choose city:").arg(city_name); it doesn't work , don't know why. error is: qstring::arg: argument missing: choose city:, ????? add %1: qstring city_name = "london"; qdebug() << qstring("you choose city: %1").arg(city_name);

java - regex to match and retrieve some tokens -

the strings interested in followings a1.foo , a2.bar , a3.whatever now need retrieve number. wrote piece of code (in java), thinking work, not. please let me know wrong pattern? final string testinput = "a2.foo"; pattern p = pattern.compile("a(\\d*)\\.([^\\w])"); matcher matcher = p.matcher(testinput); if (matcher.find()) { system.out.println("n = " + matcher.group(1)); } else { system.out.println("not matched"); } this prints not matched , while expected print 2 your regex wrong ([^\\w]) match 1 non-word character. wanted more 1 word character hence (\\w+) however can use lookahead: pattern.compile("a(\\d*)(?=\\.)");

c# - Fbx Animated Model deforming when added to XNA -

Image
hey problem have created perfect model want in 3dsmax rigged biped using skin modifier, i correctly positioned envelopes , animated biped using frames , exported .fbx , loaded xna using skinnedmodelpipeline . once loaded xna model deforms , seems on models right arm. as i'm new member can't post images @ moment in time sending link images online. 3dsmax model: model loaded in draw function models //an array of current positions of model meshes this.bones = animationplayer.getskintransforms(); (int = 0; < bones.length; i++) { bones[i] *= transform.world; } //remember can move code inside first foreach loop below //and use mesh.name change textures applied during effect customeffect.currenttechnique = customeffect.techniques[technique]; customeffect.parameters["diffusemaptexture"].setvalue(diffusemap); customeffect.parameters["bones"].setvalue(bones); customeffect.parameters["view"].setvalue(game

c++ - How to connect QQuickitem with Qml Object? -

i trying make simple program allow user connect specific websites via clicking image. here code: account.h: #ifndef accounts_h #define accounts_h #include <qobject> #include <qurl> #include <qdesktopservices> class accounts : public qobject { q_object public: explicit accounts(qobject* parent = 0) : qobject(parent){} public slots: void gmailopen(const qstring &msg) { qurl gmailurl(msg); qdesktopservices::openurl(gmailurl); } }; #endif // accounts_h main.cpp: #include <qtgui/qguiapplication> #include <qtquick/qquickview> #include <qtqml> #include "accounts.h" int main(int argc, char *argv[]) { qguiapplication app(argc, argv); qquickview *view = new qquickview; qobject *gmail = view->rootobject().findchild<qobject*>("gmaillink"); accounts *gmailaccount = new accounts; qobject::connect(gmail, signal(gmailsignal(qstring)),gmailaccount,slot(gmailopen(qstring))); view->