Posts

Showing posts from July, 2010

node.js - Is it useful to close a MongoDB connection in NodeJS when Ctrl + C is used? -

i'm working on nodejs script using mongodb. without going details, script take intentionally long time executed , of time finish using ctrl + c . i write bit of code close connection when this. but have no idea if it's useful or useless it... here code: mongoclient.connect(url, function (err, db) { console.log('connected correctly server'); /* magic happens here */ process.on('sigint', function () { //should ? console.log('bye'); db.close(); process.exit(); }) }); should use process.on('sigint', fct) or leave node job? actually, is. if connection not closed on client side, server maintains connection until timeout reached. since there limited number of connections, closing open connections should tried. it not much of problem though, unless have a lot of connections or ram tight on server. ram might problem because server allocates stack of 1mb/connection , cursors kept unti

r - Index for for-loop not working well -

i have 2 dataframe dataframe a a 1 4 7 b b 2 5 8 c c 3 6 9 dataframe b a 10 13 16 b b 11 14 17 c c 12 15 18 i wish create new dataframe c retains first 2 column of a , add corresponding numeric elements column 3 5. i used following code: c<-data.frame(matrix(na, nrow=3, ncol=5)) (i in 1:5) { if (i==1:2) {c[,i] <- a[,i]} else {c[,i] <- round((a[,i]+b[,i])/2,0)} } write.xlsx(c, "c.xlsx") however, output looks follwing in excel x1 x2 x3 x4 x5 1 #n/a 11 17 23 2 b #n/a 13 19 25 3 c #n/a 15 21 27 i think there may wrong i==1:2 part, may know how should modify code? thank you! this might of a = read.table(header = f, stringsasfactors = f, text = "a 1 4 7 b b 2 5 8 c c 3 6 9") b = read.table(header = f, stringsasfactors = f, text = "a 10 13 16 b b 11 14 17 c c 12 15 18")

ios - Why CAKeyframeAnimation didn't present after created? -

my code won't work. - (cakeyframeanimation *)createanimation { cakeyframeanimation *animation = [cakeyframeanimation animationwithkeypath:@"path"]; //does @"path" mean path created below ? or path on layer? animation.timingfunction = [camediatimingfunction functionwithname:kcamediatimingfunctioneaseineaseout]; cgmutablepathref path = cgpathcreatemutable(); cgpathmovetopoint(path, null, width-100, 0); cgpathaddquadcurvetopoint(path, null, width+100, 300, width-100, height); cgpathaddquadcurvetopoint(path, null, width+20, 220, width-100, height); cgpathaddquadcurvetopoint(path, null, width+50, 230, width-100, height); // …… more code animation.path = path; animation.repeatcount = 10; animation.delegate = self; animation.duration = 2; cgpathrelease(path); return animation; } this animation. have implement delegate animationdidstart , didstop . animation did executed. then add animation c

javascript - Polymer.dom(e).localTarget irregularity -

Image
while trying data binding , running using fire(), noticed there's weird going on event object. whenever dump entire (polymer-wrapped) event in console, localtarget entry bound dom element i'd expect , want. however, when dump localtarget directly, bound child element firing event, i.e. roottarget . i've attached code below, along console output produces. updatelatlonvalues: function(e){ console.log(polymer.dom(e), polymer.dom(e).localtarget) } produces following output i'm stumped. bug, or missing something?

android - Implement if/else -

i want implement code set color of navigation bar if android version above 5.x.x : how can implement if-statement? edit: for want to: string _osversion = android.os.build.version.release; if (_osversion.tostring().startswith("5")) { toast.maketext(getapplicationcontext(), "your android version are: \n\n" + _osversion, toast.length_short).show(); window window = this.getwindow(); window.clearflags(windowmanager.layoutparams.flag_translucent_status); window.addflags(windowmanager.layoutparams.flag_draws_system_bar_backgrounds); window.setstatusbarcolor(this.getresources().getcolor(r.drawable.indigodark)); window.setnavigationbarcolor(this.getresources().getcolor(r.drawable.indigodark)); } else if (_osversion.tostring().startswith("6")) { window window = this.getwindow(); window.clearflags(windowmanager.layoutparams.flag_translucent_status);

windows phone - Publisher attribute of the Identity element in AppxManifest (Cordova) -

i trying publish windows phone cordova application on windows store. build application with: cordova build widows --release when upload, getting error package acceptance validation error: publisher attribute of identity element in app manifest of file cordovaapp.xxx.appx cn=$username$, doesn't match publisher id: cn=xxxxxxxxxxxxx. i tried associate app defining next line config.xml: <preference name="windows-publisher-id" value="-appcn-" /> but there stil: <identity name="xxx" publisher="cn=$username$" version="1.0.0.0" processorarchitecture="neutral" /> in appxmanifest.xml after build. how can specify cn value? (i not using visual studio) try changing publisher attribute of identity tag in /platforms/windows/package.phone.appxmanifest edit: there better solution (see cadesalaberry's answer below)

vhdl signal assignment in a testbench -

even after doing extensive research in web, have not come across clean explanation of how signal assignment happens in vhdl testbench wait statements. could please elaborate how work? for e.g. within process have this: wait until spi_sck = '1'; wait until spi_sck = '0'; tb_rx_bytes(7) <= spi_mosi; how can make sure tb_rx_byte assignment happens? more specifically, problem last tb_rx_bytes not set spi_mosi assignment. for j in 31 downto 0 loop wait until spi_sck = '1'; wait until spi_sck = '0'; tb_rx_bytes(j) <= spi_mosi; end loop; in order see effect of signal assignment 3 conditions must hold successively: there event (value change) on spi_sck , new value '1' there event (value change) on spi_sck , new value '0' some physical time elapses such assignment has visible effect i guess last condition fails , prevents last assignment having visible effects. add wait 1 ns; after end loop; stat

Not able to connect to the remote server of neo4j database -

i trying data neo4j database @ remote location make ajax request follows: $.ajax({ type: "post", // headers: {"access-control-allow-origin": "*"}, url: "http://<mysite>.sb04.stations.graphenedb.com:24789/browser/", headers: { "authorization": "basic " + btoa('email' + ":" + 'mypw') }, crossdomain: true, accepts: { json: "application/json" }, datatype: "json", data: { "query": "start n = node(*) return n", "params": {} }, success: function (data, textstatus, jqxhr) { alert(textstatus); }, error: function (jqxhr, textstatus, errorthrown) { alert(textstatus); } }); but getting particular error: xmlhttprequest cannot load . no 'access-control-allow-origin' header present on requested resource. origin ' http://localhost:8383 ' th

Jmeter - Need to push 200 XML lines in a XML request with a changing parameter -

Image
i new jmeter,please me in getting below implemented. scenario: web services scritping in jmeter. have xml request in have parameter ${itemnode}. in subsequent line need pass computed value ${targetxml} pass 200 xml lines changing articleid (rest of xml line static article id changing ) need uniquely user parameter file. next ${itemnode} need pass 200 xml lines next set of articles. basically need push 200 xml lines (only articles unique , rest of xml line static) per ${itemnode}. please me inputs. for instance, have xml file like: <?xml version="1.0" encoding="utf-8"?> <note> <to>tove</to> <from>jani</from> <heading>reminder</heading> <body>don't forget me weekend!</body> </note> in http request sampler switch "body data" tab , put xml file there replace bit need change jmeter function or variable , suitable functions are: __stringfromfile() - if s

In Java, can we claim that lambda expressions are stored and is present in heap? -

1. public interface mycomparator { 2. public boolean compare(int a1, int a2); 3. } 4. myclass obj = new myclass(); 5. mycomparator mycomparator = (a1, a2) -> return a1 > a2; 6. boolean result = mycomparator.compare(2, 5); in line number 4, obj reference refers object on heap, constructed invoking myclass(). in line number 5, mycomparator reference referring present on other side of assignment operator, i.e lambda expression. is lambda expression object? if yes, stored on heap? adhere rules of garbage collector, cleans unreferenced objects or behaves different? if no, i.e if lambda expression not object , thereby assuming not present in heap, how mycomparator (being reference, assuming present in stack) able refer lambda expression , able invoke method on it? in java, arrays stored on heap, can safely claim below array stored on heap? can safely assume 'code run' getting stored objects on heap? filefilter myfilefilter[] = new filefilter[] { f -> f.exist

.htaccess - Apache alias/rewrite to a subdirectory without redirecting -

as example, accessing project foo @ https://localhost/projects/foo/dev/ . i'd rewrite url https://localhost/projects/foo/ points projects/foo/dev/ in documentroot folder this should not http 3xx redirect. furthermore dev1 , dev2 , , on should not accessible (unless there directories inside of dev names that's unlikely). of course rest of path query strings , fragments need retained, example: projects/foo/dev/assets/js/jquery.min.js -> https://localhost/projects/foo/assets/js/jquery.min.js this directory structure in documentroot folder: projects/ foo/ dev/ dev1/ dev2/ dev3/ bar/ dev/ dev1/ dev2/ and on... i've tried answer posted in this question isn't taking effect after restarting apache. i've tried seems correct giving me http 500 infinite redirects error in error.log : rewriteengine on rewriterule ^(.*)$ src/$1 [l,qsa] i have access inside each project directory (e.g. foo , bar ) , parent directory may not called

ios - How to check if CLCircularRegions intersect -

i'm developing ios app (with swift) keeps log of user's location history. part of search algorithm, i'd check if 2 clcircularregions intersect, can't seem find core location method or function it. clcircularregion has containscoordinate method, that's not need. know map kit includes functions check intersecting mkmaprects , since i'm not working maps, solutions don't seem ideal. i hope i'm missing obvious, can't seem figure out. how can check if 2 clcircularregions intersect? if don't mind small inaccuracies, can assume regions small enough curvature of earth negligible therefore regions can treated planes. in case, check whether distance of 2 center points smaller sum of radii. 2 circles intersect if , if centers closer sum of radii. clcircularregion r1, r2; const double meanearthrad = 6371009; const double metersperdegree = 2 * m_pi * meanearthrad / 360; double dlat = r2.center.latitude - r1.center.latitude; double dlon

Python: find_all in Beautiful soup does not return what is expected -

i have html this: <ul class='whs-nw m-0 items'> <li> <a href='/news/stocks-hold-slight-gains-amid-140642829.html' class='d-b fz-s fw-400' data-ylk='rspns:nav;t3:sub0;elm:hdln;elmt:ct;itc:0;pkgt:15;g:e3b49674-fd8a-3acb-9395-4ac0811af672;ct:1;cpos:2;'> <div class='p-0 whs-n'> <div class='m-0 pt-2 ov-h'> <p class='m-0 d-i'>dow closes down more 150 wal-mart, boeing weigh</p> </div> </div> </a> </li> ... </ul> i trying use beautifulsoup exctract /news/stocks-hold-slight-gains-amid-140642829.html , doing this: soup = beautifulsoup(html) tmp= soup.find_all('ul', attrs={'class' : 'whs-nw m-0 items'}) but tmp empty when @ it. doing wrong? for reference p

html - Retrieve every model and return three values -

i looking way retrieve models in database. loop through of models , read out values name , firstname , phonenumber . so far i've gotten , failed go past it: $searchmodel = new employeesearch(); $dataprovider = $searchmodel->search(yii::$app->request->queryparams); i looking implement 3 values in simple html table: <tr><td>$firstname</td><td>$name</td><td>$phone</td></tr> the table should part of pdf output, ideally save variable: $html_table = '<tr><td>$firstname</td><td>$name</td><td>$phone</td></tr>'; i need every model fulfills criteria of status = 'active' in database. so far i've been able tables via gridview , not in html template either. you don't need data provider achieve this, try : $models = employee::find()->where(['status'=>'active'])->orderby('name asc')->all(); foreach ($

How to parse complex XML to a long format data frame in R -

i tried parse xml r data frame. xml.text <- '<?xml version="1.0" encoding="utf-8" standalone="yes"?> <recordgroup> <period>60</period> <record> <datetime>01102015000000</datetime> <field> <id>equipos.0cr02-1.ae</id> <value>34.405000</value> </field> <field> <id>equipos.0cr02-1.api</id> <value>160.794000</value> </field> </record> <record> <datetime>01102015001500</datetime> <field> <id>equipos.0cr02-1.ae</id> <value>38.309000</value> </field> <field> <id>equipos.0cr02-1.api</id> <value>152.800000</value> </field> </record> </recordgroup>' library(xml) xml <- xmlpa

java - Android: I'm confused about how to get the right context to find my Views -

i've got maintabbedactivity.xml holds fragment.xml . fragment.xml holds listview . listview gets populated array of customview.xml . customview.xml holds textview wanna pass string to. so it's like: maintabbedactivity.xml -fragment.xml --customview.xml i create new customviews inside of fragment.java , populate listview them. working fine. try find textview set text, crashes because null . i'm pretty new android, after day of googleing looks i'm passing wrong context. don't know how right one. this how pass context in fragment.java : customview newcv = new customview (getactivity.getapplicationcontext()); newcv.setname("hello"); here's customview.java looks like, including line returns null: public class customview extends framelayout{ string name; //views textview usernametoset; public string getname(){ return name; } public void setname(string name){ this.name = name; } pu

Continue webservice call after transition from foreground to background in iOS objective C -

suppose call webservice when app in foreground. if user sends app background how make sure webservice call keeps executing in background. this piece of code using in app. login* login = [[login alloc]init]; [login initiatesigninprocess]; initiatesigninprocess has 4 web service calls. normal functions. using afnetworking . if of services fail, call again delay in failure block of afnetworking code below:- failure:^(afhttprequestoperation *operation, nserror *error) { [self performselector:@selector(getuserid) withobject:nil afterdelay:5]; } now want know if user sends app background, how code execute? call function in bakcground till succeeds? best use background process fetch. here great tutorial solution [ http://code.tutsplus.com/tutorials/ios-7-sdk-working-with-background-fetch--mobile-20520

mean stack - What is difference between require(path) and require(path)() in node.js -

in node.js projects have seen require(path) require(path)() paranthasis refers. when should use require(path) , require(path)() the require() statement returns module.exports property within module being loaded. depends entirely on module set to. if module set function of kind (often called module constructor function), natural call var = require('xxx')(...); but, if module exports object properties on it, programming error try call it. so, depends entirely upon module loading exporting. for example, when loading file system module, be: var fs = require('fs'); the variable fs in case object (not function) not call - reference properties on it: fs.rename(...) here's example of module exporting constructor function call () after it: // myroutes.js module.exports = function(app) { app.get("/", function() {...}); app.get("/login", function() {...}); } // app.js // other code sets app object // .... /

Java - All Elements in List Become Identical -

i'm having trouble using loop assign elements list. here's section of code i'm having trouble with: private static list<string[]> modify(list<string[]> data) { list<string[]> data2 = new arraylist<>(); (int i=0; i<data.size(); i++) { string[] block = data.get(i); // code here modify contents of block data2.add(block); } return data2; } for reason, method returns list elements identical. i've tried outputting list elements see happening, , seems happening outside of loop. example, this: private static list<string[]> modify(list<string[]> data) { list<string[]> data2 = new arraylist<>(); (int i=0; i<data.size(); i++) { string[] block = data.get(i); // code here modify contents of block data2.add(block); system.out.println(arrays.tostring(data2.get(i)); } return data2; } displays list of different elements, whereas this:

Python 3 encoding/decoding problems between FreeBSD/Linux BeautifulSoup -

i have application modifys contents of xml file (via beautiful soup), writes disk. easy enough, on development machine (linux), have working code: first off, lets load file soup: # load document document = open(contentxml, encoding="utf-8") # load soup soup = beautifulsoup(document, "lxml") # soupy stuff here open(document.name, "w") f: # soup beautiful soup data f.write(soup.decode("utf-8")) now works fine , dandy, when run exact same code on freebsd production system, error: unicodeencodeerror: 'ascii' codec can't encode character '\xa3' in position 8253: ordinal not in range(128) so in case, thought try encoding file, , write disk: with open(document.name, "w") f: # soup beautiful soup data # srting output cannot write bytes soup_enc = str(soup.encode('utf8')) f.write(soup_enc) now works without error, writes incorrect xml output file, outputs b'<myxmlcont

php - Updating 1 group through MailChimp API v2.0 while multiple is created -

i have list consists of multiple groups, batchsubscribe want update single group in list, possible or every update should contain information other groups also? replace_interest must set true (default) this code batchsubscribe: foreach ($company->users $user) { if ($this->isvalidadmin($user)) { $subscribers[] = ['email' => ['email' => "$user->email"], 'email_type' => 'html', 'merge_vars' => ['fname' => $user->first_name, 'lname' => $user->last_name, 'mc_language' => $user->lang, 'gro

node.js - How to mock streams in NodeJS -

i'm attempting unit test 1 of node-js modules deals heavily in streams. i'm trying mock stream (that write to), within module have ".on('data/end)" listeners trigger. want able this: var mockedstream = new require('stream').readable(); mockedstream.on('data', function withdata('data') { console.dir(data); }); mockedstream.on('end', function() { console.dir('goodbye'); }); mockedstream.push('hello world'); mockedstream.close(); this executes, 'on' event never gets fired after push (and .close() invalid). all guidance can find on streams uses 'fs' or 'net' library basis creating new stream ( https://github.com/substack/stream-handbook ), or mock out sinon mocking gets lengthy quicky. is there nice way provide dummy stream this? instead of using push, should have been using ".emit(<event>, <data>);" my mock code works , looks like: var mocked

c# - log4net: send email which includes hyperlink -

i using log4net smtpappender sending email my-system users. i need email-body include hyperlink site. so, attached hyperlink message string. however, seems not right, because since add it- email not sent. how can add hyper link correctly? here tried do: ilog emaillog = log4net.logmanager.getlogger("emaillogger"); string mymsg = "testmsg" + environment.newline + "http://mysiteurl"; emaillog.error(emaildata.msg); here log4net configuration: <appender name="smtpappender" type="log4net.appender.smtpappender"> <to type="log4net.util.patternstring" value="%property{toaddress}" /> <from value="myuser@mycomp.com" /> <subject type="log4net.util.patternstring" value="%property{subject}" /> <smtphost value="myhost.net" /> <username value="muusername" /> <password value="mypassword123" /> <a

mysql - How to do multiple join on same table and then join with another table? -

i want inner join on same table i.e product_attributes want prod_value = gender , prod_attr=male , maingroup = pants. means, want products gender male , falls under pants .i want print prodgroup , join product_master table need prod_name . how can achieve this? table 1 : product_attributes +----+------------+-----------+------------+ | id | prod_style | prod_attr | prod_value | +----+------------+-----------+------------+ | 1 | 0010 | gender | male | | 2 | 0010 | maingroup | pants | | 3 | 0010 | prodgroup | pants_abc | | 4 | 0010 | blue | color | | 5 | 0011 | gender | male | | 6 | 0011 | maingroup | pants | | 7 | 0011 | prodgroup | pants_pqr | | 8 | 0012 | gender | female | | 9 | 0012 | maingroup | pants | | 10 | 0012 | prodgroup | pants | | 11 | 0013 | gender | female | | 12 | 0013 | maingroup | jackets | +----+------------+---

javascript - d3.js load data dynamically -

i have file 5 variables , data 10 years. each year has 8000 data points (for every hour of day in year) each variable. when use these data (8000*10*5 = 400k) create interactive line plot using d3.js, there delay in loading viz. similar http://bl.ocks.org/dstruths/9c042e3a6b66048b5bd4 . to make plots load faster, can query average of day every year every variable , plot them, begin with. my questions if want zoom in day , 8/1/2010, how can query database hourly data of day? database using cassandra , using node.js query cassandra.

asp.net mvc - C# MVC Rote custom configuration -

i have: routes.maproute( name: "default", url: "{culture}/{controller}/{action}/{id}", defaults: new { culture = "en-us", controller = "home", action = "index", id = urlparameter.optional } ); that makes urls this: www.site.com/en-us/contactus/index www.site.com/es/contactus/index my question how configure routes when "culture" "en-us" urls this: www.site.com/contactus/index but when "culture" "es" or other culture (besides en-us) urls (example below "es" culture): www.site.com/es/contactus/index your routes should follows: public static void registerroutes(routecollection routes) { routes.ignoreroute("{resource}.axd/{*pathinfo}"); routes.maproute( name: "culture", url: "{culture}/{controller}/{action}/{id}", defaults: new {

c# - Cannot unregister UpdatePanel with ID 'UpdatePanel1' since it was not registered with the ScriptManager -

here code: protected override void oninit(eventargs e) { scriptmanager sm = scriptmanager.getcurrent(this.page); methodinfo m = ( methods in typeof(scriptmanager).getmethods( bindingflags.nonpublic | bindingflags.instance ) methods.name.equals("system.web.ui.iscriptmanagerinternal.registerupdatepanel") select methods).first<methodinfo>(); m.invoke(sm, new object[] { updatepanel}); base.oninit(e); } aspx file: <asp:updatepanel id="updatepanel1" runat="server" onunload="updatepanel_unload"></asp:updatepanel> now shows error: 'asp.v4_inbox_new_aspx' not contain definition 'updatepanel_unload' , no extension method 'updatepanel_unload' accepting first argument of type 'asp.v4_inbox_new_aspx' found (are missing using directive or assembly reference?) the name 'updatepanel' not exist in curre

regex - string comparison for hash keys in perl -

i having hash map in perl this: map_message_to_number => { 'hello world, xyz' => 11, 'i using stack overflow guidance' => 12, 'programming good!' => 13, }, in perl code trying make match hash key , if match happens return corresponding hash value ( number ). my code working fine. my $strtomatch = 'hello world, xyz!'; if ( condition ) { $val = map_message_to_number->{$strtomatch}; # code use return value dosomethingwith $val; } my question here is: if see value of variable $strtomatch has 1 character '!' not present in original hash map. because of hash map not returns value. my question how can make more generic can make comparison if part of strings match. even few characters match fine return value. let me know. i not sure how can use regular expression here because doing comparison value in hash map value coming other function. technical , not programming, trying thin

python - Manipulate List with calculating column -

i'm using ipython 2.7 , want analyze production system network. therefore, i'm trying create network out of csv-file . csv-file includes 2 columns. first column representation of work orders; second represents working stations. work orders represent modules. working stations have nodes of network. following data.csv -file: order_id,machine_id, 0,0, 0,1, 1,1, 2,2, 2,3, 2,4, 2,5, 2,6, 2,1, 2,7, 2,2, 3,8, 3,1, 4,9, 5,10, 5,10, 5,5, 5,11, 5,0, 5,12, 5,13, as long orderid has same number, 1 module. in list 5 modules. algorithm creating edges first part of network analysis. algorithm creates edges while in same module. algorithm works , isn't part of problem. following code has analyze machine distribution in module. for example: machine id 2 part of orderid 2. need solution 1 in results, machine id 2 appears 2 times in orderid 2. code's output 2. machineid 10 in modul5 appears 2 times, well. code needs addition in last for-loop (analysis) . guess code ne

c++ - Can getline() be skipped w/o user input? -

this question has answer here: using getline(cin, s) after cin 11 answers edit the issue was using cin >> @ point in program, , there trailing newline in stream buffer. so main question getline(), in order put perspective have see code first. odd reason, when run program, runs through loop fine first time. yet second time skips getline(cin, inputmenu) statment. , yes know very basic program, , know there no other errors i've tested literally every other aspect of it. there getline() don't know? while (1) { // reset input each loop inputmenu = "abc"; // menu cout << "menu\n p (purchase)\n s (shut down)" << "\n\n decide: "; /* put if statement test, make sure runs getline. odd reason when run (see run below)*/ if(1) getline(cin, inputmenu);

css - accessibility menu - open menu on focus -

in site have menu , sub menu my problem when focus tab menu, menu opened hovered menu mouse. when continued sub menu elements tab menu closed. how can keep menu open if of sub element focused. of course can via javascript, want know if can css only. here example (try go links 'tab' ) li.main{ float:left; width:200px; } li .sub{ display:none; } li:hover .sub{ display:block } li.main:focus .sub{ display:block } <ul> <li class="main" tabindex="0"> first menu <div class='sub'> <ul> <li><a href="#">first link</a> </li> <li><a href="#">second link</a> </li> </ul> </div> </li> <li class="main" tabindex="0"> second menu <div class='sub'> <ul> <li><a h

javascript - Can we add images in json data file and call it on page using D3.js -

below code displaying world map on page. i'm trying find way store image in json data file - , calling in tooltip function each country. tooltip function mapped json file , displaying data i've entered. thanks <!doctype html> <meta charset="utf-8"> <style> .country:hover { stroke: #b3b5b3; stroke-width: 3px; } span1 { font-size:18px; font-family:arial, helvetica, sans-serif; } span2 { font-size: 14px; font-family:arial, helvetica, sans-serif; } .text { font-size:14px; text-transform:none; font-family:arial, helvetica, sans-serif; } .point { padding: 2px 2px 2px 2px; } #container { margin-top:20px; height:85%; overflow:hidden; background: #e8e9e8; width:100%; } div .fixed { position: fixed; /*left: 68.9%; top: 61.8%;*/ top:61%; margin-right:10px; right:0; width: 23%; z-index:1; opacity:0.9; } /*@media screen , (-webkit-min-device-pixel-ratio: 2)

database metadata - Oracle Stored Procedure List Parameters -

i'm developing .net front end interacts oracle database. have figured out how list of stored procedures execute, don't know how list of parameters belong stored procedure. want able show list of parameters both input , output parameters stored procedure. i have tried using dba_source, dba_procedures, all_dependencies, haven't seen shows parameters belongs specified stored procedure. any ideas? you find parameter metadata in dba/all/user_arguments view.

node.js - Cannot verify Hashed password in Express using Node js -

this how hash , store password in database. newuser function var salt = bcrypt.gensaltsync(10); var hash = bcrypt.hashsync(password, salt); var query="insert user(email,firstname,lastname,logintime,gender,password) values('"+email+"','"+firstname+"','"+lastname+"','"+logintime+"','"+gender+"','"+hash+"')"; this how retrieve , check authenticate validate function var query = "select password user email='" + email + "'"; connection.query(query,function(err,result){ if(err) { console.log("error:"+err.message); } else { if(result.length!==0) { var hash=json.stringify(result[0].password); console.log(hash); console.log(bcrypt.comparesync(password,hash )); if(bcrypt.comparesync(password, hash)) { callback(err, result); } this shows false if way shows expecte

javascript - Creating a shopping list option on a website for you to write your shopping list in -

would possible create option on e-commerce website allows user write products they're looking don't forget. possibly drops down if click it, , using sessions remembers on each page? would done javascript or done html5? the html5 local storage accessible through javascript. you want have server-side storage of list support older browsers , allow users save list account, bring list on device. for example, make list on desktop computer, switch tablet show member of household in room. in case, local storage desktop not available on tablet, need fetched through ajax call, or loaded initial page load.

$set operator interpreting array index as object index in mongodb -

mongodb seems interpret $set paths numerical components object keys rather array indexes if field has not been created array. > db.test.insert({_id: "one"}); > db.test.update({_id: "one"}, {$set: {"array.0.value": "cheese"}}); > db.find({_id: "one"}) { "_id": "one", "array": { "0" : { "value" : "cheese" } } i expected "array": [{"value": "cheese"}] , instead initialized object key string "0". i array initializing whole array, so: > db.test.update({_id: "one"}, {$set: {"array": [{"value": "cheese"}]}}); ... clobber existing properties , other array elements might have been set. is there way convince $set want "array" array type, following constraints: i want execute in single query, without looking record first. i want preserve existing array entries , obje

android - AppBarLayout not collapsing during programmatically scroll -

i have viewpager fragments containe recyclerviews. collapsingtollbarlayout above viewpager. everythings works fine except during programmatically scroll on recyclerview. appbarlayout or collapsingtoolbarlayout doesn't responde. here base layout xml: <?xml version="1.0" encoding="utf-8"?> <android.support.design.widget.coordinatorlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:id="@+id/coordinatorlayout" android:layout_width="match_parent" android:layout_height="match_parent" android:fitssystemwindows="true"> <android.support.design.widget.appbarlayout android:id="@+id/appbarlayout" android:layout_width="match_parent" android:layout_height="256dp" android:fitssystemwindows="true" android:theme="@style/themeoverlay.appcompat.dark.actionbar&q

java - How to perform Key Listener on SWT Label -

keylistener not performed on label. please one? below code snippet: breaknodelabel = new label(this, swt.wrap); breaknodelabel.setbackground(new color(getdisplay(), 204, 204, 204)); breaknodelabel.addkeylistener(new keyadapter() { @override public void keypressed(keyevent event) { if (event.keycode == swt.del) { // deletenode(this); system.out.println("------------delete break node----------------"); } } }); you've added keylistener label. label must have focus events. if want listen keyboard events in whole window add keylistener shell: shell.addkeylistener(new keyadapter()... if want global keylistener add display filter: listener listener = new listener() { @override public void handleevent(event e) { if(e.type == swt.keydown||e.type == swt.keyup) { system.out.println("" + e.keycode); } } }; display.addfilter(swt.keydown, listener); display.addfilter(swt.keyup

php - Lravel 5.1 How to find database records through a from? -

in admin area of app, want have form admin can find project id , show project details there. best approach implement this? have tried: //route route::get('admin/projects/{project_id}', 'admincontroller@showproject'); //form {!! form::open(['action' => 'admincontroller@showproject', 'method' => 'get']) !!} {!! form::label('project_id', 'project id', ['class' => 'control-label']) !!} {!! form::text('project_id', null, ['class' => 'form-control']) !!} {!! form::submit('submit', ['class' => 'form-control']) !!} {!! form::close() !!} //controller method public function showproject(request $request) { $project=project::find($request->get('project_id')); return view('admin.projects.showproject', compact('project')); } it worked there little problem. afte

Uploaded ASP.NET web application does not send email -

i developing web application, planned send confirmation emails new members. new email service development aspet. app runs without error or exception, , apparently sends emails try , catch blocks return ano exception. however, no 1 receives mail. here code: using system; using system.net; using system.web; using system.net.mail; using system.collections.generic; using system.componentmodel.composition; using system.text.regularexpressions; public void sendemailaddressverificationemail(string username, string to) { mefmanager.compose(this); string encryptedname = username.encrypt("verify"); string msg = "please click on link below or paste browser verify email account.<br><br>" + "<a href=\"" + _configuration.rooturl + "account/verifyemail.aspx?a=" + encryptedname + "\">" + _configuration.rooturl + "