Posts

Showing posts from May, 2012

java - how to get session in webview created by httpurlconnection? -

i sending request server using httpurlconnection if request successfull set parameter in session send along request.but when try session on jsp page don't session there.i loading jsp page on webview. may know how can session & don't want use cookies creating & getting session? i using following code create session session.setattribute("uname",username); thanks in advance.

Python/Twisted: exceptions.RuntimeError: doWrite called on a twisted.internet.tcp.Port -

we have gem of exception being thrown during start-up of application, when clients aren't connected or trying connect, when clients start connect once system has initialised, [twisted.spread.pb.pbserverfactory] unhandled error traceback (most recent call last): file "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 88, in callwithlogger return callwithcontext({"system": lp}, func, *args, **kw) file "/usr/lib/python2.7/dist-packages/twisted/python/log.py", line 73, in callwithcontext return context.call({ilogcontext: newctx}, func, *args, **kw) file "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 118, in callwithcontext return self.currentcontext().callwithcontext(ctx, func, *args, **kw) file "/usr/lib/python2.7/dist-packages/twisted/python/context.py", line 81, in callwithcontext return func(*args,**kw) --- <exception caught here

checkbox - "The Control element must have a value for exactly one of the Property or CheckBoxPropertyRef attributes" error occured on wix installer creator -

i'm new wix installer..i dont know error happened.please suggest me <control id="compilepyc" type="checkbox" x="135" y="60" width="230" height="50" text="compile .py files byte code after installation" tabskip="no" /> basically, error message suggests following: if add checkbox control on dialog, have specify windows installer property, "tied" checkbox. you can specify property in 2 ways: the property attribute (the name of defined property linked control. column required active controls.) the checkboxpropertyref attribute the latter 1 new recent versions of wix, , the docs tell us: this attribute valid checkbox controls. value name of property used property checkbox control. property attribute cannot specified. attribute exists support multiple checkboxes on different dialogs being tied same property. so, decide way suits needs, , add either at

pthreads - how kernel manage user space threads in linux? -

i have read linux - threads , process i understood every kernel threads have unique task_struct but right question how kernel manage user application's thread, suppose user application have 12 thread how kernel manage them , every thread have unique task_struct kernel threads the kernel manages them when can, ie. whenever entered 'interrupt' changes state of threads. there 2 flavours of interrupt: either syscall running thread, or call driver has been entered 'real' hardware interrupt kb, nic, disk, timer etc, can change state of threads , initiate sceduling algorithm run may change set of threads run on available cores. in between interrupts, kernel manages nothing because not entered. the task_struct raised when running thread makes syscall create new thread. new thread created ready, , run whenever scheduling algorithm dispatches onto core.

Error parsing JSON data in android -

this question has answer here: how parse json in android 4 answers facing jsonexception while parsing json string exception : org.json.jsonexception: value anytype of type java.lang.string cannot converted jsonarray code snippet. try { androidhttptransport.call(soap_action1, envelope); soapobject response = (soapobject) envelope.getresponse(); string resp=response.tostring(); log.d("resp",response.tostring()); // newwwwww try { jsonarray jsonarray = new jsonarray(resp); (int = 0; < jsonarray.length(); i++) { jsonobject c = jsonarray.getjsonobject(i); system.out.println(c.getint("mst_bloodgroupid")); system.out.println(c.getstring("bloodgroup_name")); } } catch (jsonexception e) { e.printstacktrace(); } } response.tostring() below: any

multithreading - Java Executor to execute one Callable after previous has finished? -

i have custom business requirement. need execute series of service calls. each of these call creates new record in database. need execute next service call after previous service call has finished, because new service call use record created in db previous service call, input parameter. i had decided wrap each of these service calls in future tasks , use executors.newsinglethreadexecutor() execute these tasks in loop. please suggest suffice , better solution if not ?? also need place task.isdone() before executing next task?? i have decided use executors.newsinglethreadexecutor(). good choice given requirement. please suggest suffice , better solution if not ?? yes, pretty so. standard jdk libraries, best can find. also need place task.isdone() before executing next task?? no. javadoc executor explicitly states "[...]tasks guaranteed execute sequentially, , no more 1 task active @ given time." therefore, no task initiated before ac

java - Fetch data using single select statement in HQL (One to many relationsheep) -

i have 2 entities student , college. single college has multiple student. @entity public class college { @id @generatedvalue private int collegeid; private string collegename; public int getcollegeid() { return collegeid; } public void setcollegeid(int collegeid) { this.collegeid = collegeid; } public string getcollegename() { return collegename; } public void setcollegename(string collegename) { this.collegename = collegename; } } @entity public class student { @id @generatedvalue private int studentid; private string studentname; @manytoone(cascade = cascadetype.all) private college college; public int getstudentid() { return studentid; } public void setstudentid(int studentid) { this.studentid = studentid; } public string getstudentname() { return studentname; } public void setstudentname(string studentname)

javascript - Query on MongoDB Delete Triggers -

i newbie mongodb. please me following query: i using oplogs adding triggers mongodb operation. on doing insert/update operations, receive complete information fields added/updated in collection. my problem is: when delete operations in mongodb, oplog triggers received contains object_id. can please point out example can receive complete information in fields - deleted row in trigger. thanks you have fetch document objectid, not possible on current node tailing oplog because time have received delete operation oplog , document gone. believe means have 2 choices: make sure deletes preceded update operation allows see document fields require prior deletion (this make deletes more expensive of course) run secondary slave delay , query node document has been deleted (either directly or using tags ). for number 2, issue having delay long enough guarantee can fetch document , short enough make sure getting date version of document. unless add versioning doc

wordpress - Github gist not allgned properly -

Image
i trying embed github gist on blog, once embed it, find code misaligned. how fix it? gist link : https://gist.github.com/sarathm09/67ec411cea3b5c213cc5.js screenshot : please me in this. which editor using? editors offer 'reformat code' functionality, phpstorm. sublimetext there plugin available: https://github.com/akalongman/sublimetext-codeformatter

c# - Treeview consistency check(s) -

i have gui treeviewadv , data in listbox can dragged , dropped onto nodes in tree create hierarchy. users can define new nodes. tree manipulated in memory can committed backend user. each node saved object relations other objects. the question there ideas on how run consistency checks on tree when user drags , drops new nodes. consistency checks like: has been added node before. i thought of options needs cover previous manipulation (saved in database) , current manipulation: 1) run in memory, unfortunately in order have complete overview mean expand/collapse entire tree @ least once in order initialize nodes, smaller database round trips when initializing of nodes. 2) use current initialized gui nodes , run check against database previous relations saved, have larger overhead in database round trips. 3) read in current database configuration during gui initialization , cache needed run consistency checks. use , current tree. should result in better user experience think.

java - Pass a process to a subclass -

i pass process subclass may kill can't figure out how pass process. i'm unsure how store can return form , able call subclass method kill it. here classes package my.mashformcnts; import java.io.ioexception; import java.util.scanner; import java.util.regex.pattern; /** * * @author brett */ public class mashrocks { public static process startthread(mashformcnts mashformcnts) throws ioexception { processbuilder pb = new processbuilder("ffmpeg", "-i", "c:\\users\\brett\\documents\\telegraph_road.mp4", "c:\\users\\brett\\documents\\out.mp4"); //here name , store process final process p = pb.start(); // create new thread progress ffmpeg command , override // it's run method, , start it! thread t = new thread() { @override public void run() { scanner sc = new scanner(p.geterrorstream()); // find duration

android - App Inventor cannot connect to emulator -

started evaluating mit app inventor (ver 2.2) on windows 7 (from administrator account). since don't have android devices, have use emulator . aistarter.exe , emulator.exe both work when explicitly started, when start aistarter.exe , ai2.appinventor.mit.edu/#5440960545685504 on chrome , connect/emulator, emulator.exe not started, , aistarter disply messages like: 127.0.0.1 - - [16/dec/2014 04:15:13] "get /echeck/ http/1.1" 200 38 system cannot find path specified. problem checking devices : status 1 i tried disabling chrome extensions , , trying start ai2.appinventor.mit.edu firefox , maxthon browsers, identical negative results. both googling , searching appinventor.mit.edu didn't help. what failed path in error message referring to? any suggestions how debug app-inventor/emulator startup failure? since no remedy seemed help, decided start clean slate. i went http://appinventor.mit.edu/explore/ai2/update-setup-software.html

haskell - function defintion inside GHCi -

is possible write multi-line function definitions type-signature inside ghci (as write in source file)? i've tried far this: prelude> :{ prelude| let f :: int -> int; prelude| f = + 1 prelude| :} <interactive>:9:1: parse error on input ‘f’ but didn't work... there else try? thx in advance. mind indentation: prelude> :{ prelude| let f :: int -> int prelude| f = + 1 prelude| :} prelude> :t f f :: int -> int prelude> f 1 2

css - Square gradient background image, corner radius and transparency -

Image
i find hard describe effect want words created in photoshop , can see image below: as can see have red square 38pixel border. border outside , style set shape burst. unfortunately don't think similar style in css. border color set linear gradient color inside being same red square , outer color set transparent white. don't pay attention green underneath layer show transparency of border. what know, if there way achieve effect css or jqueryui maybe. i have been trying while in this jsfiddle , don't know how make more square. here's code in use in fiddle above <div class="test"></div> .test { width: 300px; height: 300px; border: 3px solid black; background-image: -webkit-radial-gradient(closest-side, rgba(255,0,0,1) 0, rgba(255,0,0,1) 75%, rgba(244,90,90,0.5) 88%, rgba(255,255,255,0) 100%); background-image: -moz-radial-gradient(closest-side, rgba(255,0,0,1) 0, rgba(255,0,0,1) 75%, rgba(244,90,90,0.5) 88%, rg

echo not working in JomSocial plugin -

i making jomsocial plugin name of user when echo name not displaying name. here code <?php defined('_jexec') or die('restricted access'); require_once jpath_root .'/components/com_community/libraries/core.php'; class plgcommunityname extends jplugin{ function getuserdetails(){ $cuser = cfactory::getuser(); $name = $cuser->username; echo $name; } } ?> how can ? try return $name; instead of echo $name;

symfony - Functional tests inside a standalone Symfony2's bundle -

i need make functional tests directly in standalone bundle. don't want test controller, interaction between real services. i know if there standard/best way that. did 1 way know if there better one. here own solution (i summarize process testing in standalone bundle): 1. first, bundle has own composer.json define dependencies: { "name": "my/own-bundle", "type": "symfony-bundle", "description": "symfony2 bundle provides ...", "keywords": ["my","own"], "license": "mit", "authors": [ { "name": "john doe", "email": "john.doe@omg.wtf" } ], "require": { "php": ">=5.3.2", "symfony/framework-bundle": ">=2.3" }, "require-dev": { "phpunit/phpu

java - How to add a client side pkcs12 certificate to Postman Chrome, W7 ? -

i try test 'strange' request have provide basic authentication , client side certificate. i try check postman chrome did not understand how link certificate chrome personal certificate request. i saw discussion : https://github.com/a85/postman-chrome-extension/issues/482 mac keystore , can't transpose w7/chrome. here java code set should same job postman understand want postman do. use post write inputstream = context.getresources().getassets().open("certificatefile.p12"); keystore keystore = keystore.getinstance("pkcs12"); bufferedinputstream bis = new bufferedinputstream(is); string password ="xxxxx"; keystore.load(bis, password.tochararray()); // password pkcs#12 password. if there no password, pass null // init ssl context keymanagerfactory kmf = keymanagerfactory.getinstance("x509"); kmf.init(keystore, password.tochararray()); keymanager[] keyma

html - Safari 7 background-image disappears -

i have website working fine in browsers except safari 7 reasons background-image disappears randomly when site loaded.. when scroll down re-appear. i've never seen this. the site here http://fourseasonsrally.com/2/public any mac user 5minutes of spare time? thank you! browserstack i'm trying reproduce issue ( don't own mac ), browserstack way slow debugging. the problem caused css3 animation i using animate.css fadeindown different columns. <div class="col-md-4 animated fadeindown"> removing these animations fixed problem. no idea know causing behaviour. further it

eclipse - Android - how can I generate SHA-1 fingerprint -

Image
this question has answer here: how sha-1 fingerprint certificate in android studio debug mode? 29 answers i many tutorial generate sha-1 fingerprint (in general not maps) , want know whats best way & difference between ways . first way (keytool) keytool -list -v -keystore ~/.android/debug.keystore -alias androiddebugkey -storepass android -keypass android or mention userprofile keytool -list -v -keystore "%userprofile%\.android\debug.keystore" -alias androiddebugkey -storepass android -keypass android second way (from eclipse ) window > preferences > android > build thank in advance & sorry disturb try this first can download , instal openssl , jdk file. open command prompt , copy , paste jdk file path c:\program files\java\jdk1.6.0_37\bin> next go c:>user folder>select (user name) folder> .andr

twitter bootstrap - My jQuery files won't load in any browser -

i'm trying build website templates using bootstrap can't load of js files have in distant servers. i've tried whole lot of solutions website suggesting, in vain : when refresh webpage, no js file appears in resources. here's how looks : <head> <meta charset="utf-8"> <link rel="stylesheet" type="text/css" href="css/bootstrap.css"> <link rel="stylesheet" type="text/css" href="css/style.css"> <link href="css/shop-homepage.css" rel="stylesheet"> <link href="css/3-col-portfolio.css" rel="stylesheet"> <script href="js/bootstrap.js"></script> <script href="js/grindhouseleather.js"></script> <script href="js/jquery.js"></script> <meta http-equiv="x-ua-compatible" content="ie=edge"> <meta name="viewport" content="width

c# - Do not refresh Inner Update Panel in asp.net -

i using 2 update panel in asp.net. second update panel inside main update panel . below : <asp:updatepanel id="updatepanel1" runat="server" updatemode="conditional"> <contenttemplate> <asp:updatepanel id="updatepanel2" runat="server" updatemode="conditional"> <contenttemplate> // google map... </contenttemplate> </asp:updatepanel> </contenttemplate> </asp:updatepanel> updatepanel1 contains dropdown , autupostback=true if user selects dropdown refreshs google map inside. not want refresh inside update panel anyway. possible ? people misunderstand way updatepanel works. mistakenly think that, there's no page reload when triggering postback occurs inside updatepanel. totally wrong. in fact full page reload taken place. it's not coincidence updatepanel located under category called ajax controls of to

r - Use grep to parse column names -

there data frame want delete columns in there string xfl or xst in colname. colname not exclusively xfl can ktel_xfl or ktel_xst . know there has way grep ? here's approach: # create cloumn index idx <- grep("x(fl|st)", colnames(dat), invert = true) # filter columns dat[idx] where dat name of data frame.

php - mysql Update query customize accroding if field is present -

i presently have data $user=$postdata['user_name']; $phone_no=$postdata['phone_no']; $qry = "update users set user_name = '$user', phone_no = '$phone_no' id = 1" i want update user_name if value present in $postdata['user_name'] same case phone_no , if data present in $phone_no phone_no should updated . you have construct query in segments: $user = $postdata['user_name']; $phone_no = $postdata['phone_no']; $update = array(); if($user) { $update[] = "user_name = '$user'"; } if($phone_no) { $update[] = "phone_no = '$phone_no'"; } if(count($update)) { $query = "update users set "; $query .= implode(",", $update); $query .= " id = 1"; }

angularjs - Angular JS Process form before submit -

i have scenario follows : i have 1 searchbox , user can enter 2 types of queries scenario 1 search starts i.e. a1234 scenario 2 search starts i.e. b1234 depending on 1 or 2 above want hit different webservice. whats best way distinguish search on above input. when user clicks on ng-submit use regular expression ? or should have scope variable on .watch() find out user typing ? <form role="form" ng-submit="searchform.$valid && searchcode()" name="searchform" novalidate> <div class="input-group"> <input type="text" class="form-control" ng-model="searchquery" name="searchquery" required autocomplete="off" spellcheck="false" focus> <input type="submit" value="search" class="btn btn-default btn-sarch-bar"> </div> </form> if search activated upon submit-button click, c

python - Pandas sorting dataframe on the basis of other column value -

i have sorted pandas dataframe df . i use df = df.sort(col_a,col_b) col_a col_b 6 7 8 11 b 5 b 10 b 12 c 11 c 13 c 14 but i'd sort df on basis of col_b min , max value have in first place col_a value min col_b value , @ last place col_a value max col_b value : col_a col_b b 5 b 10 b 12 6 7 8 11 c 11 c 13 c 14 is there fast way make kind of sorting using pandas fucntion? edit 1: @primer solution works 2 columns df . df col_a col_b col_c 0 6 9 1 7 8 2 8 7 3 11 6 4 b 5 5 5 b 10 4 6 b 12 3 7 c 11 2 8 c 13 1 9 c 14 0 return valueerror: wrong number of items passed 2, placement i

Angularjs to pass multiple params -

i want update status information need pass 2 params 1 school_id , other 1 status may be(approved, pending , declined) depending on user clicks button. have table school_info fields id school_name status in applicationjs need pass 2 params id , status. here html code, have ng-repeat using school in schools. <a href="#/changestatus/{{school.id}}/approved"><button class="btn btn-success" ng-model="approve">approve</button></a> <a href="#/changestatus/{{school.id}}/declined"><button class="btn btn-danger" ng-model="decline">decline</button><a> <a href="#/changestatus/{{school.id}}/pending"><button class="btn btn-deafult" ng-model="pending">pending</button></a> my app.js code is var app=angular.module("admin",[]); app.config(function ($routeprovider) { $routeprovider .when('/', { template

sql server - Questions about DeadLock -

here, am, questions. i fast , simple. i work sql server 2008 , i've been facing lot of calls deadlocks. users they're working , error transaction (process id) deadlocked on lock resources process , has been chosen deadlock victim. rerun transaction. so contact developers , tell them add with (no lock) in queries. it works 100% of times. but, right? is there instead of it, or way rid of deadlocks? thanks ok. deadlock 2 processes competing same data waiting other finish before updating (or releasing lock). 1 of reasons why data locked prevent 'dirty read'. i.e. reading out-of-date data because it's been updated so locking there reason i.e. it's there protect integrity of data. turning off (no lock) should done if sure system won't suffer result. otherwise start data corruption i.e. bad data. i using (no lock) safe procedures report i.e. selects without following updates , have no bearing on operation of system. procedu

authentication - Slim framework route middleware arguments -

i'm writing custom route authorization middleware slim. if understand "route middleware" different "middleware" . i use custom router middleware way: $app->get('/',$acl->allow(["users","admins"]),function () use ($app) { ... }); where $acl->allow route middleware: public function allow($auth=[]){ return function() use($auth){ ... }; } in docs http://docs.slimframework.com/#route-middleware read this: what arguments passed each route middleware callable? each middleware callable invoked 1 argument, matched \slim\route object. how use standard param \slim\route object , custom parameter (in example ["users","admins"] ) this simple answer both custom , route param in route middleware callable: public function allow($auth=[]){ return function($route) use($auth){ //this route: $route }; }

ios - Handling time out with NSMutableURLRequest -

i making post web service calls in parallel asynchronous, setting time interval of nsmutableurlrequest 180 seconds. but didfailwitherror: delegate not getting triggered @ interval of 180 seconds, rather goes less 75 seconds or greater value 220 seconds , on, not once 180 seconds. as far scanned through similar questions, there no solid solution this. @ places, see timeoutinterval not work post methods. want know whether issue true post methods , there way overcome @ least in ios8? if using post , ios version bellow 6, have set value above 240 seconds. otherwise, timeout ignored. see this post , this question .

javascript - Passport Facebook Strategy, trigger route with AJAX -

the problem: xmlhttprequest cannot load https://www.facebook.com/dialog/oauth?response_type=code&redirect_uri=http%…lhost%3a8080%2fapi%2fauth%2ffacebook%2fcallback&client_id=1527429390857121. no 'access-control-allow-origin' header present on requested resource. origin 'http://localhost:8080' therefore not allowed access. if click link in error autenticated , datas in json. if remove clientside js router everithing works fine. trying build spa app. i don't use specific frontend framework, use flatiron director router , generate view handlebars. on clientside: var facebook = function () { console.log('get /auth/facebook'); $.ajax({ url: '/api/auth/facebook', type: 'get', datatype: 'jsonp', cache: false }); }; // routes =============================== var routes = { ... '/auth': { '/facebook' : facebook, '/twit

Can't get AngularJS decorator for TextAngular to work -

i'm not sure totally understand decorators in angularjs - i'm trying modify textangular in example: https://github.com/fraywing/textangular/wiki/setting-defaults my code: angular.module('myangularapp', ['cfp.hotkeys', 'omr.angularfilednd', 'textangular']); angular.module('myangularapp', ['textangular']).config(['$provide', function ($provide) { // changing classes of icons $provide.decorator('tatools', ['$delegate', function (tatools) { tatools.bold.iconclass = 'icon icon-button'; return tatools; }]); }]); with decorator active, blank web page, no error messages. any ideas? @joeljeske comment correct - module, don't redeclare it. angular.module('myangularapp', ['cfp.hotkeys', 'omr.angularfilednd', 'textangular']); angular.module('myangularapp').config(['$provide', function ($provide) { // ch

ruby on rails - How to store OAuth data -

we have several oauth2 providers people can authorize through (twitter, facebook, etc). store data in database via "provider/id". problem is: want possibility use several oauth2 providers 1 user, i.e. user can authorize through facebook, through twitter , 1 user in our database. thought related table, oauth_users_info, or that, store fields facebook_id, twitter_id etc, , use after authorization. practice or u can propose better? i'm afraid of pitfalls can cause problems afterwards. actually, may want create identity model, associated user model. user can have many identities facebook, twitter, etc. identity model like, identity(id: integer, uid: string, provider: string, user_id: reference)

javascript - Capitalizing the first letter of a label element -

i getting external html page data coming in lowercase. css, tried capitalize first intial of complete label tag unable it, makes complete uppercase this: .fontmodal { text-transform:capitalize !important; } but did not worked... <table><fieldset><div><label>data</label></div></fieldset></table> - current structure now trying same in jquery, not sure , how proceed. here code trying: $('#container2').find("table>label").css(texttransform,'capitalize'); see below: label { text-transform: lowercase; } div::first-letter { text-transform: uppercase; } <table> <fieldset> <div> <label>data</label> </div> </fieldset> </table>

logical operators - Boolean Expression Optimization For All AND Conditions -

i trying solve boolean expression optimization problem simple rule engine. here trying do, lets if have following 5 conditions (where a,b,c,d,e,f complex boolean expressions) if (a , b , c , d , e , f) do-1 if (a , b , c , d , e) do-2 if (a , b , c , d) do-3 if (a , b , c) do-4 if (a , b) do-5 in case when execute these conditions in linear order - evaluate "a" 5 times - evaluate "b" 5 times - evaluate "c" 4 times - evaluate "d" 3 times - evaluate "e" 2 times - evaluate "f" 1 time i make expression execution tree each expression (a,b,c,d,e,f) evaluated minimum number of times. perfect solution each expression evaluated once. think can achieved tree creation these conditions part of tree. the tree may if(a , b) do-5 { if(c) do-4 { if(d) do-3 { if(e) do-2 { if(f) do-1 } } } } my questions - how can make tree set of boolean expression

c# - Targeting propertry settings to .net 3.5 throws error -

i converted 1 of project made .net framework 4.5 3.5(vs2013 ide) make compatible windows xp os. issues: project loads set of values 'project.property.settings @ onload event , throws error: an unhandled exception of type 'system.configuration.configurationerrorsexception' occurred in system.configuration.dll additional information: error occurred creating configuration section handler usersettings/installer.properties.settings: not load file or assembly 'system, version=3.5.0.0, culture=neutral, publickeytoken=b77a5c561934e089' or 1 of dependencies. system cannot find file specified. innerexception: when using relative path, make sure current directory correct. innerexception:verify file exists in specified location i search web regarding problem nothing works in project , changed version 3.5.0.0 in app.config file. app.config file <configuration> <configsections> <sectiongroup name="usersettings" type="sys

javascript - How to access .js function in html? -

my experience in javascript lacking terribly.. , 1 question alone solve 90% of problems @ current! so here have map displays, , marker langlat placed in .js file, require able add markers through php, i'm assuming i'll have pass array foreach , run script add each marker. accessing function appears main issue. <div class="col-md-6"> <div class="content-wrap" id="map"> <div class="wrapper" > </div> </div> </div> <script src="js/maps.js"></script> <script src="plugins/gmaps.js"></script> maps.js var googlemap = function () { var map; return { init: function () { map = new gmaps({ div: "#map", lat: ***, lng: *** }); map.addmarker({ lat: ***, lng: ***, title: "ma

jquery - Splice removing random elements issue in javascript -

i trying create interactive shopping cart using jquery, splice issue ruined everything, because when delete element directly works perfect me, going dynamically changes doesn't work deleting random elements in array after updates indexes. <script src="//code.jquery.com/jquery-1.10.2.js"></script> <div id="mydiv2"></div> <div id="mydiv"></div> <script> var wishlistarray = ["item1", "item2", "item3", "item4", "item5"]; function wishlist_show() { var wishlistarraydom = ""; jquery.each(wishlistarray, function (i, wishlistid) { wishlistarraydom += '<div><a href="javascript:;" class="rem-from-wishlist" value="' + + '">remove( ' + wishlistid + ' )</a></div>'; }); $('#mydiv').empty(); $('#mydiv').html(wishlistarraydom);

r - Error message from install.packages() - wayward continuation line -

with rstudio , running under windows, effort install textreg package encountered strange error: > install.packages("textreg") warning in install.packages : downloaded length 17116 != reported length 200 warning in install.packages : downloaded length 17116 != reported length 200 error in install.packages : found continuation line starting ' <title>marriott – ...' @ begin of record. does error tell me in package has gremlin ....? can fix problem @ end or should write luke miratrix, maintainer? or doing foolish? thank you the windows binary not available cran , install.packages didn't report indicates mirror not up-to-date. however, able build package source on win7 system. thus, can use install.packages("textreg", type="source") .

c# - Call a constant name from web.config -

in webserivce coding, want call constant name web.config. have code : namespace service.appcode.common.service { [servicecontract(namespace = constants.namespace)] public interface iservice1 { [operationcontract] void dowork(); } } and code: namespace service.appcode.common { public class constants { public const string namespace = configurationmanager.appsettings["defaulip"]; } } it : the expression being assigned 'service.appcode.common.constants.namespace' must constant is possible call web.config? constants defined @ compile-time , embedded directly resulting code, they're not initialized when application executes. (and can't change, unlike config value can change.) however, looking @ this... public class constants { public readonly static string namespace = configurationmanager.appsettings["defaulip"]; } it looks want static immutable value. t

html - Displaying image content types as grids in drupal 7? -

i using views , display suite modules create page works image gallery. click on menu button take page (the view) has multiple links nodes (individual galleries). when click these nodes, take separate page , show images uploaded using "event" content type made. the event content type has 1 field (type: image) uses multiupload widget, allowing multiple file uploads. however, images on node displayed within divs, have own rows basically. know if possible put them grids, , if so; how? tried using display suite, have 1 field work with. if want customized page , arrange fields want, use theme suggestions . for node of type "event", said, node--event.tpl.php . can duplicate code inside base template node.tpl.php of parent theme (or if don't have one, of bartik example) have starting material. just rearrange div, tags, variables convenience, add custom css make grid, , should done! i hope helps.

design patterns - How many API calls does a typical web app make on load? -

i'm working on relatively simple web app uses own api pull data on page load. nothing fancy. i've run few cases it'd simpler run 2 requests while loading page's content, i'm having trouble finding information how common multiple api calls are, , best practices around them. how many api calls typical web app make own apis when doing simple page load? what's best approach once restful api in place? how many api calls web application has depends on how complex web application be. what suggest define performance goal of web application, average loading time of web page, or 90 percentile response time, etc. once have goals defined, can check if web application developed satisfy goals. if not, there multiple ways tune application. e.g. combine multiple calls 1 restful call 1 way. try minimize page content enabling server sider http compression, js/css compression, etc. helpful.

windows installer - Error During InstallShield Wizard -

we getting error downloading file .net 4.5 before our install. error installshield wizard error says error has occurred while downloading file http://saturn.installshield.com/is/prerequisites/microsoft.net framework 4.5 web.prq. the odd thing is, error doesn’t make sense, it’s failing download prerequisite file. file inside setup , tells information prerequisite. shouldn’t have download file. it’s not .net that’s failing download. the prq on build machine build against has attribute called altprq optionally points web server. upside of allows prq tweaked long after build has been produced. downside injects point of variability can't tracked using cm practices. typically remove these references before doing build.

delphi - How to receive UTF-8 encoded messages via TIdIMAP4? -

i trying receive emails using indy's tidimap4 component. here's example code how retrieve messages: procedure temailform.getmessage(id: string); var imap: tidimap4; msg: tidmessage; begin imap := tidimap4.create(self); imap.host := 'mailserver'; imap.username := 'username'; imap.password := 'password'; imap.connect(true); imap.selectmailbox('inbox'); msg := tidmessage.create(self); imap.uidretrieve(id, msg); subject.caption := msg.subject; if (msg.messageparts.count = 0) msgbody.text := msg.body.text else if (msg.messageparts[0] tidtext) msgbody.text := tidtext(msg.messageparts[0]).body.text; imap.disconnect(); imap.free; end; where subject tlabel , msgbody tmemo . in case email multi-part message messages sent via gmail, body returned tidtext(msg.messageparts[0]).body.text correctly encoded , special characters german umlauts displayed correctly. though in case email single-part message me

javascript - Blocked from accessing an Iframe with origin 'null' -

i using iframe pseudo-ajax file upload. iframe in same view upload javascript: <iframe id="upload_iframe" name="upload_iframe" style="position: absolute; left: -999em; top: -999em;"></iframe> his works 'nicely' on local machine, when deploy azure web site, following error in chrome's debug console: uncaught securityerror: failed read 'contentdocument' property 'htmliframeelement': blocked frame origin " https://acme.azurewebsites.net " accessing frame origin "null". frame requesting access has protocol of "https", frame being accessed has protocol of "data". protocols must match. i understand iframe same-origin, strictly local, how convince browser local? is, there should doing origin , protocol of iframe avoid error? this code, in nutshell: dataaccess.submitajaxpostfilerequest = function (completefunction) { $("#userprofileform").get(

Retrieve list of cookie in Salesforce -

i have shopping cart feature in salesforce page. i've created cookiejar class store cookie based on tutorial retrieve list of cookie. cart page retrieve 1 cookie contains 1 product. retrieve cookies i've stored. how do that? apex controller: public pagereference addtocart() { for(displayproducts p : products) { if(0 < p.qtytobuy) { //create instance of cookiejar class, passing values entered in fields cookiejar c = new cookiejar(p.productid, p.name, string.valueof(p.qtytobuy)); } } pagereference pageref = new pagereference('/apex/cart'); pageref.setredirect(true); return pageref; } public string getcartcontents() { string msg = '<ul>\n'; cookie thecookie; thecookie = apexpages.currentpage().getcookies().get('productid'); if(thecookie != null) msg +=thecookie.getvalue(); thecookie = apexpages.currentpage().getcookies().get('productname'); if(thecookie != null) m

scroll - Android: How to get the current X offset of RecyclerView? -

i'm using scrollview infinite "time picker carousel" , found out, not best approach ( last question ) now, found recycler view i unable current scroll offset in x direction of recyclerview ? (let's each item 100px width, , second item visible 50%, scroll-offset 150px) all items have same width, therer gap before first, after last item recyclerview.getscrollx() returns 0 (docs say: initial scroll value) the layoutmanager has findfirstvisibleitemposition , cannot calculate x offset that update i found way keep tracking x-position, while updating value onscrolled callback, prefer getting actual value instead of tracking time! private int overallxscroll = 0; //... mrecyclerview.setonscrolllistener(new recyclerview.onscrolllistener() { @override public void onscrolled(recyclerview recyclerview, int dx, int dy) { super.onscrolled(recyclerview, dx, dy); overallxscroll = overallxscroll + dx; log.i(&

MAGMA NilpotencyClass being miscalculated -

we devised function in class test if nilpotency class of group or not sum of of p-sylows. original first 1 below, without n:=nilpotencyclass(g) line. got strange result, see below. teacher got different strange result: 3 1 . group g wasn't abelian, have found non-abelian class 1 nilpotent group, absurd. tried isolating function, because classmate of mine had function working. solved problem. curious mystery, tried isolate problem, , found came straight out of function. tried calculating returned nilpotencyclass @ start of function , worked. if don't, outside function still nilpotencyclass(g)=32767 ! have following code: testnilpotencyclass := function(g) n:=nilpotencyclass(g); if not isnilpotent(g) return 0; end if; n := #g; somma := 0; pn in factorisation(n) p := pn[1]; p := sylowsubgroup(g,p); c := nilpotencyclass(p); somma +:= c; end for; return somma, n; end function; testnilpotencyclassb := f

java - Why extra query executed while fetching data in Many to One relationship? -

i have 2 entities student , college. single college has multiple student. @entity public class college { @id @generatedvalue private int collegeid; private string collegename; public int getcollegeid() { return collegeid; } public void setcollegeid(int collegeid) { this.collegeid = collegeid; } public string getcollegename() { return collegename; } public void setcollegename(string collegename) { this.collegename = collegename; } } @entity public class student { @id @generatedvalue private int studentid; private string studentname; @manytoone(cascade = cascadetype.all) private college college; public int getstudentid() { return studentid; } public void setstudentid(int studentid) { this.studentid = studentid; } public string getstudentname() { return studentname; } public void setstudentname(string studentname)