Posts

Showing posts from February, 2010

linux - Allow non-root user rw permission on nfs share -

linux - Allow non-root user rw permission on nfs share - i have 2 linux machines running. 1 jenkins server , other lamp server (downloaded turnkey linux). need allow jenkins user on jenkins server read/write permission share on lamp server using nfs. using root user on jenkins server works fine, when run through jenkins, permission denied error when trying re-create or delete files lamp server. have tried many things, go on fail. how need configure nfs allow jenkins user on jenkins server read/write/delete nfs share on lamp server? below current config information: jenkins: 192.168.100.143 lamp: 192.168.100.145 lamp - /etc/exports /var/www 192.168.100.143(rw,anonuid=33,anongid=33) lamp - /etc/passwd www-data:x:33:33:www-data:/var/www:/bin/sh root@lamp /var/www# ls -la total 32 drwxr-xr-x 6 www-data www-data 4096 oct 4 06:12 . drwxr-xr-x 13 root root 4096 oct 15 2013 .. drwxr-xr-x 2 www-data www-data 4096 oct 15 2013 cgi-bin drwxr-xr-x 2 www-data

php - Creating new PhpMyAdmin USER for MySQL Database. ERROR -

php - Creating new PhpMyAdmin USER for MySQL Database. ERROR - i using xampp v3.2.1 , working on school project online system. since new web development, don't have slightest hint on how things. created new user in phpmyadmin, named "administrator" , entered password it. , saved. created new mysql database , tried connect simple php file. used line in connecting. $con=mysqli_connect("localhost","administrator","r00tadmin###","mjca_db"); and getting error. warning: mysqli_connect(): (hy000/1045): access denied user 'administrator'@'localhost' (using password: yes) in c:\xampp\htdocs\skyengine\system\index.php on line 3 failed connect mysql: access denied user 'administrator'@'localhost' (using password: yes) i have no thought of do, tried searching on google dont know right syntax. hope can help me out. thanks i think username "administrator" precated word,

php - Laravel 4 User Authorization and Views -

php - Laravel 4 User Authorization and Views - so working on website, writing using laravel , semantic ui. part of site, users can log in page , 1 time logged in should correctly redirected whatever page on. however, 1 time logged in, part of ui should alter show logged in, opposed showing login button. is there easy way this? various answers have seen here rely on having multiple blade templates, 1 users not logged in , user are. ideally, prefer have single blade template (called master) override section of when user correctly authenticated. ideally, logic not tied specific controller or route. then may utilize in master layout: @if(auth::check()) {{ 'user logged in, show logout button' }} @else {{ 'user not logged in, show login button' }} @endif php authentication laravel-4 blade

java - code not exiting outer for loop -

java - code not exiting outer for loop - my code isn't exiting outer loop when come end of string , cannot figure out why. understanding, outer loop should stop after 4th iteration. instead, continues , errors out @ string inputstring = input.next(); because there nil there. here code: public class exercise17 { public static void main(string[] args) { string string = "i think, hence am"; vowelcount(string); } public static void vowelcount(string s) { scanner input = new scanner(s); int[] vowelarray = new int[5]; int acount = 0, ecount = 0, icount = 0, ocount = 0, ucount = 0; for(int = 0; < s.trim().length() - 1; i++) { string inputstring = input.next(); system.out.println(inputstring); for(int j = 0; j < inputstring.length(); j++) { char c = inputstring.charat(j); system.out.println(c); if(c == 'a&

php - I want to select a table from a database and show in a drop down list -

php - I want to select a table from a database and show in a drop down list - i wanted select table specific database , list of tables appear in alternative tag under select tag. thanks lot. current code: <?php include 'database/connectdatabase.php'; if(isset($_post['select_db'])) { $select_db = $_post['select_db']; $selectdb_query = 'show tables $select_db'; $query_select = mysql_query($selectdb_query,$connectdatabase); if(!$query_select) { echo 'no table selected!'; } ?> <form method="post" action="selecttable.php" autocomplete="off"> <select name="select_db"> <option selected="selected">select database</option> <option>section_masterfile</option> </select> </form> <form method="post" action="#" autocomplete="off"> <?php while ($row = mysql_fetch_row($q

python - TypeError: 'str' object is not callable error -

python - TypeError: 'str' object is not callable error - i'm getting error , don't understand why! ideas anyone? typeerror: 'str' object not callable here code. import math lib import * test import * hostcal = (int((200 * 0.7) / 10)) basically requirement want convert float value integer. when execute .py file works fine when imported .py file robot getting above error. either lib module or test module contains binding of name int string value. (moral of story: avoid from <module> import * !) python robot

Simulation in verilog using $monitor -

Simulation in verilog using $monitor - i've been trying implement total adder in verilog. have implemented , showing results on isim. problem when seek see simulation using $monitor command, showing me 1 result, not simulation results. here testbench code: module full_adder_s2_testbench; // inputs reg a; reg b; reg cin; // outputs wire sum; wire cout; // instantiate unit under test (uut) full_adder_s2 uut ( .a(a), .b(b), .cin(cin), .sum(sum), .cout(cout) ); integer i; initial begin // initialize inputs = 0; b = 0; cin = 0; // wait 100 ns global reset finish #100; end @ ( a, b, cin ) begin // generate truth table ( = 0; < 8; = + 1 ) // every 10 ns set a, b, , cin binary rep. of #10 {a, b, cin} = i; $monitor( "%d ns: + b + cin = %b + %b + %b = cout sum = %b %b",

eventhandler - Famo.us : Is there a way to clear an "emit" emitted by a view? -

eventhandler - Famo.us : Is there a way to clear an "emit" emitted by a view? - currently trying add together multiple functions single surface. hoping there similar "pipe" "unpipe" there "unemit"? you can removelistener rid of .on or .addlistener though event emitted no longer acted on. can delete sending emit , recreate without although don't see need to. if never fires 1 time again cares doesn't take lot of memory, why want gone? famo.us eventhandler

design - Why create nodes in their own method? -

design - Why create nodes in their own method? - i see lot of javafx code this: private button getbutton(){ button mybutton = new button("a button"); mybutton.setonaction... } private hbox toolbar(){ button file = new button("file"); button edit = new button("edit"); button props = new button("properties"); hbox toolbararea = new hbox(); toolbararea.getchildren().add(file, edit, props); } i'm interested in explanation of why done (which haven't found). the little method approach works net demo code rather using little methods define ui elements, alternatives are: a long method unless application trivial. fxml defined ui (usually preferred non-trivial examples, verbose , unnecessary little demonstrations). separate enclosing objects , classes (sometimes overkill if aggregation of existing controls required). small methods decrease dependencies on pre-declared object

dropbox - HTML file name having garbage characters -

dropbox - HTML file name having garbage characters - i have been shared link of html file. user_profile.html dropbox. to naked eye file name seems user_profile.html in editor user_profile<200f>.html . in dropbox folder file appending charaters in file url. file:///home/mohan/dropbox/user/management/retain_classes%e2%80%8f.html. what possible issue? u+200f , or e2 80 8f invisible unicode character called “right-to-left mark”, or “rtl mark”. used alter text direction within text, able mix language written right left, language written left right. usage example: <code>stack overflow called &rlm;سرریز پشته&lrm; in arabic</code> gives: stack overflow called ‏سرریز پشته‎ in arabic even though can't see character, should able rename file , delete rtl mark (rename file , seek moving cursor left , right keyboard arrows. see how cursor stops extra, 0 width character). also, i'm flagging off topic, has nil programming.

ReST url path parameter naming conventions -

ReST url path parameter naming conventions - are there naming conventions generic parameter names in rest url? in illustration want address of section based on section id or organisation id under section coming under. so url path parameter name deptororgid - valid based on naming conventions or should utilize generic name sectionid or officeid or represent both section id organisation id ? thanks. check section resource uri examples of naming convention tutorial. hope answer. also, book defines 3 basic rules url design deed great starting point: • utilize path variables encode hierarchy: /parent/child • set punctuation characters in path variables avoid implying hierarchy none exists: /parent/child1;child2 • utilize query variables imply inputs algorithm, example: /search?q=jellyfish&start=20 other guidelines include: • uris should ideally not alter on time. • services offering uniquely identifiable resource via k

javascript - Visually show Angular scope changes when made programmatically -

javascript - Visually show Angular scope changes when made programmatically - is there way visually show when scoped input value changed programmatically? i have several input fields bound various ng-model values, , these values alter outside user's control. (the alter tied button in illustration below simplicity.) when values change, want input alter color or show kind of visual cue create obvious value isn't same sec ago. if there 1 field, done watch , adding css relevant input. however, in production there hundreds of values, don't have mapping of values shown in inputs, , if did, many inputs generated repeaters, hand coding countless watches out. i hoping jquery highlight effect (http://api.jqueryui.com/highlight-effect/) @ point, i'd interested in visual alter @ see if can create work need. sample fiddle here: http://jsfiddle.net/cdnaa8ew/1/ class="snippet-code-js lang-js prettyprint-override"> angular.module('changesam

Nexus 7 2013 with Android L camera issue: onPreviewFrame not called -

Nexus 7 2013 with Android L camera issue: onPreviewFrame not called - i have basic photographic camera initialization code gets me preview on acer a500 (android 3.1) , ainol novo 9 (android 4.1.1). i've bought nexus 7 2013, installed android l preview onto it, , found out camera-related code no longer works. photographic camera initialized successfully, no exceptions beingness thrown, including startpreview() call. however, onpreviewframe not beingness called @ all. reason? could because have dummy surfaceview that's not displayed anywhere? private surfaceview m_surfaceview = new surfaceview(cameratestapplication.instance().getapplicationcontext()); private surfaceholder m_surfaceholder = m_surfaceview.getholder(); void initcamera() { m_openedcamera = camera.open(0); ... m_openedcamera.setpreviewdisplay(m_surfaceholder); m_openedcamera.setpreviewcallback(this); openedcamera.startpreview(); ... } fixed problem. was, in fact, related a

Azure WebJob Schedule Error - ETAG -

Azure WebJob Schedule Error - ETAG - trying publish webjob visual studio 2013, i'm getting next error in output window: error 14 error occurred while creating webjob schedule: badrequest: status specified etag not satisfied. the job beingness published "on demand" type instead of "scheduled". ideas? i'm 1 of programme managers on product , feature in vs of import me i'd help work through this. chance, code available effort repro of error you're seeing? azure azure-webjobs azure-webjobssdk

c# - AWS Elastic Transcoder Endpoint cannot be resolved -

c# - AWS Elastic Transcoder Endpoint cannot be resolved - i'm working on project requires video transcoded , thumbnails extracted through utilize of aws elastic transcoder. have followed api best of abilities , have seems me right code. however, still error nameresolutionfailure thrown , inner exception saying the remote name not resolved: 'elastictranscoder.us-west-2.amazonaws.com' my code is: var transcoder = new amazonelastictranscoderclient(constants.amazons3accesskey, constants.amazons3secretkey, regionendpoint.uswest2); var ji = new jobinput { aspectratio = "auto", container = "mov", framerate = "auto", interlaced = "auto", resolution = "auto", key = filename }; var output = new createjoboutput { thumbnailpattern = filenam

jquery - Javascript Menu Setting Class to Active -

jquery - Javascript Menu Setting Class to Active - i got javascript, html , css few days ago, i'm quite new it.... anyway, i'm trying create vertical menu twitter's bootstrap. i've managed create menu fine, want create when click on button on menu, create button have "active" class, tried best it, works, if select menu options in order, here code , if can help me prepare up, that'd great! class="snippet-code-html lang-html prettyprint-override"> <!doctype html> <html> <head> <link rel="stylesheet" href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/bootstrap.css"> <link rel="stylesheet" href="stylehelp.css"> <link href="http://s3.amazonaws.com/codecademy-content/courses/ltp/css/shift.css" rel="stylesheet"> <link href='http://fonts.googleapis.com/css?family=indie+flower' rel='stylesheet' t

label - Adding a-axis with live editor of amcharts -

label - Adding a-axis with live editor of amcharts - i have simple question unfortunately not find related problem. i want know how can add together x-axis or y-axis label in live editor of amcharts? default, y-axis shown live editor of chart. tried utilize 'value axes' menu on left created label overlapped existing y-axis label rather appear on x-axis. also, not alter position of axis label through 'position' property of 'value axes'. please help. mushi for x axis - select "categoryaxis" , come in "title" in "general settings". similar value axis - select value axis in menu , come in title in general settings. label axis amcharts

c++ - Huffman's Data compression filltable and invert code problems -

c++ - Huffman's Data compression filltable and invert code problems - i began learning huffman's info compression algorithm , need help on next function > filltable() , invertcode() i don't understand why codetable array needed. while (n>0){ re-create = re-create * 10 + n %10; n /= 10; } please help me understand going on part of function , why if n larger 0 divided 10 because alway going greater 0 no matter how many times divided it. link code: http://www.programminglogic.com/implementing-huffman-coding-in-c/ void filltable(int codetable[], node *tree, int code){ if (tree->letter<27) codetable[(int)tree->letter] = code; else{ filltable(codetable, tree->left, code*10+1); filltable(codetable, tree->right, code*10+2); } return; } void invertcodes(int codetable[],int codetable2[]){ int i, n, copy; (i=0;i<27;i++){ n = codetable[i]; re-create = 0; whi

Finding the range and averaging the corresponding elements in R -

Finding the range and averaging the corresponding elements in R - i have different range of numbers (or coordinates) in 1 dataset , want find suitable range of numbers , take average of corresponding scores. lets dataset is: coordinate score 1000 1.1 1001 1.2 1002 1.1 1003 1.4 1006 1.8 1007 1.9 1010 0.5 1011 1.1 1012 1.0 i should find proper boundary (when coordinate not consecutive) , calculate mean each particular range. my desired result: start end mean-score 1000 1003 1.2 1006 1007 1.85 1010 1012 0.86 try (assuming df info set) library(data.table) setdt(df)[, indx := .grp, = list(cumsum(c(1, diff(coordinate)) - 1))] df[, list(start = coordinate[1], end = coordinate[.n], mean_score = round(mean(score), 2)), = indx] # indx start end mean_score # 1: 1 1000 1003 1.20 # 2: 2 1006 1007 1.85 # 3: 3 1010 1012 0.87 or using dplyr

insertion sort - Difference using lists -

insertion sort - Difference using lists - which difference of construction of insertion sort using arrays , using linked lists. to implement insertion sorst lists utilize algorithm arrays , alter commands a(k)=a(k+1) ? are there more differences? there no other difference. the array elements accessed incrementing index, whereas list elements accessed traversing next node. based on programming language, syntax might vary. list insertion-sort

c# - How to disable mscorlib.dll from within visual studio 2013? -

c# - How to disable mscorlib.dll from within visual studio 2013? - i trying utilize custom standard library in visual studio 2013 , can't seem figure out. have no problems compiling on command line using /nostdlib although able take advantage of intellisense in ide. have removed references except custom corelib , getting conflicting code errors due having 2 variations of mscorlib. the vs documentation says: to set compiler alternative in visual studio development environment open properties page project. click build properties page. click advanced button. modify not reference mscorlib.dll property. although not seem case, alternative not exist. know how can disable mscorlib.dll in vs2013? this old question, but, indeed - while ui alternative has disappeared (or moved) , documentation remains misleading day, can still replicate effect adding <nostdlib>true</nostdlib> .csproj near other options found in advanced settings: <project toolsversi

Open outlook's new email dialog with prefilled information from powershell -

Open outlook's new email dialog with prefilled information from powershell - i'm trying write powershell script (which run periodicaly) opening new email windows of outlook "to", "subject" , "body" filled data. i found way send mails powershell have send powershell. doesn't fit need because have edit body of mail. $outlook = new-object -comobject outlook.application $mail = $outlook.createitem(0) $mail.to = "random.dude@email.com" $mail.subject = "data subject" $mail.body ="example of body..." $mail.send() basicaly need $mail.show() wich open new e-mail popup info pre-filled powershell not requirement, seams able manipulate outlook tried it. thanks this thread, $mail.show() $mail.display() email powershell outlook

sql server 2008 Error converting data type nvarchar to datetime -

sql server 2008 Error converting data type nvarchar to datetime - i have stored procedure follows: use [cheminova] go /****** object: storedprocedure [dbo].[sp_firstdistil] script date: 10/30/2014 11:55:31 ******/ set ansi_nulls on go set quoted_identifier on go -- ============================================= -- author: <author,,pragya> -- create date: <create date,,> -- description: <description,,> -- ============================================= alter procedure [dbo].[sp_firstdistil] -- add together parameters stored procedure here -- @startdate varchar(50)=null, --@enddate varchar(50)=null @sdate datetime begin -- set nocount on added prevent result sets -- interfering select statements. set nocount on; -- insert statements procedure here declare @startdate varchar(50) declare @enddate varchar(50) set @enddate=convert(varchar,datepart(month,@sdate))+'/'+convert(varchar,datepart(day,@sd

Scrapy - spider with AJAX pagination -

Scrapy - spider with AJAX pagination - been going through many related questions without finding clear reply mutual scraping question. i trying scrape typical real estate site. (start_url = http://www.metrocuadrado.com/web/buscarfiltros/bogota-apartamento-venta). sixteen ads per (list) page. next (list) page shows next 16 ads, , gets content through ajax (pressing "next page" button). the detailed item-info need obtained on specific advertisement page, 1 level deeper, next links ads. info url-based, not ajax. i've been trying figure out solution crawlspider , selenium, confused how combine rules , callbacks. advice (a general structure) welcome ! ajax scrapy

ios - Using embedded framework in Xcode 6.1 results in app crashing with mapped file has no team identifier -

ios - Using embedded framework in Xcode 6.1 results in app crashing with mapped file has no team identifier - we created framework utilize our ios projects. in general tab can see embedded binary. in build phases tab shows embedded framework: after archiving project , installing ipa file on device , launching app see next error in device console: [deny-mmap] mapped file has no team identifier , not platform binary: /private/var/mobile/containers/bundle/application/ce2542e1-355a-4a45-ac97-08a2330b45e5/policy pal.app/frameworks/mtkit.framework/mtkit please help! haven't seen come across problem before. we seeing too. according this blog need revoke , re-generate certificate , mobile provisioning file. haven't tried yet, symptoms same. edit: our build-meister did few weeks ago , indeed prepare problem. ios xcode frameworks

mysql - PHP Search Result Split Into Pages -

mysql - PHP Search Result Split Into Pages - i creating search engine website in want search result split pages navigation. here php code <?php if (isset($_get['search'])){ $search = $_get['search']; $query = "select * search keywords '%$search%' or title '%$search%' order keywords limit 0, 30 "; // connect mysql_connect("localhost","root","") or die("could not connect"); mysql_select_db("search") or die("could not find db"); $query = mysql_query($query); $numrrows = mysql_num_rows($query); if ($numrrows > 0) { echo "$numrrows result found searching <b>$search </br> "; while ($row = mysql_fetch_assoc($query)) { $id = $row['id']; $title = $row['title']; $description = $row['description']; $keywords = $row['keywords'];

Double Dimensional Array in Javascript Returning Undefined Array -

Double Dimensional Array in Javascript Returning Undefined Array - this question has reply here: javascript 2 dimensional arrays [duplicate] 6 answers i have searched alot , cannot clear reply problem. var rowcount = 3; var mycounter = 0; var mynewarray = new array(); (var = 1; < rowcount; i++) { seek { mynewarray[mycounter][0] = i; mynewarray[mycounter][1] = i; mycounter = mycounter + 1; } grab (err) { alert(err.message); } } it giving , exception saying mynewarray[mycounter] undefined. thought why? have seen other post , have shown declare array or new array([]). nil working. need help, in advance give thanks you. currently mynewarray array elements trying access in not yet exist (undefined) need set these elements arrays var rowcount = 3; var mycounter = 0;

using for loop in GA in matlab -

using for loop in GA in matlab - i using ga in matlab solve optimization problem, objective function minimize cost variable v, function b = cost (v) load ('data.mat'); c1=0; = 1:n j=1:1 c1 = c1 + c(i,j)*v(i,j); end end b=c1; and constraint const function [z] = const(v) load ('data1.mat'); z1=1; i=1:n j=1:1 a(i,j) = (1-v(i,j))*t(i,j); z(i,j) = ((a(i,j)+t1)/y(i,j))/(a(i,j)/y(i,j)); end z1 = z1 * z(i,j); end z=[0.7-z1]; zeq=[]; using code ga lb=zeros(n,1); ub=ones(n,1); intcon = u; options = gaoptimset('plotfcns',{@gaplotbestf,@gaplotmaxconstr},'display','iter'); [v, fval] = ga(@cost,n,[],[],[],[],lb,ub,@const,intcon,options); where u=[1 2 3 4...n] i have saved required info in data1.mat file. i want create objective function , constraint both generalized, otherwise have write r , a , c value n number of times. problem when run it, gives message %error using ga (line 3

reference - What does &variable as a expression mean in c -

reference - What does &variable as a expression mean in c - this snippet of programme code : char authenticated = 0; char guard1 = 234; char guard2 = 234; //more variables initliased... char buf[128]; &authenticated; &guard1; &guard2; so mean when reference stands there single look in programme code? edit: more context : it's compiled gcc on debian server , it's related security project, can overflow buf array. given security project, guess these statements designed prevent compiler optimizing away authenticated , guard1 , , guard2 variables. if these variables aren't used later on in function, compliant c compiler optimize them away, changing layout of stack frame function call. technically speaking, since these statements have no side-effects, compiler in principle optimize them away well. however, sense intended compiler doesn't (not couldn't it, can't it). way, layout of stack frame have authenticated varia

listview - Correct play/stop mediaplayer android -

listview - Correct play/stop mediaplayer android - i have list view , mediaplayer utilize play sounds based on row position (like soundboard). problem when sound playing, , row clicked (different position in list view), stop sound , start new sound. code, works fine on play/stop on same row, not on different rows. how can prepare that? public void playsound(int pos){ if(isplaying && mmediaplayer.isplaying()){ mmediaplayer.stop(); mmediaplayer.release(); mmediaplayer = null; play.setimagedrawable(context.getresources().getdrawable(r.drawable.play)); play.invalidate(); isplaying = false; } else{ mmediaplayer = mediaplayer.create(context, songs[pos]); mmediaplayer.start(); isplaying = true; play.setimagedrawable(context.getresources().getdrawable(r.drawable.stop)); play.invalidate(); mmediaplayer.setoncompletionlistener(new onco

Issue with my Gradle script: Could not find property 'groovy' on source set -

Issue with my Gradle script: Could not find property 'groovy' on source set - i having problem gradle build script since added custom end2endtest task. here section of build script corresponding 1 of projects: project("bignibou-server") { description = "bignibou server" configurations { querydslapt } apply plugin: 'groovy' apply plugin: 'spring-boot' dependencies { compile project(":bignibou-client") //spring bootbignibou-server compile("org.springframework.boot:spring-boot-starter-actuator") compile("org.springframework.boot:spring-boot-starter-data-jpa") ... // testing testcompile("org.springframework.boot:spring-boot-starter-test") testcompile("org.springframework.security:spring-security-test:${springsecurityversion}") testcompile("org.mockito:mockito-core:${mockitoversion}&quo

How do adjacent parentheses in JavaScript functions work, and where is this documented? -

How do adjacent parentheses in JavaScript functions work, and where is this documented? - before flag duplicate, note: understand iife is. question not iife's. the question: why javascript able parse adjacent parentheses, in standard function call? how build - myfunction()() - work? example, here's bit of code test using jasmine: var element = compile('<div my-directive></div>')(scope); why go route rather passing scope sec argument? don't believe has keeping global environment clean, , can't find thing particular build anywhere, except concerns iife's. there name construct? most importantly, please provide sort of authoritative reference (link mdn, ecmascript spec, etc). this result of 2 rules: the homecoming value of function calls may used (no need assign variable). functions objects (they can assigned variables, passed arguments , returned function calls). the first rule means if have code this: function (

mongodb - Call stored procedure/function with PHP in Mongo DB sharded cluster -

mongodb - Call stored procedure/function with PHP in Mongo DB sharded cluster - i using mongodb 2.6 2 shard clusters config. want phone call function datastats() create , store in mongodb. php script: $client = new mongo(); $db = $client->mydata; $db->system->js->save(array("_id"=>"datastats", "value"=>new mongocode("function() { ... }"))); $db->execute("datastats()"); this code gives me error: 'err' => 'error: can\'t utilize sharded collection db.eval', 'code' => 16722 the reason $db->execute method using mongo db.eval command not supported sharded collections. there workaround issue? how can phone call stored procedure in sharded mongodb php? there's no workaround. db.eval doesn't work sharded collections. should avoid using if @ possible, anyway. php mongodb sharding

java - Iterating over an Array to find a string value -

java - Iterating over an Array to find a string value - public void addsampledata(){ userlist.add(new user("n45","sfdsf","sfgfsg")); i want iterate through array , able identify , remove object based on string value i.e "sfdsf" rather position in arraylist. you can iterate on array using for loop (either basic 1 or enhanced loop): for (user user : userlist) { // whatever want on item in current iterator position } if want identify object , potentially compare other objects, have override equals , hashcode methods. (better on subject on this link) if considering field mentioned, sfdsf, user identifier, can utilize instance variable in comparison; e.g: for (int = 0; < userlist.size(); i++) { if ("sfdsf".equals(user.getyourfield())) { // note getyourfield refers subject field accessor userlist.remove(i); // remove item if matches criteria } } java

android - How to place my Actionbar item to the left side, before title? -

android - How to place my Actionbar item to the left side, before title? - how move actionbar item left side of actionbar, before title? have 2 items, edit , settings, need items placed both on right , left side, places default on right, how can alter it? in activity actionbar actionbar = getactionbar(); actionbar.setdisplayshowhomeenabled(false); view mactionbarview = getlayoutinflater().inflate(r.layout.my_action_bar, null); actionbar.setcustomview(mactionbarview); actionbar.setdisplayoptions(actionbar.display_show_custom); my_action_bar.xml: <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:background="@color/turquoise"> <imagebutton android:id="@+id/btn_slide" android:layout_height="wrap_content" android:layout_width="wrap_content"

c# - RegEx split/tokenize string when character within the string changes -

c# - RegEx split/tokenize string when character within the string changes - racking brain on one. have string e.g. mon-123abc/456 78#abcd what want array or list follows [0] = mon [1] = - [2] = 123 [3] = abc [4] = / [5] = 456 [6] = ' ' (space character between 6 , 7 in illustration string) [7] = 78 [8] = # [9] = [10] = b [11] = c [12] = d i want split string input when there transition 1 type of character (alpha, numeric, non-alpha/numeric, upper case lower case) another either regexp or c# code do. i've got simple regex 0+|(?<=([1-9]))(?=[1-9])(?!\1) splits on numeric, regex not good. i've played c# code loop thro' string have problem transition between character types. example 2: illustration input string maybe 123qaz zbc/45678#ab-cd it's spiting on each transition not position that's key. in illustration 2 there 2 spaces between z , z way. mentioned it's transition between types that's key. here's solution do

jquery - 0x8000ffff JavaScript runtime error Unexpected call to method or property access -

jquery - 0x8000ffff JavaScript runtime error Unexpected call to method or property access - every time when seek run code in visual studio above error. not sure going on. know it's question this, did not see error in answered in solutions problem. can help me this? // display lightbox function lightbox() { var insertcontent = "<div id='chartcon'>test</div>"; // jquery wrapper (optional, compatibility only) (function ($) { // add together lightbox/shadow <div/>'s if not added if ($('#lightbox').size() == 0) { var thelightbox = $('<div id="lightbox" class="highcharts-container"/>'); var theshadow = $('<div id="lightbox-shadow"/>'); $(theshadow).click(function (e) { closelightbox(); }); $('body').append(theshadow); $('body').append(theli

objective c - I'm trying to send requests to servers -

objective c - I'm trying to send requests to servers - nsstring *url =[nsstring stringwithformat:@"http://cvidyasharam.physicscafe.in/loginmobile.php?email=%@ password=%@",username.text,password.text]; equest = [nsmutableurlrequest requestwithurl:[nsurl urlwithstring:url] cachepolicy:nsurlrequestreloadignoringlocalcachedata timeoutinterval:10.0]; nsurlconnection *conn = [[nsurlconnection alloc] initwithrequest:request delegate:self]; if (conn) { nsurlresponse *response; nserror *err; responsedata = [nsurlconnection sendsynchronousrequest:request returningresponse:&response error:&err]; } if ([responsedata isequal:@"yes"]){ [self performseguewithidentifier:@"condition" sender:nil]; login = @1; } else{ uialertview *alert= [[uialertview alloc]initwithtitle:@"incorrect combo" message:@"intruder alert" delegate:self cancelbuttontitle:@"cancel" otherbuttontitles: nil]; [alert show];

android - Device isn't compatible with this version - LG P705 -

android - Device isn't compatible with this version - LG P705 - firstly, appreciate there several questions asked topic, i'm looking reply why device isn't able download app (its in beta version) here permissions manifest file: <uses-permission android:name="android.permission.access_fine_location" /> <uses-permission android:name="android.permission.access_coarse_location" /> <uses-permission android:name="android.permission.internet" /> <uses-permission android:name="android.permission.write_external_storage" /> <uses-feature android:name="android.hardware.camera" /> <uses-sdk android:minsdkversion="3"/> and here screenshot showing features of phone: i believe app should available download on device has camera, , has gps, email etc - features app uses. however, person owns device isn't able download app pay store beta testing. can see

javascript - Angular binding for loading doesn't update the HTML -

javascript - Angular binding for loading doesn't update the HTML - i trying show loading indicator whenever user clicks save button. when button clicked, state changes successfully, reverting value of loading property on scope false state doesn't update ui. is i'm doing wrong scope properties, or flaw angular? here's jsbin: http://jsbin.com/xafexorope/2/edit?html,output the reason why doesnt work because angular's internal dirty-checking loop not fired. it's because utilize standard settimeout. instead of that, either manually phone call $scope.$apply() @ end of settimeout callback, or better, utilize angular wrapper $timeout. here updated jsbin: http://jsbin.com/devuhovaxa/3/edit additionally here docs $timeout: https://docs.angularjs.org/api/ng/service/$timeout javascript angularjs

javascript - incorrect web service method URL -

javascript - incorrect web service method URL - i've built simple web method in webservice1.asmx checks strength of password. i'm trying method work javascript on string in html input field. [webmethod] [scriptmethod(usehttpget = true, responseformat = responseformat.xml)] public string passwordcheck(string str) { bool flag1 = false; bool flag2 = false; int k = 0; while ((flag1 == false || flag2 == false) && k < str.length) { if ((str[k] <= 'z' && str[k] >= 'a') || (str[k] <= 'z' && str[k] >= 'a')) flag1 = true; else if (char.getnumericvalue(str[k]) <= 9 && char.getnumericvalue(str[k]) >= 0) flag2 = true; k++; } if (flag1 && flag2) homecoming "strong"; else homecoming "weak"; } and here's javascript section: < script type = "text/javascript" > var httpreq = new xmlhttprequest();

python - fit multiple parametric curves with scipy -

python - fit multiple parametric curves with scipy - i have set (at to the lowest degree 3) of curves (xy-data). each curve parameters e , t constant different. i'm searching coefficients a,n , m best fit on curves. y= x/e + (a/n+1)*t^(n+1)*x^m i tried curve_fit, have no thought how parameters e , t function f (see curve_fit documetation). furthermore i'm not sure if understand xdata correctly. doc says: m-length sequence or (k,m)-shaped array functions k predictors. what's predictor? ydata has 1 dimension can't feed multiple curves routine. so curve_fit might wrong approach don't know magic words search right one. can't first 1 dealing problem. any help appreciated. j. one way utilize scipy.optimize.leastsq instead ( curve_fit convenience wrapper around leastsq ). stack x info in 1 dimension; ditto y data. lengths of 3 individual datasets don't matter; let's phone call them n1 , n2 , n3 , new x , y have shape (n1+n2+n

c - Read in a paragraph witht getchar() and print it with a loop and putchar() -

c - Read in a paragraph witht getchar() and print it with a loop and putchar() - i have been working on while , wondering if possible read in paragraph getchar() , print putchar(). know there improve methods read in , print out paragraph, messing around c , curious, here have far: #include <stdio.h> int main() { int c; printf( "enter value:"); { (int i=0; i<10000; i++) { c = getchar( ); putchar( c ); } printf("\nthank you"); printf("\n"); } homecoming 0; } my desired output be: enter in value/paragraph: your entered value is: i guess wanted capture whole paragraph altogether. need stop when press enter. here detail: getchar() wait come in anyway, , during time, ever typed, stored in buffer , shown on screen @ same time. after press enter, getchar() stops wait, , homecoming 1 char @ time can print them putchar . /* ge

Number of sessions in Symfony2 -

Number of sessions in Symfony2 - i using symfony 2. session created symfony2 whenever user login successful. is there way count of active session? do have write code information? there no way in symfony2 this. have build custom logic this. symfony2

c# - String or binary data would be truncated. The statement has been terminated?8 -

c# - String or binary data would be truncated. The statement has been terminated?8 - i trying save image file on db in binary format. using info set write insert query. beginner don't know how utilize these things. while using given below code errors. are: string or binary info truncated. statement has been terminated please help me. code: protected void btnsubmit_click(object sender, eventargs e) { dataset1tableadapters.tbl_emptableadapter adp1; adp1 = new dataset1tableadapters.tbl_emptableadapter(); adp1.getinsert(txtempname.text,fileupload1); } source: <asp:textbox id="txtempname" runat="server"></asp:textbox> &#10038</td> <asp:fileupload id="fileupload1" runat="server" /> <asp:button id="btnsubmit" runat="server" text="submit" onclick="btnsubmit_click" /> insert query: insert tbl_emp (empname, emppic) v

c# - Working state restore -

c# - Working state restore - when computer rebooted windows update, working state of microsoft software(like word, visual studio, outlook ....) restored when computer after rebooting. windows provide these apis implement feature? or how can implement feature in c# windows form program? thanks! edit if open word file, , computer rebooted windows update. and, word file reopen after computer rebooted. how can tell windows programme should reopened after computer reboot caused windows update? c# winforms windows-update

java - Referring path variable in jsp Spring framework -

java - Referring path variable in jsp Spring framework - i pass couple of objects "studentdetails" , string-"dept" jsp. question- how refer studentdetail.st.fname in jsp file? ie; need refer firstname pupil object. i tried , failing - <form:label path="s.studentdetail.st.fname" class="labels">first name</form:label> , <form:label path="studentdetail.st.fname" class="labels">first name</form:label> @requestmapping(value = "/student", method = requestmethod.get) public modelandview student() { map<string, object> model = new hashmap<string, object>(); model.put("studentdetail", new studentdetails()); model.put("department", "dept"); homecoming new modelandview("student", "s", model); } studentdetails: public class studentdetails { public contactinfo getci() { h