Posts

Showing posts from June, 2013

Apache Storm: Access Disruptor Queue Size -

i wanted know how access queue size of executor's incoming queue. referred question: how monitor size of bolt's pending queues? provides mechanism log information. however, need access data in code. this not possible. storm not provide api access information within code.

table to xml record c# -

i need store on sql server db many records in same column , use xml field this.on backend have code reads/writes xml records , inserts data in table.the table of variable size. have problem in reading fields table , insert them xml variable. need : <bigtag> <smalltagname1> something</smalltagname1> <smalltagname2> thanksforanswering</smalltagname2> <smalltagname3> youareawesome</smalltagname3> </bigtag> the table is: smalltagtable[] = {something,thanksforanswering,youareawesome,....} here code: xelement widgetliste1 = null; widgetliste1 = new xelement("bigtag" ); string smalltagname = "smalltag "; string smalltagdata; for(int i=0;i<smalltagtable.length; i++ ) { smalltagname = "smalltagname " + i; smalltagdata = smalltagtable[i]; widgetliste1.add(new xelement(smalltagname.tostring(),smalltagdata.tostring() )); } string a2 = widgetliste1.tostring(); the problem code hits e

Set and Get the default value of checkbox in ASP.NET mvc -

i using checkbox in asp.net mvc project, i can set check box default unchecked. age: <input class="associationcheckbox" type="checkbox" name="age" /> when post form (for has checkbox), checkbox not showing in formcollection (here expected name , value age, ‘false’). using below code,i reading velues. [httppost] public actionresult index(formcollection formcollection) { foreach (var key in formcollection.keys) { var value = formcollection[key.tostring()]; } return redirecttoaction("corticonindex", "test"); } if check check box @ run time, submit form. can name , value. how default values(false)if don’t check checkbox? i tried setting value property using model property same issue coming. model class: public bool checkboxvalue { get; set; } this.checkboxvalue=false age: <input class="associationcheckbox" type="check

android - FATAL Exception:java.lang.RuntimeException: Unable to start activity ComponentInfo -

i try solve problem don't find solution please me solve it. 1)my package.java file: b_indian=(button)findviewbyid(r.id.b_indian); b_classic=(button)findviewbyid(r.id.b_classic); b_royal=(button)findviewbyid(r.id.b_royal); t_pkg=(textview)findviewbyid(r.id.t_pkg); t_indian=(textview)findviewbyid(r.id.t_indian); t_classic=(textview)findviewbyid(r.id.t_classic); t_royal=(textview)findviewbyid(r.id.t_royal); b_indian.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent i=new intent(package.this,indianpkg.class); startactivity(i); } }); b_classic.setonclicklistener(new view.onclicklistener() { @override public void onclick(view v) { intent i=new intent(package.this,classicpkg.class); startactivity(i); } }); b_royal.s

java - I need to fill the cache(CacheBuilder) as it starts. Is there any random way to do it? -

i have batch program uses cache. cache empty, data arrives compares received data previous received data. * - if data not found: added data * - if data found different: update data * - if data found same: data filtered out so, after few time, cache size increases data keep on increasing. , there processing taking quite amount of time process. i need test whole situation, , have few incoming data , need regenerate situation. need fill cache starts. there random way it? i using cachebuilder cache: private cache> statescache = .newbuilder() .maximumsize(1000) .build(); i thought, there inbuilt function that. later did using loop: private static cache> statescache = cachebuilder.newbuilder()// .maximumsize(1000).expireafteraccess(24, timeunit.hours).build(); static { (int = 0; < 999; i++) { map<string, state> map = new hashmap<string, state>(); (int j = 0; j < 50; j+

wamp - Having trouble while launching localhost in WampServer 3 -

after installing wampserver 3 on windows 7, deleted default file , copied project folder www folder of wamp. then lanched localhost via browser , got error the requested url / not found on server. i have similar problem wampserver 2.5 . please me

selenium webdriver - Xpath get element above -

suppose have structure: <div class="a" attribute="foo"> <div class="b"> <span>text example</span> </div> </div> in xpath, retrieve value of attribute "attribute" given have text inside: text example if use xpath: .//*[@class='a']//*[text()='text example'] it returns element span, need div.a, because need value of attribute through selenium webdriver hey there lot of ways can figure out. so lets text example given, can identify using text:- //span[text()='text example']/../.. --> if know 2 level or //span[text()='text example']/ancestor::div[@class='a'] --> if don't know how many level `div` above 2 xpaths can used if want identify element using text example , if don't want iterate through text. there simple ways identify directly:- //div[@class='a']

java - How to create Full Index Index via Hibernate Mapping -

i can create unique constraint on column in hibernate mapping by @table(name = "table_name", uniqueconstraints = { @uniqueconstraint(columnnames = {"column_with_unique_value"}) }) if want add index specified column @column(name = "index_column", nullable = false) @index private string indexcolumn; so out of 3 indexes possible in mysql (unique, index, full_text), can able create 2 of indexes (unique, index) via hibernate mapping annotation. can't seem find annotations or documentation creating full text index . mysql version : 5.7.x. hibernate version : 4.2.7.final searching full text index creation returns results related hibernate search , lucene. there hibernate annotation available create full text index directly in mysql innodb table..? (just @uniqueconstraint or @index annotation)

java - JTable choose other rows and get their data when certain cell is clicked -

Image
i have jtable. want create event 1 cell if user clicks on it, able choose 1 or more rows table , corresponding ids saved in cell. so in example user click on "click here choose" in row 2 , click on e.g. row 1 , row 3. cell "click here choose" should overwritten 1 , 3 afterwards: i'm thinking of somehow creating mouseadapter event on click on cell have no real idea how it. idea how can approach this? yes need use mouseadapter below(you have cell if "if condition become true"): jt.addmouselistener(new java.awt.event.mouseadapter() { @override public void mouseclicked(java.awt.event.mouseevent evt) { int r = jt.rowatpoint(evt.getpoint()); int c = jt.columnatpoint(evt.getpoint()); if (r >= 0 && c >= 0) { ...... } } });

alertdialog - How to show alert confirmation dialog from listview button in android -

i trying show confirmation dialog after clicking on button in listview . i have setonclicklistener in customadapter in getview method. but on click listener getting following error: 02-25 21:36:32.065 20631-20631/com.themsg.chat w/toast: com.themsg.chat, go ahead. 02-25 21:36:32.095 20631-20631/com.themsg.chat w/system.err: android.view.windowmanager$badtokenexception: unable add window -- token null not application 02-25 21:36:32.095 20631-20631/com.themsg.chat w/system.err: @ android.view.viewrootimpl.setview(viewrootimpl.java:569) 02-25 21:36:32.095 20631-20631/com.themsg.chat w/system.err: @ android.view.windowmanagerglobal.addview(windowmanagerglobal.java:266) 02-25 21:36:32.095 20631-20631/com.themsg.chat w/system.err: @ android.view.windowmanagerimpl.addview(windowmanagerimpl.java:69) 02-25 21:36:32.095 20631-20631/com.themsg.chat w/system.err: @ android.app.dialog.show(dialog.java:286) here code: holder.tvm.setonclicklistener(new view.onclickli

Compare an id to an array in PHP MySQL -

i have array in while lets "while a",like this: myarr=array(); while($row = mysql_fetch_assoc($result)) { $myarr[$kodetb]= $kuranggesek; echo "kodetb=".$kodetb."value=".$myarr[$kodetb]."<br>"; } and result displays: kodetb=tb201506114 value=7001500 kodetb=tb201602179 value=8204000 kodetb=tb201602186 value=200000 kodetb=tb201602321 value=3500000 kodetb=tb201602322 value=150000 kodetb=tb201602327 value=500000 and have query in while let "while b ": while($row3 = mysql_fetch_assoc($result3)) { $kodetbori=$row3['kodetb']; //this id of while b //what trying accomplish want check like: start loop array sintax if $kodetbori_in_while_b==$kodetb_in_while_a) { echo value of $myarr[$kodetb]in while } end } please help.. thanks.

android - Looping through JSONObject to Create Array Java -

i have jsonobject of following format: [{"ascii_name":"rio de janeiro"},{"ascii_name":"riyadh"},{"ascii_name":"rome"},{"ascii_name":"rawalpindi"},{"ascii_name":"rabat"},{"ascii_name":"recife"},{"ascii_name":"ra's bayrut"},{"ascii_name":"rajkot"}] which has been created using following code: while($row = $all_cities->fetch_array()) { $myarray["ascii_name"] = $row["ascii_name"]; $returnarray[] = $myarray; } echo json_encode($returnarray); now using volley task load android app. in onresponse method want obtain each of city names , load arraylist<string> using for loop. code now, won't work since s jsonobject not jsonarray . @override public void onresponse(string s) { try { jsonobject jsonobject = new jsonobject(s);

schema.org - Should the blog index page be optimised for structured data as well as individual article pages? -

there many tutorials out there outline how apply structured data blog articles such one: http://edusagar.com/articles/view/72/how-to-add-microdata-to-markup-structured-data-in-your-blog but 1 question i've had, , have never been able find answer blog index page, excerpts each blog article shown on 1 page? how should these marked up, if @ all, using structured data? is okay have several blogposting schemas on 1 page each blog article? because have currently. but should applying structured data individual blog article pages, , not having on index page? yes, that’s purpose of blog type , blogpost property. on page listing 1 or multiple blog posts (semantically doesn’t matter if these full posts or teasers), each blog post can represented blogposting item gets referenced via blogpost property blog item. with microdata this: <section itemscope itemtype="http://schema.org/blog"> <article itemprop="blogpost" itemscope itemtyp

java - Splitting Netbeans Jar File -

i'm working on project game engine, used make other games. working in netbeans. project has 2 parts, engine itself, , game core being ran. modify build.xml when project builds, takes 1 group of packages, , compiles them jar, (the game core), , rest gets compiled second jar, , places first jar inside of asset folder in second jar. possible, or have keep building manually? i know nothing ant builds, despite research. i found solution, using code. <project name="wraithengine2" basedir="." default="main"> <target name="clean"> <delete dir="/home/thedudefromci/netbeansprojects/wraithengine2/build"/> <delete dir="/home/thedudefromci/netbeansprojects/wraithengine2/dist"/> </target> <target name="jar"> <mkdir dir="/home/thedudefromci/netbeansprojects/wraithengine2/build/classes1"/> <mkdir dir="/home/thedudefromci/netbeansprojects

Blank xml namespace in child nodes in SQL Server -

hi need following in sql: i need create xml file in format <document xmlns="urn:iso:std:iso:20022:tech:xsd:001.002.001.04"> <fitofipmtstsrpt> <grphdr> <msgid></msgid> </grphdr> <orgnlgrpinfandsts> <orgnlmsgid /> </orgnlgrpinfandsts> </fitofipmtstsrpt> </document> at moment have variable holds main info , build between info (take grphdr can inserted multiple times main xml, different info) declare @xml xml='<document xmlns="urn:iso:std:iso:20022:tech:xsd:001.002.001.04"> <fitofipmtstsrpt> </fitofipmtstsrpt> </document> ' declare @xmlgrp xml='<grphdr> <msgid></msgid> </grphdr>' --here code fill msgid then when add grphdr main xml set @xml.modify ('declare namespace a= "urn:iso:std:iso:20022:tech:xsd:001.002.001.04"; insert sql:variable("@xmlgrp") (a:document/a:fitofipmtstsrpt)[1]

Customize date and time in javascript -

i need date , time in format in javascript. 2016/02/17-14:31:36 currently using var data = new date(); but gives date {fri feb 26 2016 18:38:45 gmt+0530 (india standard time)} var d = new date(), year = d.getfullyear(), month = ('0'+(d.getmonth()+1)).slice(-2), day = ('0'+d.getday()).slice(-2), hour = ('0'+d.gethours()).slice(-2), minute = ('0'+d.getminutes()).slice(-2), second = ('0'+d.getseconds()).slice(-2); var datestring = year+'/'+month+'/'+day+'-'+hour+':'+minute+':'+second; next time, please google yourself. thanks. edit has leading zero's.

wordpress - Get current active category from multi category page -

i'm here little challenge. the context: i working company building new website them. being built in wordpress, btw everthing going ok. the website has news , blog page posts on there. in special cases news post can part of blog page. so when happens set 2 categories , put primary @ on of categories. the challenge: when visit post multiple categories can either go to: http://example.com/blog/news_post or http://example.com/news/news_post but there values on page depended on name of category. (i know not idea have no other choice in matter). when visit page want category used field values need. so, when going news page "news" category name when use function name. i have tried multiple things internet said trick either don't work or (what happens most) aren't meant multi category posts getting cat of page. if need more info please let me know. ps. rather not url if best option take it. hope guys can help edit i managed it. althou

Python SQLite error: "attempt to write a readonly database" -

i'm using chunks write local sqlite database. after has progressed point, error "attempt write readonly database". if change chunk size, point @ error comes changes well. database being created progresses, it's 15mb before error, gets 35mb. ideas on how fix or why it's occurring? import pandas pd sqlalchemy import create_engine import datetime dt disk_engine = create_engine('sqlite:///c:\\databases\\test.db') start = dt.datetime.now() chunksize = 100000 j = 0 index_start = 1 df in pd.read_csv('c:\my_file.txt',sep='\t', error_bad_lines=false, chunksize=chunksize, iterator=true, encoding='iso-8859-1'): df = df.rename(columns={c: c.replace(' ', '') c in df.columns}) # remove spaces columns df.index += index_start columns = ['column_1'] c in df.columns: if c not in columns: df = df.drop(c, axis=1) j+=1 print '{} seconds: completed {} rows'.format((dt.datetime.

c# - How to stop a task of FluentScheduler? -

i using fluentscheduler , , have registry class, public class unreadalertregistry : registry { public unreadalertregistry(int minute, string user, bool? type) { var alertaction = new action(() => { // show message box } schedule(alertaction).torunevery(minute).minutes(); } } and in app, initialize it. alert = new unreadalertregistry(5, _dashboarduser, false); taskmanager.initialize(alert); it run every 5 minute. i want stop this. how stop scheduler? i set name schedule. schedule(alertaction).withname("unreadalertregistry").torunevery(minute).minutes(); and stop , use removetask taskmanager.removetask("unreadalertregistry");

android - Store a collection of objects in SharedPreferences -

i working on developing utility class storing data in sharedpreferences. till now, able make generic function store , retrieve string, int , boolean. there generic way store , retrieve collection of objects? there no direct way 2 indirect ways: 1. use gson. public static boolean saveobjecttoprefs(string prefkey, object object, context context) { sharedpreferences.editor editor = getsharedpreferences(context).edit(); try { gson gson = new gson(); string json = gson.tojson(object); editor.putstring(prefkey, json); editor.apply(); return true; } catch (exception e) { e.printstacktrace(); return false; } } the generic here should implement serializable interface. to retrieve object create method this: public static <t> t getobjectfromprefs(string prefkey, class<t> type, context context) { string json = getsharedpreferences(context).getstring(prefkey, null); if (json != null

asp.net - how can i try and catch duplicate data in the database -

try con.open() comm.connection = con comm.commandtext = "insert [adminanduser] (username,firstname,lastname,email,password,usertype) values ('" & textbox1.text & "','" & textbox2.text & "','" & textbox3.text & "','" & textbox4.text & "','" & textbox5.text & "','" & label6.text & "')" comm.executenonquery() response.write("data saved") con.close() catch end try unless alter table such there unqiue constraint on 1 of columns, not able exception when inserting duplicate data. rather attempting generate error though, use sql ensure duplicate entry won't added. presuming trying keep unique usernames, write sql this: comm.commandtext = @"if not exists(select * [adminanduser] [username] = @username)

angularjs - How to get the value of selected row directly in HTML using ag-grid -

Image
i try the value of number row selected, , print in html using angularjs, no issue, have count when clic in grid column header. value of " selectedrowscounter " 0 in html, when dosn't clic in grid header my code like var activebuttons = function() { var countrowsselected = $scope.gridoptions.api.getselectedrows().length; $scope.selectedrowscounter = countrowsselected; console.log($scope.selectedrowscounter); $rootscope.count.selectedrows = countrowsselected; }; $scope.gridoptions = { rowdata: null, angularcompilerows: true, onselectionchanged: activebuttons, } there screenshot i have open same subject here https://github.com/ceolter/ag-grid/issues/1023 i have added line activebuttons function , work fine $scope.gridoptions.api.refreshview(); i dont knew if there solution, work now

c++ - "binary '[' : no operator found -

i have 2 vectors of strings: std::vector<std::string> savestring{"1", "3", "2", "4"}; // numbers std::vector<std::string> save2{"a", "b", "c", "d"}; // names and wish reorder latter based on former, ends being {"a", "c", "b", "d"} . tried this: for (int i=0; i<savestring.size(); i++) { savestring[i] = save2[savestring[i]]; } but getting error: "binary '[' : no operator found takes right-hand operand of type 'std::basic_string<_elem,_traits,_alloc>' (or there no acceptable conversion)" what mean , wrong code? the problem savestring[i] std::string whereas there should integer inside square brackets in save2[] . so, solution first convert std::string integer writing custom function. so, change to: // converts std::string int int toint( const std::string& obj ) { std::str

git - Diff Branches By Commit Message -

if git log master..feature going show me difference between master , feature using hash id. however, if want compare using commit message? e.g. if have rebased branch , hashes different commit messages not. git cherry didn't seem work either, listed commits.

javascript - How do I load remote script in jQuery noConflict mode? -

i want load remote script not utilizing jquery noconflict mode wordpress website, is. need wrap remote script in noconflict mode. thought trick, apparently not. <script> jquery.noconflict(); jquery(document).ready(function($) { $.getscript('http://remote-domain.com/load/remote/script'); }); </script> i thought straightforward, couldn't see remote scripts on googling , checking other stack overflow questions. possible? missing something? being dim? see codepen featuring actual script having issues with no conflict should done 1 once before scripts. see no other problems in code. but keep in mind, jquery ajax request file , use remote url. there might problems when browser and/or server dosesn't allow this. jquery.noconflict(); jquery(function() { jquery.getscript('http://remote-domain.com/load/remote/script'); });

ruby - rubygems platform specific dependency -

gem install pomo not pull in dependency libnotify on linux, causes loaderror @ runtime. problem seems rubygems doesn't know how deal conditionals in gemfile , , writing this extension suggested rubygems wikibook didn't help. how supposed express platform-specific dependencies? you might consider using bundler. configure dependencies using text file (gemfile) , can have platform-specific regions. think newer versions of ruby have bundler in gems.

java - Issues with ActiveMQ client: ClassNotFoundException org.apache.logging.log4j.spi.AbstractLoggerAdapter -

i have small activemq client supposed connect amq service, create queue, , send out message. getting following error message: failed instantiate slf4j loggerfactory reported exception: java.lang.noclassdeffounderror: org/apache/logging/log4j/spi/abstractloggeradapter @ java.lang.classloader.defineclassl(native method) ... the following jars on classpath : log4j-1.2-api-2.6.2.jar log4j-core-2.6.2.jar log4j-slf4j-impl-2.6.2.jar activemq-broker-5.13.3.jar activemq-client-5.13.3.jar activemq-console-5.13.3.jar activemq-jaas-5.13.3.jar activemq-kahadb-store-5.13.3.jar activemq-openwire-legacy-5.13.3.jar activemq-protobuf-1.1.jar activemq-spring-5.13.3.jar activemq-web-5.13.3.jar geronimo-j2ee-management_1.1_spec-1.0.1.jar geronimo-jms_1.1_spec-1.1.1.jar geronimo-jta_1.0.1b_spec-1.0.1.jar hawtbuf-1.11.jar jcl-over-slf4j-1.7.13.jar slf4j-api-1.7.13.jar if take away top 3 libraries error failed load class “org.slf4j.impl.staticloggerbinder” i've tried searching can't

JavaFX. Binding list of non-observables values with TableView -

this question has answer here: javabean wrapping javafx properties 1 answer i write application uses tableview in want represent , edit list of data. i have data model. public class cmodel { private list<citem> m_lstitems; public list<citem> getlist() { return m_lstitems; } } public class citem { private string m_sname; private string m_stype; public void setname(string s) { m_sname = s; } public string getname() { return new string(m_sname); } } if need bind data model can create observablelist() . doesn’t allow me observe items editing. make editing possible need inherit citem members observable . if declare property tableview observes items changes. the problem if cmodel pure data model shouldn’t inherit observable (because data , view should separated). ho

php - Call to undefined method mysqli_stmt::get_result -

here's code: include 'conn.php'; $conn = new connection(); $query = 'select emailverified, blocked users email = ? , sla = ? , `password` = ?'; $stmt = $conn->mysqli->prepare($query); $stmt->bind_param('sss', $_post['emailid'], $_post['sla'], $_post['password']); $stmt->execute(); $result = $stmt->get_result(); i error on last line as: call undefined method mysqli_stmt::get_result() here code conn.php: define('server', 'localhost'); define('user', 'root'); define('pass', 'xxxx'); define('db', 'xxxx'); class connection{ /** * @var resource */ var $mysqli = null; function __construct(){ try{ if(!$this->mysqli){ $this->mysqli = new mysqli(server, user, pass, db); if(!$this->mysqli) throw new exception('could not create connection using mysq

swift - SKAction sequence is not delaying the spawnning of my nodes -

i'm using skaction sequence delay spawning of nodes under circumstances. when lanefire true not want delay happen. if else want delay happen. created skaction called spawnaction. inside spawnaction added child. put spawnaction inside sequence. put after waitaction in sequence in order create delay before node spawns. however, spawning of node not delayed. spawns on screen , waits 1.5 seconds before performing moveaction. also, mouse! skspritenode() , movingobjects skspritenode() var action = skaction() let spawnaction = skaction(movingobjects.addchild(mouse!)) let actiondone = skaction.removefromparent() if lanefire == true { action = skaction.movetoy(self.size.height, duration: duration) } else { let waitaction = skaction.waitforduration(1.5) let moveaction = skaction.movetoy(self.size.height, duration: duration) action = skaction.sequence([waitaction, spawnaction, moveaction]) }// end of lanefire if state

c# - Lambda expression not return correct result when using All() -

i have class: public class change() { public int id {get; set;} public decimal price {get; set;} } and have 2 lists oldprices , newprices . both lists contain same items albeit different instances. some items in newprices have different prices, list of changed prices i'm doing: var list = newprices .where(x => oldprices.all(p => p.price != x.price)) .todictionary(x => x.id, x => x.price); this expression should correct list empty though there changes. what missing? enumerable.all returns true if conditions true. that's not want check. want new-prices differ old-prices. you have join both lists id first able compare prices: var joined = np in newprices join op in oldprices on np.id equals op.id np.price != op.price select np; var newpricesbyid = joined.todictionary(p => p.id, p => p.price);

Convert Java String returned from JDBC to Json object -

great genius people, need in solving java problem related java. in program making jdbc call , function returns string similar this: [[{prod_cd=42, short_desc=waterfall edge}, {prod_cd=31, short_desc=n/a}, {prod_cd=51, short_desc=ogee edge}]] i need rid of curly braces, commas, , save json object. [ { "prod_cd": " 42", "short_desc": "waterfall edge", }, { "prod_cd": "31", "short_desc": "n/a", }, { "prod_cd": "51", "short_desc": "ogee edge", } ] i highly appreciate help here tried far: @override public map<string, string> getedgecd() { map<string, string> edgecd = new hashmap<string, string>(); map<string,object> temp = new hashmap<string,object>(); try { simplejdbccall fgetedgecd = new simplejdbccall(jdbctemplate) .withsche

r - Why are these numbers not equal? -

the following code wrong. what's problem? i <- 0.1 <- + 0.05 ## [1] 0.15 if(i==0.15) cat("i equals 0.15") else cat("i not equal 0.15") ## not equal 0.15 general (language agnostic) reason since not numbers can represented in ieee floating point arithmetic (the standard computers use represent decimal numbers , math them), not expected. true because values simple, finite decimals (such 0.1 , 0.05) not represented in computer , results of arithmetic on them may not give result identical direct representation of "known" answer. this known limitation of computer arithmetic , discussed in several places: the r faq has question devoted it: r faq 7.31 the r inferno patrick burns devotes first "circle" problem (starting on page 9) david goldberg, "what every computer scientist should know floating-point arithmetic," acm computing surveys 23 , 1 (1991-03), 5-48 doi>10.1145/103162.103163 ( revision availa

reactjs - Prevent react-router re-creating component when switching links -

i have number of nav links @ top level switch page level components in , out when switch between links. pages have complex grid components expensive create. noticed react-router constructs component every time page switched. there way cache component passed route?, i.e positionspage <route path="/positions" component={positionspage} /> this important performance consideration in react whole (and not react-router ). by default design, react re-renders complete dom tree change in props or state . here summary of techniques react documentation advanced performance suggests. use production build note : correctness of components automatically taken care of. nothing worry. this should simply. following webpack.config.js plugins section snippet should make sure node_env variable reaches react source code. ... plugins: [ new commonschunkplugin('bundle.js'), new webpack.defineplugin({ 'process.env': { '

DB2 - Select values based on number of days in current month -

i have table below. table name (issues): id issue_id created_date 1 101 15 july 2016 2 102 13 july 2016 3 103 10 july 2016 4 104 8 july 2016 5 103 7 july 2016 6 104 19 june 2016 7 103 10 june 2016 8 104 1 june 2016 i want retrieve number of issues(count) opened in last 30/31/28 days based on number of days in current month. for example, in month of july, have 31 days, want retrieve issues got opened in last 31 days. if in case of june, have 30 days, have retrieve issues opened in last 30 days. in db2, number of days on month can retrieved day(last_day(date(current timestamp))) i still confused how apply query. have limited knowledge on queries. thanks in advance. the following query didn't work. select count(*) issues month(created_date) > (month( date(current timestamp) ) - 1 month) , day(date (created_date)) > day(date(current timestamp)) you can su

Intercept the request send from an ios app to a service, from Python and Appium -

i working on mac , trying automate app on iphone , @ point required verify request app sends service (more json request). using appium connect phone , python write scripts. i aware instruments has network functionality lets inspect network traffic of app, not sure if displays json request. so, looking wait intercept json request , make assertions in python script. know methods ? i had similar question few months , dumbs not remotely concerned automation gave down votes me well. anyways have 2 solutions problem. not sure instruments functionality not comment on it. 1) use idevicesyslog @ logs app in terminal , send them file , parse file ever looking for. more info here http://krypted.com/tag/idevicesyslog/ but app logs need turned on work. 2) need use proxy sniff http requsts app making. days of traffic being sent commercially https might run certificate issues secured traffic. secured requests work need stable proxy sniff traffic certificates , all. suggest @ ch

node.js - Mongodb: How to get records N to M? -

lets want records 5 10 (second last 5 records). what query should used in nodejs or mongodb shell ? i know last 5 messages 1 try (in nodejs): db.collection(collection_name).find().limit(5); as @saleem posted in comments, need .skip() db.coll.find(querydoc).skip(x).limit(y) however, have predictable order, should add .sort() db.coll.find(querydoc).sort(sortdoc).skip(x).limit(y)

c++ - How to use direct initialization of an object in OpenMP threadprivate directives? -

on this question 1 of answers cite following part of openmp standard: a threadprivate variable class type must have: an accessible, unambiguous default constructor in case of default initialization without given initializer; an accessible, unambiguous constructor accepting given argument in case of direct initialization; an accessible, unambiguous copy constructor in case of copy initialization explicit initializer. using (almost) same example on posted question, want is: struct point2d{ int x; int y; point2d(){ x = 0; y = 0; } //copy constructor point2d(point2d& p){ x = p.x; y = p.y; } }; and declare 2 point variables of type point2d : point2d global_point; point2d local_point(global_point); #pragma omp threadprivate(local_point) i see on example used in question posted code failed due first item on cited part of openmp standard (as

node.js - Strongloop - HasAndBelongsToMany always returns 401 -

i'm trying execute request: put /api/cars/564d8e792583afef310affe3/categories/rel/suv-idcat this works fine if i'm logged in administrator, if i'm logged in role, 401 response. my car model has following acls: ... { "accesstype": "execute", "principaltype": "role", "principalid": "admin", "permission": "allow", "property": "__create__categories" }, { "accesstype": "execute", "principaltype": "role", "principalid": "admin", "permission": "allow", "property": "__updatebyid__categories" }, { "accesstype": "execute", "principaltype": "role", "principalid": "admin", "permission": "allow", "property": "__destroybyid__categories" } ... now, if