Posts

Showing posts from April, 2013

c# - Self Referencing Many-To-Many Linq Query -

c# - Self Referencing Many-To-Many Linq Query - i have datatable this: mtom { parentid, childid } item { id, data, label } how write linq query returns every childid under given parentid , associated info , label each of these decendent ids. if using sql i'd utilize union all , inner join , don't know linq plenty this. performance absolutely not issue there @ 3 levels of nesting , 1 or 2 items in each level. ddl i'm trying populate used , not mission critical. assuming kid id refering id field in items table u can write next query fetch required records from mt in mtom mt.parentid == givenparentid bring together in item on mt.childid equals it.id select new { parentid = mt.parentid, childid = it.id, childdata = it.data, childlabel = it.label} data beingness returned in anonymous type. u can create new type , populate resultant records c# linq linq-to-sql

java - Compass guide to GPS destination -

java - Compass guide to GPS destination - i want rotate imageview arrow current user location saved gps location. how do this? is initial bearing got location.distancebetween method right way go on this? if so, how utilize compass readings? you can utilize bearingto method in location class, retrieve current bearing using sensormanager.getorientation method. finally, adding both results, draw arrow. hope helps. java android gps compass-geolocation

asp.net - Get previous page URL after Response.Redirect -

asp.net - Get previous page URL after Response.Redirect - i'm trying previous page url after response write , i've looked around web , people using http_referer doesn't work response.redirect there anyway url of previous page? i have code on few pages , need know page coming when gets servererror/default.aspx page response.redirect("servererror/default.aspx?404") and on servererror/default.aspx page i'm trying grab previous page url , set session session("errorpage") thanks jamie update i have got work this response.redirect("server-error.aspx?404&" & request.url.tostring()) that passes url of page error next page , grab query string thanks jamie you can pass url of previous page error page's url. response.redirect("servererror/default.aspx?404&url=/folder/page.aspx") and url value on error page , redirect previous page. asp.net session response.redirect

flex - How to remove row from datagrid? -

flex - How to remove row from datagrid? - i have datagrid i'd able remove rows @ will. below component item renderer i'm putting in order accomplish desired result, there has improve way access info provider of "parent" info grid. have ideas/suggestions? <?xml version="1.0" encoding="utf-8"?> <s:mxdatagriditemrenderer xmlns:fx="http://ns.adobe.com/mxml/2009" xmlns:s="library://ns.adobe.com/flex/spark" xmlns:mx="library://ns.adobe.com/flex/mx" focusenabled="true"> <fx:script> <![cdata[ public function deleterow(event:mouseevent):void { var datagrid:datagrid = event.target.parent.parent.parent; // there has improve way info grid climbing entity chain this. datagrid.dataprovider.removeitemat(datagrid.dataprovider.getitemindex(data)); } ]]> </fx:script> <s:button label="delete" click="deleterow(event)"/> </s:mxdatagriditemrendere...

eucalyptus - How do I add more vmtypes to euclytpus 3.4.2 -

eucalyptus - How do I add more vmtypes to euclytpus 3.4.2 - i using eucalyptus 3.4.2 , need add together more "vmtype" definitions. or how add together definitions vmtype screen? eucalyptus supports modification of existing types, , restricting visible types via policy of version 4.1 not back upwards additional vmtypes. eucalyptus

.net - Vb.net, Crystal Report : Number of lines vary from computer to computer -

.net - Vb.net, Crystal Report : Number of lines vary from computer to computer - output required : there many lines generated in vb.net printed in crystal reports. lines set in such way each page should contain 36 lines. problem occurred : even though content, paper size , font family same, number of lines printed vary scheme system. print 35 lines , print 36 lines. environment : software programmed in vb.net. crystal reports used printing. why problem has occurred? , how solve this? .net vb.net printing crystal-reports report

pointers - How to avoid memory leaks, with C++ with STL containers? -

pointers - How to avoid memory leaks, with C++ with STL containers? - code snippet below: //container declared map<string, structa*>& amap; // allocation , insertion container structa *item = new structa(); amap["arrdevaddr"] = item; however iterate , free map value (pointer) @ end of map getting used. now, due above code snippet, valgrind flagging me "definitely leaked" message. i want clarify, general principle of coding avoid memory leak. per understanding, in (c++ coding): when allocate memory, entitled free aswell, limted overall span of code. when maintain allocated memory in container (e.g. map here), still need retain pointers (allocations), until map using pointers. which means, allocate >> add together pointer container >> usage of pointers in map >> ensure "deleting/freeing" struct-pointers, when map utilize over, or if map contained in object, in object's "destructor", map should i...

Entity framework adding null foreign key to child tables -

Entity framework adding null foreign key to child tables - i'm new ef. here problem. i have 2 classes: public class menu { [key] public string number { get; set; } public virtual list<category> categories { get; set; } } public class category { public int64 categoryid { get; set; } public string menucategory { get; set; } public virtual list<item> menuitems { get; set; } } update-database command creates 2 tables create table [dbo].[menus] ( [number] nvarchar (128) not null, constraint [pk_dbo.menus] primary key clustered ([number] asc) ); create table [dbo].[categories] ( [categoryid] bigint identity (1, 1) not null, [menucategory] nvarchar (max) null, [menu_number] nvarchar (128) null, constraint [pk_dbo.categories] primary key clustered ([categoryid] asc), constraint [fk_dbo.categories_dbo.menus_menu_number] foreign key ([menu_number]) references [dbo].[menus] ([number]) ); when ...

html - Need help creating a drop down button with Java -

html - Need help creating a drop down button with Java - i new programming in java. trying create button when clicked produce drop down. example, have user input field google type rolling search , separate button when clicked display window right of brings available options. here button: <input id = "maincontainer" type = "button" value = " + ";> is there way create drop downwards menu after clicking button html or css? or need in javascript? it not seem hard theoretically not know much java don't have much of starting point. believe need onclick() event create new menu. don't know how write out in java. need finish project in next 2 weeks help appreciated. if provide code explanation of how works happiest dude in world. reference appreciated. you can write own using javascript or utilize ui components such as: jquery autocomplete java html select button drop-down-menu

vb.net - How do I improve performance of WPF UserControl rendered in Windows Forms -

vb.net - How do I improve performance of WPF UserControl rendered in Windows Forms - we using wpf user controls in windows form info entry screen more 100 controls. form rendering time increased after go on usage. suggestions? in xaml part: grid panel arrange controls windows form calling method: public form new wpfusercontrol form.tag = me elementhost1.child = form form.formload() -- more code comments -- private sub frmswitch_new_load(byval sender object, byval e system.eventargs) handles me.load public form new wpfusercontrol form.tag = me elementhost1.child = form form.formload() end sub you creating instance of 100s command everytime call frmswitch_new_load but never unload new controls created. when frmswich unloads need unload wpf controls well where give phone call frmswitch_new_load if that's load event handler form, have event handler unload event form , underthat event handler unload current wpf control wpf ...

MongoDB querying with Java API -

MongoDB querying with Java API - here sample document of mongodb: user:{ _id:1, name:'xyz', age:12, mobile:21321312, transaction:[{ trans_id:1, prod:'a', purchasedat:isodate("2015-02-01"), }, { trans_id:2, prod:'b', purchasedat:isodate("2015-02-01") }, { trans_id:3, prod:'c', purchasedat:isodate("2014-11-24") }] ,... } my query looks like: db.user.find({transaction:{$elemmatch:{prod:'a', purchasedat:isodate("2015-02-01")}}, transaction:{$elemmatch:{prod:{$nin:['b','c']}, purchasedat:isodate("2015-02-01")}}}).count() i trying user count have purchased product 'a' on date "2015-02-01" not have purchased product b & c on same day. so while trying in java query: coll.find(new basicdbobject().append("transaction", new basicdbobject("$elemmatch", new basicdbobject("prod", 'a').append("purchasedat"...

asp.net - How to get all cards list for customer on stripe.net? -

asp.net - How to get all cards list for customer on stripe.net? - offering select payment card (existing) added client himself. using stripe.net 1.1.17.0. since cannot upgrade version due client limitation. there way fetch card list provided client id ? you can list of cards var cardservice = new stripecardservice(); ienumerable<stripecard> response = cardservice.list(*stripecustomerid*); asp.net vb.net webforms

excel vba - VBA - Delete rows that have the same ID and based on a Date -

excel vba - VBA - Delete rows that have the same ID and based on a Date - i trying build vba macro in order delete rows have same id and contains date before 01/01/2015. please see screenshot : http://i61.tinypic.com/2wpjno3.png (red rows have deleted). i have started build next macro : sub auto_open() application.screenupdating = false application.calculation = xlcalculationmanual '***** variables declaration ***** dim lastrow integer dim eventdate string dim col new collection dim itm dim long dim cellval variant '***** find lastly row ***** lastrow = range("a" & rows.count).end(xlup).row '***** conditional formatting statut ***** = 2 lastrow cellval = sheets("dataset1").range("a" & i).value on error resume next col.add cellval, chr(34) & cellval & chr(34) on error goto 0 next each itm in col debug.print itm next application.calculation = xlcalculationautomatic application.screenupdating =...

jasperserver - How to add hyperlink in jasper report using jasper studio 6.03 -

jasperserver - How to add hyperlink in jasper report using jasper studio 6.03 - i new jasper studio . want create study have field value link other table or study . read tutorial they show right click on text field , select hyperlink . in case there no hyperlink when right click on text . please 1 familiar jasper studio 6.0 can help me i have installed jaspersoft studio 6.0.3 , hyperlink alternative on text field seems quite hidden against in ireport in standart perspective. you can find hyperlink alternative between properties tabs when click on text field in table. 5th tab after inheritence , before lastly advanced. might out of monitor, if have not big width of left panel :( hope help :) jasper-reports jasperserver

css - CSS3 Transformation blurry borders -

css - CSS3 Transformation blurry borders - i have centered form on page positioned using top , left values , css3 transformations. <div class="middle"> <h1>this blurry, or should be.</h1> </div> .middle { position: absolute; top: 50%; left: 50%; min-width: 390px; -webkit-transform: translate(-50%, -50%); transform: translate(-50%, -50%); /** backface-visibility: hidden; **/ } h1 { padding-bottom: 5px; border-bottom: 3px solid bluish } notice backface-visibility. when set hidden, problems solved me using chrome 42. doesn't render blurry. others using same chrome version, renders blurry it. here's looks without bv: http://jsfiddle.net/mzws2fnp/ to may blurry, others may not. here's looks bv: http://jsfiddle.net/mzws2fnp/2/ for reason people see border blurry not. know backface-visibility: hidden meant prepare that, , me, not others using same browser i. strange. ...

java - Add a foreign key to composite primary key and changes in JPA Entity class -

java - Add a foreign key to composite primary key and changes in JPA Entity class - i have class user primary key (id) corresponds 'user' table in sql server database. user class has many 1 relationship project entity. public class user{ @id @generatedvalue(strategy = generationtype.identity) @basic(optional = false) @column(name = "id") private integer id; @joincolumn(name = "project", referencedcolumnname = "id_project") @manytoone(optional = false) private project project; } database: create table [dbo].[user]( [id] [int] identity(27,1) not null, [name] [varchar](45) null, [project] [int] not null, constraint [pk_user_1] primary key clustered ( [id] asc) now in database need have 2 rows same user ids different projects changed primary key composite primary key in user table. user table: id name id_project --------------------------- ...

xml - XSLT template match for CSV transform -

xml - XSLT template match for CSV transform - i'm using next xsl transform xml csv, based on before query. xml: <rows> <row> <loannumber>123456</loannumber> <datereceived>2015-04-10</datereceived> <dateclosed>2015-04-10</dateclosed> </row> <row> <loannumber>9988776</loannumber> <datereceived>2015-04-10</datereceived> <dateclosed/> </row> </rows> xsl: <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/xsl/transform"> <xsl:output method="text" encoding="iso-8859-1"/> <xsl:strip-space elements="*" /> <xsl:template match="/*/child::*"> <xsl:for-each select="child::*"> <xsl:if test="position() = 1"><xsl:value-of select="normalize-space(.)"/>,open,</xsl:if> <xsl:if test="position() != 1 , position() != last()...

WCF REST service know when client terminates -

WCF REST service know when client terminates - i developing network card game my server wcf not restful because saving cookie client id identify client each request. from moment know client other info retrieved database (cards has in hand example) there utilize case player connected room , kill client process (not exit nicely telling server left room) how can notified in server user not connected room anymore (and user ter wcf rest client-server server

node.js - How to have OUT parameters in a nodejs addon function? -

node.js - How to have OUT parameters in a nodejs addon function? - i'm writing nodejs addon should have function returns rather big junk of info , result. the result can used homecoming value, how set parameter out parameter? void foobar(const functioncallbackinfo<value>& args) { isolate* isolate = isolate::getcurrent(); handlescope scope(isolate); unsigned int ret = -1 local<uint8array> data; /* here info filled , ret set */ args[0] = local<value>::cast(data); args.getreturnvalue().set(ret); } cheers! node.js

vb.net - Query, edit and add attributes in objects from Active Directory -

vb.net - Query, edit and add attributes in objects from Active Directory - i need create little app using visual basic retrieve user advertisement , edit/add attributes. code here queries ldap , fills textboxes info found in object property. vb knowledge limited please understand question, want know if there's improve ways accomplish goal: dim desystem new directoryentry("ldap://etc") dim dssystem new directorysearcher(desystem) dim srsystem searchresult seek dssystem.filter = ("(&(objectclass=user)(samaccountname=" & textbox1.text & "))") dssystem.searchscope = searchscope.subtree dssystem.propertiestoload.add("samaccountname") dssystem.propertiestoload.add("givenname") dssystem.propertiestoload.add("sn") dssystem.propertiestoload.add("proxyaddresses") srsystem = dssystem.findone()...

python - Caffe network getting very low loss but very bad accuracy in testing -

python - Caffe network getting very low loss but very bad accuracy in testing - i'm new caffe, , i'm getting unusual behavior. i'm trying utilize fine tuning on bvlc_reference_caffenet accomplish ocr task. i've taken pretrained net, changed lastly fc layer number of output classes have, , retrained. after few one thousand iterations i'm getting loss rates of ~.001, , accuracy on 90 percent when network tests. said, when seek run network on info myself, awful results, not exceeding 7 or 8 percent. the code i'm using run net is: [imports] net = caffe.classifier('bvlc_reference_caffenet/deploy.prototxt', 'bvlc_reference_caffenet/caffenet_train_iter_28000.caffemodel', image_dims=(227, 227, 1)) input_image = caffe.io.load_image('/training_processed/6/0.png') prediction = net.predict([input_image]) # predict takes number of images, , formats them caffe net automatically cls = prediction[...

python - how can i merge 2 .txt files? -

python - how can i merge 2 .txt files? - i have 2 .txt files listed below: letter.txt: [fname] [lname] [street] [city] dear [fname]: fellow citizen of [city], , neighbours on [street] invited celebration saturday @ [city]'s central park. bring beer , food! q2.txt: michael dawn lock hart ln dublin -- kate nan webster st king city -- raj zakjg late road toronto -- dave porter stone ave nobleton -- john doe round road schomberg how can merge files produce , print personalized letters illustration first address should print: michael dawn lock hart ln dublin dear michael: as fellow citizen of dublin, , neighbours on lock hart ln invited celebration saturday @ dublin central park. bring beer , food! in conclusion: how can create function merge these 2 .txt files create personalized letters? what have far: first_file = open( "letter.txt", "r") dest_file = open( "q2.txt", 'w') l...

Could a google static map be blocked or deny request? -

Could a google static map be blocked or deny request? - i need generate static maps hospital clients. know, hospitals have strict firewalls (which why not going dynamic). wondering, though google static maps are, well, static: generating them pose issue highly secured firewalls? google-static-maps

PDF template shows wrong font when populated by iTextSharp -

PDF template shows wrong font when populated by iTextSharp - we have application our clients utilize adobe acrobat create pdf template completion certificate. when user completes requirements our application fills in defined fields , allows them print certificate. 1 of certificates printing in arial (helvetica) instead of requested font in (but not all) of fields. i have checked relevent links in stack overflow , other sites none of them address failure of template display font defined in field. code snippet: var pdfstream = new memorystream(); var pdfreader = new pdfreader(pdftemplate); var pdfstamper = new pdfstamper(pdfreader, pdfstream); var pdfformfields = pdfstamper.acrofields; var basefont = basefont.createfont(new hostconfig().getconfigroot().getparent().fullname + "\\fonts\\arialuni.ttf", basefont.identity_h, basefont.not_embedded); pdfformfields.addsubstitutionfont(basefont); foreach (dictionary...

javascript - How to find what caused a DOM element appearance change when hovered over? -

javascript - How to find what caused a DOM element appearance change when hovered over? - there's this page, click next go time slots page. if hover on time slot 1 shown here, appearance changes. checked in chrome's dev tools , couldn't find style hover declaration nor attached javescript mouse on event. how style changed? the time slot has hover style attached it. .ab-columnizer .ab-available-hour:hover { border: 2px solid #f4662f!important; color: #f4662f!important; } how find? inspect element right click , select forcefulness state you find :hover javascript html css

swift - NSOpenPanel as sheet -

swift - NSOpenPanel as sheet - ive looked around @ other answers, nil seems helping case. i have viewcontroller class contains ibaction button. button should open nsopenpanel sheet viewcontroller: class viewcontroller: nsviewcontroller { @ibaction func folderselection(sender: anyobject) { var myfiledialog: nsopenpanel = nsopenpanel() myfiledialog.prompt = "select path" myfiledialog.workswhenmodal = true myfiledialog.allowsmultipleselection = false myfiledialog.canchoosedirectories = true myfiledialog.canchoosefiles = false myfiledialog.resolvesaliases = true //myfiledialog.runmodal() myfiledialog.beginsheetmodalforwindow(self.view.window!, completionhandler: nil) var chosenpath = myfiledialog.url if (chosenpath!= nil) { var thefile = chosenpath!.absolutestring! println(thefile) //do thefile } else { println("nothing chosen") } } } the problem comes myfil...

IronPython: how can I run init code when I import a module using clr.AddReference()? -

IronPython: how can I run init code when I import a module using clr.AddReference()? - i wondering if there way init code run upon importing .net assembly using clr.addreference(), in same way importing python file executes init.py code resides in same directory. in advance! it's not possible clr.addreference , far know. if assembly has ironpython module, can run code when imported (a la __init__.py ). ironpython module pretty simple set up: [assembly: pythonmodule("mymodule", typeof(mymodule))] public static class mymodule { [specialname] public static void performmodulereload(pythoncontext/*!*/ context, pythondictionary/*!*/ dict) { // module initialization code } // variables, functions, classes, etc. appear in module } don't confused "reload" part of name; it's called when module loaded every time reloaded. if assembly used outside of ironpython, can set module in separate assembly references original ...

Troubles with JDBC-ODBC, DSN-less connection strings, and 64-bit Windows 7 -

Troubles with JDBC-ODBC, DSN-less connection strings, and 64-bit Windows 7 - i'm dealing issue has arisen application i've been working on connects access file via jdbc-odbc. on other windows platforms, issue hasn't been encountered, on windows 7 64-bit boxes, attempting connect dsn-less connection strings return: java.sql.sqlexception: [microsoft][odbc driver manager] info source name not found , no default driver specified multiple variations on string have been attempted, of them have returned same error. here's how tries connect: class.forname("sun.jdbc.odbc.jdbcodbcdriver"); stringbuffer databaseconnectionstring; if (systemutils.is_os_windows_7) { databaseconnectionstring = new stringbuffer("jdbc:odbc:driver=microsoft access driver (*.mdb, *.accdb);dbq="); databaseconnectionstring.append(databasefile); } else { databaseconnectionstring = new stringbuffer("jdbc:odbc:driver={microsoft access dri...

Trying to get a DataRow[] Debugger Visualizer to work in Visual Studio 2010 -

Trying to get a DataRow[] Debugger Visualizer to work in Visual Studio 2010 - i'm trying datarow[] debuggervisualizer working visualstudio 2010 , unfortunately can't work work. i'm able datarow 1 working not datarow[], love please? the meat of code here. class="lang-cs prettyprint-override"> [assembly: debuggervisualizer( typeof( pchenry.dr ), typeof( pchenry.drobjectsource ), target = typeof( datarow[] ), description = "datarow array debugger visualizer (or if see it's working yahoo!)" )] namespace pchenry { public class dr : dialogdebuggervisualizer { protected override void show( idialogvisualizerservice windowservice, ivisualizerobjectprovider objectprovider ) { stringbuilder stringtodebug = new stringbuilder(); using( stream datastream = objectprovider.getdata() ) { binaryformatter formatter = new binaryformatter(); ...

classpath - How to reference an included file in OSGi bundle when performing java.io.File or FileInputStream -

classpath - How to reference an included file in OSGi bundle when performing java.io.File or FileInputStream - i using aqute bnd toolset create osgi bundle , have packaged dependant 'resource' files. includes *.css files , *.xsd files in resources directory have created. i have included next in bundle.bnd file: include-resource: resources/=resources/ and when build, generated *.jar file has *.css , *.xsd files in resources directory in top directory of jar bundle file. however, in actual code having difficulty in trying refer part of class path: i have tried following: new file("resources/example.css"); i have tried: url cssfile = this.getclass().getresource("resources/example.css"); seek { file = new file(cssfile.touri())); } catch(exception e) { e.printstacktrace(); } i either nullpointexception error or file cannot found ioexception error (depending 1 use). error when running in both eclipse equinox in debug configu...

android - why ExpandableListView group item scrool to bottom by default? -

android - why ExpandableListView group item scrool to bottom by default? - i have 20 grouping items in expandablelistview displaying in 1 tab, , @ time 5 item can visible on screen. i using setselectedgroup(9) set 10 grouping visible when expandablelistview loads. in case working want, items visible 10 15 on screen. problem occurs when seek alter info set list 10 item , seek display first 5 item using setselectedgroup(0), in case when expandablelistview loads, bottom 5 iems visible on screen. i want see top 5 items visible when alter info set list. question why expandablelistview grouping items moves bottom of list? why cant display top. can help me on please.. android expandablelistview

Sorting SUM of Calculated Field by other value in Table with SQL -

Sorting SUM of Calculated Field by other value in Table with SQL - i calculating "onhand value" of products, multiplying 2 fields (onhand * price). each product belongs class, , want know total onhand value of products within each product class. not sure how this? here's code: select class, (onhand * ptprice) part grouping class, (onhand*ptprice); this lists the class each item, , item's value. want class single column , total of calculated onhand values class shown. guidance appreciated. i'm working in access 2013. just add together sum aggregate calculation part , remove calculation part group by select class, sum(onhand * ptprice) part grouping class; sql calculated-field

Counting entities in particular range in Google Appengine Datastore -

Counting entities in particular range in Google Appengine Datastore - i new google datastore. building simple app , want count number of entities satisfying particular criteria. obvious way first query entity , take count on result : // applying query on "height" property of entity "person filter heightfilter = new filterpredicate("height", filteroperator.greater_than_or_equal, minheight); // utilize class query assemble query query q = new query("person").setfilter(heightfilter); // utilize preparedquery interface retrieve results preparedquery pq = datastore.prepare(q); // , count. i wondering if best way carry out particular task. querying mechanism go through entire database of particular entity(person in case) , match 1 one. there improve way if need count , not entire entity? the database not designed kind of queries, counting hard scale , you're encouraged come solution particular ...

ruby - Rememberable in Devise Rails 4 -

ruby - Rememberable in Devise Rails 4 - i have seen few posts none seem reply i'd understand – "how know rememberable working way think should be?" while testing in localhost using editthiscookie chrome extension, able see remember_user_token beingness created how know before pushing staging it's working correctly? maybe i'm beingness little broad likings stackoverflow didn't want create long-winded post post code , inquire dissect – that's not intention. more anything, i'm looking guidelines maybe great blog post/tutorial explains setting step-by-step can wrap head around if it's working , how/why behind it. in advance , apologize if approach not best. i'd happy provide more info feedback/maybe tips consider didn't consider previously. there tests within devise gem ensure rememberable working expected. can read @ them here: https://github.com/plataformatec/devise/blob/master/test/integration/rememberable_test.rb ...

html - Angular. How to set css properties for "after" and "before" DOM psuedo elements -

html - Angular. How to set css properties for "after" and "before" DOM psuedo elements - i need alter color of "border-left" reddish default color in scope (blue example). class="snippet-code-css lang-css prettyprint-override"> .hello:before { content:' '; display:inline-block; width: 22px; height: 25px; position:absolute; border-left:3px solid red; } .hello:after { content:' '; display:inline-block; width: 20px; height: 30px; position:absolute; border-left:3px solid red; } class="snippet-code-html lang-html prettyprint-override"> <div class="hello"></div> example single color .hello.blue:before { border-color: blue; } .hello.blue:after { border-color: blue; } <div class="hello {{color}}"></div> example hexadecimal color code use embedded style, may work i...

spring mvc - 406 Status on Response when invoking setErrorResult on DeferredResult -

spring mvc - 406 Status on Response when invoking setErrorResult on DeferredResult - i trying create simple spring restcontroller uses rxjava's observable class perform async processing. here code: @restcontroller @requestmapping("/users") public class usercontroller { @autowired private userasyncrepository repository; @requestmapping(value="/{username}", method=get) public deferredresult<responseentity<user>> getbyusername( @pathvariable string username) { final deferredresult<responseentity<user>> deferred = new deferredresult<responseentity<user>>(); repository .findbyusername(username) // returns observable<user> .singleordefault(null) .timeout(1, timeunit.seconds) .subscribe(u -> { if(u == null) { deferred.seterrorresult(responseentity.notfound()); } else { deferred...

How to do center alignment in multirow in Lyx -

How to do center alignment in multirow in Lyx - i have problem center alignment in lyx. can see on screen. possible prepare somehow in lyx have limited options edit code? thank petr merge of cells (0,3) (0,6), i'm using lyx version 2.1.3. to merge of cells you'll need delete text, unmerge, re-merge , add together text in. lyx

javascript - Using prototype with scrollTop to make instances of a Class(js class) active (css class) -

javascript - Using prototype with scrollTop to make instances of a Class(js class) active (css class) - i think title pretty confused, dont know how named i'm trying do. i have paragraph: <p data-initial="100" data-final="1000">test</p> note data-* and paragraph have simple css: p { color: black; margin-top: 500px; } p.active { color: red; } and paragraph instance of animation class: + function($) { var animation = function(element) { this.element = $(element); this.initial = this.element.data('initial'); this.final = this.element.data('final'); if (this.initial > $(this).scrolltop()) { this.applyanimation(); } } animation.prototype.applyanimation = function() { alert('worked!!'); this.element.addclass('active'); } animation.prototype.disableanimation = function() { this.element.removeclass('active'); } $(window).on('lo...

Learning to implement a Linked List Queue in C++ -

Learning to implement a Linked List Queue in C++ - i implement linked list using queue in c++. here class: class linkedlistqueue { public: linkedlistqueue(); void enqueue(int x); void dequeue(); int peekfront(); int peekback(); private: struct node { int data; node *next; }; node *head; node *tail; }; linkedlistqueue::linkedlistqueue() { tail = 0; head = tail; } void linkedlistqueue::enqueue(int x) { struct node* newnode = (struct node*) malloc(sizeof(struct node)); newnode->data = x; newnode->next = tail; tail = newnode; if(head != null) { head = tail->next; } } void linkedlistqueue::dequeue() { struct node* newtail = tail->next; delete m_tailptr; tail = newtail; } int linkedlistqueue::peekfront() { if(tail != null) { homecoming tail->data; } else { homecoming head->data; } } int linkedlistqueue::peekback() { if(head != nu...

java - Trying to create and test a comparable arraylist class -

java - Trying to create and test a comparable arraylist class - here's code have. i'm trying test out bubblesort method.. import java.util.arraylist; import java.util.list; public class myarraylist<t extends comparable<? super t>> extends arraylist<comparable<t>> { private static final long serialversionuid = 1l; private myarraylist<t> mylist; // class list public myarraylist(arraylist<comparable<t>> aslist) { (comparable<t> e: aslist) { mylist.add(e); } } public void bubblesort() { boolean swapped = true; while (swapped) { swapped = false; (int = 0; < this.size() - 1; i++) { if (this.get(i).compareto((t) this.get(i + 1)) > 0) { swapped = true; comparable<t> temp = this.get(i); this.set(i, this.get(i + 1)); this.set(i + 1, temp); } } } } } in test class, having p...

c++ - How to return a std::map item -

c++ - How to return a std::map item - i have issue on returning item std::map residing within class. trying create simple function like explorerobjectmapitem* myclass::getfirst() { minternalmapiterator = mobserverlookup.begin(); explorerobjectmapitem* item = &*minternalmapiterator; homecoming item; } where next typedefs used typedef map< subject*, shared_ptr<explorerobject> > explorerobjectmap; typedef pair<subject*, shared_ptr<explorerobject> > explorerobjectmapitem; typedef explorerobjectmap::iterator explorerobjectiter; and map , iterator class members: explorerobjectmap mobserverlookup; explorerobjectiter minternalmapiterator; the above code getfirst() function gives compile error saying e2034 cannot convert 'pair<subject * const,boost::shared_ptr<explorerobject> > *' 'explorerobjectmapitem *' not sure going ...

c# - Open a website on client's computer from the server -

c# - Open a website on client's computer from the server - in university can connect wireless network cannot have net access unless log site. site opens automatically when connect wireless network. if don't have browser open, browser automatically open on site. if close browser, open 1 time again after time. can give me thought on how done? i'd utilize school project. in advance. this technique called captive portal , meaning following. a captive portal special web page shown before using net normally. portal used nowadays login page.1 done intercepting packets, regardless of address or port, until user opens browser , tries access web. @ time browser redirected web page may require authentication and/or payment, or display acceptable utilize policy , require user agree. captive portals used @ many wi-fi hotspots, , can used command wired access (e.g. flat houses, hotel rooms, business centers, "open" ethernet jacks) we...

osx - Programmatically formatting string in swift -

osx - Programmatically formatting string in swift - i have strings var arraywithstrings = ["813 - crying flute.mp3", "ark patrol - never.mp3"] i want get var stringtitle1 = "813" var stringnameoftrack1 = "cryingflute" var stringformat1 = "mp3" var stringtitle2 = "ark patrol" var stringnameoftrack2 = "never" var stringformat2 = "mp3" how programmatically? you can utilize regular expressions: let string = "813 - crying flute.mp3" allow regex = nsregularexpression(pattern: "^(.*) - (.*)\\.(.*)$", options: nil, error: nil) if allow matches = regex?.firstmatchinstring(string, options: nil, range: nsmakerange(0, count(string))) { allow title = (string nsstring).substringwithrange(matches.rangeatindex(1)) allow name = (string nsstring).substringwithrange(matches.rangeatindex(2)) allow format = (string nsstring).substringwithrange(matches.rangeatind...

php - Instagram Real Time API OAuth limit exceeded -

php - Instagram Real Time API OAuth limit exceeded - i'm trying set subscription , created business relationship , client few minutes ago. when seek send post request using php , curl, error: { "code":429, "error_type":"oauthratelimitexception", "error_message":"you have exceeded maximum number of requests per hour. have performed total of 5476 requests in lastly hour. our general maximum limit set @ 5000 requests per hour." } i don't think it's possible have sent many requests in time i've had business relationship much less in past hour. there other reason instagram homecoming error? here's code i'm using. it's 1 page handle both initial curl request , homecoming request. <?php if (!isset($_get['hub.challenge'])) { $curl_handle = curl_init('https://api.instagram.com/v1/subscriptions/'); curl_setopt($curl_handle, curlopt_verbose, true); curl_setopt($curl_han...

thumbnails - Android 2.2 GetThumbnail returns incorrect Bitmap -

thumbnails - Android 2.2 GetThumbnail returns incorrect Bitmap - i'm using mediastore.video.thumbnails.getthumbnail() method fetch thumbnails files displaying in list. works begin with, after while thumbnails not ones match file. 1 time getthumbnail() starts failing seems homecoming same bitmap on , on again, regardless of file try. happens on htc desire, running android 2.2, , hard reproduce - start happening after time. here (a cutting version of) source code: static public bitmap getthumbnailforfile(file p_file, activity p_activity) { long imageid = getimageid(p_file, p_activity); if (imageid < 0) { homecoming null; } homecoming mediastore.images.thumbnails.getthumbnail(p_activity.getcontentresolver(), imageid, thumbnails.micro_kind, null); } public static long getimageid(file p_file, activity p_activity) { long result =-1; cursor c = p_activity.getcontentresolver().query(mediastore.images.media.external_content_uri, ...

ruby on rails - How do I access my Virtualbox using Vagrant on Windows 7 -

ruby on rails - How do I access my Virtualbox using Vagrant on Windows 7 - steps have done far: have downloaded virtualbox , vagranton windows7 on local machine made directory in c: drive -> mkdir sitesvm @ windows command line cd'ed sitesvm , did vagrant init vagrant vagrant ssh this popped up c:\sitesvm>vagrant ssh ssh executable not found in directories in %path% variable. ssh client installed? seek installing cygwin, mingw or git, of contain ssh client. or utilize favorite ssh client next authentication info shown below: host: 127.0.0.1 port: 2222 username: vagrant private key: c:/sitesvm/.vagrant/machines/default/virtualbox/private_key i have installed cygwin suggested, cygwin must not communicating locally because not have files available through cygwin command line. what missing here ? the cygwin tools (like ssh ) work cygwin command line, not windows command line. do vagrant destroy or @ to the lowest degree vagrant s...

java - I QUERY [conn487] assertion 13 not authorized for query on -

java - I QUERY [conn487] assertion 13 not authorized for query on - when tried connect mongodb3.0 java service, there error 2015-04-04t07:39:15.008+0800 query [conn487] assertion 13 not authorized query on.... in fact, can utilize username query directly in mongodb. also, can utilize username finish crud operations node.js application. of course, it's simple mongodb, no replication. i set duplicated usernames in admin , database, granted user privileges , actions( actions: [ "find","insert","remove","update" ] ). i have no thought what's wrong java service. this mongo configuration file. port = 27017 fork = true auth = true directoryperdb = true nohttpinterface = true my mongo-java-driver 3.0.0. i've googled it, can't find solution. give thanks much. java mongodb

python - Trying to print a display row-by-row, by adding rows together in a single, multi-line string -

python - Trying to print a display row-by-row, by adding rows together in a single, multi-line string - i trying print out series of die display below: ___ ___ ___ ___ ___ |* | |* | |* *| |* | | | | | | * | |* *| | * | | * | | *| | *| |* *| | *| | | ^^^ ^^^ ^^^ ^^^ ^^^ these die should represent numbers produced when 'roll dice'. have created die class , hand class, , produced below. import random class die(): def __init__(self): self.value = random.randint(1,6) def roll(self): self.value = random.randint(1,6) '''def __str__(self): homecoming str(self.value)''' import die class hand: def __init__(self): self.l=[] in range(5): self.l.append(die.die()) #makes number of dice def __str__(self): """converts hand string printing""" hom...

c# - Restsharp returns error 404 but link is working in a web browser -

c# - Restsharp returns error 404 but link is working in a web browser - i'm trying send info web api error 404: not found. tried link in web browser , it's working fine. i'm using restsharp post request. here's code: var restclient = new restclient(baseurl); var request = new restrequest(resource); request.method = method.post; restclient.cookiecontainer = new system.net.cookiecontainer(); restclient.useragent = "windows phone"; restclient.followredirects = false; request.addheader("content-type", "application/json; charset=utf-8"); request.requestformat = dataformat.json; request.addbody(new scoreinputmodel{ username = uname, email = mail, password = pass, gender = "male" }); seek { restclient.executeasync(request, (response) => { seek { mess...

wxpython - how to use details from one function on another function? -

wxpython - how to use details from one function on another function? - i want utilize "a" randnum function on guessnum function possible? instructions: 1. click new game button 2. come in 4 numbers in empty textbox 3.click guess button 4. should print doesnt work import wx wx.lib.masked import numctrl class myframe(wx.frame): def __init__(self,parent,id,title): wx.frame.__init__(self,parent,id,title) self.panelmain = wx.panel(self, -1) panel = self.panelmain #text boxes , bottons self.guesstxt = wx.lib.masked.numctrl(self.panelmain,-1,size=(100,20),pos=(50,102)) self.newgametxt = wx.textctrl(self.panelmain,-1,size=(100,20),pos=(180,73)) self.guessbutton = wx.button(panel,-1, "guess",pos=(180,100)) self.gamebutton = wx.button(panel,-1, "start new game",pos=(50,70)) #guess botton clicked self.guessbutton.bind(wx.evt_left_down,self.guessnum) #new game botton ...

javascript - Cannot pass dynamically map style in angular-google-maps -

javascript - Cannot pass dynamically map style in angular-google-maps - i have issue. i'm getting styles dynamically services. styles arrays , check worked ok when added inline when i'm getting info dynamically map renders default styling. for illustration here's code: var stylearray = data.settings.theme.mapselected; if(data.settings.theme.mapselected != undefined) { $scope.mapoptions = { maptypeid: google.maps.maptypeid.roadmap, maptypecontrol: false, styles: stylearray }; } else { $scope.mapoptions = { maptypeid: google.maps.maptypeid.roadmap, maptypecontrol: false, styles: [{"featuretype":"landscape","stylers":[{"saturation":-100},{"lightness":65},{"visibility":"on"}]},{"featuretype":"poi","stylers":[{"saturation":-100},{"lightness":51},{"visibility":"simplified"}]},{"fe...

php - Reference: What is variable scope, which variables are accessible from where and what are "undefined variable" errors? -

php - Reference: What is variable scope, which variables are accessible from where and what are "undefined variable" errors? - note: reference question dealing variable scope in php. please close of many questions fitting pattern duplicate of one. what "variable scope" in php? variables 1 .php file accessible in another? why "undefined variable" errors? what "variable scope"? variables have limited "scope", or "places accessible". because wrote $foo = 'bar'; 1 time somewhere in application doesn't mean can refer $foo everywhere else within application. variable $foo has scope within valid , code in same scope has access variable. how scope defined in php? very simple: php has function scope. that's kind of scope separator exists in php. variables within function available within function. variables outside of functions available anywhere outside of functions, not within function. m...

javascript - For loop error in Firefox and IE but not Chrome -

javascript - For loop error in Firefox and IE but not Chrome - i have weird issue: have loop in javascript works absolutely expected in chrome not in firefox or ie. in firefox , ie adds undefined item array , have no clue why. angular.module('app', []) .controller('itemctrl', function($scope){ $scope.itemsa = [ { name: 'testa' }, { name: 'testb' } ]; $scope.itemsb = []; $scope.dosomething = function(idparam) { for(var = 0; < $scope.itemsb.length; i++){ if ($scope.itemsb[i].name === $scope.itemsa[idparam].name) { ... }; }; according developer tools in both browsers $scope.itemb has length 0 @ loop start line for(var = 0; < $scope.itemsb.length; i++) (for whatever reason) still starts loop (which shouldn't know) , in next line if ($scope.itemsb[i].name === $scope.itemsa[idparam].name) there appears undefined item 0 array position out of (and produces error of course). any idea...

verilog - Synthesis of wand as and gate -

verilog - Synthesis of wand as and gate - here have multiple drivers 1-bit port x . want resolve using wand net type. when check out schematics, to the lowest degree important bit of input port connected port x , while remaining bits unread. want bits of a used , assign x port using , gate resolve multiple drivers. module test(input [3:0]a, output [1:0]b); wire [3:0] d [1:0]; wand temp; assign temp=a; inst inst_name (.x(temp),.y(d[1][3]),.z(b[1:0])); assign d[1] = {4'd15}; assign d[0] = {4'd0}; endmodule module inst (input wand x,y, output [1:0]z); assign z={x,y}; endmodule you can utilize for generate loop accomplish want: generate for(i = 0; < 4; = + 1) begin: wand_loop assign temp = a[i]; end endgenerate this code generate next structure: edit: correctly pointed out @mcleod_ideafix, if define temp simple wire can utilize next assignment: assign temp = &a; accomplish goal. verilog

php - create clean url from ID but show name instead of ID -

php - create clean url from ID but show name instead of ID - i trying create htaccess file clean urls i have id , articlename columns in database i trying creat clean urls : localhost/article.php?id=50 localhost/article/articlename/ is possible htaccess file? i have code in article.php file $article=$_request['article']; $getarticle = $db->get_rows("select * articles id=$article"); i have in htaccess file: rewriterule ^article/([^/]*)$ /article.php?id=$1 [l] there's no way utilize apache rewrite convert clean url numeric database id, best way accomplish add together new column database clean url value , utilize query string value instead. then thing need alter in code utilize new column in sql query clause instead of id. php apache .htaccess

How should I handle inclusive ranges in Python? -

How should I handle inclusive ranges in Python? - i working in domain in ranges conventionally described inclusively. have human-readable descriptions such from b , represent ranges include both end points - e.g. from 2 4 means 2, 3, 4 . what best way work these ranges in python code? next code works generate inclusive ranges of integers, need perform inclusive piece operations: def inclusive_range(start, stop, step): homecoming range(start, (stop + 1) if step >= 0 else (stop - 1), step) the finish solution see explicitly utilize + 1 (or - 1 ) every time utilize range or piece notation (e.g. range(a, b + 1) , l[a:b+1] , range(b, - 1, -1) ). repetition best way work inclusive ranges? edit: l3viathan answering. writing inclusive_slice function complement inclusive_range option, although write follows: def inclusive_slice(start, stop, step): ... homecoming slice(start, (stop + 1) if step >= 0 else (stop - 1), step) ... here represents ...

Android - Google maps changed my app name to "Active App" after installatin -

Android - Google maps changed my app name to "Active App" after installatin - after implementing google maps in app, app name changed "active app"(means when install in phone or in genymotion , it's name active app instead of real name) , it's never beingness changed name. this manifest code: <?xml version="1.0" encoding="utf-8"?> <manifest xmlns:android="http://schemas.android.com/apk/res/android" package="param.app.college_selector" android:versioncode="1" android:versionname="1.0" > <uses-sdk android:minsdkversion="8" android:targetsdkversion="21" /> <permission android:name="edu.bloomu.huskies.tsc71523.skatelogger.maps_receive" android:protectionlevel="signature" /> <uses-permission android:name="edu.bloomu.huskies.tsc71523.skatelogger.maps_receive" /...