Posts

Showing posts from January, 2011

Wireshark Lua dissector reassembly - dissector not called with previous Tvb's data -

i trying write lua dissector data comes in payload of protocol. each packet contains serial data. data needs processed cr-delimited ( 0x0d / \r ) packets, these don't line protocol packets. i'm having problem dissector function not called left on data last time if report don't have enough data parse. for example, have following protocol packets: 1: 01 02 03 0d 2: 11 12 13 3: 21 22 23 24 0d then have 2 dissectable sequences: 01 02 03 0d (the first packet), 11 12 13 21 22 23 24 0d (packet 2 , packet 3). my strategy to: work though each packet, looking offset of \r if not found: set desegment_offset = 0 set desegment_len = desegment_one_more_segment (since don't know how data left) return nil , try again next packet if found in middle: set desegment_offset offset of newline, next packet can tail data set desegment_len = desegment_one_more_segment (since don't know how data left) don't return if found @ end, leave desegmentatio

php - Magento export product gives error: "Fatal error Call to a member function getName() on a non-object" -

Image
i'm try export product magento admin end & getting below error: call member function getname() on non-object in /home/projectname/public_html/app/code/core/mage/importexport/model/export/entity/product.php on line 171 and gives error in firebug console: networkerror: 500 internal server error - http://domain.com/index.php/admin/export/getfilter/key/a1f090de71262ab853875ebe91411165/entity/catalog_product?isajax=true how resolve error? before try please try re-index data , check again. the issue $structure[$i] entity_id (category id) passing in function. seems entity_id not valid in catalog_category_entity or category flat tables. check in database if flat tables fine. alternative not solution. open : /home/projectname/public_html/app/code/core/mage/importexport/model/export/entity/product.php find: $path[] = $collection->getitembyid($structure[$i])->getname(); replace with $category = mage::getmodel('catalog/category')->lo

c# - Loop through Groupbox in TabControl -

i have wpf contain tab control (page1, page2 , , page3). in tab control page 2, have 3 groupbox ( groupbox_a , groupbox_b , , groupbox_c ), , each of groupbox contain 3 textbox . may know c# code loop through textbox , clear content. this function return textboxes within tab control. public static ienumerable<t> findvisualchildren<t>(dependencyobject depobj) t : dependencyobject { if (depobj != null) { (int = 0; < visualtreehelper.getchildrencount(depobj); i++) { dependencyobject child = visualtreehelper.getchild(depobj, i); if (child != null && child t) { yield return (t)child; } foreach (t childofchild in findvisualchildren<t>(child)) { yield return childofchild; } } } } you can text boxes enumerating : foreach (var textbox in findvisualchildren<textbox>(window)) { // tb h

security - how to identify android mobile device uniqueid in xamarin android in c# -

for application, need trace users android device unique id , android devices give employees client , when use device open our application , type code. have check whether request came devices of our employees open app. if other people have app in phone though app not open. it's requirement client wants, googled lot found few links. tried not working public static string getdeviceandroidid(context context) { string android_id = secure.getstring(context.getcontentresolver(), secure.android_id); if(android_id != null) return android_id; else return ""; } tried not getting "context . getcontentresolver()" need assistance thanks. try android.provider namespace: var android_id = android.provider.settings.secure.getstring(contentresolver, android.provider.settings.secure.androidid);

java - How to subtract System.currentTimeMillis() from Hours+Minutes taken from timepicker? -

i want subtract system.currenttimemillis() hours + minutes taken timepicker. however, system.currenttimemillis() larger compared hours + minutes converted milliseconds . this code: // setting time in milliseconds. hour1 , minute1 taken timepicker. app.settimemillisdosagetime(timeunit.hours.tomillis(hour1) + timeunit.minutes.tomillis(minute1)); i have timertask subtracting system.currenttimemillis . timertask task = new timertask() { timeinmillis = app.gettimemillisdosagetime(); timertask task = new timertask() { @override public void run() { long ellapsedmillis = timeinmillis - system.currenttimemillis(); } timer = new timer(false); timer.schedule(task,0,1000); } } but elapsedmillis negative. solution? timeunit.hours.tomillis // given number converted milliseconds. if give 1 input 60*60*1000 output. timeunit.hours.tomillis(1) = 60* 60 * 1000 timeunit.minutes.tomillis(1) = 60 * 1000

jsf - Primefaces: RadioButtons stop working when using value property -

i'm using primefaces, , need create radio groups in each row of datatable, i'm trying connect separate groups. use widgetvar property so: <p:selectoneradio id="first" widgetvar="connect"> <f:selectitem itemvalue="false" itemlabel="false" /> </p:selectoneradio> <p:selectoneradio id="second" widgetvar="connect"> <f:selectitem itemvalue="true" itemlabel="true"/> </p:selectoneradio> it's working fine, when check one, other unchecks itself. problem shows when try attach default value adding value property this: <p:selectoneradio id="first" value="false" widgetvar="connect"> <f:selectitem itemvalue="false" itemlabel="false" /> </p:selectoneradio> <p:selectoneradio id="second" value="false" widgetvar="connect&q

sql server - deployment facing -

hi not able create ssis catalog in management studio? it showing error.... the catalog backup file 'c:\program files\microsoft sql server\110\dts\binn\ssisdbbackup.bak' not accessed. make sure database file exists, , sql server service account able access it. (microsoft.sqlserver.integrationservices.common.objectmodel) i have same issue. trying google way through it. things have noted in answers other sites: integration services has part of sql server install (update product , add if missing, add file) version of sql server management studio , sql server engine need match file may in wrong location, find , copy sql server looking it. run sql server management studio administrator avoid permissions issues my solution was attempting create ssis db on remote server , not server logged into. once attempted on local server worked fine.

java - Intersection of groups on testng.xml -

hi i'm trying make groups intersection inside testng.xml when run maven command have nullpointerexception. here suite: <test name="test"> <method-selectors> <method-selector> <script language="beanshell"><![cdata[ runtest = false; groupin = system.getproperty("includegroups"); groupnotin = system.getproperty("excludegroups"); if ((groupin == null) || (groupin == "")) { runtest = false; } else { stringtokenizer groupstaglist = new stringtokenizer(groupin, ","); runtest = true; while (groupstaglist.hasmoretokens()) { if (!(groups.containskey(groupstaglist.nexttoken()))) runtest = false; } if (runtest && (groupnotin != null) && (groupnotin != "")) {

java - jackson json to Object parsing -

i have task parse json java class. json fragment trying parse , have problems tree structure. the key point here parametervalue may string, or array of parameter name/value pairs; i use jackson mapper response response = mapper.readvalue(jsonobjstring, response.class); the problem here not know how can describe response class here, auto parsed jackson. if possible. json: [{ "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "apnrecord", "parametervalue" : [{ "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" : "value" }, { "parametername" : "name", "parametervalue" :

sql server - How Can I Use unpivot dynamically? -

this question has answer here: sql server dynamic pivot query? 6 answers sql server : columns rows 5 answers i using ms sql server 2008r2, have table named category profile batch doubles feeder image hardware 1 1 0 2 1 b 1 2 3 0 4 1 5 1 6 1 1 2 1 2 7 where doubles , feeder , image , hardware event categories. column names profile, batch fix, more event categories may added later. want sum of event categories individually unpivot , dynamic. expected output is, eventcategory occurence doubles 10 feeder 5 image 10 hardware 13 by more event categories may added later mean, when more categori

sql - hive group by and order by collect list -

select b.name, count(b.items) count, concat_ws('|',collect_list(b.items)) items (select distinct name,items,item_rank sourcea)b group b.name order b.item_rank error invalid column reference item_rank try output nameofperson,count(items),list of items (pen,paper,book..) @ output order should maintained item_rank in ascending order example : pen item_rank 1, paper item_rank 2, book item_rank 3 item order should in ascending per rank pen, paper,book in collect_list my output of collect_list screwed pen,book,paper, not following rank when keep order inside subquery if keep order outside error invalid column reference item_rank where going wrong thanks

python - prevent DictReader from adding quotes -

i want convert csv python dict. keys strings values not. vertical;"aaa";"bbb";"ccc" "one";1;none;3 two";11;22;{"t":"type","v":"value"} three";111;222;333 whatever use quoting , quotechar, dictreader adds quotes. reader = csv.dictreader(open('matrix_test.csv'), delimiter=";") row in reader: component_type = row["vertical"] row.pop("vertical") matrix.update({component_type: row}) this get: {'"one"': {'"aaa"': '1', '"bbb"': 'none', '"ccc"': '3'}, '"three"': {'"aaa"': '111', '"bbb"': '222', '"ccc"': '333'}, '"two"': {'"aaa"': '11', '"bbb"': '22', '"ccc"': &#

android - Synchronous query? -

how implement synchronous query parse in android? want below, synchronous way. parsequery<parseobject> query = parsequery.getquery("myclass"); query.findinbackground(new findcallback<parseobject>() { public void done(list<parseobject> objects, parseexception e) { if (e == null) { objectswereretrievedsuccessfully(objects); } else { objectretrievalfailed(); } } } use parsequery#find() perform query , block until finished. following should work: parsequery<parseobject> query = parsequery.getquery("myclass"); try { list<parseobject> objects = query.find(); objectswereretrievedsuccessfully(objects); } catch (parseexception e) { objectretrievalfailed(); } however, mentioned others, blocking main thread not idea doing makes ui unresponsive.

Python pandas: compare data and put together -

im using pandas read out csv-file , xlsx-file. both files have 1 common column numbers. save both datasets in 2 seperate lists. want check columns common values , add dataset second list first. criteria values must match. hope understand want do. here lists: list 1: fak-art fak-dat leist-dat kd-crm mw-bw eq-nr material \ 1 zpaf 2015-05-18 2015-05-31 tmd e 1003594714 g230ets 2 zpaf 2015-05-18 2015-05-31 tmd b 1000943473 g230ets 3 zpaf 2015-05-18 2015-05-31 tmd e 1000943608 g230ets 4 zpaf 2015-05-18 2015-05-31 tmd b 1000943704 g230ets 5 zpaf 2015-05-18 2015-05-31 tmd e 1000943823 g230ets 6 zpaf 2015-05-18 2015-05-31 tmd b 1000943985 g230ets 7 zpaf 2015-05-18 2015-05-31 tmd e 1000954774 g230ets 8 zpaf 2015-05-18 2015-05-31 tmd b 1000954790 g230ets 9 zpaf

VB.NET Gecko Web Browser javascript function calling? -

i using geckowebbrowser within vb.net (windows form app) program. geckowebbrowser loads local html file. html has embed in-line svg file ( human body diagram bones , internal organs ) javascript function picking "ids" of elements svg document. i'd call aforementioned javascript function vb.net (windows form app), don't know how so. can me, or give me source code example please? stuff i've found based in c# ... javascript function in html file: <script type="text/javascript"> (funcion () { // function called in vb.net when dom loaded var svghandler = function () { // picking id root node="cuerpo_humano" svg variable var svg = document.queryselector('#cuerpo_humano'); // in items save <g> have id var items = svg.queryselectorall('g[id], path[id]'); //var items = svg.queryselectorall('g[id]'); // loop nodes saved in items , add them click event listener

angularjs - How to start Gulp server for Yeoman app? -

i'm trying build first application using yeoman + angular + gulp. i've created application using gulp, works fine. following step followed install application, npm install -g yo npm install -g generator-angular (in i've asked select between gulp , grunt, selected gulp) install gulp , related plugins mentioned in gulpjs file try run application using gulp here gulpfile.js // generated on 2016-07-28 using generator-angular 0.15.1 'use strict'; var gulp = require('gulp'); var $ = require('gulp-load-plugins')(); var openurl = require('open'); var lazypipe = require('lazypipe'); var rimraf = require('rimraf'); var browsersync = require('browser-sync'); var wiredep = require('wiredep').stream; var runsequence = require('run-sequence'); var yeoman = { app: require('./bower.json').apppath || 'app', dist: 'dist' }; var paths = { scripts: [yeoman.app +

Parsing a json nested dictionary in python -

i need reach value "y "of "b" in result. { "response": { "result": [2] 0: { "a": "x" "b": "y" "c": "z" } 1: { "a": "d" "b": "e" "c": "f" "d": "g" } } } my attempt ['response']['result'][0]['b'] produces given error indexerror: list index out of range any appreciated. thanks. the key 0 not under "result" should use ['response'][0]['b']

android - Apps are not supported in lesser than v5.0(lollipop) -

in android studio, have create new project run on 2.2(that shows 100% compatibility). project calculation. have installed on phone(lollipop), , app working properly. but, tried install in friends kitkat phone, app installed but, when open app, shows unfortunately app has stopped. so, need help. have do? thank you. may set minimum sdk @ lollipop check out in build.gradle file. android { compilesdkversion 24 buildtoolsversion "23.0.3" defaultconfig { applicationid "com.communitynow.communitynow" minsdkversion 15 targetsdkversion 24 versioncode 1 versionname "1.0" } and add compile 'com.android.support:multidex:1.0.0' in gradle file here in defaultconig{} minsdkversion should 15 or according minimum android run requirement.

python - How to get dependencies tree? -

this question has answer here: how return multiple objects related foreignkey in django 4 answers making tree structure in django models? 3 answers i have model: class myuser(abstractuser): parent = models.foreignkey(myuser, null=true) [...] and want dependencies tree, example: user1 -> childs: user2, user3, user4 user2 -> childs: user5, user6 user3 -> childs: user7, user8 etc. in case want list: [ (user1, user2), (user1, user3), (user1, user4), (user2, user5), (user2, user6), (user3, user7), (user3, user8), ] how it? you need use related objects . in pseudocode: for each myuser element e: related elements (for e.pk) print result this question may of use.

jquery - Showing the data from mysql data to php page using select -

i using jquery line control plugin textbox, include both images links text(which can styled in either format) , proving me html code saves in mysql database. for example : if in line control textbox insert image , paragraph saves in mysql below result <img src="data:image/jpeg;base64,/9j/4aaqskzjrgabaqeayabgaad/4rdgrxhpzgaatu0akgaaaagabae7aaiaaaahaaaisodpaaqaaaabaaaiupydaaeaaaaoaaaqyuocaacaaagmaaaapgaaaaac6gaaaagaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...and lonbg garbage text this" alt="" height="151" width="139"/> <br><br>summis cernantur possumus, sunt arbitror ea comprehenderit, ne multos quibusdam &lt;br&gt;distinguantur de multos est cernantur e e laborum arbitrantur dolor e &lt;br&gt;excepteur iis laborum fugiat fabulas si nescius quem nostrud vidisse. labore &lt;br&gt

Update Buttons JavaFX when a selected process in TableView ends -

i want disable/enable buttons under borderpane when process in selected row ends. i try this downloadtable.getselectionmodel().getselectedindices().addlistener(new listchangelistener<integer>() { @override public void onchanged(change<? extends integer> c) { int selectedindex = downloadtable.getselectionmodel().getselectedindex(); if (downloadtable.getitems().get(selectedindex).getstatus() == download.downloading) { cancelbutton.setdisable(false); } else { cancelbutton.setdisable(true); } } }); but works if switch items (download) ended. want enable/disable buttons while item selected. all example of ended download cancelbutton want disable maybe can you: public class main { private button somebutton; private tableview<?> downloadtable; private void somemethod() { //somecode callback<tableview<?>, ta

ios - View presented from master panel of UISplitViewController not rotating when rotated from portrait to landscape (iPad) -

Image
i presenting modal view , action sheet master panel of uisplitviewcontroller . ios 9.3 1) if present view when ipad in portrait mode , rotate ipad landscape, screen not rotating. 2) if present view when ipad in landscape mode , rotate ipad portrait, screen rotating. how can achieve rotation? there 2 solutions resolve issue: it not ideal present modal views master panel should doing uisplitviewcontroller itself. splitviewcontroller.preferreddisplaymode =uisplitviewcontrollerdisplaymodeallvisible; // displaying master panel in screen shot in question modalviewcontroller.modalpresentationstyle = uimodalpresentationformsheet; // displaying modalviewcontroller in form sheet style [splitviewcontroller presentviewcontroller:modalviewcontroller animated:true completion:nil]; // note: modalviewcontroller presented uisplitviewcontroller , not master panel of split view the master panel of spilt view presented in popover when in portrait mode device rotation changes have

R data frame from data stored in a variable length concatenated string -

i have data frame contains number of features against id delimited |: df = data.frame(id = c("1","2","3"), features = c("1|2|3","4|5","6|7") ) df my goal have column each feature , indicator of presence id e.g. id | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 1 | 1 | 1 | 1 | 0 | 0 | 0 | 0 | 2 | 0 | 0 | 0 | 1 | 1 | 0 | 0 | 3 | 0 | 0 | 0 | 0 | 0 | 1 | 1 | the features stored in different table complete list of possible features available better if generate dynamically. my first attempt use horribly slow loop grepl() populate pre created matrix 'm' e.g. (i in 1:dim(df)[1]){ print(i) if(grepl("1\\|", df$feature[i])) {m[i,1] <- 1} if(grepl("2\\|", df$feature[i])) {m[i,2] <- 1} if(grepl("3\\|", df$feature[i])) {m[i,3] <- 1} if(grepl("4\\|", df$feature[i])) {m[i,4] <- 1} if(grepl("5\\|", df$feature[i])) {m[i,5] <- 1} if(grepl("6\\

Defining a variable in scala with two implicits -

i came across interesting post on twitter scalalang. code compiles , works class a(implicit implicit val b: int) val obja = new a()(42) can please explain me how working? read documentation of implicits didn't found case this. please explain me what's happening here. any appreciated ! you can have implicit before last parameter list of class or method, , before member of class or trait. combines both, legal because forbidding make language specification , parser more complex no real benefit. don't think there reason ever use or difference writing implicit once.

white border on html email in ios -

we did html email dark backgrounds, perfect except thin white borders in ios. has strange behavior of appearance: bordera appears in original size, when zoom screen horizontal 1 stays. ideas how can fix it? screenshots , code snippet below https://postimg.org/image/6l32f0cbl/ https://postimg.org/image/rw0mj9ug1/ <table style="width: 600px; border-collapse: collapse;" cellspacing="0" cellpadding="0"> <tr> <td style="width:200px; border-collapse: inherit; background-color: #000;" cellspacing="0" cellpadding="0" align="center"><img src="http://static.beeline.kz/pics/vip/bundle.png"></td> <td style="width:200px; border-collapse: inherit; background-color: #000;" cellspacing="0" cellpadding="0" align="center"><img src="http://static.beeline.kz/pics/vip/call.png"></td> <td style="width:200px; border-c

c# - Change ListBox Item Background color programmatically -

i having real hard time understanding how xaml works in connection c#. problem is, have 2 different list<string> objects filled content, want 1 list<string> have backgroundcolor 'blue' , other 1 have background color 'red'. afterwards want display in listbox my xaml listbox code: <listbox x:name="listbox1" horizontalalignment="left" height="240" margin="81,80,0,0" verticalalignment="top" width="321" borderbrush="#ff6c6c6c" selectionmode="single" selectionchanged="listboxselectionchanged"> </listbox> my c# code loads content listbox public partial class mainwindow : window { public void additemstolistbox() { foreach (var object1 in objects1) { thread.sleep(1); listbox1.items.add(object1.label); //i want these objects blue } foreach (var object2 in objects2) { thread.sleep(1); list

html - Importing a common structure of a webpage -

when creating webpage, include nav on pages: <nav id="nav"> <ul> <li><a href="about.html" class="active">about us</a></li> <li><a href="services.html">services</a></li> <li><a href="contact.html">contact</a></li> </ul> </nav> we'll mark active page using active class: <li><a href="contact.html" class="active">contact</a></li> copying-and-pasting whole navigation subpages not idea - if decide add 1 new page, have change nav on subpages. can put navigation separate file , import it? <!-- pseudocode --> <import file="nav.html" active="about us" /> or maybe there html-compliant preprocessor (i want reuse existing code, not rewrite scratch) you have few options on how this, , always, each 1 has it's pros ,

ios - updateChildValues: not saving all data -

a user enters post tags. tags come array , i'm supposed check if tag exist or not , use tagid write post database tags relate post (see below). whats happening last tagid being recorded database not of them for item in tags { ref.child("tags").observesingleeventoftype(.value, withblock: { snapshot in if snapshot.childsnapshotforpath(item.lowercasestring).exists() { let tagkey = snapshot.childsnapshotforpath(item.lowercasestring).value as! string self.savetagid(tagkey, postkey: postkey, uid: userid) } else { let tagkey = self.ref.child("tags").childbyautoid().key let tagupdate = ["/tags/\(item.lowercasestring)": tagkey] self.ref.updatechildvalues(tagupdate) self.savetagid(tagkey, postkey: postkey, uid: userid) } }) } func savetagid(tagid: string, postkey: string, uid: string){ let posttag = [tagid: true] print("post tag\(postt

vba - Excel sort order - special characters not first -

i use macro sort table data in 1 column: activeworkbook.worksheets("sheet").sort.sortfields.add key:=range(sortrange), sorton:=xlsortonvalues, order:=xldescending, dataoption:=xlsortnormal is there way make code sort in order: first 0-9, a-z, , special characters (there @ least • , + last in sort order) ? alright, sounded fun task, tried vityata's approach different lists in worksheet. sub crazysort() dim ws worksheet dim ws2 worksheet dim lastrow long dim yourcolumnindex, letters, numbers, others long dim long set ws = worksheets("sheet") 'this sheet our temp lists, rename accordingly set ws2 = worksheets("tempsheet") columnscount = x = 1 letters = 1 others = 1 numbers = 1 ws j = 1 columnscount 'loop through cells in column 'change yourcolumnindex accordingly while .cells(i, j) <> "" 'check ascii-code of first character in every list select case asc(left(.cells(i, j), 1

exclude item from array list c# -

i using asp.net 2013, want draw chart , give different color each point except e.g black, transparent , on. it working fine there colors exclude. var colours = typeof(system.drawing.color) .getproperties() .where(x => x.propertytype == typeof(system.drawing.color)) .select(x => x.name) .toarray(); random rcolor = new random(); foreach (var item in chart2.series[0].points) { item.color = system.drawing.color.fromname(colours[rcolor.next(0, colours.length)]); } use color[] excludecolors , except : color[] excludecolors = { color.black, ... }; var allcolors = var colours = typeof(system.drawing.color) .getproperties() .where(x => x.propertytype == typeof(system.drawing.color)) .select(x => system.drawing.color.fromname(x.name)); color[] usedcolors = allcolors.except(excludecolors).toarray(); foreach (var item in chart2.series[0].points) { color

c# - Selenium chrome failed to start -

running basic selenium test can think of. using system; using microsoft.visualstudio.testtools.unittesting; using openqa.selenium.chrome; using openqa.selenium; using openqa.selenium.support.ui; using openqa.selenium.firefox; namespace unittestproject1 { [testclass] public class unittest1 { [testmethod] public void testmethod1() { string path = @"d:\selenium webdrivers\chromedriver\"; iwebdriver driver; driver = new chromedriver(path); } } } i using, chrome version 52.0.2743.82 m chromedriver 2.22 selenium webdriver 2.53.1 selenium webdriver support classes 2.53.1 win10 (recent upgrade) i have tried uninstalling , reinstalling chrome , removing user profiles. the error is, test name: testmethod1 test fullname: unittestproject1.unittest1.testmethod1 test source: c:\users\user\documents\visual studio 2013\projects\unittestproject1\unittestproject1\unittest1.c

queue - Will OpenVBX and Twilio handle multiple calls and if one line is busy, go to the next line, etc -

can tell me if call flow below work openvbx & twilio , if so, how set there? i'm using twilio trial number test out, no luck far. have downloaded plugin "openvbx-plugin-queue-master" looks may work, can't to. i'm not telephony expert. programmer. =) here need. need able receive multiple calls @ same time , move caller next available attendants. they need hear main greeting, press 1 then go support group ideally (that not working me right either)- let's attendant #1. if attendant #1 on phone, put them on hold briefly listening greeting, send them attendant #2 if attendant #2 busy...repeat process until run out of attendants , go vm. here install version: current version: 1.2.20 schema version: 79 latest schema available: 79 site revision: 1026 any appreciated! support openvbx not active @ time. i'd suggest take @ guide queues. https://www.twilio.com/docs/api/twiml/guides/queues beginning queuing caller (an exampl

crystal reports - Call function only for unsuppressed records -

i use 2 string formulas in details section determine countries suppress. formula1 refers company field, , suppress values: {countries} in formula2 call function parameter @formula1: function(@formula1) but problem function still takes suppressed countries account. normal behavior, or need whileprintingdata narrow results. when debug function first time function called incoming string country1 though specified suppress one. how can ensure unsuppressed values passed function? you write additional logic formula2 perform same check formula1 does. like: if ({countries} = 10) function("company a") else if ({countries} = 14) function("company b") // else if....

Intel XDK iOS build produce zero sized ipa files -

i'm trying make build system work.. i've managed create , build several projects, cool way building running on iphone. @ point today, xdk started produce 0 sized ipa files , links sends email download binaries broken. no errors, no warnings. android files produced fine , downloadable, yet ios files 0 sized. ok few minutes ago, nothing changed on side.. kind of show stopper me. use intel xdk practical things? how stable it? there problem build system has been resolved.

node.js - process.nextTick(function() { throw err; }) rror: getaddrinfo ENOTFOUND noder noder:27017 - nodejs -

when first time hit http://localhost:8080 , gives me correct response, shows below error too. when again hit http://localhost:8080 , see nothing on ui. d:\node_workspace\node-token-jwt\node_modules\mongodb\lib\server.js:242 process.nexttick(function() { throw err; }) ^ error: getaddrinfo enotfound noder noder:27017 @ errnoexception (dns.js:27:10) @ getaddrinforeqwrap.onlookup [as oncomplete] (dns.js:78:26) i using node.js. how can fixed ? server.js // packages var express = require('express'); var app = express(); var bodyparser = require('body-parser'); var morgan = require('morgan'); var mongoose = require('mongoose'); var jwt = require('jsonwebtoken'); // used create, sign, , verify tokens var config = require('./config'); // our config file var user = require('./app/models/user'); // our mongoose model var port = process.env.port ||

xamarin.forms - How to open a popup on click of button placed in menu page in master detail page in xamarin forms? -

i working on xamarin.forms. using master detail page. in menupage of masterdetailpage have menu items listed. @ bottom of menu list placed button on menu page. need open popup on click of button. trying popuplayout not able success. please tell me how can open custom popup box @ click of button placed in menu page? regards, anand dubey without going separate, native projects platforms targeting (such android, ios, uwp...), cannot pop out custom ui content on existing pages in xamarin.forms out of box. need bring in additional references or creative absolutelayout control. here few options have: simple popup message , or option selection if need simple popup message or list of buttons, should native displayalert , displayactionsheet methods. built xamarin.forms , work these simple cases. more complex popup dialogs for more complex that, there excellent userdialogs project: acr userdialogs github page give support various loading dialogs, date, time pickers, act

django - Displaying only children of objects created by the user in Admin -

there following relation in django models: django user --has many-- competition --has many-- category --has many-- competitor in admin want show objects created logged in user . can competition - no problem: in admin.py override get_queryset of model admin , assign model: class competitionadmin(admin.modeladmin): def get_queryset(self, request): qs = super(competitionadmin, self).get_queryset(request) if request.user.is_superuser: return qs return qs.filter(user_id=request.user.id) admin.site.register(competition,competitionadmin) how can same thing category , consequently competitor ? you can reference foreign key relation double underscore notation: for category if category has foreignkey field competition : category.objects.filter(competition__user=request.user) for competitor if competitor has foreignkey field category : competitor.objects.filter(category__competition__user=request.user)

jquery - How to handle nested event listeners javascript? (not about nested html elements) -

i need function trigger after 2 events. first event onload, , second onmessage coming iframe. if onload , onmessage=="something"=> trigger that. otherwise => else. however, seems onload executed before onmessage. need 2 event nested. (or not?) shoud this: document.getelementbyid("myiframe").addeventlistener("load", iframeloaded, false); function iframeloaded(){ window.top.addeventlistener("message", whatisthemessage, false); } function whatisthemessage(event){ window.top.removeeventlistener("message", whatisthemessage, false); if(event.date=="something"){//do something} else if(event.date=="somethingelse"){//do somethingelse} } does seem correct? problem appear me if "message" arriving before (i think not not possible), don't listen it. window.addeventlistener("load",test,false); window.addeventlistener("message

Instantiating a class - Python -

i'm trying instantiate straightforward class in python. class student: def __init__(self, name, age, major, gpa): name = self.name age = self.age major = self.major gpa = self.gpa def main(): student_1 = student('john', 31, 'history', 3.4) student_2 = student('george', 31, 'english', 3.5) print student_1.name, student_2.name the error is: attributeerror: student instance has no attribute 'name' change: name = self.name age = self.age major = self.major gpa = self.gpa to: self.name = name self.age = age self.major = major self.gpa = gpa

jquery - Displaying POST response in Dialog -

hello i'm creating webpage test api , i'm sending form nodejs backend , backend return json response me. far sending request works fine , can see request lands on vps console, want create feedback on webpage well. how can create alert contains information response json? above code: <html> <head> <script src="https://code.getmdl.io/1.1.3/material.min.js"></script> <script src="//code.jquery.com/jquery-1.11.0.min.js"></script> <link rel="stylesheet" href="https://code.getmdl.io/1.1.3/material.indigo-pink.min.css"> <link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=material+icons"> </head> <body> <!-- shows header, in smaller screens. --> <div class="mdl-layout mdl-js-layout mdl-layout--fixed-header"> <header class="mdl-layout__header"> <div class="mdl-layout__header-row

unix - Ubuntu: Script for check the status of a page and after restart -

how can programmatically check status of page in application? i'd able reboot server if receive 404 . possible on automated basis, checking page status @ 15 second intervals? something like #! /bin/bash while true; curl --fail --silent http://localhost/your.page >/dev/null if [[ $? -eq 22 ]]; sudo reboot fi sleep 15 done check curl man page more details

java - Difficulty writing object to file -

i'm trying read map of students txt file, after add new student map (now bigger before) , save file. after close program , reload data file, new students weren't saved. hashmap<string, student> studentobj = new hashmap<>(size); try { objectinputstream in = new objectinputstream(new fileinputstream(default_file_name)); studentobj = (hashmap<string, student>) in.readobject(); studentobj.put(student.getstudentid(), student); objectoutputstream out; out = new objectoutputstream(new bufferedoutputstream(new fileoutputstream(default_file_name))); out.writeobject(studentobj); out.flush(); system.out.println("here " + studentobj.size()); in.close(); out.close(); } catch (ioexception e) { throw new exception("file not created"); } catch (classnotfoundexception e) { throw new exception("class not found excpetion"); } i agree @xdevs23 instead of saving data array

python - BeautifulSoap to get first value using string/text -

beautifulsoup handy html parsing in python, meet problem have clean code value directly using string or text from bs4 import beautifulsoup tr =""" <table> <tr><td>text1</td></tr> <tr><td>text2<div>abc</div></td></tr> </table> """ table = beautifulsoup(tr,"html.parser") row in table.findall("tr"): td = row.findall("td") print td[0].text print td[0].string result: text1 text1 text2abc none how can result for text1 text2 i want skip inner tag beautifulsoup4-4.5.0 used python 2.7 you try this: for row in table.findall("tr"): td = row.findall("td") t = td[0] print t.contents[0] but work if looking text before div tag

javascript - angular promise after render all the data -

i have big data call angular page ajax . i want know when browser finished object my code $http({}) .success(function(data){ deferred.resolve(data); log("get data"); }) .finally(function(data){ log("finally data"); }); my problem when call log function seems happend when browser start ping server , not after complete object server. of course object big data , take many time, , want know how can find second object complete client

MYSQL Query issue with incorrect output -

hi have following query : $query = "select distinct registration, series, operator, msn, ln, model, status, pic, piccopy (select * (select * history status = 'active' order date asc) group ln) a2 group msn order ln asc"; this works - kind of.... see here its listing airframes have been or active. need list active airframes. because airframe scrapped or put museum example - classed no longer active - e.g. preserved, same may scrapped, above query still sees active. can prevent showing aircraft may falling 1 of following categories: grounded scrapped parted out written off missing stored preserved however grounded /stored/preserved airframe may returned service , become active again, needs find latest "active" , display if not been withdrawn after date. im guessing simple grabs records airframe eg et-aop, , selects last (latest date aka newest date) sees if active , if displays it, if not wont. how do this, driving me mental si

javascript - cannot import some packages on android, but on ios, it's ok -

i'm developing game cocos2d-js , browserify . but wrote on title, require("stream") not work on android. it's work on ios.... here debug info { gl.supports_vertex_array_object: true gl.supports_bgra8888: false gl.supports_atitc: false gl.supports_s3tc: false cocos2d.x.version: cocos2d-x 3.4 gl.supports_discard_framebuffer: true cocos2d.x.compiled_with_profiler: false gl.supports_pvrtc: false cocos2d.x.build_type: debug gl.renderer: mali-t760 gl.supports_etc1: true cocos2d.x.compiled_with_gl_state_cache: true gl.version: opengl es 3.1 v1.r7p0-03rel0.b596bd02e7d0169c10574b57180c8b57 gl.supports_npot: true gl.max_texture_units: 96 gl.vendor: arm gl.max_texture_size: 8192 } and want run script : https://gist.github.com/growingdever/75dc2bb9e52a1bfdb57279c33add42cc the version of spidermonkey(javascript engine of cocos2d-x) 34. i tried changing min version or target version of android s

awk - Inline reordering of substrings via bash -

assume text file contains specific lines word order should altered. words (substrings) delimited single whitespaces. lines altered can identified first character (e.g., ">"). # cat test.txt >3 test foo bar baz foo bar qux >2 test foo bar baz >1 test foo bar qux what command (probably in awk ) use apply same ordering process across lines starting key character? # cat test.txt | sought_command >this test 3 foo bar baz foo bar qux >this test 2 foo bar baz >this test 1 foo bar qux here's 1 way using awk: awk 'sub(/^>/, "") { print ">"$3, $4, $2, $1; next } 1' file sub returns true (1) when makes substitution. 1 @ end shortest true condition, trigger default action { print } .

osx - IntelliJ PHP debugger not connecting -

i've set php 5.6 , apache on mac , have intellij php plugin installed (2016.2). problem ide doesn't want connect local server. i've added following lines php.ini: [xdebug] zend_extension=/usr/local/cellar/php56/5.6.24/lib/php/extensions/no-debug-non-zts-20131226/xdebug.so xdebug.remote_enable = 1 xdebug.remote_autostart = 1 xdebug.remote_port = "9000" and when run php -v get: zend engine v2.6.0, copyright (c) 1998-2016 zend technologies xdebug v2.4.0, copyright (c) 2002-2016, derick rethans and phpinfo() shows xdebug.remote_enable on on xdebug.remote_port 9000 9000 but intellij shows: xdebug.remote_enable 0 i've checked, i'm pointing right php.ini (checked path , other changes appear when file edited). i tried configurations (including ide key) nothing seems work. is there way can check if debugging working (i.e. ide not recognizing or server faulty), because @ point don't know problem may be. th

sql server - A network-related or instance-specific error on dotnet ef database update -

i'm learning build asp.net core mvc app visual studio this tutorial. in " adding model " step created new separate project (as written in instructions), when run dotnet ef database update , following error occurs: a network-related or instance-specific error occurred while establishing connection sql server. server not found or not accessible. verify instance name correct , sql server configured allow remote connections. (provider: sql network interfaces, error: 52 - unable locate local database runtime installation. verify sql server express installed , local database runtime feature enabled.) but have installed sql server , sqlexpress service running. tried open port, didn't help. setup localdb the template's connection string localdb , mssqllocaldb instance. make sure have both. appsettings.json { "connectionstrings": { "defaultconnection": "server=(localdb)\\mssqllocaldb;database=aspnet-mvcmovie-87ad

solrnet - Can I combine result sets in Solr -

i want following: let set of documents, each field important:true, , date beginning year, or previous year. result set should ordered date. in pseudo code: result set a: q="testquery" +important:true , +(date:2015* or date:2016*) sort=date desc then, let b remaining set of documents, i.e. those important:true , date preceeding year 2015, , documents important:false . set should ordered date. again in sloppy pseudo: result set b: q="testquery" -(date:2015* or date:2016*) sort=date desc now, return followed b, , able use paging features etc. noob solr ( < 10 hrs of trying out different queries) , can't figure how accomplish behavior. guess cannot use bq since don't sort score, right? an example of desired outcome: <result name="response" numfound="2089" start="0"> <doc> <bool name="important">true</bool> <str name="date">2016-03-01 00:00:0