Posts

Showing posts from September, 2015

cordova - Pushwoosh and Android Phonegap App not communicating -

the problem okay have phonegap (2.3.0) android application pushwoosh manage push notifications. followed instructions, , got app few wording errors working. app seems run fine, doesn't seem pushwoosh pushing gcm (google cloud messanger), turn isn't pushing app. think wrong, first time using gcm , pushwoosh. on pushwoosh console page shows each "push" completed no errors, on gcm console doesn't show requests, nor notification pop on phone. i have gcm api key (server key) in xml , pushwoosh correct xxxxx-xxxxx key. here code better outline how code setup (and maybe can see i'm missing). the code here androidmanifest.xml <?xml version="1.0" encoding="utf-8"?> <supports-screens android:largescreens="true" android:normalscreens="true" android:smallscreens="true" android:resizeable="true" android:anydensity="true" /> <uses-sdk android:

set a mysql user variable per row? -

the following sql statement sets user variable @id i'm using in trailing subquery. problem @id variable gets set first items.id in result set - not "per row" - result subquery same every row in main select. know if there's way reset @id variable each row?? select items.id ,items.title ,@id := items.id ,( select group_concat(x.y) ( select group_concat(ledger.stockcode) y ledger @id = ledger.itemid group ledger.stockcode having sum(ledger.stockqty) > 0 ) x ) extras items items.id = 196 try query select a.id ,a.title ,b.y extras items inner join (select group_co

jquery - Full calendar not ordering the events in correct order -

i using full calendar plugin. want events ordering according start date/time ascending. can see below event # 2 , event # 3 & event # 4 in correct order event # 1 not in correct order. should in last. wrong order: [ {"id":"1","title":"aaa","start":"2013-04-01 00:00:00","end":"2013-04-01 23:59:59", "allday":false}, {"id":"2","title":"bbb","start":"2013-04-01 07:30:00","end":"2013-04-01 09:30:00", "allday":false}, {"id":"3","title":"ccc","start":"2013-04-01 08:00:00","end":"2013-04-01 10:30:00", "allday":false}, {"id":"4","title":"ddd","start":"2013-04-01 13:00:00","end":"2013-04-01 10:30:00", "allday":

What are pure virtual methods in UML? -

i attempting understand how should use realization of interfaces , implementation of abstract classes in uml. came across post @ https://stackoverflow.com/a/13438187/700543 whereby poster states pure virtual methods interfaces whilst part pure virtual methods abstract classes. able give me real world scenario , not 1 based on code? an interface "class skeleton" library users extend, , said, methods cannot implemented. abstract class can have implemented methods. give real life example: imagine provide interface people implement sorting functions , provide class bench marking sorting functions. bench marking class needs know methods of interface needs call in order perform bench marking, not know how implemented. therefore, inside bench marking class might see sortinterfaceinstace.getnumberofswap() , whereas sortinterfaceinstance known of sortinterface type @ compile time, , not of specific user sort implementation. if need implemented methods, use abstract

ms access - Value Violates the Validation Rule -

everything works fine on form,i following message when enter incorrect data in particular field: " the value violates validation rule field or record" i don't want user see message. unfortunately, not error message..im not sure why got error since have validation rule , text works fine the problem need make combo-box , text-box validation rule , validation text..the problem make 1 text box that's why value violates validation rule field or record error keeps pops up if done text box , combo-box validation text message box display without error..

java - How can I read html that loads after the rest of the other html? -

ok, sorry question crap. it's hard put question :p if put word thought dictionary.com or irregular verb pronunciation [thawt] loads after rest of html. if check code you'll see mean. instead of [thawt] loads [thingk].. package oepr; import java.awt.eventqueue; import java.awt.gridlayout; import java.awt.toolkit; import javax.swing.jframe; import javax.swing.jbutton; import java.awt.gridbaglayout; import java.awt.gridbagconstraints; import java.awt.datatransfer.clipboard; import java.awt.datatransfer.clipboardowner; import java.awt.datatransfer.stringselection; import java.awt.datatransfer.transferable; import java.awt.event.actionevent; import java.awt.event.actionlistener; import java.io.bufferedreader; import java.io.inputstreamreader; import java.net.url; import java.net.urlconnection; import java.util.regex.matcher; import java.util.regex.pattern; import javax.swing.grouplayout; import javax.swing.grouplayout.alignment; import javax.swing.layoutstyle.componentp

php - Unknown column 'Process_Status' in 'where clause' -

$result = mysql_query('select * accounting acctstatustype = "start" , process_status null limit 10'); if($result === false) { die(mysql_error()); } the following code spits back unknown column 'process_status' in 'where clause' however, when copy , paste query select * accounting acctstatustype = "start" , process_status null limit 10 directly mysql, successful. i bit new php/mysql queries have worded differently when parsing them php? thanks, matt

excel vba - VBA code to reference my inbox in my archive - CLOSED -

i have code can used folder in primary inbox or inbox subfolder. does know how reference archive folders or sent items? archive folder saved "my personal folders" thank much sub listallitems() dim olf outlook.mapifolder, curruser string dim emailitemcount integer, integer, emailcount integer application.screenupdating = false cells(1, 1).formula = "subject" cells(1, 2).formula = "recieved" cells(1, 3).formula = "attachments" cells(1, 4).formula = "recipients" cells(1, 5).formula = "sendername" range("a1:f1").font .bold = true .size = 14 end application.calculation = xlcalculationmanual set olf = getobject("", _ "outlook.application").getnamespace("mapi").getdefaultfolder(olfolderinbox).folders("toastmasters") emailitemcount = olf.items.count = 0: emailcount = 0 ' read e-mail inform

Curious about the new way YouTube is loading pages -

Image
i've noticed when i'm watching video , click on logo or related video red progress bar (above logo) dashes across screen. @ same time there slight overlay "grey" out content fades in new page. fyi, url changes new url before progress bar , transition happens. the div id of bar progress. looks kind of cool jquery ajax load changing pages. don't know. youtube using html5 history api add , remove page urls history stack. results in url changing in address bar, , back/forward buttons working, while still loading page via js (ajax). the easiest way implement api backwards compatibility @ point using history.js . backwards compatibility mean falling hash tag method older browsers not support html5 history api yet. check out history.js demo! i think twitter best known example of website using hashed urls. example twitter.com/#!/username has been common sight years. problem method hash tags client side, need js read them , serve proper content. no

Eclipse Java Android compile error -

why error happening? http://img35.imageshack.us/img35/4883/whyerror.png i thought r automatically generated class not supposed touch? thanks //anything above had no errors public boolean oncreateoptionsmenu(menu menu) { getmenuinflater().inflate(r.menu.lovemenu, menu); //error here return true; } @override public boolean onoptionsitemselected(menuitem item) { switch(item.getitemid()) { default: break; } return true; } } make sure not including following import import android.r; and including reference own import com.example.r;

c - What's wrong in this allocation? -

this struct declared :- struct page_table_entry { struct addrspace* as; vaddr_t va; //page_state_t state; int timestamp; }; now want dynamically allocate memory array of this. implementation here :- struct page_table_entry **coremap = (struct page_table_entry**) kmalloc(npages*sizeof(struct page_table_entry*)); int i; for(i=0;i<npages;i++) { coremap[i] = (struct page_table_entry*)kmalloc(sizeof(struct page_table_entry)); coremap[i].va=(firstaddress+(i*page_size)); } its giving me error on last line accesing variable va. error is:- error: request member `va' in not structure or union you have array of pointers structs, not array of structs. in line coremap[i] = (struct page_table_entry*)kmalloc(sizeof(struct page_table_entry)); cast memory allocation page_table_entry* , coremap[i] pointer. you access actual struct via coremap[i]->va=(firstaddress+(i*page_size));

java - Regarding adding days to the current date -

i newbie world of java. learning , exploring java calendar class abstract class consisting of factory method instance (). trying increment or decrement date, e.g. adding 1 day current date tomorrow's date, subtracting 1 day yesterday's date, etc. since date in java maintained long millisecond value, programmers tend add 24 hours 1 day. wrong if day falls on daylight saving timezone, day either 23 or 25 hours long. when add or subtract days date, other components of date e.g. month , year must roll. my query shown below. in class trying add , subtract days. please advise, correct approach or there other better approach advise. //using calendar increment , decrement days date in java date today = new date(); system.out.println("today " + toddmmyy(today)); calendar cal = calendar.getinstance(); //adding 1 day current date cal.add(calendar.day_of_month, 1); date tommrrow = cal.gettime(); system.out.println("tomorrow " + toddm

configuration of paths within gradle project -

i have gradle project formatted this container/ dist/ mod1/ build.gradle mod2/ build.gradle mod3/ build.gradle build.gradle basically grade project lot of submodules. trying when run assembly on container/build.gradle runs builds on sub projects. part easy enough. im trying accomplish centralizing configuration settings , parameters across everything. here snip container/build.gradle file subprojects { apply plugin: 'java' apply plugin: 'scala' jar { manifest.attributes provider: 'onuspride' } property { sourcecompatibility = 1.7 archivepath = file("dist") } ext { springversion = "3.2.1.release" springsecuritywebversion = "3.1.3.release" springsecurityoauth2version = "1.0.1.release" jacksoncoreversion = "2.1.2" } dependencies { testcompile 'junit:junit:4.8.2' } } i

jsp - Dynamic Proxy in Java EL -

edit: narrowed down problem , posted related question here . please check out! i trying use dynamic proxies make html form processing easier. using pretty plain mvc setup (no fancy frameworks) using jsps on google app engine. keep getting following exception: javax.el.propertynotfoundexception: not find property testvalue in class com.sun.proxy.$proxy7 @ javax.el.beanelresolver.tobeanproperty(beanelresolver.java:430) @ javax.el.beanelresolver.getvalue(beanelresolver.java:290) @ javax.el.compositeelresolver.getvalue(compositeelresolver.java:231) @ org.apache.el.parser.astvalue.getvalue(astvalue.java:123) @ org.apache.el.valueexpressionimpl.getvalue(valueexpressionimpl.java:186) ... okay, here code. first, interface proxying: public interface myform { public string gettestvalue(); } next, code creates proxy: // imports omitted public final class forms { private forms() { } public static <t> t fromrequest( final cl

html - How to login to reddit.com using the api? -

i'm not sure how format request url login reddit using api. i've tried page not found error https://ssl.reddit.com/api/login/?user=myusername&passwd=mypassword&api_type=json refer this question . user strelok has great answer public void sometest() throws ioexception { url u = new url( "https://ssl.reddit.com/api/login/myusername" ); login( u, "myusername", "mypassword" ); } public static void login( url url, string user, string pw ) throws ioexception { string data = "api_type=json&user=" + user + "&passwd=" + pw; httpurlconnection ycconnection = null; ycconnection = ( httpurlconnection ) url.openconnection(); ycconnection.setrequestmethod( "post" ); ycconnection.setdooutput( true ); ycconnection.setusecaches( false ); ycconnection.setrequestproperty( "content-type", "a

2d character array to string (java) -

i need converting 2d character array string. figured out how convert 1d character array string, i'm unsure how go changing display 2d char array. public class chararraytostring { public static void main(string[] args) { char[] chararrays = new char[] {'0', '4', '2', 'b', 'p', 'r'}; string newstring1 = new string(chararrays); system.out.println("newstring1 : " + newstring1); string newstring2; newstring2 = string.valueof(chararrays); system.out.println("newstring2 : " + newstring2); } }

android - My App not supporting nexus 7 -

my manifest file (permissions & support-screens) follow : <uses-sdk android:maxsdkversion="17" android:minsdkversion="10" android:targetsdkversion="17" /> <permission android:name="com.ecw.healow.permission.c2d_message" android:protectionlevel="signature" /> <uses-permission android:name="my_app_package.permission.c2d_message" /> <!-- app receives gcm messages. --> <uses-permission android:name="com.google.android.c2dm.permission.receive" /> <!-- gcm requires google account. --> <uses-permission android:name="android.permission.get_accounts" /> <!-- keeps processor sleeping when message received. --> <uses-permission android:name="android.permission.wake_lock" /> <uses-permission android:name="android.permission.internet" /> <uses-perm

c# - Replace part of a string with new value -

i've got scenario, wherein need replace string literal new text. for example, if string "01hw128120", first check if text contains "01hw" if yes, replace string "machineid-". so wanted "01hw128120" "machineid-128120". string "1001hw128120" - in case require replace "1001hw" "machineid-" tried below code snippet, not work expectation. string sampletext = "01hw128120"; if(sampletext.contains("01hw")) sampletext = sampletext.replace("01hw","machineid-"); any suggestion of great me. few possible search values if there few possible combinations, can multiple tests: string value = "01hw128120"; string replacement = "machineid-"; if( value.contains( "01hw" ) ) { value = value.replace( "01hw", replacement ); } else if( value.contains( "1001hw" ) ) { value = value.replace( "1001hw&qu

java - How do I save states to a file and keep the file safe? -

i'm trying create save states game, not game left simple score boards. format this: wins: 5 losses: 10 gamesplayed: 15 i need able access file, , depending on whether player won/lost append +1 value in file. what best way go this? i've heard of bunch of different ways save data, example xml, aren't overkill size of data? also, want keep file safe users being able go files , change data. have sort of encryption? and, if user removes file , replaces empty 1 can't technically reset values? you can use plain serialization/deserialization this. in order serialize/deserialize class, must implement serializable interface. here's example start with: public class score implements serializable { private int wins; private int loses; private int gamesplayed; //constructor, getter , setters... } public class scoredatahandler { private static final string filename = "score.dat"; public void savescore(score score) {

php - $_SERVER['PHP_SELF'] shows different after writing .htaccess -

this our site actual url http://www.globalmedicalaware.com/gma-new/home.php?city=chennai i rewrite url using .htaccess following code options +followsymlinks rewriteengine on rewriterule /city/(.*) home.php?city=$1 now url rewrite to http://www.globalmedicalaware.com/gma-new/home/city/chennai i written code in column-right.php , in other area footer,..etc,.. this if($_server['php_self']=='/gma-new/home.php') { ------------ designs , action display column right home.php ----------- } in localhost $_server['php_self'] shows /gma-new/home.php correctly.. but in live site $_server['php_self'] shows city/chennai ..so column right coding home.php not working.. please me this.. you may try instead in .htaccess file @ root directory: options +followsymlinks -multiviews rewriteengine on rewritebase / rewritecond %{request_uri} !home\.php [nc] rewriterule ^gma-new/home/city/([^/]+)/? /gma-new/home.php?city=$1 [l,nc]

java - Im getting the same one error over and over -

this error. know problem why im getting error ? im using jgrasp peertutorreport.java:13: error: <identifier> expected public static string[] gettutornames(listnames) { ^ 1 error ----jgrasp wedge2: exit code process 1. import javax.swing.joptionpane; import java.util.arrays; public class report { public static void main(string[] args) { string[] listnames = gettutornames(); } public static string[] gettutornames(listnames) { string firstname; string lastname; string[] listnames = new string[10]; (int x = 0; x < listnames.length; x++) { firstname = joptionpane.showinputdialog(null, "enter tutor's first name: "); lastname = joptionpane.showinputdialog(null, "enter tutor's last name: "); if (firstname.equals("") && lastname.equals("")) { break; // loop end } listnames[x] = lastna

c# - ExecutionEngineException in Windows Phone device during navigate to a page -

i have error of class executionengineexception . when navigate page: private void friendsmaintxt_tap(object sender, system.windows.input.gestureeventargs e) { navigationservice.navigate(new uri("/view/map/usermap.xaml?type=users", urikind.relative)); } protected override void onnavigatedto(navigationeventargs e) { base.onnavigatedto(e); if (navigationcontext.querystring["type"] != null) //executionengineexception here { typemap = navigationcontext.querystring["type"]; } } i have error wp8 device, in emulator never have. after error call private void rootframe_navigationfailed(object sender, navigationfailedeventargs e) { if (debugger.isattached) { debugger.break(); } } this exception can occur during garbage collection, how can influence process in wp? any ideas. thanks in advan

c# - WPF treeview item background over entire row -

Image
i writing 1 app , need set background under entire row items. found inspiration in here cannot idea how border background value in template (the problem bit more complicated:) my problem in treeview 2 types of "data" (files , folders). user can modify background under files , folders. right have background on textblock, seems horrible , want have background on entire row (i think looks better). now seems so: but need is: if change value of border background, change items (logically). guess need work textblock background, cannot reach spreading on entire row (stretch not solution, because spread end of line not white space before). thanks advice. edit : xaml in here: <resourcedictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="clr-namespace:treeview"> <!-- treeview --> <style x:key="expandcollap

vb.net - Print automatically after PDF is generated in c#? -

this question has answer here: how print document using printdialog in c# 1 answer generate pdf automatically prints 4 answers i'm developing billing application, in project need generate pdf, use 'itextsharp.dll' generate pdf. works fine. after pdf generation, need print pdf file automatically without action. pdf generation code follow: pdfwriter writer = pdfwriter.getinstance(document, new filestream("d:\\bill1.pdf", filemode.create)); document.open(); document.add(table1); document.close();

html - li breadcrumb image positioning error -

Image
i've got following menu. <ul> <li><img src="images/item_grp_nav_img.jpg" alt="nav-image">home</li> <li>menu type</li> <li>menu type</li> <li>menu type</li> </ul> the css goes following. #item-group-navigation{ height: 30px; background-color:#949698; min-width:760px; } #item-group-navigation ul{ height: 100%; width: 30%; padding: 0px 0px 0px 15px; margin: 0px; } #item-group-navigation li{ float: left; list-style: none; display: block; padding: 3px 6px 0px 5px; color: white; font-size: 18px; font-family:myriadproreg; } #item-group-navigation li:first-child:before{ content:none; } #item-group-navigation li:before{ display: block; width: 20px; height: 30px; content: url('../images/list_arrow.jpg'); float: left; } #item-group-navigation img{ float: left; } the issue displayed on following image. how can fix issue using css. please me. thank you. i've found issu

ios - Iphone application crash when i post JSON data through PHP webservice having null values -

i developing webservice through php iphone application convert send json object iphone app whenever webservice called. problem while converting deep multidimensional array may contain null values.i want covert all null values empty string application don't crash.is there way check deep inside multidimensional array sometime deep removing null values.and 1 more thing need solution in such way don't slow down whole process because mobile application , if there solution can tell mobile developer can handle side example of array provided array ( [result] => 1 [data] => array ( [basic_detail] => array ( [name] => coca-cola company [industry_detail] => array ( [0] => array ( [industry_name] => beverages )

html5 - Getting text to line up in center of div squares -

i'm working on adding text disappearing/appearing square system written html , css. there simple way go adding paragraph tag center of each square? here's code: jsfiddle.net/busterroni/wbcwc/8/ you better off not using <p> tag include default margins. can use plain <span> class easier. use line-height:100px (same height ) , text- align:center; center text horizontally , vertically. jsfiddle html <span class="wrapper"> <div class="rowone" class="a"><span class="hoverable">test</span></div> ... css div { text-align:center; line-height:100px; } .hoverable{ color:transparent; } .hoverable:hover{ color:red; text-align:center; }

c# - Shim Custom Dictionary -

i have created class extension of dictionary class, looks follows: public class pkmrelations : dictionary<guid, pkmrelation>, idisposable i want shim count method of pkmrelations, returns value want. add few elements, not possible because of current configuration. currently unable figure out how shim count method of dictionary. able have create shim of specific generic dictionary class. is @ possible, , if how can this? count not virtual method in dictionary, cannot override it! can use new keyword. so, can add following propety new int count { { //your intercept code here return base.count; } }

vb.net - VBNet 2008 Mobile: New text line in button -

Image
i've looked everywhere, hope can give me final outcome .... made vbnet 2008 mobile application, , placed large button, should contain text wraps. tried everything, including stringbuilder object "append", or special characters such chr(10) & chr(13), vbcrlf, constants.vbcrlf, \n, vbnewline , more, , results nothing spaces or squares when application running! any solutions? the standard button automatically wraps - don't need it.

AES same encryption/decryption in iOS and Android -

i want encrypt same text: "lorem ipsum dolor sit amet" ios , android. key used is:"a01bd1be-9d28-11e2-a12e-48086188709b" ios implementation: - (nsdata *)aes256encryptwithkey:(nsstring *)key{ char keyptr[kcckeysizeaes256 + 1]; // room terminator (unused) bzero( keyptr, sizeof( keyptr ) ); // fill zeroes (for padding) // fetch key data [key getcstring:keyptr maxlength:sizeof( keyptr ) encoding:nsutf8stringencoding]; nsuinteger datalength = [self length]; //see doc: block ciphers, output size less or //equal input size plus size of 1 block. //that's why need add size of 1 block here size_t buffersize = datalength + kccblocksizeaes128; void *buffer = malloc( buffersize ); size_t numbytesencrypted = 0; cccryptorstatus cryptstatus = cccrypt( kccencrypt, kccalgorithmaes128, kccoptionpkcs7padding, keyptr, kcckeysizeaes256, null /* initialization vector (optional) */,

c++ - How to launch an "event" when my Boost::asio tcp server just start running ( AKA io_service.run() )? -

based on boost::asio client/server relationship, have launch client program server program when server thread in " waiting connected " state. question how have knowledge of state ? as sample use asio example/serialization link , , replace main function of server.cpp code: #include <conio.h> #include <concrt.h> // wait function #include <future> #include <thread> void server_thread( std::promise<bool>& run ) { boost::asio::io_service io_service; s11n_example::server server(io_service, 123); // run.set_value( true ); io_service.run(); // late run.set_value( true ); } int main(int argc, char* argv[]) { std::promise<bool> run; std::thread thrd( server_thread, boost::ref( run ) ); thrd.detach(); bool launched = run.get_future().get(); // server waiting connection // launch client if( launched ) { int rc = system( "start client.exe localhost 123" );

Javascript/JQuery to make Multidimentional Arrary of all DOM Elements i defined? -

lets have following dom s on form: <body> <input id="input_1" class="post" type="text" value="abc" /> <input id="input_2" class="xxxx" type="text" value="xyz" /> <!--to ignore--> <input id="input_3" class="post" type="checkbox" checked="checked" /> <input id="input_4" class="post" type="radio" checked="checked" /> <select id="input_5" class="post"> <option value="1">one</option> <option value="2" selected="selected">two</option> </select> <input id="input_6" class="xxxx" type="checkbox" /> <!--to ignore--> </body> how can value array of class="post" elements? multidimentional array in way like: p

facebook - Request app links in android - no request ids -

i've set basic application, using "send requests" , "handle request app links" docs reference. now when check "facebook login" in app settings, request app links don't work @ - facebook app gets infinite "wait while i'm loading something" state. when check both "facebook login" , "deep linking", request app links work - however, no request ids being sent app. in fact, getintent().getdata() returns only: http://www.facebook.com/apps/application.php?id=[app id] here's code sending request: bundle params = new bundle(); params.putstring("message", invite_message); webdialog requestsdialog = ( new webdialog.requestsdialogbuilder(this, session.getactivesession(), params)).setoncompletelistener(new oncompletelistener() { @override public void oncomplete(bundle values, facebookexception error) { on_invite_request_complete(values, error);

logging - How can I get trace of my linq query (using linqtotwitter on windows 8 app in c# and xaml) -

i'm developping windows 8 metro app using linqtotwitter. i need trace of linq queries in log file searched , didn't find hox can this. read speak linq sql, database, don't have database. information querying twitter api via linqtotwitter. how can trace of query? my code: user usersresponse = new user(); usersresponse = (from user in twitterctxprop.user user.type == usertype.lookup && user.screenname == name select user).singleordefault(); it's open source, check source see if developer used systems.diagnostics trace, nlogger or other logging framework. if web.config edits can view trace. if used outputdebugstring, can use debugview http://technet.microsoft.com/en-us/sysinternals/bb896647.aspx see trace. if didn't instrument library trace, (not developers buy idea of trace), you'd want pick favorite library , add trace commands. and finally, if

asp.net - Session_End doesn't call after i close browser -

i use below setting in web.config <sessionstate mode="inproc" cookieless="false" timeout="10"/> ... <authentication mode="forms"> <forms loginurl="login.aspx" timeout="10"/> and in session_end according session's value change column's value in database (if column's value 1 means user online) after day user close browser column's value steel 1 (means session_end doesn't call after user close browser) no session_end not call on page close. need use script <script> window.onbeforeunload = function (evt) { var message = ‘are sure want leave?’; if (typeof evt == ‘undefined’) { evt = window.event; } if (evt) { evt.returnvalue = message; } return message; } </script> using script can identify when user closes browser

jquery - MVC Authentication and Antiforgery token with Durandal SPA template -

some areas of spa need open users, , areas require authentication. in these areas, it's data loaded via ajax want protect. i have authentication service (see below), add dependency in durandal main.js . service called: authentication in main.js call authentication.handleunauthorizedajaxrequest(function () { app.showmessage('you not authorized, please login') .then(function () { router.navigateto('#/user/login'); }); }); it warns user not authorized, , navigates user login view/viewmodel can enter details , try logging in. some questions come mind when building authentication viewmodel: are there obvious concerns i'm doing? is how i'm 'meant' things in durandal? am re-inventing wheel? couldn't see within durandal. most people seem creating seperate cshtml pages; 1 login (if user not authenticated), , usual index.cshtml there reasons me switch method? my login action on server-si

Reloading Zookeeper solr conf (schema.xml) -

i have setup solrcloud replication using standalone zookeeper. wish make changes schema.xml , reload core. problem when run single server solr (no solrcloud) new schema loaded, not know how reload schema on replication server. tried reloading schema on 1 of server no desired impact. there way in can reload schema.xml in solr in distributed replication setup uses zookeeper. just found solution need push changed configuration zookeeper ensemble. just use sh zkcli.sh -cmd upconfig -zkhost 127.0.0.1:2181 -collection collection1 -confname myconf -solrhome ../solr -confdir ../solr/collection1/conf zkcli.sh present under example/cloud-scripts after need reload cores in every server: http://server1:8080/solr/admin/cores?action=reload&core=collection1_shard1_replica1

jquery - Getting and manipulating product ID -

i want clarify proper way getting , manipulating product id. here attempt: html: <div data-product-id="100"></div> script: var pid = $(this).attr('data-product-id'); $('#product_' + pid).css('display', 'none'); is there better way $('#product_' + pid) ? why not like: $('#product_id').hide(); but if insists: $('#product_' + $(this).data('product-id')).hide();