Posts

Showing posts from June, 2010

javascript - Drag and drop using Raphael.js has laggy performance with more than 10 draggable elements -

i'm making simple html5 app, wrapped used on android, ios , web browsers. in app need set of points dragged , sorted in way, i'm using raphael.js animations , movememts , works fine 3 or 4 circles, when use more laggy performance appears (mobile browser). need app able draw lines on freehand, marker, , code i'm using refers drag to, performance awful. interesting part first moves work great, move more elements performance drops down drastically. works fine in pc browser, works fine 3 or 4 movements on mobie browser. is there way make drag , drop run fast , smooth large quantity of elements? here's code: <!doctype html> <html lang="en"> <head> <meta charset="utf-8"> <title>raphaĆ«l · drag-n-drop</title> <link rel="stylesheet" href="demo.css" type="text/css" media="screen"> <meta name="apple-mobile-web-app-capable"...

How to create link make cakephp with twitter bootstrap -

example: <a class="btn btn-mini" href="#"><i class="icon-star"></i> star</a> i try html::helpers echo $this->html->link($this->html->tag('i','', array('class' => 'btn')), array('action' => '../link')); but not work ! try: echo $this->html->link( $this->html->tag('i', '', array('class' => 'icon-star')) . " star", array('action' => 'your_action'), array('class' => 'btn btn-mini', 'escape' => false) );

How to improve performance of this linear interpolation in r -

for given column in dataframe, want construct new vector each point consists of average of points on either side. last observation instead second last. , first observation second. wrote r code solve issue, calling repeatedly , extremely slow. can give tips on how more efficiently? thanks. x1 <- c(rep('a',100),rep('b',100),rep('c',100)) x2 <- rnorm(300) x <- data.frame(x1,x2) names(x) <- c('col1','data1') a.linear.interpolation <- function(x) { require(zoo) require(data.table) a.dattab <- data.table(x) setkey(a.dattab,col1) #replace na values using locf / nocb a.dattab[,data1:=na.locf(data1,na.rm=false),by=list(col1)] a.dattab[,data1:=na.locf(data1,na.rm=false,fromlast=true),by=list(col1)] #adding within group sequence number , size of group field facilitate #row row processing a.dattab[,grpseq:=seq_len(.n),by=list(col1)] a.dattab[,grpseq_max:=.n,by=list(col1)] #convert...

multithreading - Accessing form control from within a thread using delegates in vb.net -

i have problem in updating form control thread using delegate. this flow use. dashboard screen(parent mdi window) -> quizscreen (child mdi window) once in quizscreen thread started , thread code kept in module(server.vb). thread need find , update control(which dynamically created) following delegate code call inside thread public sub changepictimage(byval ipaddress string) if me.invokerequired dim del nodedelegate del = addressof changepictimage me.invoke(del, ipaddress) 'return else me.backcolor = color.green me.backgroundimage = system.drawing.image.fromfile(application.startuppath & "\images\application-on.png") end if dim centerflowpanel flowlayoutpanel = ctype(quizscreen.centerflowpanel, flowlayoutpanel) dim computericonspanel flowlayoutpanel = ctype(centerflowpanel.controls("computericonspanel"), flowlayoutpanel) dim flowpanel flowlayoutpanel = ctype(computerico...

asp.net - c# how to set the styling of a gridview text field to 2 options: with hyperlink and without -

i have code gridview feild displays title, , evaluates hyperlink (link) in way if there value in link, title clickable , title redirect link.. followed: <asp:templatefield headertext="title" sortexpression="title" controlstyle-forecolor="black"> <itemtemplate > <asp:hyperlink id="title" runat="server" text='<%# bind("title") %>' navigateurl='<%# eval("link") %>' ></asp:hyperlink> </itemtemplate> </asp:templatefield> the code working fine, title black. need style title in way if there link, blue , undelined, else black. i'm using c#/aspx in here. any idea? try this <asp:hyperlink id="title" runat="server" text='<%# bind("title") %>' navigateurl='<%# eval("link") %>' style='<%# eval(...

sql - Find Page which leak memory in asp.net -

Image
i using redgate memory profiler find memory leak. software show system classes. want find page creating problem, please help when profiling asp.net website you'll see lot of system classes because iis doing lot behind scenes, ants memory profiler isn't limited showing system classes. classes have source code highlighted in bold in class list, , can use filtering show classes have source. if don't have source, still want highlight classes specific namespace (eg in case isn't in system) can selecting group namespace . ants showing objects held in memory @ point when memory snapshot taken. if class list shows none of classes exist in memory, it's because don't @ point in time. you haven't given information it's hard give guidance in specific case, in general: do have memory issue? use performance counters on ants timeline @ memory usage while use application. if isn't going up, maybe don't have issue. make sure you're ...

Google Earth KML touring speed -

i'we created kml tours can played in google earth , i'm wondering if there option define speed @ tour being played ... not speed of transition between points actual play speed - i.e. defining high value make tour it's in fast forward mode while defining low(er) value make tour play slowly. thanks for it's worth, can control tour playback speed clicking >> button on playback controls in bottom left of view window. if you'd change raw speed in kml, can divide tour/playlist element durations fixed number 2.0. dividing 2.0 halve playback time, resulting in playback twice fast realtime.

column names along their headings php mysql -

helo, want print , retrieve column names along headings or catagories title .. i'm using following code print column names: $arrlength=count($sort); for($x=0;$x<$arrlength;$x++) { echo " <td class=\"tr1 td26\"><p class=\"p12 ft4\">".$sort[$x]."</p></td>"; } i want print column names along column headings, how can retrieve them if have following table schema: **col heading 1 - col1 col heading 1 - col2 col heading 2 - col1 col heading 2 - col2 col heading 3 - col1 col heading 3 - col2 col heading 3 - col3 col heading 3 - col4 col heading 1 col heading 2 col heading 3 ------------- ------------- ------------------------- col1 col2 col1 col2 col1 col2 col3 col4 i can store column headings in other table can replaced or printed in particular place .. thankx in anticipation .. ;) to retrieve column names in php using pdo: private function ...

java - How to grab a whole body unless header and footer of another site page -

i'm developing liferay portal . , i'm facing little problem : i'm making site company has subsidiaries. then , must cut out parts(precisely header , footer) of other site(sub. site) , put body of page without'em in iframe of main site. i "googling" , looking grabbers . but i've found how grab php or perl. , here doesn't seem exact need. you can try webproxy portlet this. as you'll have modify external content's body, can't show in iframe, portlet might need. doesn't work iframe internally , can replace content on-the-fly.

Flex DataGrid DataChange Event not working -

in code datagrid not fire datachanged event. can me find wrong. code given below. <mx:datagrid id="userlist" horizontalgridlines="true" horizontalgridlinecolor="0xeeeeee" datachange="datachanged();" editable="true" change="changegrid(event);" width="100%" height="250" bordercolor="#ff0000" borderstyle="solid" borderthickness="1"> <mx:columns > <mx:datagridcolumn datafield="user" editable="false" headertext="user" /> <mx:datagridcolumn datafield="cam" edi...

c# - Storing and retrieving multiple values in a single session -

Image
i know there topics similar heading, kinda different. first, in order store multiple values in single session, have use list whereas store list values in session, right ? if so, when want add value list, in session, retrieve list session , add value. need assign list session every time have added/removed value list ? or ,by default, gets automatically updated in session when manipulate assigned @ first in session , after that. update: providing sample code of question public void assignnewid(int currentid) { if(session["usersid"] == null) { session["usersid"] = new list<int>(); } if(currentid != null) { var list = (list<int>)session["usersid"]; list.add(currentid); // should hereby assign list // session like: // session["usersid"] = list; // or gets automatically updated in session default ? } } list reference type storing refere...

javafx - Where can I find Java prism render possible options and documentation? -

i had problem application canvas generation ( i'm using javafx ). setting option helped: -dprism.order=j2d the thing problem cann't find documentation prism ( dprism ). second problem set option via config file. properties props = system.getproperties(); props.setproperty("com.sun.prism.order", "j2d"); code above dosen't work me. these properties used javafx 20 months ago (from adamish blog ): com.sun.scenario.animation.adaptivepulse com.sun.scenario.animation.animationmbean.enabled com.sun.scenario.animation.nogaps decora.purgatory glass.platform javafx.animation.framerate javafx.animation.fullspeed javafx.animation.pulse javafx.debug javafx.embed.iseventthread javafx.sg.warn javafx.toolkit javafx.verbose javafx.version nativewindow.ws.name prism.debug prism.device prism.dirtyregioncount prism.disablebaddriverwarning prism.forcerepaint prism.multisample prism.nofallback prism.order prism.printallocs prism.reftype prism.sho...

android - Custom (gradient) background of ActionBar Compat -

i using action bar compat action bar navigation drawer backward compatible down api level 9 , want change background of action bar. i copied code android developers : <?xml version="1.0" encoding="utf-8"?> <resources> <!-- theme applied application or activity --> <style name="customactionbartheme" parent="@style/theme.appcompat.light.darkactionbar"> <item name="android:actionbarstyle">@style/myactionbar</item> <!-- support library compatibility --> <item name="actionbarstyle">@style/myactionbar</item> </style> <!-- actionbar styles --> <style name="myactionbar" parent="@style/widget.appcompat.light.actionbar.solid.inverse"> <item name="android:background">@drawable/actionbar_background</item> <!-- support library compatibility --> <item name="backgroun...

javascript - Change date format in java script -

this question has answer here: where can find documentation on formatting date in javascript? 33 answers i have date in different format. , wanted show in different format. , wanted on client side. there way convert format. date : 2013-07-30 16:12:13.0 expected format :jul 30, 2013 4:12 pm you can use momentjs, great time formatting: http://momentjs.com/

asp.net mvc 3 - HTML5 video path confusion -

this weird 1 bare me. i have been playing video.js , have run problem example provided. when specifying mp4 (h264) video, using html5 video element, there confusion. when use (absolute): <source src="c:\<filsystempath>\media\oceans-clip.mp4" type='video/mp4' /> the video displayed, no problem. when use: <source src="@url.content("~/media/oceans-clip.mp4")" type='video/mp4' /> the video not displayed. conclude using relative path problem when using ogv video so: <source src="@url.content("~/media/oceans-clip.ogv")" type='video/ogg' /> it works fine. one more annoyance - when video used flash fallback, works. i using asp.mvc , video.js. using localhost debug. full video tag - <video id="example_video_1" class="video-js vjs-default-skin" controls preload="auto" width="640" height="264" poster="http:/...

android - Change color of content in listview -

i asking question in context previous question i have following piece of code: callsoap cs=new callsoap(); lst=cs.getmessage(id); lstnew=cs.getnewmessage(id); int numofmessages=lst.length-lstnew.length; arrayadapter<string> adpt = new arrayadapter<string>(messages.this, android.r.layout.simple_list_item_1,lst); lm.setadapter(adpt); (int i=0;i<numofmessages;i++) { lm. } i number of new messages in variable : numofmessages lm listview . listview lm=(listview)findviewbyid(r.id.listview1); suppose numofmessages=3 , want make color of text of first 3 elements of listview (lm) red. please me how can in loop, in such case. try impliment additional column of unique id or time of last fetch , next time compare database new fetch ids or time , according display color in row..

java - Android, set Background Stretches or zooms in but never correct -

i have been trying set background of phone using android wallpaper app made. every time press "set background" stretches image. here code using btnsetwallpaper.setonclicklistener(new view.onclicklistener() { @override public void onclick(view view) { wallpapermanager wmanager; try { // bitmap bitmap = ((bitmapdrawable)imageview1.getdrawable()).getbitmap(); wmanager = wallpapermanager.getinstance(view.getcontext().getapplicationcontext()); display display = getwindowmanager().getdefaultdisplay(); point size = new point(); display.getsize(size); int fullwidth = size.x; int fullheight = size.y; //int fullwidth = wmanager.getdesiredminimumwidth(); //int fullheight = wmanager.getdesiredminimumheight(); log.d(...

extjs4 - ExtJS 4.2.1 - Form custom field validation -

Image
i working on form contains grid panel checkbox selection model select users. after submission users id's (as other form field values) posted server. works perfect. but need add custom validation special (custom) field - if no user selected, display error icon error tooltip text. here custom field component screenshot: as can see within image, there title (done xtype: label ), empty space, filled label no text (the area marked red rectangle) , grid itself. if select user (or more), names (blanked data) displayed in empty label. but within process of validation need show error icon tooltip somewhere here if no user selected. i can check selected data using grid.getselectionmodel().getselection().length > 0 ? true : false therefore wise of selection valid or not, not know how display error icon, nor should best display it. think best position icon should within section title label (either left or right, not matter much). any on how display icon highly appreciate...

android - Create an array of JSON Objects -

i need create json object arraylist. below code public boolean submitorder(arraylist<orderdetailsdata> orderlist) { seruri = "lists.json"; method = "post"; jsonobject jsonobject = new jsonobject(); jsonobject json = new jsonobject(); jsonarray array = new jsonarray(); try { (int = 0; < orderlist.size(); i++) { json.put("orderno", orderlist.get(i).getordernumber() .tostring()); json.put("tableno", orderlist.get(i).gettablenumber() .tostring()); json.put("itemname", orderlist.get(i).getitemname().tostring()); json.put("amount", orderlist.get(i).getamount().tostring()); json.put("ordstatus", orderlist.get(i).getorderstatus() .tostring()); array.put(json); } ...

How to combine PHP array from user input with MySQL table for calculation (conceptually)? -

i have website, user can enter time series (date; series) text area. data sent server using post method. i have few tables different time series stored in mysql database. user specified time series , stored in database should combined statistical calculations. i store user input array using explode , want select time series database using date selector ( where date = $datefromuserinput ). have 2 problems here: the date format array not match 1 in mysql (iso, o-m-d) after several transformations (e.g. strtotime ). also, time series data type in mysql in decimal (15,4) format, 1 in php string (transformed float ). before trying find solutions, know if concept right , best. putting user input mysql table make calculations faster (as understand). however, several users can use form simultaneously result in overwriting entries in new table in mysql, right? should load complete mysql table php array (session necessary)? i have read many solutions not find these answer. hint...

php - How to get Current Page URL in MediaWiki -

i trying current page's url , store variable in custom skin template. trying can use url other purposes. trying function currentpageurl() //some custom function { $url= [something can current page's url in mediawiki , store variable] .....use $url variable other purposes.... ...... ..... } does mediawiki has way can identify current page's url or option find current page using method? $url="http://".$_server['http_host'].$_server['request_uri']; if you're writing quicktemplate subclass skin, can title object current page using $this->getskin()->gettitle() . once have title object, can call getlinkurl() on url of page. (you don't want use getprefixedurl() ilya suggests, gives url-encoded version of page name.) or can pass title object linker::link() if want generate standard wikilink-style link without having mess urls yourself. in fact, $this-getskin() general way gain access "reque...

java - Best way to find out if user is already registered -

how find out, user registered, e.g. in web application? have database of 1 million users. every time comparing every single row in database inefficient. there other optimal approach? every time comparing every single row in database inefficient i gather you're hauling entire db table contents java's memory select * user , looping on every row in while loop , comparing username equals() below, true? public boolean exists(string username) throws sqlexception { // ... declare, etc. statement = connection.preparestatement("select * user"); resultset = statement.executequery(); while (resultset.next()) { if (username.equals(resultset.getstring("username"))) { return true; } } return false; // ... close, etc (in finally!) } then that's indeed inefficient. should indexing username column (it is, unique constraint) , make use of sql where clause. it'll return 0 or 1 rows , ...

iphone - Custom TableView Cell ,check condition -

am doing custom cell tableview cell , writing condition in customcell class, if indexpath.row=0 create 2 images cell else create 3 images , my custom cell class if (appdelegate.rowindex==0) { uibutton *lobjimagebutton=[uibutton buttonwithtype:uibuttontypecustom]; lobjimagebutton.frame=cgrectmake(150*0+12.5, 5, 150-10, 290 - 120+10); [lobjimagebutton setbackgroundcolor:[uicolor greencolor]]; //lobjimagebutton.imageview.contentmode = uiviewcontentmodescaleaspectfit; [self addsubview:lobjimagebutton]; uibutton *lobjimagebutton1=[uibutton buttonwithtype:uibuttontypecustom]; lobjimagebutton1.frame=cgrectmake(150*1+10+5, 5, 150-10, 170+10); [lobjimagebutton1 setbackgroundcolor:[uicolor redcolor]]; //lobjimagebutton1.imageview.contentmode = uiviewcontentmodescaleaspectfit; [self addsubview:lobjimagebutton1]; imagebuttonarray = [[nsarray alloc...

Getting sqlite3.dll not found error with Delphi -

i getting sqlite3.dll not found error @ delphi app. have sqlite3.dll file on pc located @ e://sqlite-dll-win32-x86-3071700 my source follows procedure tform2.button1click(sender: tobject); var results: tdataset; begin sqlconnection1.params.add('database=e://empn.s3db'); sqlconnection1.libraryname := 'e://sqlite-dll-win32-x86-3071700/sqlite3.dll'; try sqlconnection1.connected := true; sqlmonitor1.active := true; sqlconnection1.execute('selct * usergroup', nil, results) end; end; as mentioned in above code pointed out path library by sqlconnection1.libraryname := 'e://sqlite-dll-win32-x86-3071700/sqlite3.dll'; but still error sqlite3.dll not found. how troubleshoot error? a small note beginning delphi xe3, libraryname is obsolete . in older delphi versions, libraryname indicated "dbexpress library associated driver" (e.g. dbxfb.dll firebird), while vendorlib indic...

assembly - Accessing bytes out of page -

i have simple question. i'm not able find answer on own don't have environment test it. if access 4 bytes on edge of page, happen? mov eax, dword [0x100000+4095] what upper 3 bytes when have access page on 0x101000 , when don't? please help. what happnes depends on operating system. if have normal memory access, nothing happen. value read whatever there @ time. if access page not allowed, program generate page fault, os has deal with. if page on disc, because swapped out, os load page, , resume program left off. programm not notice this. if page invalid os raise exception , depending on os may able catch it, or program crash. if access done on kernel level , can not resolved, os crash kernel panic, or if written, may disable driver, caused it.

java - Custom error messaging on Hibernate Validation -

i trying set hibernate validation in ecommerce site. have order object multiple objects assigned. customer goes through checkout, want able individually validate these objects - multiple objects 1 form. for example, upon submitting delivery form, deliverycharge , deliveryaddress should validated. if validation fails, delivery form returned list of validation errors. i can validate objects via java implementation, when try view these on view tier using <form:error /> tag, not getting anything. order model @entity @table(name = "bees_address") public class address { @onetoone @joincolumn(name = "paymentaddress") private address payment; @onetoone @joincolumn(name = "deliveryaddress") private address payment; @column(name = "deliverycharge") private integer deliverycharge; ... address model @entity @table(name = "bees_address") public class address { @size(min=2, max=150) @column(name = ...

javascript - setTimeout function not working on Android -

i developing mobile application, , have call function after 2 seconds. using settimeout, working in chrome, on samsung not working. here code. window.settimeout(function () { loadbooking(booking); localstoragewrapper.add('currentbooking', currentbooking); changecirclecolor(currentbooking, bookingsdata.length); $("#swiped").fadein('slow', 'linear'); }, 700); do have idea why not working?

android - MultiAutoCompleteText contacts -

Image
i want multiautocompletetextview this: i can retrieve contacts numbers in array , names in array. how can multiautocompletetextview ? example, in picture if enter ca there suggestion , if enter 22 , there same suggestion, , under other. have 2 arrays numbers[] , names[] , multiautocompletetextview . here code: cursor phones = getcontentresolver().query(contactscontract.commondatakinds.phone.content_uri, null,null,null, null); arraylist<string> numbers = new arraylist<string>(); arraylist<string> names = new arraylist<string>(); while (phones.movetonext()) { names.add(phones.getstring(phones.getcolumnindex(contactscontract.commondatakinds.phone.display_name))); numbers.add(phones.getstring(phones.getcolumnindex(contactscontract.commondatakinds.phone.number))); } phones.close(); string[] numbersarray = new string[numbers.size()]; string[] namesarray = new string[names.size()]; numbers.toarray(numbersarray); names.toarray(namesarray); arra...

email - Setting up mail server in pc -

while working on php script, need send emails. see progress have upload full project online. there way setting mail server in local machine? i'm using windows 8. use stmp mail class , can send example via google mail. no need upload on server then.

ios - How to pass image from one View to Previous view from Gallery in iPhone? -

i fetched image gallery , appearing in second screen.but when click on done button image send previous screen. below detailed explanation 1)first screen 1 image. 2)when click on image navigate second screen , ask choose gallery 3)i choose gallery 1 image , image appearing in second screen. 4)when click on done button in second screen navigate previous screen first screen , image change selected image how pass image previous screen , set selected image. mprofileviewcontroller.h #import <uikit/uikit.h> #import "addprofileviewcontroller.h" @class mprofileviewcontroller; @interface mprofileviewcontroller : uiviewcontroller<uiimagepickercontrollerdelegate,uitableviewdatasource,uitableviewdelegate,imageselectiondelegate> { nsmutablearray* titles; iboutlet uitableview *maintableview; iboutlet uiimageview *image2; } @property(strong,nonatomic)iboutlet uiimageview *image2; @property(nonatomic, retain) nsmutablearray *titles; @property(s...

html - Height to 0 hover effect under Firefox -

hy have problem under ff. when try use hover on div transform height 0, working strangely. there way make work under chrome? code is: css : #square{ position:fixed; top:50%; left:40%; width:11%; height:22%; background-color:blue; transition:height 0.8s linear; -webkit-transition:height 0.8s linear; -moz-transition:height 0.8s linear; } #square:hover{ height:0%; } html: <div id="square"></div> you should wrap div, keep hover when #square div no longer under pointer : css #mydiv { position:fixed; top:50%; left:40%; width:11%; height:22%; } #mydiv:hover>#square { height:0%; } html <div id="mydiv"> <div id="square"></div> </div> demo jsfiddle

java - Using values from an ArrayList in a where clause without loads of queries? -

i'm trying accomplish this: select * x id != for(int : arraylist) so have arraylist 10 ids, want sql not return of rows have id same in arraylist, , i'd rather not 10 queries. there way this? you're looking sql in keyword: select * x id not in ( 1, 2, 3, etc. )

MDX Select measures between two values -

i have fact table stores each record init_year , end_year integers, refer year range in record valid. in way can design mdx query select measures (count) each year, in order have trend of measures on year? thanks i'm not sure should done in mdx. this sort of thing calculated in fact tables (linked dimension table of available years), , new measure created. no calculation done in mdx; you'd display new measure. having said that, i've googled "mdx count start end date" , found www.purplefrogsystems.com/blog/2013/04/mdx-between-start-date-and-end-date suggests use linkmember function. example code was... aggregate( {null:linkmember([date].[calendar].currentmember ,[start date].[calendar])} * {linkmember([date].[calendar].currentmember , [end date].[calendar]):null} , [measures].[project count]) ...or... aggregate({null:[date].[calendar].currentmember} , [measures].[project count])...

angularjs - Passing html into a directive template using ng-bind-html-unsafe -

i using angular-strap tabs , need change directive add buttons last tab. trying use ng-bind-html-unsafe pass html scope variable directive. works point. what not working calling of function when click button generated code. here's plunk... http://plnkr.co/edit/ydwbnqvsuu8faflxevhz?p=preview

c# - Error while converting PPT to PDF -

i trying make application converts docx/xls/ppt pdf. conversion of docx , xls requires microsoft.office.core dll conversion of ppt requires office.dll i converted 1 , 2 separately when try merge both of them i.e when try add both reference (microsoft.office.core dll , office.dll) gives me error. so, there problem in adding both dll's ? 229 error of same kind ---- error 1 cannot embed interop type 'microsoft.office.core.msoblogimagetype' found in both assembly 'e:\all pdf\watermark_pdf\pdf merger , protector source code\pdfmerger\obj\debug\interop.microsoft.office.core.dll' , 'c:\program files\microsoft visual studio 10.0\visual studio tools office\pia\office12\office.dll'. consider setting 'embed interop types' property false. note - had changed "embed interop types" property false both dll's. please help. just use specific libraries: using excel = microsoft.office.interop.excel; using word = micro...

c# - How do I call a SOAP service in ASP.NET -

i'm new visual studio , asp, need call soap service requires passing in username , password , responds token. know how in javascript, clueless in c# / asp.net. i have added service reference, , seems see there issuetoken call. can't figure out how use , pass in username , password. i have tried searching google , on here, have found "add service reference , use it", can't figure out use part. want click button, send call, , token. this have... not it'll help. protected void button1_click(object sender, eventargs e) { string username = "name"; string password = "password"; tokenservice.issuetoken calltoken = new tokenservice.issuetoken(); } it'll this: string username = "name"; string password = "password"; var proxy = new tokenserviceclient(); var token = proxy.issuetoken(username, password); proxy.close();

javascript - Append more drop down box value to text box area -

<html> <script type="text/javascript"> function chkind1(){ var dropdown2 = document.getelementbyid('dropdown1'); var textbox = document.getelementbyid('textbox1'); textbox.value=dropdown1.value; } </script> <script type="text/javascript"> function chkind2(){ var dropdown3 = document.getelementbyid('dropdown2'); var textbox = document.getelementbyid('textbox2'); textbox.value=dropdown2.value; } </script> <input id="textbox1" name="size" type="text" /> <input id="textbox2" name="copies" type="text" /> <select onchange=chkind1()' id='dropdown1'> <option value='nil'>select print size</option> <option value = '$file - 5x7'>5x7</option> <option value = '$file - 6x8'>6x8</option> </select> <select on...

javascript - scope change doesn't execute code in directive -

here directive looks like //noinspection jscheckfunctionsignatures angular.module('notificationdirective', []).directive('notification', function ($timeout) { //noinspection jsunusedlocalsymbols return { restrict: 'e', replace: true, scope: { ngmodel: '@' }, template: '<div class="alert fade" bs-alert="ngmodel"></div>', link: function (scope, element, attrs) { scope.$watch('message', function () { console.log('message now: ' + json.stringify(scope.message)); // element.show(); // //noinspection jsunresolvedfunction // $timeout(function () { // //element.empty(); // element.fadeout("slow"); // }, 2000); }); } } }); here controller function notificationcontroller($sco...

c# - Is there an easy way to retrieve the start time stamp from TimeSpan -

Image
what difference between timespan private field starttimestamp , datetime.ticks property? there easy way retrieve starttimestamp (without using reflection) ? starttimestamp long, it's not timespan , it's not datetime.ticks . it time stopwatch started, time based on high performance counter, or datetime.ticks if no high performance counter available. you can current value starttimestamp generated calling stopwatch.gettimestamp() static method. the starttimestamp not directly exposed can calculate calling stopwatch.gettimestamp() - stopwatch.getrawelapsedticks()

php - nicEditor some items not working to display -

i'm using nicedit image upload option. i'd tested site on localhost , works well. i've uploaded server doesn't work. found reason that, adding \ every " . , tags i'm getting looks like: <img src=\"http://someurl.com/image.jpg\"> how tackle problem? faisal can replace \ "" (empty space). use private string replace(string path){ return path.replaceall("\\", ""); }

java - SAX Parser having parent and child tags similar -

i using sax parser parse xml has parent , children tags this: <a name="parent" level="0"> <a name="child" level="0"> <a name="subchild01" level="1"> <a name="subchild11" level="1"> </a> </a> <a name="subchild11" level="1"> </a> </a> <a name="child2" level="0"> <a name="subchild02" level="1"> </a> </a> </a> code class node{ list<integer> childnodeid=new arraylist<integer>(); } to save childnodes id immediate subsequent parent. how can achieved? with vast majority of sax applications, have maintain stack. push information onto stack when notified of startelement, , pop stack on endelement events. can find information relevant parent of curren...

c - permutations for pass generation -

from original code generates possible combinations of 3 numbers: void gen(char *word, char *chars, int ug, int length) { size_t = 0; int u = ug; while(i < strlen(chars)){ word[u] = chars[i++]; if(u < (length-1)) { gen(word, chars, ++u, length); u--; } else { printf("%s\n", word); } } } int main(int argc, char* argv[]) { char *chars = "0123456789"; /* 3 char long */ int = 3; int length = 3; /* allocate memory output */ char *word = calloc(length, 0); gen(word, chars, 0, 3); return 0; } but cause need function work differently, modified this: char *genpass(char* pass,int len, int crt, size_t i) { char *chars = "0123456789"; pass[crt] = chars[i++]; return pass; } int main(int argc, char* argv[]) { char *pass = calloc(10, 0); int crt;//current permutation int len = 3; size_t = 0; (crt=0;crt...

wpf - Forwarding keyEvents from one window to another -

i'd bring keydown events popup window-object hosting window-object. the popup able reference hosting window-object. to pass events 1 uielement another, can use raiseevent method. there number of ways this, 1 simple. if want learn more concept, take @ this overview on routed events . in popup window: protected override void onkeydown(keyeventargs e) { base.onkeydown(e); var window = // reference hosting window window.raiseevent(e); } in hosting window body: protected override void onkeydown(keyeventargs e) { base.onkeydown(e); // use key event }

c# - ASP.NET MVC 4 User Authentication -

i trying write login method authenticates , authorizes users web site developed asp.net mvc 4. problem is, although call formsauthentication.setauthcookie method after validating user inside login method , redirect viewprofile action, user.identity.isauthenticated returns still false in custom authorize attribute object. i gave code below: [httppost] [allowanonymous] public actionresult login(loginmodel model) { if (membership.validateuser(model.username, model.password)) { formsauthentication.setauthcookie(model.username, model.rememberme); return this.redirecttoaction("viewprofile"); } modelstate.addmodelerror("", "the user name or password provided incorrect."); return view(model); } [myauthorize(roles = "super role, seeker")] public actionresult viewprofile() { if (modelstate.isvalid) { ... } } and here code of myauthorizeattribute class [attributeusage(attributetargets.method, ...

javascript - jquery typeahead and address picker? -

with release of bootstrap 3.0 typeahead plugin has been removed , replaced twitters typeahead plugin . idea how can use in conjunction addresspicker plugin . my old code worked this: $('#location').addresspicker({ boundelements: { '#wizard .country': function(data) { var result = ''; $.each(data.address_components, function (index, value) { if (value.types.indexof('country') !== -1) { result = value.long_name; } }); return result; }, '#wizard .state': 'administrative_area_level_1', '#wizard .city': 'locality', '#wizard .postalcode': 'postal_code', '#wizard .lat': 'lat', '#wizard .lng': 'lng' ...