Posts

Showing posts from July, 2013

java - Four Way Intersection Simulation -

Image
i'm trying write program displays light sequences @ 4 way intersection. the direcitons are: at given time traffic can move in 1 direction. traffic lights have 3 colors red, yellow , green. based on event. lights change color in synchronized way allow safe driving. define class called “trafficlight” has 2 methods. 1 called “change” , called “getcolor”. in separate class “assignment5”, main entry point, want create 4 trafficlight instances 2 north/south traffic , 2 east/west traffic. using 2 methods objects provide want show have correctly simulated 4 way traffic light. so far have: public class trafficlight { /** * @param args */ public trafficlight(int c){ this.c = c; }//end constructor public int getc(){ return c; } java.lang.string getcolor; string n = "gyr"; string s = "gyr"; string e = "gyr"; string w = "gyr"; public void change(){ int c = 1; while (c <= 4){

java - Android image view top crop -

Image
i'm developing android application , need header use @ top of screen similar action bar ..... want transparent when start scroll view content of view goes behind decided use image view (it has different in fragment that's why didn't use action bar) used frame layout , fixed image view @ top height of 50 , used same background of main view source of image view .... problem scale type used center crop in main view , it's perfect it's useless in header i'm looking thing : which center crop crops top of image . used this link wasn't i'm looking ..... your approach kind of hacky, suggest take @ using sticky fragment (for example). the video, source , sample can found in this google+ post

java - NullPointerException on getAction( ) or Intent -

i wanted utilize search view widget in action bar google places api , stumbled upon link tutorial shared in various posts on stack overflow, decided check out. have implemented existing code, getting nullpointerexception , hoping can me out bit, can debug issue. i've been browsing through various posts on stack overflow , articles via google... logcat specifies caused lines 119 , 123. mainactivity.java: public class mainactivity extends fragmentactivity implements googleplayservicesclient.connectioncallbacks, googleplayservicesclient.onconnectionfailedlistener, locationlistener, onmaplongclicklistener, loadercallbacks<cursor> { //global constants private final static int connection_failure_resolution_request = 9000; // milliseconds per second private static final int milliseconds_per_second = 1000; // update frequency in seconds public static final int update_interval_in_seconds = 5; // update frequency in milliseconds private static final long update_interval =

vb.net - debugging .NET application loading slowness -

i have application written using windows forms , complied against visual studio 2010. upgraded solution visual studio 2013 , changed using hard references using nuget manage dependencies. the application runs on terminal server. when running application on terminal server using version compiled using 2010, opens instantly. when running version compiled using 2013, takes many minutes open. how can find out why application takes long open initial form? thoughts or ideas why changing these 2 things have made application slow? thank you. after lot of debugging, found out mysql.data.dll component executing queries twice slow previous versions. downgraded version 6.3.8 in nuget , has increased speed dramatically. i hope helps similar slowness - , using mysql component set.

android - unfortunately <app name > has stopped onclick to -

i doing simple application: when click on button take me next activity . problem when run emulator , click on button pops message unfrotunately < app name> has stopped here code: main activity: package learn2develop.uingintent; import android.app.activity; import android.content.intent; import android.os.bundle; import android.view.menu; import android.view.view; public class mainactivity extends activity { @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); } public void onclick(view view){ startactivity(new intent("learn2develop.uingintent.secondd")); } @override public boolean oncreateoptionsmenu(menu menu) { // inflate menu; adds items action bar if present. getmenuinflater().inflate(r.menu.main, menu); return true; } } second activity called : secondd package learn2develop.uingintent; import android.os.bundle; import android.app.a

erlang - gen_server:call causes server to crash with a noproc -

i have simple server (below). can create server cell_tracer:start_link() , works; know because when repeat same call, already_started error. problem after server created, using cell_tracker:get_cells() (or doing gen_server:call(...) ) on causes server exit exception this: ** exception exit: {noproc,{gen_server,call,[cell_tracker,get_cells]}} in function gen_server:call/2 (gen_server.erl, line 180) i can call handle_call(get_cells...) directly, , expected result. i'm not sure what's happening here. doesn't give me information work with, , don't see problem. how can dig further? -module(cell_tracker). -behavior(gen_server). -export([start_link/0, stop/0]). -export([add_cell/1, del_cell/1, get_cells/0]). -export([init/1, handle_cast/2, handle_call/3, terminate/2, handle_info/2, code_change/3]). %% operational api start_link() -> gen_server:start_link({global, ?module}, ?module, [], []). stop() ->

install - Installing dropbox (and use Kirby CMS) on openshift -

i'm trying find way integrate kirby cms dropbox running on openshift using these tutorials: http://getkirby.com/blog/kirby-meets-dropbox http://getkirby.com/forum/how-to/topic:561 i stuck installing dropbox, since assume don't have permission while sshing: http://www.dropbox.com/install?os=lnx so question: there way of achieving greatness? if no, not if reaaaally creative? if no, why not? if yes, how? thanks bunch! i have no experience kirby, here's how dropbox working on openshift. the following combination of doing dropbox install on server , doing in non-standard location. gets done in $openshift_data_dir because that's have write privileges. first, make sure you're in $openshift_data_dir cd $openshift_data_dir next, download appropriate version of dropbox: wget -o - "https://www.dropbox.com/download?plat=lnx.x86" | tar xzf - this should give .dropbox-dist folder in $openshift_data_dir. next, tell dropbox start installa

html - Why does a specific method have to be located at a specific location inside of JavaScript and cannot be moved around? -

my question why drawscreen have located , cannot moved outside of method. method inside method. think still weak on javascript because there seems times when method, one, should able moved outside of long can called point inside of script. question: why drawscreen() method have located in code? code here: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>chapter 1 example 6 canvas sub dom example </title> <script src="modernizr.js"></script> <script type="text/javascript"> window.addeventlistener("load", eventwindowloaded, false); var debugger = function () { }; debugger.log = function (message) { try { console.log(message); } catch (exception) { return; } } function eventwindowloaded () { canvasapp(); } function canvassupport () { return modernizr.canvas; } function canvasapp () { if (!canvassupport

haskell - Altered compose function -

i wondering while f. provide example how should running function? (note: understand (.) function composition , know function composition if) -- compose function n >= 0 times composen :: int -> (a -> a) -> (a -> a) composen 0 f = id composen n f = f . (composen (n-1) f) f arbitrary function, provided user. supply composen succ , increment integer, , have composed 3 times , applied 2, thereby adding 3: ghci> composen 3 succ 2 5

c# - Loading Runtime DLL -

i'm trying load dll runtime , invoke method in 1 of classes present in dll. here i've loaded dll , invoking method, object[] mthdinps = new object[2]; mthdinps[0] = mscope; string paramsrvrname = srvrname; mthdinps[1] = paramsrvrname; assembly runtimedll = assembly.loadfrom("classlibrary.dll"); type runtimedlltype = runtimedll.gettype("classlibrary.class1"); object compobject = activator.createinstance(runtimedlltype, mthdinps); type compclass = compobject.gettype(); methodinfo mthdinfo = compclass.getmethod("method1"); string mthdresult = (string)mthdinfo.invoke(compobject, null); here class(present in dll) , method i'm trying invoke, namespace classlibrary { public class class1 { public class1() {} public string method1(object[] inpobjs) { } } } the error i'm getting this, constructor on type 'classlibrary.class1' not found. please help. seems you'

php - Send post through two files -

i'm making login system in php. have 3 files, login.php , check.php , login_success.php . in login.php have login form enter username , password hit button send data check.php $_post see if login matches database. if does, continue on login_success.php user logged in , see content of webpage. now problem/question: want able use variables posted check.php login.php in login_success.php . is there way can keep posting data through 1 file third? i have tried using include = 'check.php'; didn't work nothing had been sent file variables empty. hopefully knows way, thanks! if want post data login page login_success.php page must store post data $_session variable on login success page.

How to configure phplist to use Gmail smtp server? -

anyone know how configure phplist use gmail smtp server? can advise? alot advice in advance based on page https://github.com/phpmailer/phpmailer/blob/master/examples/gmail.phps i added following config.php. define("phpmailerhost",'smtp.gmail.com'); $phpmailer_smtpuser = 'usernae@gmail.com'; $phpmailer_smtppassword = 'password'; define('phpmailerport','587'); define("phpmailer_secure",'tls'); no other changes needed. did warning google attempt made access account , blocked. had follow steps allow connection. https://support.google.com/accounts/answer/6010255

python - Basic Tests in Django -

i making test in django project, when execute test in console following output (course)bgarcial@el-pug:~/python_devel/course/proyecto_clase2$ python manage.py test app creating test database alias 'default'... e ====================================================================== error: proyecto_clase2.app.tests (unittest.loader.moduleimportfailure) ---------------------------------------------------------------------- importerror: failed import test module: proyecto_clase2.app.tests traceback (most recent call last): file "/usr/lib/python2.7/unittest/loader.py", line 252, in _find_tests module = self._get_module_from_name(name) file "/usr/lib/python2.7/unittest/loader.py", line 230, in _get_module_from_name __import__(name) importerror: no module named app.tests ---------------------------------------------------------------------- ran 1 test in 0.000s failed (errors=1) destroying test database alias 'default'... (cour

playframework - how to get the startup time of the play framework? -

i need retrieve startup time of play framework. added code startup time inside onstart method in global. however, collects startup time when receives first request. what need 1.get time when play framework(web server) starts. 2.is there api me start time of physical server? your app starts after first request, because starting in dev mode instead production, don't you? in case play waits first request, always. if you'll start app play start invoke beforestart , onstart methods possible without waiting request. if want measure time required downloading dependencies , compilation i'd use ie. shell script first create file start.txt , run app play start . next in onstart can compare time between current time , time of file's creation. getting uptime of physical server dependent on os, need search additionally current machine. i.e. linuxes like in answer

Form validation on Button click in android -

Image
i'm developing android app in login activity has edittext,radiobutton,spinner , button.so when button pressed i've validate form checking whether fields filled else alert message given user.can please me java code. in advance. public void onclicklistener(view v) { name=(edittext)findviewbyid(r.id.edittext1); years1=(radiobutton)findviewbyid(r.id.radiobutton3); years2=(radiobutton)findviewbyid(r.id.radiobutton4); years3=(radiobutton)findviewbyid(r.id.radiobutton5); manager=(radiobutton)findviewbyid(r.id.radiobutton1); teamleader=(radiobutton)findviewbyid(r.id.radiobutton2); rg1=(radiogroup)findviewbyid(r.id.designation); rg2=(radiogroup)findviewbyid(r.id.years); button proceed = (button) findviewbyid(r.id.button1); proceed.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { if (validationsuccess()) { } else if(manager.ischecked())

xml - Reducing the need for xsl:if and code duplications -

i have xslt code differs single class element. however, of internal div content. i attempted separate out starting tag such: <xsl:if test="position() = 1"> <div class="position first"> </xsl:if> <xsl:if test="position() != 1"> <div class="position"> </xsl:if> but ofcourse produces invalid xslt code. [the div's must closed within scope]. is there way add optional class keyword without have reduplicate internal contents? try this: <div class="position"> <xsl:if test="position() = 1"> <xsl:attribute name="class">position first</xsl:attribute> </xsl:if> </div> the xsl:attribute instruction should override literal attribute.

codeigniter - Passing array from controller to view and show it -

i new codeigniter.i want send array controller view , show it.but error show in view: a php error encountered severity:notice message:undefined variable:pub filename:views/first.php line number:25 this code : cotroller $data['pub']=$this->mymodel->get_public(); $this->load->view('first',$data); model function pub_article() { $where=array('public'=>'1'); $query=$this->db->get_where('article',$where); if($query->num_rows() > 0) return $query->result(); else return false; } view foreach($pub->result() $row){ echo "<p>".$row->tiltl."</p>" } try code: in model: $where=array('public'=>'1'); $query=$this->db->get_where('article',$where); if($query->num_rows() > 0) return $query; else return false; in view: if($pub!=false) { fore

vim - How do I merge these two regexs into a single one? -

i'm using 1 remove whitespace: %s/\s\+//g and 1 wrap comma-separated words between double quotes (and leave 1 space after comma): %s/\s*\([^,]\+\)/ "\1"/g i tried merging them this: %s/\s\+//\|/\s*\([^,]\+\)/ "\1"/g but trailing characters error. how correctly merge 2 regexs? because replacement part different, you'd have use :help sub-replace-expression differentiate between 2 regexp parts , either remove or double-quote, this: :%s/\s\+\|\s*\([^,]\+\)/\=empty(submatch(1)) ? '' : ' "'.submatch(1).'"'/g but still doesn't make sense, because deletion of trailing whitespace come after it's been double-quoted. these 2 substitutions aren't related, should concatenate 2 commands | command separator (in mapping, you'd use <bar> instead): :%s/\s\+//g|%s/\s*\([^,]\+\)/ "\1"/g

angularjs - Nested views error - only after refreshing page -

i total beginner angluar.js. want have single page application row of tabs, each of can contain row of tabs, each of contains view. so, asked this question , accepted answer, had demo @ http://plnkr.co/edit/bubcr8?p=preview . the demo close, used list instead of second row of tabs, trying modify code. far, have skeleton, proof of concept of nested tabs views. drop real contents in later. i post code below, here problem: when drag & drop index,html file browser, works fine. can click around , expect happen seems happen. there not see when moving between tabs left , centre & right ; far action on link & link2 of left tab . seems perfect - until press f5 , refresh page, start geeing errors in js console: error: not resolve '.link2' state 'left.link1' @ object.t.transitionto (http://angular-ui.github.io/ui-router/release/angular-ui-router.min.js:7:8834) @ object.t.go (http://angular-ui.github.io/ui-router/release/angular-ui-router.min

php - Codeigniter error Missing argument -

i've concatenated id of user , pass paramater controller addquestion($id) keep getting these errors: a php error encountered severity: warning message: missing argument 1 questions::addquestion() filename: controllers/questions.php line number: 49 php error encountered severity: notice message: undefined variable: id filename: controllers/questions.php line number: 67 database error occurred error number: 1048 column 'question_user_id' cannot null insert `questions` (`question_user_id`, `question`) values (null, 'sdf') filename: c:\xampp\htdocs\webdev\askme\system\database\db_driver.php line number: 330 here's view: <h1>ask users</h1> <ul class="list_items"> <?php foreach ($users $user):?> <li> <div class="list_name"><b><?php echo $user->username;?></b></div> <div class="list_body"><?php echo $user->register_date;?> </di

android - Mxit Integration -

i need mxit integration android app. know how integrate mxit android app facebook. have google found link https://dev.mxit.com/docs/authentication.i tried connect link per steps mentioned in site got error while connecting https://auth.mxit.com/ shows unknown host exception.please can me out of error. thanks in advance

java - Unable to compile code despite setting the target Platform -

i unable compile code despite setting target platform containing required jars. tried cleaning workspace , restarting eclipse didn't help. when include folder (which contains jars) in build path, compiles fine. kindly help!

cluster analysis - Interpreting the results of R Mclust package -

i'm using r package mclust estimate number of clusters in data , result: clustering table: 2 7 8 9 205693 4465 2418 91 warning messages: 1: in map(z) : no assignment 1,3,4,5,6 2: in map(z) : no assignment 1,3,4,5,6 i have 9 clusters best, has no assignment 5 of clusters. mean want use 9 or 5 clusters? if answer can found somewhere online, link appreciated. in advance. most likely, method did not work @ on data... you may try other seeds, because when "lose" clusters (i.e. become empty) means seeds not chosen enough. , cluster 9 pretty gone, too. however, if data generated mixture of gaussians, it's hard find such bad starting point... likely, of results bad, because data not satisfy assumptions. judging cluster sizes, i'd have 1 cluster , lot of noise ... have visualized , validated results? don't blindly follow number. validate.

javascript - Find the closest marker to a new marker added Customer Service app -

i working on fast food customer service application call center should able add address of caller (a marker on map) clicking on map has old markers (the branches) , automatically should calculate closest branch marker added. i add markers array , used this calculation function, nevertheless need know how call function after clicking event , connect new marker added. code follow identifying branches var map; var markers = []; var marker, i; var locations = [ ['title a', 3.180967,101.715546, 1], ['title b', 3.200848,101.616669, 2], ['title c', 3.147372,101.597443, 3], ['title d', 3.19125,101.710052, 4]]; the initialization function function initialize() { var haightashbury = new google.maps.latlng(3.171368, 101.653404); var mapoptions = { zoom: 12, center: haightashbury, maptypeid: google.maps.maptypeid.terrain }; map = new google.maps.map(document.getelementbyid('map-canvas'), mapoptions);

Not getting Local/Device contact name and type using AccountManager android -

/** * account available in phone , add list */ private void getallaccounts() { int counter = 0; final accountmanager accmanager = accountmanager .get(activity.this); final account accounts[] = accmanager.getaccounts(); (int = 0; < accounts.length; i++) { log.i(tag, "name " + accounts[i].name + ", type " + accounts[i].type); } } i using above code getting available accounts of device. works on sony device not in samsung, micromax, htc. don't know reason behind this. if has idea please kindly me. i not able local/phone/device contact name , type samsung, htc, micromax. do private string[] getaccountnames() { maccountmanager = accountmanager.get(this); account[] accounts = maccountmanager.getaccountsbytype( googleauthutil.google_account_type); string[] names = new string[accounts.length]; (int = 0; < names.length; i++) { names[i] = accounts[i]

php - is it possible to insert a long sentence to database? from textarea form -

i'm trying send sentences database. sent sent empty. this submit form <td align="center" colspan="3"> <font face="algerian"><h2>todays tazkirah</font> <form method="post" id="usrform" action="inserttazkirah.php" ><br> <textarea rows="4" cols="50" type="text" name="tazkirah" form="usrform"> </textarea><br> <input type="submit"><br> </form> </td> and process insert database <?php $con=mysqli_connect("rock","mido","****","fyp"); // check connection if (mysqli_connect_errno()) { echo "failed connect mysql: " . mysqli_connect_error(); } $sql="insert tazkirah (version) values ('$_post[version]')"; if (!m

typescript - How create imported class object in typescirpt? -

interface imodal { widgetnames: knockoutobservablearray<string>; widgets: knockoutobservablearray<iwidget>; } one web.d.ts file declare module declare module "modules/dialog/modal" { var themodal: imodal; export = themodal; } class modal implements imodal { widgetnames: knockoutobservablearray<string>; widgets: knockoutobservablearray<iwidget>; constructor() { this.widgetnames= ko.observable<string>(['widget1','widget2']) } } export = modal; class index want import modal.ts file , create new object. problem when import modal.ts unable create object. typescript not compiler index.ts file here "new modal()" import modal = require('modules/dialog/modal'); class index{ constructor(){ var_modal = new modal();//problem here, unable create modal. not compiled typescript compiler; don't want use singleton pattern; } } export = index; solution import that: work fine

three.js - how can i modify mesh size in my scene? -

first say, not speak english well. anyway, let's straight. i want modify mesh(cube) size when scroll mouse wheel zoomin or zoomout. i hope increase mesh(cube) size when zoom in , opposite case, too. my code below. <script src="../lib/three.js/build/three.js"></script> <script src="http://code.jquery.com/jquery.min.js"></script> <script> var canvas_width = 400, canvas_height = 300; var renderer = null, //웹지엘 또는 2d scene = null, //씬 객체 camera = null; //카메라 객체 var capture = false, start = [], anglex = 0, angley = 0, zoom = 1.0; function initwebgl() { setuprenderer(); setupscene(); setupcamera(); var mycolor = new three.color( 0xff0000 ); mycolor.setrgb(0.0, 1.0, 0.0); var alpha = 1.0; renderer.setclearcolor(mycol

linux kernel - How Can I put ARM processor in different modes using C program? -

i going through different mode of arm processor. want check processor state(ex: register values) while in different mode. so can me find out sample code put processor in different mode ? for example found code undefined mode: asm volatile (".short 0xffff\n"); if wish test modes user space, difficult question. there maybe no way go fiq mode, if there no fiq peripheral in system. system may not using monitor mode @ all, etc. abort mode, can use invalid pointer, or use mmap . however, answer mode switches user space book (or impossible) without assistance kernel. creating test module /proc or /sys file , using techniques below implement kernel code straight forward method. you should aware not mode switch transitions allowed. instance, may never switch user mode other mode except through exception mechanisms. issue each arm mode has banked registers. 1 of these important sp (or stack pointer) , lr (or link register) that fundamental 'c'

php - Remember submitted field in form drop down list -

i have html form , php script on same page, calculates price based in input html form. it important information provided in form stored when php script runs, customer can see price based on. the following code stores text input: <input type="number" min="1" max="420" name="stofprijs" width="100" placeholder="prijs" value="<?=( isset( $_post['stofprijs'] ) ? $_post['stofprijs'] : '' )?>"> euro. i had tried store data drop down list code: on top: <?php $gordijnsoort = $_post['gordijnsoort']; ?> in form: <select name="gordijnsoort"> <option value="gordijn" <?php echo $gordijnsoort == 'gordijn' ? 'selected="selected"' : ''; ?>>gordijn</option> <option value="vouwgordijn" <?php echo $gordijnsoort == 'vouwgordijn' ? 'selected="selec

javascript - How to prevent xss script execution via url when using/testing with third party tool? -

users/testers in website able execute scripts via url using third party tool so tool running , enter http://yoursite.com?q=nokia 188413544056">alert(document.cookie);16cd1a0b206 then browser executes alert in url not without tool. i using codeigniter/twig. twig escaping not work in case burpsuit tool running. however if normal scenario twig outputs following escaped values , script in url not execute. search?query=nokia188413544056%22%3e%3cscript%3ealert(document.cookie);%3c/script%3e16cd1a0b206 i able reproduce same on ie after disabling xss filter using internet option of ie. however have verified multiple times striping tags , filtering url parameters. can guide me reason, or valid case. note: can provide more , more details out put of every step if needed.

Alloy integer comparison semantics using "Forbid Overflow: Yes" -

i have following alloy module , run command: sig { x : set } run {all a: a| #a.x<3 , #a.x>1} 2 a, 2 int with "forbid overflow: no" alloy analyzer 4.2 (build date: 2012-09-25) not find instance. believe reason due overflow of constant 3 run predicate reads {all a: a| #a.x<-1 , #a.x>1} . with "forbid overflow: yes" alloy analyzer finds instance. ---instance--- integers={-2, -1, 0, 1} univ={-1, -2, 0, 1, a$0, a$1} int={-1, -2, 0, 1} seq/int={0} string={} none={} this/a={a$0, a$1} this/a<:x={a$0->a$0, a$0->a$1, a$1->a$0, a$1->a$1} the alloy evaluator tells me predicate {all a: a| #a.x<3 , #a.x>1} used in run command evaluates false . could please explain behavior? there difference in sematics of integer comparisons in evaluator , analyzer? edit: noticed behavior different in latest experimental version: alloy 4.2_2014-03-07. not find instance. behavior expected. you provided right answers in question, can rei

syntax function into Erlang -

i have module written notepad: -module(hhfuns). -compile(export_all). one() -> 1. two() -> 2. add(x,y) - x() + y(). and save hhfuns.erl. when run ok called: hhfuns:add(myfun hhfun:one/0, myfun hhfun:two/0). this command make syntax error. when changed myfun fun worked.maybe it's basic syntax i'm new @ erlang, please explain me why. when passing function outside module parameter should use syntax fun module:function/arity . correct version hhfuns:add(fun hhfun:one/0, fun hhfun:two/0) . fun here required keyword , can not use myfun here instead.

php - how to control database update by going back and directly opening the link -

created 3 pages. first 1 login page , second page details (userinput.php) , while submitting update details in database , redirect page (thankyou.php). now requirement is if directly open (userinput.php) page should not. instead should redirect login page. after given user details(userinput.php), go (thankyou.php) page. there chance of updating database same info going (userinput.php) page clicking button in browser. how can overcome problem. thank in advance. you must use session this: , check session variable that: <?php session_start(); if(empty($_session['variable'])) { header("location:login.php"); die(); }

c# - Set height and Width of Pop Window on button click which button is reside in that window -

i have open aspx page pop window. in aspx page have 2 div 1 data , 1 no data. when there no data visible no data div. in have images , simple message in it. i have set pop window height : 730px , width : 1050px and have set no data div height :600px , width : 850px. now when there no data div visible want set pop window height , width same no data div. so how can set height , width of pop window @ runtime. i have use below code visible no data div. dvdata.visible = false; dvnodata.visible = false; lblmessage.text = ""; thanks, hitesh you can put following javascript function on designer of popup page , call when set visibility of no data div true: function resize_now(){ window.moveto(new_posx,new_posxy); window.resizeto(newsizex, newsizey); } hope helps.

google cast - What to do to recover from onStalled method with DRM on chromecast? -

what correct way recover onstalled method on chromecast player when playing drm stream ? i can call 'load' method if there currenttime in mediaelement, drm's license? i get: uncaught invalidstateerror: attempt made use object not, or no longer, usable. on line 105 ( media_player.js ) if call to: this.mediaelement.load(); // called in onstalled method thanks in advance

Reverse key value array in JSON (PHP) -

i have key value array in php this [1]=>"something" [2]=>"somethingelse" [4]=>"this" now export json, reverse array, keep indexes. json format like { "4":"this", "2":"somethingelse" "1":"something" } is there easy way accomplish (without parsing json manually)? $reverse = array_reverse($array, true); $json = json_encode ($reverse);

magento android APP for customers -

i'm developing android app work magento , wanted have option login customers , can add item cart, view have in cart , buy stuff find can view customers, view orders, couldn't find how make login customers , how add items cart , buy that. thanks help. in order customer's cart detail using rest api first customer token using api "post /v1/integration/customer/token". curl -x post " http://example.com/rest/v1/integration/customer/token " -h "content-type: application/json" -d '{"username":"username","password": "password"}' this return token. can use token in header in order access customer resources like cart details let token xxxxxxxxxxxxxxxxxxxxxxxxx curl -x " http://domainname.com/rest/v1/carts/mine "\ -h "authorization: bearer xxxxxxxxxxxxxxxxxxxxxxxxx"

How to select which instance to update with command line in Installshield (silent mode)? -

i have installscript project (non msi), in multi-instance mode. in cases, setup.exe launched command line in silent mode. then, new versions of program generated, , may have update som instances installed on machine. problem don't know how select instance want update cmdline (in silent mode). there way ? i've noticed there /ig switch, enables me use specific instance guid, not seem let me select instance guid... i found it. to update specific instance need : a record file correspondig update mode (to it, have run setup.exe cmdline in record mode : setup.exe /r /f1"/full/path/to/your/recordfile.iss" the guid of instance want update : guid contained in installscript "instance_guid" variable. can write file during installation of instance. then, can update instance following command line : setup.exe /r /f1"/full/path/to/your/recordfile.iss" /ig"{your-guid-goes-here}" this did trick me.

In-page analytics requires ga.js instead of analytics.js -

recently added ga('require', 'linkid', 'linkid.js'); in analytics code. this source code. (function(i,s,o,g,r,a,m){i['googleanalyticsobject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new date();a=s.createelement(o), m=s.getelementsbytagname(o)[0];a.async=1;a.src=g;m.parentnode.insertbefore(a,m) })(window,document,'script','//www.google-analytics.com/analytics.js','ga'); ga('create', 'ua-24190***-7', 'whitebeartest.com'); ga('require', 'linkid', 'linkid.js'); ga('send', 'pageview'); but when tried in-page analytics,it requires ga.js i think ga.js downward compatibile of analytics.js how can use in-page analytics?? we've identified problems in setup. these may cause problems loading in-page analytics. site doesn't load ga.js google. if host google tracking code on own servers, isn't updated automa

sql server - SQL bcp The semaphore timeout period has expired -

i'm making bulk copy onto file of select in database. declare @cmd varchar(1000) declare @sql varchar(8000) set @cmd='"select * [mydb].[dbo].mytable"' select @sql = 'bcp '+@cmd+' queryout c:\myfile.txt -c -t -t -s myserver -u user -p password'; exec xp_cmdshell @sql; if change parameters , execute same command on database test on machine works, on database server error: msg 121, level 20, state 0, line 0 transport-level error has occurred when receiving results server. (provider: tcp provider, error: 0 - semaphore timeout period has expired.) i check server name, user, password, table name , correct, cannot understand i'm doing wrong. can me issue? thanks increase timeout seconds in connection string. private static void opensqlconnection() { string connectionstring = getconnectionstring(); using(sqlconnection connection = new sqlconnection(connectionstring)) { connection.open(); console.writeline(&q

asp.net - Can node.js replace my javascript timer? -

i posted here short while ago today. had asked whether compile javascript using jscript.net. i told (quite rightly) jscript.net old technology , not unsupported) , should @ new technology node.js. i have taken @ node.js. understand standalone web server can sit side-by-side iis. i have developed asp.net application. uses lot of jquery/javascript ajax calls client. i using javascript timer calls url generic handler (asmx)to return image in bytes. i wanted see if compile javascript using jscript.net (hence original question) would: hide url address call , perhaps improve performance of javascript. i have looked @ sample code node.js not find 'replace' javascript timer. i admit javascript/client skills not great. but firstly, possible node.js? i ready learn... i have taken @ node.js. understand standalone web server can sit side-by-side iis. node.js platform on can execute javascript (generally on server). use side-by-side iis. hide ur

java - build-impl.xml:1048: The module has not been deployed. See the server log for details. BUILD FAILED (total time: 36 seconds) -

i using ubuntu, tomcat apache, netbean java web based project. able defualt file of tomcat7 trying build project, building properly, when try run project getting above error. didnt find solution online found lot question none of them provide me resolution. please give me solution. see log file, type in netbeans when configured connection. maybe username , password incorrect or in team modified it?? it's mine first published solution. it's begginers. watch video tutorials more details. here: services/databases/right click on (for example) mysql connection , next properties. if basic properties empty write username , password use in mysql database or friend's username , password if add new user project. see phpmyadmin/config.inc.php actual username , password. login database managing program example phpmyadmin , if different data root user in netbeans change twice in phpmyadmin users tab , in config.inc.php 2) or create new user same friend -ask him details.

character encoding - HTML files with no http-equiv meta tag and the charset may be other than UTF-8 -

we using jsoup - excellent thanks. we may html files no http-equiv meta tag , charset may other utf-8. how best handle please. can have list of encodings , try them not sure how tell programatically if wrong. jsoup throw ioexception? jsoup try determine encoding content type header or http equiv tag , if have none of them use utf8 . not sure if jsoup can more here. but can try approach: implement class reads files you. there can take care of encoding issues. result such class should give proper encoded string or @ least encoding that's used input. (html input) --> [encoding class] --normalized encoding--> [jsoup] --> (whatever) jsoup can parse input known encoding. i guess changes on html-creation thing not possible, isn't it? some further readings: http://illegalargumentexception.blogspot.co.uk/2009/05/java-rough-guide-to-character-encoding.html#javaencoding_autodetect character encoding detection algorithm what accurate encoding

Eclipse unable to load project properly in android? -

Image
i have updated sdk . here getting trouble new sdk. facing that, when create new project main.xml & main.java file not created automatically, have create manually. have seen many solution it's not working me. question how can resolve problem? edited i have solve above problem. getting new trouble. when create new project it's create appcompact_v7 automatically. how fix problem? did want create android project? so, when want create activity project in eclipse should select "blank activity" .. step 3 in create android project.

javascript - how jquery handles map? -

iam doing spring mvc project maven..i want display jqxgrid items..am getting item through map..the problem ,i got grid no items displaying..the data return controller map..how jquery handles returning map ?? my jquery code $(document).ready(function () { var source = { datatype: "json", type:"get", url: "account/list", datafields: [ { name: 'id' }, { name: 'periodname' }, { name: 'startdate' }, { name: 'enddate' }, { name: 'isactive' } ], sort: function () { $("#jqxgrid").jqxgrid('updatebounddata', 'sort'); }, id: 'id'

php - Multiple wordpress category IF conditional tags -

hi there posted question other day using conditional tags, managed solve. i've encountered obstacle, i've managed 1 working saying "if posts in 'blogs' category echo '[blogs]'" i'm trying display posts in blogs category , another. read use multiple conditional tags use 'elseif' have doesn't seem have done anything. here code i'm using: <h2> <a href="<?php the_permalink() ?>" rel="bookmark" title="permanent link <?php the_title_attribute(); ?>"> <?php if (in_category ('blogs')) { ?> <?php _e('[blog]'); ?> <?php } elseif (in_category ('blogs', 'showstopper-spillings')) { ?> <?php _e('[blog] showstopper spillings:'); ?> <?php } ?> <?php the_title(); ?> </a> </h2> not sure if i'm missing anything, or i'm trying pos