Posts

Showing posts from February, 2014

javascript - AngularJS minError Uncaught Object -

javascript - AngularJS minError Uncaught Object - i have new angularjs project i've set up. i've installed angular , angular-resource via bower , all's good. i've installed service i've used before - https://github.com/fundoo-solutions/angularjs-modal-service when inject module causes error below: uncaught object it's pointing homecoming statement of function in angularjs: function minerr(module) { homecoming function () { var code = arguments[0], prefix = '[' + (module ? module + ':' : '') + code + '] ', template = arguments[1], templateargs = arguments, stringify = function (obj) { if (typeof obj === 'function') { homecoming obj.tostring().replace(/ \{[\s\s]*$/, ''); } else if (typeof obj === 'undefined') { homecoming 'undefined'; } else if (typeof obj !== 'string') { homecoming json

sql server - How to INSERT INTO Table with SELECT and auto incremented field -

sql server - How to INSERT INTO Table with SELECT and auto incremented field - i trying insert table created production table - able before formula think caused duplicates , did not populate primary key(in case prospect_id properly. since auto incremented field , using select table insert help on how auto increment field in production? mkt_prospect insert mkt_prospect(prospect_id,record_type,search_name,label_name,first_name,last_name,customer_class_code,customer_status_code,company_name,job_title,formatted_detail,address_1,address_2,city,state,postal_code,address_type_code,address_status_code,home_phone,email,addoper) select prospect_id,record_type,search_name,label_name,first,last,customer_class_code,customer_status_code,company,title,formatted_detail,address1,address2,city,state,zip,address_type_code,address_status_code,phone,email,addoper dbo.prospects search_name not null , label_name not null if insert table specific id utilize identity insert on john hartsoc

output - Outputting a bitstream onto a pin in verilog -

output - Outputting a bitstream onto a pin in verilog - i need output 32bit bit-stream onto pin in verilog. know verilog has streaming operators pack , unpack not believe want do. i have 32x512 fifo ram in info stored. info variable "i" stored on first 32 bits , info variable "q" stored on next 32 bits (the rest of fifo saves info in alternating fashion). need continually 32bit stream off fifo ram , output 32bit info stream onto pin. fifo has 3 output signals(a signal 32 bit info stream(32_data), signal when fifo empty (32_empty), , signal when fifo full(32_full)) sudo code next (it's sudo code because know how else part need help , wanted maintain simple understanding): process @ posedge clock begin if (32_empty != 1) //if fifo has info if (32_full == 1) //if fifo full, lose info (for testing purposes know if need create ram bigger pin_1 <= 1; //output onto pin fifo total pin_2 <= 0; //clear pin 2 outputti

objective c - Unrecognized Selector Sent to Instance; selector doesn't exist? -

objective c - Unrecognized Selector Sent to Instance; selector doesn't exist? - so i'm new objective c, practically new programming in general. anyway, in simple program, control-dragged uitextfield storyboard viewcontroller.m thinking way create method invoked when field entered/tapped on. wasn't long until deleted method. when running simulator, keyboard come , text field focused on. if tapped anywhere else on screen, resulted in crash giving me unrecognized selector error selector deleted. there's nil in viewcontroller.h , rest of code seems fine. if re-add selector no instructions, behaves intended , keyboard resigns. question is, why getting error? it more helpful have output of crash. said suspect storyboard still has outlet hooked up, referencing function or outlet created. storyboard click on textfield , navigate connections inspector (view -> utilities -> connections inspector). there should able see connections have made. click x r

java - Ignore threads if the pool is full -

java - Ignore threads if the pool is full - i want accomplish next behaviour in java application: when button clicked, task called in new thread. however, if button clicked 1 time again , current task still running, don't want run one. i'm not sure what's approach this. i'm using code similar 1 below. private executorservice backgroundtaskexecutor = executors.newsinglethreadexecutor(); private boolean runningbackgroundtask = false; private synchronized void setrunningbackgroundtask(boolean running) { this.runningbackgroundtask = running; } private synchronized boolean isrunningbackgroundtask() { homecoming runningbackgroundtask; } private void runbackgroundtask() { if (isrunningbackgroundtask()) { system.out.println("this task ignored because thread pool busy."); return; } runnable backgroundtask = new runnable() { @override public void run() { setrunningbackgroundtask(true)

three.js - Keeping camera above ground (using OrbitControls.js) -

three.js - Keeping camera above ground (using OrbitControls.js) - so have simple situation ground plane y=0 , want maintain photographic camera above ground @ time. want controls sense intuitive (and touch-compatible) , figured out orbitcontrols.js seems best suited this, because there can limit polar angle setting maxpolarangle less or equal math.pi/2 (quarter turn). still, doing user can pan below ground unless panning disabled altogether (which don't want to). manually limiting y never goes negative felt weird figured ignoring changed on y axis e.g. changing line 165 (panup function) following panoffset.set( te[ 4 ], 0, te[ 6 ] ); panoffset.normalize(); led quick , dirty solution did wanted. but user can alter photographic camera height zooming. can think of improve solution? maybe thread can serve nutrient thought official solution, sure wouldn't 1 benefiting such solution. /edit: wasn't normalizing offset vector @ first led issue, changed now.

matrix - How to efficiently store and manipulate sparse binary matrices in Octave? -

matrix - How to efficiently store and manipulate sparse binary matrices in Octave? - i'm trying manipulate sparse binary matrices in gnu octave, , it's using way more memory expect, , relevant sparse-matrix functions don't behave way want them to. see this question higher-than-expected sparse-matrix storage in matlab, suggests matrix should consume even more memory, helped explain (only) part of situation. for sparse, binary matrix, can't figure out way octave not store array of values (they're implicitly 1 , need not stored). can done? octave seems consume memory values array. a trimmed-down illustration demonstrating situation: create random sparse matrix, turn "binary": mys=spones(sprandn(1024,1024,.03)); nnz(mys), whos mys shows situation. consumed size consistent storage mechanism outlined in aforementioned answer , expanded below, if spones() creates array of storage-class double , if indices 32-bit (i.e., totalstoragesize - rowin

java - Is there any way to use an instance variable in another method? -

java - Is there any way to use an instance variable in another method? - lets have method defines , assigns value variable. want somehow able utilize variable , value within method. i don't want pass variable argument because i'm running selenium test, , there multiple test methods depends on 1 method - means execute if 1 of test methods (that depends on it) executed. i've tried using accessors/mutators assign id class variable, doesn't seem work e.g string mainid; public void setid(string s) { mainid = s; } public string getid() { homecoming mainid; } @test public void dosomething() { string numeric = this.randomnumeric(); string id = "d1234" + numeric; this.setid(id); ... // id number } @test (dependsonmethod = {"dosomething"}) public void somethinga() { ...sendkeys(this.getid()); // id - e.g search database see if id added correctly } @test (dependsonmethod = {"dosomething"}) public voi

colors - R force bar colours -

colors - R force bar colours - this question has reply here: manually setting grouping colors ggplot2 1 reply i beginner , self-taught r user bear me. my info looks this: city variable value var1 0.398847367 var2 0.975311071 var3 0.957249734 b var1 0.313723366 b var2 0.130885548 b var3 0.771616001 c var1 0.057720637 c var2 0.398434369 c var3 0.088653681 d var1 0.024273226 d var2 0.744307456 d var3 0.315222384 i trying create stack bar plot ggplot. order of colours important. code cols <- c(var1="tomato2", var2="steelblue3", var2="darkolivegreen3") ggplot(lul4, aes(x=city, y=value, group=factor(variable)) + geom_bar(stat="identity", colour="black") + scale_fill_manual(values = cols)

hadoop - sqoop user defined functions -

hadoop - sqoop user defined functions - is apache sqoop 1 or sqoop 2 supports user defined functions ? have scenario info in hdfs , want extract info elements records sitting in hdfs , insert rdbms. i uncertainty sqoop supports udf , can anytime write custom mapreduce job extract info hdfs @ particular location , utilize sqoop to export rdbms, can automate run atomically configuring flow in oozie. hadoop sqoop

Why are am i getting out of memory error when i use codenameone result processor? -

Why are am i getting out of memory error when i use codenameone result processor? - i trying utilize result processor extract info hashmap result result = result.fromcontent(co); system.out.println(co.tostring()); system.out.println(result.get("//propertytype[text()='image'/..").tostring()); when run, output. out of memory error not come after , there no other code running. { "picture": { "propertyname": "picture", "propertytype": "image", "propertyvalue": "/var/folders/_j/xsgymcmd1lsc5zqtg65ctlsm0000gn/t/temp7922678673908500238s.png" }, "documenttype": { "propertyname": "documenttype", "propertytype": "text", "propertyvalue": "accident" } } {picture={propertyname=picture, propertytype=image, propertyvalue=/var/folders/_j/xsgymcmd1lsc5zqtg65ctlsm0000gn/t/temp792267867390

android - Merge two bitmap data -

android - Merge two bitmap data - for application, have create 2 bitmap per requirements. one actual image goes through image processing , sec logo bitmap display application logo on top left corner. now @ saving time want combine these bitmaps , want generate single jpeg file output. to accomplish task have write next code. orignalbitmap = orignalbitmap.copy(config.argb_8888, true); canvas savedcanvas = new canvas(orignalbitmap); savedcanvas.setbitmap(logobitmap); savedcanvas.drawbitmap(orignalbitmap, 0, 0, transpaint); savedcanvas.drawbitmap(logobitmap, 0, 0, transpaint); seek { orignalbitmap.compress(compressformat.jpeg, 100, new fileoutputstream(new file("/mnt/sdcard/original.jpg"))); } grab (filenotfoundexception e) { e.printstacktrace(); } but @ nowadays got original image output not attached logo. want image logo info available in logo bitmap. how combine both bitmaps info can't understand please provide guidance in this.

solaris 10 - Tomcat Restrict Access to specific domain name only -

solaris 10 - Tomcat Restrict Access to specific domain name only - the server, on tomcat running, having 2 domain names (like, example1.com , example2.com). want restrict access tomcat, such that, can access example2.com. when seek example1.com or ip address, tomcat should error page not found.. as unable touch dns entries, there anyway can build restriction within tomcat?? you not able block completely: tcp connection done ip of adress , there no way know domain name queryed find ip. short of changing dns, there no absolute solution (and then, won't able block access ip) one way block request host: different exemple2.org . exemple, custom filter : class="lang-java prettyprint-override"> @override public void dofilter(servletrequest request, servletresponse response, filterchain chain) throws ioexception, servletexception { if (!request.getservername().equals("exemple2.com")) { ((httpservletresponse) response).senderr

android - Is the new ART a virtual machine? -

android - Is the new ART a virtual machine? - i have read through articles on net new fine art runtime android operating system. many of articles phone call fine art new virtual machine, think wrong because applications compiled upon installation native machine code. if fine art not virtual machine, then? provide runtime environment such garbage collector, memory manager etc running applications? does provide runtime environment such garbage collector, memory manager etc running applications? yes, plus hooks debugging , tracing, , more. note there google i|o 2014 conference presentation coming go more details (presumably). many of articles phone call fine art new virtual machine, think wrong because applications compiled upon installation native machine code. google describes "runtime". android virtual-machine dalvik

python - Different content-types in the same script -

python - Different content-types in the same script - i need utilize different content-types in python script , know how 'reset' content-type after used 'text/html' example. here illustration not working expect #!/usr/bin/env python print "content-type: text/html\n" print "hello! i'm going redirect" print "content-type: text/plain" print "refresh: 0; url=http://www.stackoverflow.com\n" a cgi script run separately each request. figure out page beingness requested, , send right content type. python

I have a dataset in R with 3 columns of numbers that I need to convert to a vector of dates -

I have a dataset in R with 3 columns of numbers that I need to convert to a vector of dates - in data.frame 3 variables month, dayofthemonth ,dayoftheweek, info in same year. need convert these columns vector plotting using ggplot2 variable info: date_cols = data.frame(month=1:12, dayofthemonth=1:31, dayoftheweek=1:7) #(monday=1) in case need month , day of month, dd<-data.frame(month=rep(1:3, each=5), dayofthemonth=rep(seq(1,length.out=5, by=5), 3)) i can covert info dates as.date(sprintf("%04d-%02d-%02d", 2014, dd$month, dd$dayofthemonth)) all convert canonical date-time format , add together in year, utilize as.date transformation. r date ggplot2

c# - WCF Callbacks not working for multiple clients -

c# - WCF Callbacks not working for multiple clients - i've managed create wcf service callbacks. callbacks working expected, 1 client. if start client, first 1 stops receiving callbacks, sec 1 receives them twice , on. i've tried instancecontextmode in single, percall , persession mode leads same problem. do know how prepare problem? here's service class: [servicebehavior(concurrencymode = concurrencymode.reentrant, instancecontextmode = instancecontextmode.single)] public class hostfunctions : ihostfunctions { #region implementation of ihostfunctions public static ihostfunctionscallback callback; public static timer timer; public void opensession() { console.writeline("> session opened @ {0}", datetime.now); callback = operationcontext.current.getcallbackchannel<ihostfunctionscallback>(); timer = new timer(1000); timer.elapsed += ontimerelapse

html - PHP data is not displaying in CKEditor -

html - PHP data is not displaying in CKEditor - i new yii framework. had web page , need fetch info database page. when set both html , php code in ckeditor, it's straight displaying php code special characters. it's not recognizing <?php ?> tags. how can create back upwards php extension? here code ckeditor: <script type="text/javascript" src="ckeditor/ckeditor.js"></script> <script type="text/javascript" src="somedirectory/ckeditor/ckeditor.js"></script> <?php // create sure using right path here. include_once 'ckeditor/ckeditor.php'; $ckeditor = new ckeditor(); $ckeditor->basepath = '/ckeditor/'; $ckeditor->config['filebrowserbrowseurl'] = '/ckfinder/ckfinder.html'; $ckeditor->config['filebrowserimagebrowseurl'] = '/ckfinder/ckfinder.html?type=images'; $ckeditor->config['filebrowserflashbrowseurl'] = '/ckfi

ios - How to send URL to Friend in Twitter -

ios - How to send URL to Friend in Twitter - how can send url twitter friend in ios. can send direct message not allow me send url in it. here code posting drirect message twitter friend , working. -(void)postmessagetofriend:(nsstring *)id withmessage:(nsstring *)message { notificationame = notificationnamestr; acaccounttype *accounttype = [accountstore accounttypewithaccounttypeidentifier:acaccounttypeidentifiertwitter]; [accountstore requestaccesstoaccountswithtype:accounttype options:nil completion:^(bool granted, nserror *error) { if (granted && !error) { nsarray *accountslistary = [accountstore accountswithaccounttype:accounttype]; int noofaccounts = [accountslistary count]; if (noofaccounts >0) { nsurl *url = [nsurl urlwithstring:@"https://api.twitter.com/1.1/direct_messages/new.json"]; twitteraccount = [accountslistary lastobject]; nsdicti

sql server - Set Output Parameter to equal result of Select statement -

sql server - Set Output Parameter to equal result of Select statement - i work ms-access 2010 frontend, called stored procedures , ms- sql server 2008 backend, apply scripts stored procedures. created stored procedure retrieves testid input parameters match values in 2 joined tables.my issue trying capture select statement returns output parameter. here sql stored procedure create procedure upgettestidforanalyte @woid nvarchar(60), @sampleid nvarchar(60),@analyte nvarchar(60), @recordsaffected int out select testid = t1.testid tblwosampletest t1 bring together tbltest t2 on t1.testid=t2.testid; @woid = t1.woid , @sampleid = t1.sampleid , @analyte = t2.analyte set @recordsaffected = @@identity go i researched ways , seems should utilize set statement don't know how capture value. illustration returns zero. i thinking maybe work: create procedure upgettestidforanalyte @woid nvarchar(60), @sampleid nvarchar(60),@analyte nvarchar(60), @recordsaffected int out

c# - Add array to array of keys in web.config -

c# - Add array to array of keys in web.config - my web.config looks this <add key="studentname1" value="english, maths, french" /> <add key="studentname2" value="english" /> <add key="studentname3" value="english, french" /> the number of students can increased or decreased. how read in c#? array within array since want store array/list of students should serializing. create models this: public class pupil { public string name { get; set;} public list<course> courses { get; set; } } public class course of study { public string name { get; set;} } public class mysettings { public list<student> students {get; set;} } you can add together students students list within mysettings. each pupil have 0 or more courses (rather doing comma separated variant). then serialize mysettings , store on filesystem. public static class myserializer { public stat

javascript - 2 Divs next to each other with little spacing in between -

javascript - 2 Divs next to each other with little spacing in between - i trying create 2 divs next each other have little space in between them. next code have , spacing far apart. can't figure out how set spacing: <style type="text/css"> .formlayout { background-color: #f3f3f3; border: solid 1px #a1a1a1; padding: 10px; width: 300px; border-radius: 1em; } .formlayout label, .formlayout input { display: block; width: 120px; float: left; margin-bottom: 10px; } .formlayout label { text-align: right; padding-right: 20px; } br { clear: left; } .box_header { font-weight: 600; color: #000000; text-align: center; border-radius: 1em; } </style> <div class="formlayout" style="float:left;"> <div class="box_header">

sass - Integrating Compass into Visual Studio 2013 update 2 with Web Essentials 2013 -

sass - Integrating Compass into Visual Studio 2013 update 2 with Web Essentials 2013 - the way have set downloaded compass https://github.com/compass/compass placed root of scss files located. works great but, wondering if way integrate compass doing mindscape workbench http://visualstudiogallery.msdn.microsoft.com/2b96d16a-c986-4501-8f97-8008f9db141a i utilize mixins compass, rely on web essentials compile scss files on save. gives me much improve development experience, since compass watch requires few seconds compile stylesheets, whereas web essentials fast. compass watch had problem reloaded page in browser before css files compiled, confusing me @ times. since compass scss files library rely on, copied them source tree, have them in git repo. solved problem web essentials unable resolve compass files. this approach works me, much improve mindscape workbench. must i'm not big fan of mindscape workbench, although experiments lie approximately 1 year back.

QA platform requirements for KIK integration -

QA platform requirements for KIK integration - is fair assume if tested on these platform, we've covered qa requirements? our assumption testing on 7.0 same 7.x, , android, testing on os gingerbread cover 2.3 variants, , jelly bean cover 4.1-4.3. our assumption there isn't much difference btwn variants. please advise on coverage is. thanks. iphone 5c/7.0.4 iphone 5s/8.0 iphone 5/6.0 iphone 5s/7.0.4 s2 skyrocket/2.3.5/gingerbread lg nexus 5/4.4.2/jellybean samsung galaxy s4/4.2/jellbean htc 1 x/4.0.3/ice cream sandwich samsung galaxy s3 mini/4.1.1/jellybean samsung galaxy tab 7.7/3.2/honeycomb generally testing on of variants of next sufficient passing qa: ios 4/5 (if decided include back upwards these) ios 6 ios 7 android 2.2 (if decide include back upwards it) android 2.3 (any 1 of 2.3.x work) android 4.0.3 android 4.3 kik

c# - How to find the count/number of paragraphs in the table (having merged cell)? -

c# - How to find the count/number of paragraphs in the table (having merged cell)? - how find count/number of paragraphs in table (having merged cell)? how can current paragraph number in word document. below code splitting cell based on paragraphs. final value not matching right paragraph value. for (int k = 1; k < range.cells.count; k++) { if (range.cells[k].range.text.trimend(exclusions).tostring() != "") { string[] temp = range.cells[k].range.text.split('\r'); int tempcnt = temp.length - 1; j = j + tempcnt; } } c# .net

html - How to center input label and input in a row? -

html - How to center input label and input in a row? - i have code: <div class="well"> <form role="form" id="shop-order" method="post" action=""> <div class="row"> <div class="form-group"> <div class="col-md-3"> <div class="pull-right"> <label for="name">label</label> </div> </div> <div class="col-md-6"> <select class="form-control" name="clientid"> $options </select> </div> </div> </div> // perchance other rows... </div> the result of code on image: i don't how can center label , input in row. want

c# - Post Data from contentpage to Masterpage using ajax technique -

c# - Post Data from contentpage to Masterpage using ajax technique - i'm working on web application based on asp.net , c#. when click button in content page, want pass data(string) masterpage , show user. know technique , codes problem ajax. since button in content page within of updatepanel, when click button, message not appear in masterpage. because part of page wil refrsh , not know, how refesh master page code within contentpage: <asp:content id="content1" contentplaceholderid="contentplaceholder_body_member" ...> <asp:updatepanel id="updatepanel1" runat="server"> <contenttemplate> <asp:textbox ... ></asp:textbox> <asp:button id="showtext" ... /> </contenttemplate> </asp:updatepanel> code within masterpage (actually nested masterpage): <asp:content id="content1" contentplaceholderid="cont

java - custom fault message in IBM webspher esb -

java - custom fault message in IBM webspher esb - i have ws copy’s info oracle server. need find proper syntax in java in order utilize custom mediation show me in fault message specific error of why didn't succeed. right i’m getting is: internal error or this. does here know how assist me? java esb websphere-esb

processing - Can't set nofill() when using PGraphics -

processing - Can't set nofill() when using PGraphics - i can't set nofill while rendering pgraphics object. trying draw arc gets me this. while want this. i used next code in processing application 64 bit windows 7 pgraphics pg; void setup() { size(123, 123); pg = creategraphics(123, 123); pg.strokeweight(5); pg.stroke(255); pg.nofill(); nofill(); } void draw() { pg.begindraw(); pg.background(0); pg.translate(width/2, height/2); pg.arc(0, 0, 100, 100, 0, pi+1); pg.enddraw(); image(pg, 0, 0); } it improve set modes , style pg within draw block , works want: pg.begindraw(); pg.background(0); pg.strokeweight(5); pg.stroke(255); pg.nofill(); pg.translate(width/2, height/2); pg.arc(0, 0, 100, 100, 0, pi+1); pg.enddraw(); processing

math - Can't subtract two JavaScript numbers -

math - Can't subtract two JavaScript numbers - both pos1 , pos2 javascript numbers, yet when subtract 1 other, nan. http://jsfiddle.net/2akel/2/ var str = "2014/6/3 "; var y = str.substr(2,2); var pos1 = str.indexof("/"); var pos2 = str.indexof("/", pos1+1); pos2 = ((pos2-pos1)==2 ? 1 : 2 ); var m = str.substr(pos1+1, pos2); var d = str.substr(pos2+1); var = (m.length < 2 ? str("0") + m : m) + "/" + (d.length = 2 || "0" + d) + "/" + y + "*"; alert(pos1 + "|" + pos2 + "|" + m + "|" + pos2); the problem lies in javascript rules order of evaluation. alert look evaluated if written this: alert((((((((pos1 + "|") + pos2) + "|") + m) + "|") + pos2) - pos1)); thus "pos2" appended string before "pos1" subtracted. unlike add-on operator, there no string semantics - , string ends nan . write line this:

ia 32 - What happens when memory "wraps" on an IA-32 supporting machine? -

ia 32 - What happens when memory "wraps" on an IA-32 supporting machine? - i'm creating 64-bit model of ia-32 , representing memory 0-based array of 2**64 bytes (the language i'm modeling in uses ** exponentiation operator). means valid indices array 0 2**64-1 . now, model possible modes of accessing memory, 1 can treat 1 element 8-bit number, 2 elements (little-endian) 16-bit number, etc. my question is, should model if inquire 16-bit (or 32-bit, etc.) number location 2**64-1 ? right now, model returned value memory(2**64-1) + (8 * memory(0)) . i'm not updating flags (which feels wrong). wrapping right behavior? should setting flags when wrapping happens? i have re-create of intel-64-ia-32-isa.pdf i'm using reference, it's 1,479 pages, , i'm having hard time finding reply particular question. i tested (did expect that?) 64bit numbers code: mov dword [0], 0xdeadbeef mov dword [-4], 0x01020304 mov rdi, [-4] phone call writelon

web applications - How to manage 3 ways of filtering in rails app? -

web applications - How to manage 3 ways of filtering in rails app? - this architectural , implementation question, i'm more focused on getting ideas big image strategy. the scenario the app lists foo records in table. there several ways sort them follows: by attribute b_domains , each foo has_many :b_domains, :through => :b_domain_foos easy enough, foos b_domains , working. by set of drop-down pills. foos belong_to each of objects represented pill. example, foo may belong instance of m called m_one . each foo should able sorted number of pills of type m , n , o , or p . freeform text search. all of should done js , never reload page. what strategies maintain active list of foos in memory? mutual rails pattern? can find example? what find myself origin replace list of foos rather refining list in memory on new requests. thanks. ruby-on-rails web-applications

c# - Unexpected behaviour of Convert.ToDateTime() -

c# - Unexpected behaviour of Convert.ToDateTime() - consider next code snippet: datetime dt = convert.todatetime("06/16/2014 -0:10"); console.write (dt.tostring()); console.readkey(); the output 6/15/2014 8:10:00 pm . this came during testing of web application time of day allowed entered manually (date, hh , mm in separate asp.net textbox controls) , characters not limited digits (asp .net validator command accepts "-0" integer in 0..23 range). can explain logic how string converted date/time? either expect exception thrown or "6/16/2014 12:10:00 am" considering "-0" same "0" ("06/16/2014 0:10" converts "6/16/2014 12:10:00 am" 1 expect). according msdn think have set timezone -10 minutes. datestring = "2009-05-01t07:54:59.9843750-04:00"; convert.todatetime(datestring); // '2009-05-01t07:54:59.9843750-04:00' converts 5/1/2009 4:54:59 local time. c# .net datetime

java - Why can't we return an ArrayList.iterator() for Iterator? -

java - Why can't we return an ArrayList<Foo>.iterator() for Iterator<IFoo>? - i have method returns iterator<ifoo> . within method, if seek homecoming somearraylist of type arraylist<foo> , compilation error saying: type mismatch: cannot convert iterator<foo> iterator<ifoo> here's type hierarchy: interface:ifoo --class: foo (implements ifoo) and, here's method: public iterator<ifoo> iterator() { homecoming somearraylist.iterator(); } my question is, when method wants me homecoming of type iterator<ifoo> , why can't homecoming somearraylist of type arraylist<foo> since foo implements ifoo ? update @ 8:38 on friday, june 20, 2014 (utc) the method in question public iterator<ifoo> iterator() cannot modified since i'm implementing interface. i should have mentioned before. sorry. going off recent edit, can't modify method signature (which bad, because more fle

actionscript 3 - Array shuffle function not touching last element -

actionscript 3 - Array shuffle function not touching last element - i using function shuffle 4 element array. shuffles first 3 elements well, shuffling them randomly, lastly element shuffled around other three. public function shufflearray(obja:object, objb:object):int{ homecoming math.round(math.random() * 2) - 1; } there's nil wrong it. that's random. mentioned, algorithm used math.random() makes difference , don't believe as3 algorithm good. for testing purposes, ran few times in js , saw similar things, specific index same quite few times in row. results showing 5-10 times in row, 1 of indexes same. in few tests, saw exact same result appear 11 times in row. running higher maxvalue (i tried 15) resulted in much more random outcome, though still had same problems. interestingly, bumping iterations seemed break pattern. noticed became more random got higher in tries (i tried 10k). var maxvalue = 4, iterations = 100, = []; (var = 1; &

jquery - Events on cloned elements? -

jquery - Events on cloned elements? - i have on click: $('.btn-delete').on('click', function(){console.log('delete')}); i clone div: this.filetemplate = $('.file:first').remove().clone(true); later add together clone page. 'delete' fails log the html: <li class="file"> <button class="btn-delete">&times;</button> </li> since you're not cloning button itself, parent, need deep clone: this.filetemplate = $('.file:first').clone(true,true); $('.file:first').remove(); http://api.jquery.com/clone/#clone-withdataandevents-deepwithdataandevents however, if you're removing element anyway, don't need clone @ -- store div of events using .detach() instead of .remove() : this.filetemplate = $('.file:first').detach(); http://api.jquery.com/detach/ to add together copies of element, deep-clone after it's detached: cl

ios - Set the default text color for "Value History" and "Quick Look" for Playground on XCode -

ios - Set the default text color for "Value History" and "Quick Look" for Playground on XCode - i have been trying find way set default text color "value history" , "quick look" playground on xcode. but, couldn't find settings that. the below screen shot shows both text color , background color "value history" , "quick look" white. couldn't see text without highlighting it. how alter text color black? this bug has fixed in xcode6-beta3, check out! ios xcode swift swift-playground

android - Activity start from sleep mode immediately close? -

android - Activity start from sleep mode immediately close? - i have app wich kind of alarmclock. have weird issue. the principle simple : alarmmanager send broadcast start service , activity. the service vibrates phone 10s , kill activity , itself. activity shows dismiss button. if click on it, stops service , itself. if broadcast received when the phone on, works fine (activity starts , phone vibrates). if broadcast received when phone is in sleeping mode, then activity starts , immediatly stops (you can't see on screen unless set thread.sleep somewhere). service works fine. i don't understand why activity stops after beingness created ? in logcat, have these 2 lastly lines didn't have when it's working : 06-23 18:07:58.349: i/activitymanager(305): displayed com.example.testproject/.alarmescreenoffactivity: +100ms 06-23 18:07:58.349: i/power(305): *** set_screen_state 1 06-23 18:07:58.359: d/kernel(145): [557082.194793] request_suspend_state: wa

ASP.NET Identity 2 - injecting ISecureDataFormat -

ASP.NET Identity 2 - injecting ISecureDataFormat<> - i'm having same issue described here no answer, using unity. i'm trying register isecuredataformat<> in lastest vs2013 (update 2) spa/web api template. i've tried container.registertype(typeof(isecuredataformat<>), typeof(securedataformat<>)); container.registertype<isecuredataformat<authenticationticket>, securedataformat<authenticationticket>>(); container.registertype<isecuredataformat<authenticationticket>, ticketdataformat>(); it "works" not because complains next depenedency in tree, idataserializer... , next idataprotector, found no implementation. i solved next error in simpleinjector next mappings container.register<idataserializer<authenticationticket>, ticketserializer>(); container.register<idataprotector>(() => new dpapidataprotectionprovider().create("asp.net identity" to figure out s

copyfile - QT Splitting files inside folder into different subfolders -

copyfile - QT Splitting files inside folder into different subfolders - i have next code re-create files subfolders. first 20 pictures copied instead of 1-20 first folder, 21-40 sec folder , 41-60 3rd folder: qdir dir(ui->lineedit->text()); qlist<qstring> filenamelist; qfileinfolist files = dir.entryinfolist(); foreach(const qfileinfo &fi, files) { if(!fi.isdir()) { if (fi.filename().endswith(".jpg")) { filenamelist.append(fi.filename()); } } } int parts = (int) (filenamelist.size()) / ui->spinbox->value(); qdebug() << "parts=" << parts; (int = 0; < parts; i++) { qdir().mkdir(ui->lineedit->text() + qstring("/part%1").arg(i + 1)); (int l = 0; l < ui->spinbox->value(); l++) { qfile::copy(ui->lineedit->text() + "/" + filenamelist.at(l), ui->lineedit->text() + qstring("/part%1").arg(i + 1) + "/" + file

java - Android DrawerLayout not Closing -

java - Android DrawerLayout not Closing - i having problem getting android drawerlayout close. in implementation using linearlayout rather listview. list view implementation 1 commonly found in of tutorials , discussed on site. in implementation want utilize same drawerlayout on activities of application. reason of xml layout files utilize include cutting downwards amount of code 1 needs store. the functionality of drawer , it's buttons want them be. draw slides open on swipe, closes on swipe , buttons respond appropriate functionality. however, cannot drawer close programmatically calling of following. has no effect. drawerlayout.closedrawers(); drawerlayout.closedrawer(gravity_start); drawerlayout.closedrawer(drawerlinearlayout); i tried few variants on calling whole drawlayout object veiw no avail, tried different gravity options. here got run time errors complaining illegal states. why closing draw programmatically such hard thing do? why closedra

javascript - Google Maps Can't add event to infowindow div -

javascript - Google Maps Can't add event to infowindow div - i trying add together event infowindows when user "mousesout" of info window closed. have added div around infowindow. in controller create hash create infowindow partial: marker.infowindow render_to_string(partial: "/destinations/map_area_hotel_tile.html", locals: { hotel: hotel }) in partial have <div id="info1"></div> wrapped around else. i have extended regular builder , added in test code basic info printed console: class @areamarker extends gmaps.google.builders.marker create_infowindow_on_click: -> @addlistener 'click', @infowindow_close @addlistener 'mouseover', @infowindow_binding #@addlistener 'mouseout', @infowindow_close create_infowindow: -> homecoming null unless _.isstring @args.infowindow boxtext = document.createelement("div") boxtext.innerhtml = @args.infowindow

url routing - How to handle invalid URL parameters with ui-router in AngularJS? -

url routing - How to handle invalid URL parameters with ui-router in AngularJS? - i transitioning state state planmanager/:param param can param1, param2 or param3. utilize code navigate: <a href ui-sref=".({state: 'param1'})" ng-click="updateresize()" ui-sref-opts="{reloadonsearch: false}">go param1 state</a> now if somehow user hits url parentstate/planmanager/invalidparam , want redirect parentstate/planmanager/param1 in planmanager module, using: angular.module( 'parentstate.planmanager', [ 'ui.router' ]) .config(function config( $stateprovider, $urlrouterprovider) { $stateprovider["state"]( 'planmanager', { url: '/planmanager/:state', views: { "main": { controller: 'planmanagercontrol', templateurl: 'planmanager/planmanager.tpl.html' } }, data:{ pagetitle: 'plan manager', current

CASE statement with IN clause in SQL SERVER -

CASE statement with IN clause in SQL SERVER - this question has reply here: using case statement within in clause 4 answers how can utilize case statement in status along in clause? trying next query , giving syntax error. select * tblcustomers custcode = 'cst1' , case @accounttype when 'doemstic' city in ('hokkaido','tokyo') else city in ('mumbai') end this statement gives syntax error near 'in' i using sql server 2012 when have similar, seek write in way: select * tblcustomers custcode = 'cst1' , ( ( @accounttype = 'doemstic' , city in ('hokkaido','tokyo') ) or ( @accounttype <> 'doemstic' , city in ('mumbai') ) ) if has improve idea, please share

bootloader - Could OpenWrt run on barebox? -

bootloader - Could OpenWrt run on barebox? - could openwrt run on barebox is there portable application framework on top of uboot/barebox? source code indepent low-level hardware. absolutely possible. i've been using barebox main bootloader imx25 soc. there no barebox in public packages though(i've never met it), can build own "bootloader-barebox" package. follow these links: https://vivekian2.wordpress.com/2007/03/28/building-your-own-package-for-openwrt/ http://prplfoundation.org/wiki/creating_an_openwrt_package_for_a_web_page i'm not sure framework, know can create application. http://www.denx.de/wiki/view/dulg/ubootstandalone here illustration of makefile barebox: # # copyright (c) 2013 openwrt.org # # free software, licensed under gnu general public license v2. # see /license more information. # include $(topdir)/rules.mk include $(include_dir)/kernel.mk pkg_name:=barebox pkg_version:=0.1 pkg_release:=0 pkg_build_dir:=$(kernel_build_d

ruby - block function until it finishes returning. -

ruby - block function until it finishes returning. - cluster_size = 5 def build_namenode_box( config ) vmname = "namenode" config.vm.define vmname.to_sym |namenode| namenode.vm.box = "dummy" namenode.vm.provision :chef_solo, preserve_order: true |chef| chef.cookbooks_path = "cookbooks" chef.roles_path = "roles" chef.add_role "test" chef.data_bags_path = "data_bags" chef.add_recipe "cloudera::namenode" chef.add_recipe "cloudera-cluster" end namenode.vm.provision :hostmanager namenode.vm.provision :shell, :inline => $script end end def build_slaves_boxes( config, cluster_size ) (1..cluster_size).each |i| vmname = "slave#{i}" config.vm.define vmname.to_sym |slave| slave.vm.box = "dummy"