Posts

Showing posts from August, 2013

html - Insert data from form into MYSQL using Node JS -

i trying inserting data mysql using node , express framework html form. code form : <html> <head> <title>personal information</title> </head> <body> <div id="info"> <h1>personal information</h1> <form action="/myaction" method="post"> <label for="name">name:</label> <input type="text" id="name" name="name" placeholder="enter full name" /> <br><br> <label for="email">email:</label> <input type="email" id="email" name="email" placeholder="enter email address" /> <br><br> <label for="city">city:</label> <input type="text" id="city" name="city" placeholder="enter city" /> <br><br> <label for=&

javascript - How can I run a lot of functions in sequence? -

maybe question duplicate. found lot of similar questions, no 1 can solve problem. task: function animate(){ $ul.each(function(){ $(this).find('li').each(function(){ //animate block $(this).animate({top:'-100%'},100,function(){ $(this).css({top:'100%'}); }); //endblock }); }); } as may know, 'animate block' functions run @ same time. want them run in sequence. how can achieve that? i have read jquery 'deferred', 'q' relate article, still confusing. sorry english. ---------addition------ if want run animate function several times, should do? if want avoid jquery's awkward .queue() / .dequeue() , can build promise chain jquery collection of <li> elements. function animate($ul) { var p = $.when(); //resolved starter promise $("li", $ul).each(function(i, li) { p = p.then(function() { return $(li).

EnsureUser using email address in SharePoint client object model -

i need update fielduservalue field in sharepoint 2013. given email address data. can't user ensureuser since accepts logonname. used fromuser method gives me error says "the user not exist or not unique" fielduservalue user = fielduservalue.fromuser(email); it worked when tried using email address when use email addresses in data results in error. how fix issue? you resolve user email address using utility.resolveprincipal method , example: var result = microsoft.sharepoint.client.utilities.utility.resolveprincipal(ctx, ctx.web, emailaddress,microsoft.sharepoint.client.utilities.principaltype.user,microsoft.sharepoint.client.utilities.principalsource.all, null, true); ctx.executequery(); if (result != null) { var user = ctx.web.ensureuser(result.value.loginname); ctx.load(user); ctx.executequery(); } references get user identity , properties in sharepoint 2013

c# - Handle position of other pages when SplitView pane is open -

i trying implement splitview in app.but when ii set ispaneopen = true; pivots not moving right of split view pane.insted splitview pane opens on pivotitems. please me resolve this. in advance. my main page: <page x:class="splitview.mainpage" xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:local="using:splitview" xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:ignorable="d"> <grid background="{themeresource applicationpagebackgroundthemebrush}"> <relativepanel x:name="myrelativepanel"> <pivot x:name="mypivot" relativepanel.alignrightwith="spv">

dynamics crm - Removing fields from flyout in CRM 2015 OOB entity -

Image
i customizing contact entity (oob) in crm 2015. 1 of attributes of entity address, composite attribute built using following street1 city state/province i remove city field flyout alltogether. how can achieve ? even though, there no supported way control (hopefully microsoft might make available in future release) little tweak did trick me overcome challenge. i created business rule ho hide default fields (city, state , country) form. wrote business rule without specifying conditions means load/work time. consequently, effect of business rule fields got hidden flyout menu well. changed display name of address composite field street , made visible, included rest 3 new lookup under same section. finally requirement got fulfilled able use composite field capture 4-fields (street1, street2, street3 , zip code) , use individual lookups city, state , country. link: https://ashwaniashwin.wordpress.com/2014/03/24/update-change-address-composite-field-in

How to make Bootstrap buttons in separate forms inline (horizontally aligned)? -

i'm trying following bootstrap buttons on same horizontal line: <a class="btn btn-success btn-lg checkout" href="/foo/buy"> <i class="glyphicon glyphicon-shopping-cart"></i> $50.00 </a> <form action="/subscriptions" accept-charset="utf-8" method="post"> <div class="btn-group"> <button class="btn btn-default btn-lg" type="submit"> <i class="glyphicon glyphicon-eye-open"></i> watch </button> <a class="btn btn-default btn-lg" href="/foo/watchers"> <span>1</span> </a> </div> </form> <form action="/wishlists" accept-charset="utf-8" method="post"> <div class="btn-group"> <button class="btn btn-default btn-lg" type="submit"> <i class="glyp

javascript - Jquery ajax on IE11 -

i have problem here. use jquery ajax send request end server , return clue notice if request proceed or not. had try in ie8 , ie7, jquery ajax works well, when try on ie11, error few times, , work after that. question is, how make run on ie11 without have wait few times? this jquery ajax script var value = $("#record"+index).attr('value'); var hiddenamount = number ($("#hiddentotalamount").val()); var values=value.split('/'); var uncheckedamount = number(values[1]); var realamount = 0; var realrecord = number ($("#totalrecord").val()); var checkeddoc = $("#record"+index).val(); var datastring = "action=validatedocnum&holddocnum="+checkeddoc; if($("#record"+index).attr('checked')){ $.ajax({ type: "post", url: "executesp2d.do", data: datastring+"&act=check", cache: fa

How to extends Abstract Inner Class in java -

i confused if abstract class a{method();method2();} and other class b have inner class c class b{abstract class c{method(){//body}}} and question how extends class c b/c abstract class must extends else unused class. first, let's make simpler - has nothing android directly, , don't need a class @ all. here's want: class outer { abstract class inner { } } class child extends outer.inner { } that doesn't compile, because when create instance of child need provide instance of outer inner constructor: test.java:6: error: enclosing instance contains outer.inner required class child extends outer.inner { ^ 1 error there 2 options can fix this: if don't need refer implicit instance of outer inner , make inner static nested class instead: static abstract class inner { } you change child accept reference instance of outer , , use that call inner constructor, uses surprising syntax, works: child(outer outer) { // cal

Rotate compass in smooth way issue android -

this code use sensor class , other activity but want compass rotate in smooth way use bitmap image on canvas bitmap not rotate in smooth way public class compassview extends view { private int mwidth; private int mheight; private float position = 0; private bitmap mycompasspointer; public compassview(context context) { super(context); mycompasspointer=bitmapfactory.decoderesource(getresources(), r.drawable.pin_finder); } @override protected void ondraw(canvas canvas) { int cx = (mwidth - mycompasspointer.getwidth()) >> 1; int cy = (mheight - mycompasspointer.getheight()) >> 1; if (position > 0) { canvas.rotate(position, mwidth >> 1, mheight >> 1); } //it set bitmap cx,cy position canvas.drawbitmap(mycompasspointer, cx, cy, null); canvas.restore(); } public void updatedata(float position) { this.position = position; invalidate(); } protected void onmeasure(int widthmeasuresp

c# - Incorrect Website Mapping in local folder from TFS -

Image
somehow in tfs, in esqwire service solution website esqwireservice. host has been moved tfs path (in tfs folder structure showing correct) $/esqwire/dev/esqwireservice/esqwireservice/tests/esqwireservice. host but when latest version tfs, website esqwireservice. host showing under wrong path i.e c:\anitha_2\dev\esqwireservice\esqwireservice\esqwireservice. host i had removed mapping tfs on folder esqwireservice. host , after latest version, esqwireservice. host there in correct path in tfs. when try open solution, asks me "new projects added solution open? (because there dependent projects added) . when click ok esqwireservice. host moving wrong path i.e c:\anitha_2\dev\esqwireservice\esqwireservice\esqwireservice. host the correct path should same tfs path c:\anitha_2\dev\esqwireservice\esqwireservice\tests\esqwireservice. host you must edit work space definition on tfs. writing steps. step-1 => open team explorer on visiual studio. step-2 =&g

android - Different font for Some activities using Calligraphy Library -

i using calligraphy library using custom font in application. set custom font whole application default font using calligraphyconfig , in application class in #oncreate() method , working fine. problem comes when need change font of 1 activity (settingsactivity). i tried using custom font in style didn't change font of activity. following code of style <style name="englishactivitiestheme" parent="apptheme"> <item name="android:textviewstyle">@style/apptheme.widget.textview</item> </style> <style name="apptheme.widget.textview" parent="android:widget.holo.light.textview"> <item name="fontpath">fonts/roboto-regular.ttf</item> </style> in manifest <activity android:name=".settingsactivity" android:theme="@style/englishactivitiestheme" android:parentactivityname=".mainactivi

c# - What to use in the blank space in order to add the "x" variable from class A without creating another object of A? -

i have use this keyword in order add 3 values of x present in 3 classes. i not allowed create instance of class a in method m1 . class program { static void main(string[] args) { c c = new c(); int op = c.m1(); console.writeline(c.x); console.writeline(); } } public class { public int x = 10; } public class b:a { public int x = 100; } public class c:b { public int x = 1000; public int m1() { return (x + base.x + _____ ); //what use in blank space in order //add "x" variable class without //creating object of } } } cast current instance ( this ) a . can use ((a)this).x heres complete code of method, how define it public int m1() { return (x + ((b)this).x + ((a)this).x ); }

php - CGridView Pagination not working. Yii -

i have form in view selects columns dropdown list. sqldataprovider used data generated query i have been trying use cgridview sqldataprovider, working bit fine, still having issues pagination. don't have keyfield give first column, , without keyfield doesn't work. here action: public function actionindex() { $tables = yii::app()->db->schema->gettables(); if(isset($_post['yt0'])){ //if submitted $query = $this->generatequery(); $count=yii::app()->db->createcommand('select count(*) ( ' . $query . ' ) count')->queryscalar(); $dataprovider = new csqldataprovider($query, array( 'keyfield' => $firstcolumn, 'totalitemcount'=> $count, 'pagination'=> array( 'pagesize'=>20, ), )); $columns = $this->getcolumnnameswithouttable(); $this->render('index',

javascript - Required attribute on inputs in bootstrap is not working -

this question has answer here: defining `required` field in bootstrap 6 answers why required attribute on inputs in bootstrap not working? <input type = "text" id = "thisisatext" class= "form-control" required> use type,it work validator <form data-toggle="validator" role="form"> <div class="form-group"> <label for="inputname" class="control-label">name</label> <input type="text" class="form-control" id="inputname" placeholder="cina saffary" required> </div> <div class="form-group"> <label for="inputtwitter" class="control-label">twitter</label> <div class="input-group"> <span class="i

javascript - Get this of this -

(purely fictional!) how can descend() return 1,2,3...? obj = { val: 1, obj: { val: 2, obj: { val: 3, obj: { val: 4, descend: function() { return this.val; } } } } } obj.obj.obj.obj.descend();

google cloud datastore - gae ndb query failing to find related records with key property -

i'm trying implement code won't let entity deleted if has related entities. class father(ndb.model): name = ndb.stringproperty(indexed=true) class son(ndb.model): name = ndb.stringproperty(indexed=true) father = ndb.keyproperty(father) this code: father = father.get_by_id(long(keynumber)) if father: father_key = father.key if father_key: sons = son.query(son.father==father_key).fetch() number_of_sons = len(sons) if number_of_sons == 0: father_key.delete() when runs, sons empty list [] although there related sons father. why doesn't query work? as @patrick costello suggests, using strongly-consistent query right way handle this: class father(ndb.model): name = ndb.stringproperty(indexed=true) class son(ndb.model): name = ndb.stringproperty(indexed=true) @classmethod def create(cls, name, father): son = cls(name=name, parent=father) son.put() i recommend usin

vb.net - Concatenate 2 variables -

how can make code working? dim c integer = 0 icol = 0 reader.fieldcount dim col+c string = reader.getname(icol)) c = c + 1 next thanks you may use list<string> well: dim lst new list<string>(); icol = 0 reader.fieldcount - 1 lst.add(reader.getname(icol)); next

css - jQuery Overlay Image on HTML5 Video -

Image
i trying build small utility can start watching html5 video (not youtube - stream same server site hosted on), click in specific area of video, have pause , put small circle on video clicked. once occurs, small window pop user can comment indicating why clicked there (something wrong in video, etc.). the basic html structure this: <div id="videocontainer" style="margin-left: auto; margin-right: auto; height: 550px; width: 950px; background-color: #fff"> <video id="pcvideo" src="fvb0375.mov" style="margin-left: auto; margin-right: auto; height: 550px; width: 950px; display:inline;" preload="auto" controls></video> </div> the custom styling can ignored - center video on screen generic height/width won't used later. js on page (to handle when video clicked) this: $("#pcvideo").click(function(e) { //height , width of container var height = $(&qu

prolog - Minimum number of moves -

in page http://cseweb.ucsd.edu/classes/fa09/cse130/misc/prolog/goat_etc.html demonstrated how solve popular wolf, goat , cabbage puzzle. change(e,w). change(w,e). move([x, x,goat,cabbage], wolf,[y, y,goat,cabbage]) :- change(x,y). move([x,wolf, x,cabbage], goat,[y,wolf, y,cabbage]) :- change(x,y). move([x,wolf,goat, x],cabbage,[y,wolf,goat, y]) :- change(x,y). move([x,wolf,goat,cabbage],nothing,[y,wolf,goat,cabbage]) :- change(x,y). oneeq(x,x,_). oneeq(x,_,x). safe([man,wolf,goat,cabbage]) :- oneeq(man,goat, wolf), oneeq(man,goat,cabbage). solution([e,e,e,e],[]). solution(config,[firstmove|othermoves]) :- move(config,firstmove,nextconfig), safe(nextconfig), solution(nextconfig,othermoves). but in order find actual solution program necessary specify exact number of moves needed, this: ?- length(x,7), solution([w,w,w,w],x). x = [goat, nothing, wolf, goat, cabbage, nothing, goat] ; x = [goat, nothing

php - get rid of string in mysql dump -

i created script dump database, script working there dont it. the ( ' ), how dump tables without having remove in every column gets fetched? this part of script looks like: $query = $db->query("select * {$table}"); $numrows = mysqli_num_rows($query); if($numrows != 0) { $insert .= "insert {$table} ($fields) values \n"; while($row = $query->fetch_array()) { $insert .= "("; $comma = ''; foreach($field_list $field) { $row[$field] = preg_replace("#\'#", "", $row[$field]); $insert .= $comma."'".$db->real_escape_string($row[$field])."'"; $comma = ', '; } $insert .= "),\n"; } $insert = substr($insert, 0, -2);

Calling a dialog function from an action bar item crashes Android app -

i have action bar item click set: android:onclick="showdialog" so can call show dialog function works fine when called button on activity_main.xml not menu_main.xml. when enter code in menu_main.xml small informational warning, -- method "showdialog" in "mainactivity" has incorrect signature. as app opens up, instantly crashes fatal exception: dialog.com.dialogtry1 e/androidruntime﹕ fatal exception: main android.view.inflateexception: couldn't resolve menu item onclick handler showdialog in class dialog.com.dialogtry1.mainactivity here showdialog code in mainactivity: public void showdialog(view v){ fragmentmanager fmanager = getfragmentmanager(); dialog mydialog = new dialog(); mydialog.show(fmanager, "mydialog"); } here dialog class: public class dialog extends dialogfragment{ @nullable @override public view oncreateview(layoutinflater inflater, viewgroup contai

c++ - std::list iterator, no operator "=" matches these operands -

it's first time using lists sorry if i'm doing stupid std::list<abstractblock>::iterator i; (i = universe.getloadedblocks(); != universe.getloadedblocks().end; i++){ } universe.getloadedblocks() returns , std::list<abstractblock> list, keep getting error: 1 intellisense: no operator "=" matches these operands operand types are: std::_list_iterator<std::_list_val<std::_list_simple_types<abstractblock>>> = std::list<abstractblock, std::allocator<abstractblock>> in first condition of for() loop, trying assign std::list std::list::iterator , compiler complaining about. code needs more instead: std::list<abstractblock>::iterator i; std::list<abstractblock> &blocks = universe.getloadedblocks(); (i = blocks.begin(); != blocks.end(); i++){ //... }

c - is there a way to restrict user to input only numerical values for the variables? -

#include<stdio.h> void main(void) { int n1,n2,r; // variables //this add n1 , n2 , shows result, want // allow numbers not alphabet printf("enter first number = "); scanf("%d",& n1); fflush(stdin); printf("enter second number = "); scanf("%d",& n2); fflush(stdin); r=n1+n2; printf("total = %d ", r); } as can see codes wont restrict anything, want in restricting input of alphabets i believe below question answers yours. let me know if helps! it using while loop ensure input numbers, bee altered chars . can set variable numbers such double or integer , same way can make string . original answered link: how make cin take numbers from jesse good's answer i use std::getline , std::string read whole line , break out of loop when can convert entire line double. #include <string> #include <sstream> int main() { std::string line;

cocoa - NSTableView changes highlighting style -

Image
i have nstableview "source list" highlighting on os x 10.10.3. highlighting shows blue background , white text shown here: but (usually when dragging app across windows) highlighting style switch greyish translucent background: a few times tableview has mixed two, second highlight style being used when change selection, , previous selected row using first highlight style. how can make table view use first highlighting style time?

javascript - how to display JSON data in html div -

Image
here json string: [[{"name":"pepe pinedo"},{"message":"something"},{"datein":"2015-07-01 11:12:34"}],[{"name":"pepe pinedo"},{"message":"something"},{"datein":"2015-07-01 11:14:30"}]] here's js code $.post(url, function( data ) { //fire ajax post request alert("got messages: " + data); // /*$.each(data, function(index,e){ content += e.name + ':'+ e.message +'<br>'; $("#chatbox").append(content); });*/ }); i trying make messages this: php $messages = $this->person_model->get_msg(); foreach ($messages $i => $valor) { $fila['name'] = $valor->names; $message['message'] = $valor->message; $fecha['fecha'] = $valor->datein; $

swift - iOS8: viewDidLayoutSubviews() hides elements in Storyboard Auto-Layout -

Image
setup: i have view controller consists of view , container view . i have setup view , container view using class sizes. the code below adds gradient fine: class viewcontroller: uiviewcontroller { @iboutlet weak var graphview: uiview! @iboutlet weak var containerview: uiview! let backgroundcolor = cagradientlayer().graphviewbackgroundcolor() override func viewdidload() { super.viewdidload() } override func viewdidlayoutsubviews() { super.viewdidlayoutsubviews() backgroundcolor.frame = self.graphview.bounds self.graphview.layer.addsublayer(backgroundcolor) } } output: there no constraints laid out in code. problem: however, have label black background not appearing. if comment out following lines, label appears: //backgroundcolor.frame = self.graphview.bounds //self.graphview.layer.addsublayer(backgroundcolor) output: question: why gradient hiding uilabel element in auto-lay

java - Generate date before certain time? -

my input string "mmyy" date format, want able replace string random date same format "mmyy" year has before 2010. should do? suggestion? have set simpledateformat? example: input: "0914" , output should random , return string "0802" "02" 2002 before 2010. thanks try following snippet java 8 version: // generate random date random random = new random(); localdate maxdate = localdate.of(2010, 1, 1); long randomday = random.nextint((int) maxdate.toepochday()); localdate randomdate = localdate.ofepochday(randomday); // convert string using 'mmyy' pattern datetimeformatter dtf = datetimeformatter.ofpattern("mmyy"); string result = dtf.format(randomdate.atstartofday()); system.out.println(result); note 1: should generate random date between 1jan1970 , 1jan2010 (excluding) - wanted? note 2: date format fixed , known priori way stated it. there no need input string "replace", use result (u

Azure multiple VM connect to the same HD? -

i need share same hard disk multiple cloud-services/vm, possible ? if possible how can ? i know can use storage blob storage or sql store data i'm using local software on each service accepts local paths import data (to it). i'm not sure if can share exact same hd, azure file service may helpful. here's link for more details , stack overflow post may helpful.

google apps script - moving folders in drive using sheet -

back on seemingly impossible task. apparently people in office can't move folders around drive, task automate moving process. can see in sheet (link below) have setup routing system. https://drive.google.com/file/d/0b2lmfutaxagkn1vhqlphofeynvk/view?usp=sharing i have criteria, such name of folder, folder should in, , folder needs moved to. basically, i'm trying find script following things: 1) works when button selected in google sheet 2) moves folder in drive folder folder b. 3) using cell references. don't know how find folder id, wouldn't folder moved change based on spreadsheet criteria. , can't use outside program it's on government system. ideas? have great piece of script, doesn't seem work using cell references. function copyandmove(file,folder){ var newfile=file.makecopy('copy of '+file.getname(d9)); newfile.addtofolder(b1);// newfile.removefromfolder(docslist.getrootfolder());} any appreciated! to value in cell hav

c# - Unity3D UnauthorizedAccessException: Access to the path is denied -

i have anayltics in unity3d game , realised android devices throw unauthorizedaccessexception when trying create folder on device. have @ code throws exception: static void savetocache(entry entry, byte[] bytes) { if (entry.file != null) { string path = path.getdirectoryname(entry.file); try { if (!directory.exists(path)) directory.createdirectory(path); file.writeallbytes(entry.file, bytes); } catch (exception ex) { analytics.logexception(ex, "couldn't save cache: " + path); } } } the code looks me, perhaps i'm missing something... not throw on test devices - have stack trace analytics. more relevant code how build path: static readonly char directoryseparator = path.directoryseparatorchar; static string bundlefile(string id, string languagecode) { stringbuilder sb = new stringbuilder(); sb.append(bundlepath()); sb.append(id); sb.append("_&qu

javascript - How to prevent child event from firing in JQuery -

so have button <input id="expandbutton" type="submit" value="expand" class="loadwindow"/> i have 2 event handler attached. function confirmcontinue() { return confirm("do want expand window, might reload information?"); } $("input.loadwindow").click(function(event) { showprocessingwindow(event); } $("#expandbutton").click(function(event) { var result = confirmcontinue(); if (!result) { event.preventdefault(); event.stoppropagaton(); } } i want prevent "input.loadwindow" click event firing if cancel. this happening right now. button clicked --> confirmation fire --> click cancel --> show processing window still fires. i want button clicked --> confirmation fire --> click cancel --> nothing. it looks event.stopimmediatepropagation() work in case. $("#expandbutton").click(function(event) { var r

php - Model attributes set in beforeSave() are not being saved -

i trying set model attributes in beforesave() method not saved afterwards. public function beforesave(){ if(!$this->isnewrecord){ // ... $this->status = self::visible; } return parent::beforesave(); } i have tried returning true instead of parent::beforesave(). have tried if(parent::beforesave) {} structure. i have checked model attributes in aftersave , set. don't there can lost afterwards. any ideas? basically updating model above.. if(!$this->isnewrecord). remove conditin while saving status field

cygwin - Expect while loop dies after 29th iteration -

i'm using expect script within cygwin. reads 2 input files: 1 list of network devices full hostname, , other list of commands run on devices while logging output. works until completing 29th device. when spawn command executes on 30th device, output: send: spawn id exp65 not open while executing "send -s "myuserid\r"" ("while" body line 30) invoked within "while {[gets $switches host] >= 0} { set hostname [string trimright $host] ;# rid of trailing whitespace if {[string length $hostname] == 0} {..." (file "./getna-lab.exp" line 37) to rule out issue cygwin, wanted test mac used expect, can't anymore (devices secured , available via windows virtual desktops, hence cygwin.) @ first thought because "exit" telnet session wasn't working , remaining open, that's not it; tried adding "exit" command list file executes. the script , other file contents listed bel

mysql - convert variable names to array in PHP -

i have lite problem converting php $_post virables. i send such information website: $_post['name.1']='xxx'; $_post['height.1']='100'; $_post['qty.1']='2'; $_post['op.1.0']='color'; $_post['op.1.1']='size'; $_post['opv.1.0.0']='red'; $_post['opv.1.0.1']='blue'; $_post['opv.1.1.0']='xl'; $_post['opv.1.1.1']='l'; $_post['opv.1.1.2']='xxl'; $_post['name.2']='yyy'; $_post['height.2']='10'; $_post['qty.2']='4'; $_post['number.2']='4'; $_post['op.2.0']='color'; $_post['op.2.1']='weight'; $_post['opv.2.0.0']='red'; $_post['opv.2.0.1']='silver'; $_post['opv.2.1.0']='90'; $_post['opv.2.1.1']='60'; $_post['opv.2.1.2']='42'; i need convert data format: $

angularjs - How to display data in angular accordion differently for each accordion -

i using angular accordion. display accordions based on object size in (ng-repeat). when click accordion heading should make api call , store result in variable (department details) , should displayed in expanded window of accordion. when click first accordion, making api call , displaying data correctly in accordion window. but, when click second accordion making api call , data in both accordions (first , second) same because department details variable has result of second accordion api call. how can display data unique each accordion?. should make api calls in controllers itself, store results in array, , use in html instead of making api calls when click accordion-heading. in advance. html: <accordion close-others="false"> <accordion-group is-open="isopen" ng-repeat="item in object"> <accordion-heading"> <span ng-click="ctrl.getinfo(item.id)"> {{item.label}}

c# - SendKeys ALT + SPACE -

okay i've done research , know it's not possible send spacebar sendkeys() , , solution use sendkeys(" ") . however, i'm trying send alt + spacebar command window (this combination opens menu , i'm trying copy out text using keystrokes) i've tried sendkeys.sendwait("%( )") ; that's sending space text. i'm stuck here because need actual spacebar pressed while holding alt shortcut work. you can use following syntax sendkeys.send("% "); where % means alt

jquery - How to change a variable in server machine using javascript -

i have few html pages on server. have designed admin page , page on server. goal there button on server page. if click button index page redirected error,html page. here code in admin page var iserror=false; $( document ).ready(function() { $("#turnon").hide(); localstorage.setitem('iserror', iserror); $("#turnoff").on('click',function(){ iserror=true; localstorage.setitem('iserror', iserror); $("#adminmessage").text("the site turned off"); $("#turnon").show(); $("#turnoff").hide(); }); $("#turnon").on('click',function(){ iserror=false; localstorage.setitem('iserror', iserror); $("#adminmessage").text("the site turned on"); $("#turnon").hide(); $("#turnoff").show(); }); }); in above code setting localstorage

java - Spring. How to pass some variable to method in service-activator? -

i newbie in spring, trying understand it. try create rss reader, examples in google overkill , don't understand them. far have beans xml: <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:int="http://www.springframework.org/schema/integration" xmlns:feed="http://www.springframework.org/schema/integration/feed" xsi:schemalocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd http://www.springframework.org/schema/integration http://www.springframework.org/schema/integration/spring-integration.xsd http://www.springframework.org/schema/integration/feed http://www.springframework.org/schema/integration/feed/spring-integration-feed.xsd">

java - Moving a String from one JList To Another -

i can't figure out how transfer string 1 jlist another. there class main creates jframe buttons on. tried rightlist.setlistdata(leftlist.getselectedvalues crossed out getselectedvalues package multilist; import java.awt.*; import java.awt.event.*; import java.util.list; import java.util.vector; import javax.swing.*; import javax.swing.event.*; public class gui extends jframe { private jlist leftlist; private jlist rightlist; private jbutton movebutton; private static string[] food = {"pizza", "spagetiti", "mac , cheese", "cheese", "morepizza"}; public gui() { super("title"); setlayout(new flowlayout()); leftlist = new jlist(food); leftlist.setvisiblerowcount(3); leftlist.setselectionmode(listselectionmodel.multiple_interval_selection); add(new jscrollpane(leftlist)); movebutton = new jbutton("move ---->"); movebutt

asp.net mvc - MVC call action method from Html.DropDownList -

_layout: @if (user.identity.isauthenticated) { <li>@html.dropdownlist("user", new list<selectlistitem> { new selectlistitem { text = user.identity.name, value = "1", selected = true }, new selectlistitem { text = "logout", value = "2" } })</li> } when user clicks on logout option drop down list need call logout() method can actionlinks. how do this? edit: signout isn't working new jquery code. why this? public actionresult logout() { formsauthentication.signout(); return view("../home/index"); } my old code still works though logging user off though. <li>@html.actionlink("logout", "logout", "users", new { }, new { @class = "nav-link&q

Python pandas create additional dataframe columns by grouping on existing column -

trying create new dataframe columns contents of existing column. easier explain example. convert this: . yr month class cost 1 2015 1 l 19.2361 2 2015 1 m 29.4723 3 2015 1 s 48.5980 4 2015 1 t 169.7630 5 2015 2 l 19.1506 6 2015 2 m 30.0886 7 2015 2 s 49.3765 8 2015 2 t 167.0000 9 2015 3 l 19.3465 10 2015 3 m 29.1991 11 2015 3 s 46.2580 12 2015 3 t 157.7916 13 2015 4 l 18.3165 14 2015 4 m 28.2314 15 2015 4 s 44.5844 16 2015 4 t 162.3241 17 2015 5 l 17.4556 18 2015 5 m 27.0434 19 2015 5 s 42.8841 20 2015 5 t 159.3457 21 2015 6 l 16.5343 22 2015 6 m 24.9853 23 2015 6 s 40.5612 24 2015 6 t 153.4902 ...into following can plot 4 separate lines [l, m, s, t]: . yr month l m s t 1 2015 1 19.2361 29.4723 48.5980 169.7630 2 2015 2 19.1506 30.0886 49.3765 167.0000 3 2015 3 19.3465 29.1991 46.2580 157.7916 4 2015 4 18.3165 28.2314 44.5844 162.3241 5 2015 5 17.4556 27.0434 42.8841 159.3457 6 2015 6 16.5343 24.9853 40.5612 153.4902

c# - A better solution for Webscraping -

goal: locate the sentence "from today's featured article" website " http://en.wikipedia.org/wiki/main_page " using webscape c# code. problem: retrieve website's soucecode inside of string value. believe can locate sentence "from today's featured article" looping substring. have feeling inefficient approach. is there better solution locate sentence "from today's featured article" string input? info: *i'm using c# code visual studio 2013 community. *the soucecode not work properly. on the first 3 row working. webclient w = new webclient(); string s = w.downloadstring("http://en.wikipedia.org/wiki/main_page"); string svar = regexutil.matchkey(input); static class regexutil { static regex _regex = new regex(@"$ddd$"); /// <summary> /// returns key matched within input. /// </summary> static public string matchkey(string input) { //match match =

Issue upgrading application to rails 4.2.1 with libv8 & devise & therubyracer -

my application working fine following gemfile: source 'https://rubygems.org' #ruby version ruby "2.1.5" # bundle edge rails instead: gem 'rails', github: 'rails/rails' gem 'rails', '4.1.10' # use sqlite3 database active record gem 'pg' # use scss stylesheets gem 'sass-rails', '~> 4.0.3' # use uglifier compressor javascript assets gem 'uglifier', '>= 1.3.0' # use coffeescript .js.coffee assets , views gem 'coffee-rails', '~> 4.0.0' # see https://github.com/sstephenson/execjs#readme more supported runtimes # gem 'therubyracer', platforms: :ruby # use jquery javascript library gem 'jquery-rails' gem 'jquery-ui-rails' # turbolinks makes following links in web application faster. read more: https://github.com/rails/turbolinks gem 'turbolinks' # build json apis ease. read more: https://github.com/rails/jbuilder gem 'jbuilder', &#