Posts

Showing posts from April, 2012

Netezza connection with Spark / Scala JDBC -

i've set spark 2.2.0 on windows machine using scala 2.11.8 on intellij ide. i'm trying make spark connect netezza using jdbc drivers. i've read through this link , added com.ibm.spark.netezza jars project through maven. attempt run scala script below test connection: package jdbc object simplescalaspark { def main(args: array[string]) { import org.apache.spark.sql.{sparksession, sqlcontext} import com.ibm.spark.netezza val spark = sparksession.builder .master("local") .appname("simplescalaspark") .getorcreate() val sqlcontext = sparksession.builder() .appname("simplescalaspark") .master("local") .getorcreate() val nzoptions = map("url" -> "jdbc:netezza://server:5480/database", "user" -> "user", "password" -> "password", "dbtable" -> "admin.tablename") val df = sqlcontex...

direct3d - Inputting Position Into the Pixel Shader -

in of programs have seen make use of vertex position data in pixel shader, there tendency process float4 vector. restriction not appear present fin other shaders. in program writing, instance, float2's inputted vs , float3's gs no problem. when try input data ps, rejects forms except float4. other vector types not allowed ps? if so, why? in pixel shader, sv_position system-generated value must float4 . when use sv_position semantic in vertex shader, it's alias old position semantic , comes input assembler in whatever format input layout specifies. binding between vertex , geometry shader has agree, can whatever value. in other words, has special meaning pixel shader because it's pixel position computed rasterizer stage.

javascript - Pushing to null array, even though it is called as a global and works in my localhost, but not on the server -

i'm getting following error in javascript. title states, code working on localhost, not when put onto server uncaught typeerror: cannot read property 'push' of null @ additemtocart (shoppingcart.js:36) @ htmlbuttonelement.<anonymous> (shoppingcart.js:193) @ htmldocument.dispatch (jquery-1.11.1.min.js:3) @ htmldocument.r.handle (jquery-1.11.1.min.js:3) i have identified before push function called cart variable indeed null, declare globally empty array, i'm not sure why be. code function failing on var cart = []; function additemtocart(name, price, count, id, shortname) { (var in cart) { if (cart[i].id === id) { cart[i].count += count; savecart(); (var in cart) { if (cart[i].id == 500 && id != 500) { removeitemfromcart(500); alert('because changed cart, have reapply coupon'); } } return; ...

git - Squash all commits with commit messages that match a certain pattern -

is there way squash git commits commit messages match pattern? ideally non-interactive - automatic @ command line. git rebase -i creates todo file , calls editor; it's supposed user edits file , git interprets it. file in well-known format . instead of interactive editor create shell script edits file non-interactively; use sed -i edit in place; use s/// search command find pick commands $pattern , replace them squash commands. file squash.sh ; put pattern (basic regular expression style) there: #! /bin/sh exec sed -i 's/^pick \([^ ]\+\) $pattern.\+$/squash \1/' $1 command line: chmod +x squash.sh git_editor=./squash.sh git rebase --interactive $commit_id

Mysql clusters or replication -

im building application should work online , off-line. i have application on fisical stores , administration on web application should systems installed locale on store. i have actions insert , update system web should execute , systems local keep insert , update actions time, cannot depends of internet, because need database local. i try use galera clusters , replication master master, galera clusters work nice when node offline node stop work, node store , store cannot stop. replication master master generate primary key conflit. which tool me on situation. updated to simplification, all data generated stored offline wont should affect other store, mean orders, clients, payments. datas can on database, store see self data. system admnistration online, should see datas of stores , have actions insert , update above stores like, block clientes, aprove orders, generated stoke, but actions system admnistration online able, store not able, example, system admnis...

amazon web services - Wordpress Permalink Doesn't Work Ubuntu Server AWS -

i try tutorial nothing happen http://guiem.info/permalinks-on-wordpress-amazon-ec2/ apache2.conf directory codes <directory /> options followsymlinks allowoverride require granted </directory> <directory /usr/share> allowoverride none require granted </directory> <directory /var/www/> options indexes followsymlinks #none allowoverride require granted </directory> <directory "/var/www/html"> options indexes followsymlinks allowoverride require granted </directory> <directory "/var/www/html/wordpress"> options indexes followsymlinks allowoverride require granted </directory> #<directory /srv/> # options indexes followsymlinks # allowoverride none # require granted #</directory> of course, restart apache every time make change if not use permalinks wordpress works perfect according t...

How to connect Salesforce with DocuSign using REST API to send envelopes? -

need complete requirement users can send pdf docusign salesforce click of button using apis. there article on web 2010 ( http://developer.force.com/cookbook/recipe/accessing-docusign-api-from-salesforcecom-to-send-contracts-for-esignatures ) details soap api. however, more prudent go rest route @ time. tried going through docusign docs not easy understand imho. have sample code chance? much!

ruby on rails - Puffing Billy with Poltergeist error: "rack-test requires a rack application, but none was given" -

using puffing billy instructions rspec capybara created simple test stub request using :poltergeist_billy driver resulting in error: argumenterror: rack-test requires rack application, none given # /home/resrev/.rvm/gems/ruby-2.3.1/gems/capybara-2.4.4/lib/capybara/rack_test/driver.rb:16:in `initialize' # /home/resrev/.rvm/gems/ruby-2.3.1/gems/capybara-2.4.4/lib/capybara.rb:372:in `new' # /home/resrev/.rvm/gems/ruby-2.3.1/gems/capybara-2.4.4/lib/capybara.rb:372:in `block in <top (required)>' # /home/resrev/.rvm/gems/ruby-2.3.1/gems/capybara-2.4.4/lib/capybara/session.rb:79:in `driver' # /home/resrev/.rvm/gems/ruby-2.3.1/gems/capybara-2.4.4/lib/capybara/session.rb:227:in `visit' # /home/resrev/.rvm/gems/ruby-2.3.1/gems/capybara-2.4.4/lib/capybara/dsl.rb:51:in `block (2 levels) in <module:dsl>' # ./spec/scraypa_spec.rb:52:in `block (4 levels) in <top (required)>' with code: spec/spe...

numpy - How to generate all points in Python for 0< x_1+x_2+x_3<1, x_1>0,x_2>0,x_3>0, say dx=0.01 -

how generate points in python 0<x_1+x_2+x_3<1 , x_1>0 , x_2>0 , x_3>0 , $dx=0.01$. trying use grid in solving constrained optimization problem. you can randomize 2 points between 0 , 1, , additional 1 described below. x1 equal: first point x2 equal: abs(first-second) x3 equal: random point in (0, 1 - x1 - x2)

C Calculating annual rainfall totals with nested loops, & matching user inputs -

i having hardest time understanding why program won't execute correctly. need calculate total rainfall per year using loop, problem i'm having not excepting user input month of february , instead adds previous years total (i.e. 2011 total becomes feb. 2012 user input). appreciated. #include <stdio.h> #include <stdio.h> #include <stdio.h> #define nummonths 12 #define numyears 5 // function prototypes void inputdata(); void printdata(); // global variables // these available functions float raindata[numyears][nummonths]; float sum = 0.0; char years[numyears][5] = {"2011","2012","2013","2014","2015"}; char months[nummonths][12] = {"jan","feb","mar","apr","may","jun","jul","aug","sep","oct","nov","dec"}; int main () { char enterdata = 'y'; printf("do want input...

Capitalize every 3rd letter in a string - Python -

i'm beginning learn python, please bear me. math knowledge little shaky well. i'm able capitalize single word, or first word in string. having problem need capitalize every 3rd letter in string. need function. i've used this, can change letter in 1 word, not every 3rd. x = "string" y = x[:3] + x[3].swapcase() + x[4:] there sample template used if in phrase (len(phrase)) but i'm not sure how works. i'd output show "this texting function" thanks in advance help. you can take stride slice of array makes pretty , pythonic few lines: s = "thisisareallylongstringwithlotsofletters" # convert list = list(s) #change every third letter in place list comprehension a[2::3] = [x.upper() x in a[2::3]] #back string s = ''.join(a) # result: thisisareallylongstringwithlotsofletters it's not clear want spaces - treats them characters.

php - How not to display MySQL row if the row is empty -

i new php , trying solve this, went through many articles before asking here no better answer. fetching sql rows using mysqli_fetch_array($result) if rows empty frontend displays empty row gives weird look. there should way not display empty rows database. my code <?php include_once("config.php"); date_default_timezone_set('asia/kolkata'); //$timestamp = time(); $day = "" . date("d"); $dayt= "t" . date("d"); $dayr= "r" . date("d"); $result = mysqli_query($mysqli, "select * time_table regd='". $_session['textbox1'] ."' order id desc"); while($res = mysqli_fetch_array($result)) { echo "<tr>"; echo "<td style='width: 30%'>".$res[$dayt]."</td>"; echo "<td style='width: 30%'>".$res[$day]."</td>"; echo "<td...

java - Override a public method that accesses private members -

i working on huge code base has huge class many private members , public , private methods. want create derived class base class have same members , methods, except 1 of public methods have line commented. how can that? i thought of overriding method, method accesses many private members of base class. below skeleton of want do. public class base { private var1; private var2; public tobeoverriden(){ processa(var1); processb(var1); processc(var1); // needs commented processd(var2); processe(var2); } } ideally - public class derived extends base{ @override public tobeoverriden(){ processa(var1); processb(var1); processd(var2); processe(var2); } } this not possible because cannot access private variables of base class. there can without making private members protected? please note overriding processc() empty not option because can used other non-overriden methods. if have ...

python - Why does a Popen child process not die? -

i'm launching subprocess popen , , expect finish exit. however, not process not exit, sending sigkill still leaves alive! below script demonstrates: from subprocess import popen import os import time import signal command = ["python","--version"] process = popen(command) pid = process.pid time.sleep(5) #ample time finish print pid print "sending sigkill" os.kill(pid,signal.sigkill) try: #kill signal 0 checks whether process exists os.kill(pid,0) print "process still alive after (not bad...)!" except exception e: print "succeeded in terminating child quickly!" time.sleep(20) #give ample time die #kill signal 0 checks whether process exists try: os.kill(pid,0) print "process still alive! that's bad!" except exception e: print "succeeded in terminating child!" for me, prints: 77881 python 2.7.10 sending sigkill process still alive after (not bad...)! process still al...

swift - Check if local time is after midnight in another timezone -

i want check if local time after midnight in time zone. specifically, if right @ 11 pm saturday, or 1 sunday local time, want see if start of new week in central time (after 12 sunday). you can use calendar 's datecomponents(in: timezone, from: date) check time , date in timezone. specific application: // create current date, central time zone, , current calendar let = date() let centraltimezone = timezone(abbreviation: "cst")! let calendar = calendar.current let components = calendar.datecomponents(in: centraltimezone, from: now) if components.weekday == 1 { print("it sunday in central standard time.") } else { print("it not sunday in central standard time.") } what you're doing there asking current calendar give full set of datecomponents in specified timezone. components.weekday gives day of week int, starting 1 sunday in gregorian calendar. if want know more if it's "tomorrow" somewhere, here'...

c++ - cmake based bitbake recipe : sysroot missing? -

i feel must doing fundamentally wrong. created recipe based on cmake project. compiling project using toolchain yocto created simple running cmake make fails compile using recipe: summary = "opendnp3 de facto reference implementation of ieee-1815 (dnp3)" description = "opendnp3 portable, scalable, , rigorously tested implementation of dnp3 (www.dnp.org) protocol stack written in c++11. library designed high-performance applications many concurrent tcp sessions or huge device simulations. embeds nicely on linux." homepage = "https://www.automatak.com/opendnp3" section = "libs" depends = "asio" license = "apache-2.0" lic_files_chksum = "file://notice;md5=9788d3abe6c9401d72fdb3717de33e6a" srcrev = "e00ff31b837821064e5208c15866a9d46f8777b1" src_uri = "git://github.com/automatak/dnp3;branch=2.0.x" s = "${workdir}/git" inherit cmake extra_oecmake += "" problem think cxxflag...

javascript - Cannot get a simple XMLHttpRequest to work -

i'm struggling work part of larger exercise. it's pretty simple - user fills in form sent using xmlhttprequest processing page. should return response below form. i had working, 1 field wouldn't show... , nothing. cache problem or problem code. here's form: <div id="minicontact"> <label for="yourname">your name</label> <input type="text" name="yourname" id="yourname"><br> <label for="phone">your phone</label> <input type="text" name="phone" id="phone"><br> <input type="text" name="reqd" id="reqd"><br> <label for="email">your email</label> <input type="email" name="email" id="email"><br> <label for="type">your vehicle type</label> <input type="text" name="type" id=...

javascript - Cloud Functions for Firebase timeout -

simple cloud function database data not working. getusermessage() not working error: function execution took 60002 ms, finished status: 'timeout' index.js getting database result. const functions = require('firebase-functions'); const admin = require('firebase-admin'); admin.initializeapp(functions.config().firebase); const cors = require('cors')({origin: true}); // take text parameter passed http endpoint , insert // realtime database under path /messages/:pushid/original exports.addmessage = functions.https.onrequest((req, res) => { // grab text parameter. const original = req.query.text; // push new message realtime database using firebase admin sdk. admin.database().ref('/messages').push({original: original}).then(snapshot => { // redirect 303 see other url of pushed object in firebase console. res.redirect(303, snapshot.ref); }); }); // listens new messages added /messages/:pushid/original , creat...

unity3d - Adding an animation controller to a UIImage in a canvas -

i trying animated image in canvas animate, don't believe sprite rendering works canvas'. ive tried adding animation component need image have controller on it, it's animation changes time. how able make uiimage animated whilst still using animation controller you need create animation using animation view , selected uiimage - animation view let change uiimage sprites, position , more. drop animation animation controller , create whatever transitions want. here can read more it: animation view documentation

node.js - Using express to serve an Angular app -

i planning serve angular index.html express. is possible make call service can populate node model. pass model value index.html. for example, call service trusted source within our compnay gives me few files write index file. i in javascript index.html @ runtime, think woud better if node server did bootstrapped , served index.html. i cannot seem find how done or common approach. i have done before in .net/angular app node/express new approach me. thanks

C++ Initializing an array with a variable and not a constant expression -

i in process of learning c++ , have been reading c++ primer (5th edition) . in chapter 3.5 talks arrays , initializing them, says arrays must initialized using constant expression. here example book unsigned cnt = 42; // not constant expression constexpr unsigned sz = 42; // constant expression int arr[10]; // array of ten ints int *parr[sz]; // array of 42 pointers int string bad[cnt]; // error: cnt not constant expression string strs[get_size()]; // ok if get_size constexpr, error otherwise” excerpt from: stanley b. lippman. “c++ primer, fifth edition.” however when try using g++ -std=c++11 compiles fine. kind of confused whether mistake in book or has standard been modified since writing of book though book states uses c++ 11. here actual code using compiles , runs fine unsigned int cnt = 42; // not constant expression constexpr unsigned int sz = 42; // constant expression int arr[10]; // array of 10 ints int *parr[sz]; // array of 10 int pointers string bad[cnt]...

c# - High draw count results in low FPS on iOS device unity -

Image
i have relatively simple game, when run on ios fps low draw count high. not sure if can use static batching in case graphics moving around in scene @ different speeds. suggestions increase fps appreciated... edit 1: game 2d 1) adding instancing materials to enable gpu instancing on materials, select material in project window, , in inspector, tick enable instancing checkbox. https://docs.unity3d.com/manual/gpuinstancing.html 2) quality settings unity allows set level of graphical quality attempt render. speaking, quality comes @ expense of framerate , may best not aim highest quality on mobile devices or older hardware since have detrimental effect on gameplay. quality settings inspector (menu: edit > project settings > quality) used select quality level in editor chosen device. split 2 main areas - @ top, there following matrix: https://docs.unity3d.com/manual/class-qualitysettings.html hope thing on project...

regex - Matching non-numbers after a few characters with javascript -

i'm new regexes , i'm validating form. want use string.prototype.match filter out array responses incorrect. input should match form: "foo-1234567" where each identifier starts foo- , has 7 digits. if there's more 1 identifier, input takes form: "foo-1234567\nfoo-7654321\nfoo-1324536"` where identifiers separated linefeeds. i want match give me each identifier has foo- , 7 characters 1 or more non-digit characters. if input this: "foo-1234567\nfoo-1234a67\nfoo-123$5^7" i want array match this: ["foo-1234a67", "foo-123$5^7"] . regexes have tried: /^foo-\d+$/gmi //nada /^foo-(\d){1,7}$/gmi //not close /^foo-\d*\d+\d*$/gmi //good matches > or < 7 characters /^foo-(?=^foo-\d*\d+\d*$)(?=pr-.{7})/gmi //empty string or null as always, code-golf, shortest code wins. the regex match individual valid values simple: /^foo-\d{7}$/ . i'd suggesting .split() ing on newlines , .filt...

c# - EDIT: Why DataReader opened error occurs in this map? -

this question has answer here: there open datareader associated command must closed first 14 answers i'm trying pass map view. before populate data entities(session, movie, theater). start doing selection in sessions: var sessions = s in db.sessions s.theaterid == id orderby s.movieid, s.time select s; this method. inside iterate on each session , verify if in map have list movie name key. when execution reaches thie point i'm receiving infamous "there open datareader associated command must closed first." exception. can't cast list because of types: public actionresult myaction(int id) { theather theater = db.theater.find(id); viewbag.theatername = theater.nomecinema; var sessions = s in db.sessions s.theaterid == id orderby s.movieid, s.time select s; var mapmovies = new dictionary...

performance - Python scipy butterworth runtime is drastically different on 2 arrays of similar size. Help me understand why? -

i analyzing neural signals (specifically local field potentials) recorded in brains of awake behaving rats. have 2 signals recorded on 2 different days same subject. 1 of them 1586996 samples long (12.7mb), while second 1465754 samples long (11.7mb). i naively thought shorter data take less time filter scipy.signal.butter, totally wrong. astonished discover takes 45 s run on first one, takes whopping 8092.6 s (almost 2.5 hours) run on second one! second file takes on 180 x long filter though shorter! how can there such huge discrepancy? , can reduce run time? here code: import numpy np import time # load data (you might have provide filepath) lfp1 = np.fromfile('rk97_2017-01-19_raw_30k_30pres_ger_lfp.dat', dtype='float') # longer data file lfp2 = np.fromfile('rk97_2017-02-12_raw_30k_30pres_pp_lfp.dat', dtype='float') # shorter data file sf = 3000 # sampling freuqency (hz) def butter_filt(order, low, high, signal): # note: freuqencies mus...

python - Is adding folders to system path for reaching other modules is a dirty hack? -

i have commands.py module in directory contain subdirectory script. don't want copy in every folder, contain scripts. bad practice? import sys sys.path.append("..") # add previous folder run script sys.path.append(".") # add current folder if run script in folder, contain commands.py commands import * sorry bad english. current folder first entry in sys.path (from python's path-making perspective '' == '.' ) adding pointless in second case. the first case more problematic - first of all, current path should first entry if insist on adding folders sys.path @ least insert them @ index 1+ , or better, append path end of sys.path ensure built-in , current-folder visible modules accessible intended locations. finally, due fact different parts using sys.path search path in different ways, setting relative paths not idea. if want hardcode parent path, use os.path.realpath("..") . this under assumption there no ...

python - Chrome crashes when opened with selenium webdriver -

when launching chrome browser python shell using selenium webdriver, works , good. but, when launch browser using same code inside python script, crashes. how can solve it? okay got it. reason was not providing url after opening broswer. we need provide url after opening browser can go specific page , works fine, else crash.

java - Accessing the edit method from google play developer rest api -

i authenticated google play developer rest api , getting refresh token can figure out how make edit requests. have method signature @ following link: https://developers.google.com/android-publisher/api-ref/edits/insert i added following header authorization:{{token_type}} {{access_token}} but cant figure out put package name: post https://www.googleapis.com/androidpublisher/v2/applications/packagename/edits i putted packagename above using , post parameter , in both cases encountered "404 not found" error. please help. you can try post https://www.googleapis.com/androidpublisher/v2/applications/edits?id = packageid && expirytimeseconds = 20 https://www.googleapis.com/androidpublisher/v2/applications/**packagename**/edits/**editid** according https://developers.google.com/android-publisher/api-ref/edits#methods

javascript - Accessing global method with namespace in TypeScript -

i'm trying call method in .js file looks this: if (typeof shared === "undefined" || !shared) { var shared = {}; } shared.helperclass = (function () { // ... private stuff here return { init: function() { }, testmethod: function(name) { return name; } }; })(); naturally call init in javascript, i'd call: shared.helperclass.init(); now have typescript file i'd call in, throws compiler error because doesn't know is. how tell typescript these methods such can call code .ts file? how tell typescript these methods such can call code .ts file? create file globals.d.ts , add following declare var shared:any; done! more more on migrating : https://basarat.gitbooks.io/typescript/docs/types/migrating.html

java - How to send text file to a http request which shows error "request was rejected because no multipart boundary as found" -

Image
i having issue in file uploading jmeter i hav added parameter in http header manager , uploaded .txt file , hitting http request. sampler request giving request code 200 response data shown below: could not parse multipart servlet request; nested exception org.apache.commons.fileupload.fileuploadexception: request rejected because no multipart boundary founderror make sure provide full path file being uploaded under "files upload" tab of http request sampler make sure tick use multipart/form-data post box make sure "parameter name" matches "name" attribute of relevant file html input field . in absolute majority of cases easier record file upload event using jmeter's http(s) test script recorder , make sure copy file(s) jmeter's "bin" folder prior recording request itself, see recording file uploads jmeter article more details.

python - Installed detectem, but "det: command not found" -

i fresh python , web scraping. following tutorial introducing detectem detect frameworks or languages website uses, firstly started install docker detectem installed. i encountered problem "operation not permitted" while installing detectem pip in terminal app, googled , used command $ pip install detectem --user adding additional --user flag. after than, no annoying red error message poped out, looked fine shown: terminal message screenshot. however, after installation, when tried use det command, terminal said command not found following image shows. terminal error message screenshot i tried google , find out reason, however, did not useful information problem. thanks guys if give me suggestion on this. try navigating directory detectem installed: usr/lib/.../det.extension , using dat command. believe can use pip show <package> see installation path.

android - App is crashed when I start Service after Boot -

Image
i want start service when turn on device. if start activity, working fine in case of service crashed. please guide me. code here. in logcat. getting error activitynotfoundexception . how solve issue? my service public class startserviceafterboot extends broadcastreceiver { public startserviceafterboot() { } @override public void onreceive(context context, intent intent) { if (intent.getaction().equals(intent.action_boot_completed)) { intent = new intent(context, backgroundlocationservice.class); i.addflags(intent.flag_activity_new_task); context.startactivity(i); } } } my activity public class mainactivity extends appcompatactivity { private button mstartupdatesbutton; private button mstopupdatesbutton; @override protected void oncreate(bundle savedinstancestate) { super.oncreate(savedinstancestate); setcontentview(r.layout.activity_main); toolbar toolbar = (toolbar) findviewbyid(r.id.toolbar); setsupportactionbar(tool...

how to get java Hashmap object using javascript -

restcontext.getrequestheaders(); passing hashmap of type hashmap(string,string) request header shown in abstract code. var headers=restcontext.getrequestheaders(); for( key in headers){ query.replace(''#id#'',headers[key]); query= query.concat(headers[key]); }

google chrome - ChromeDriver 2.31 not working in CentOS / RHEL 7 (gilbc 2.18 required) -

when trying use chromedriver 2.31 in centos 7 following error: version 'glibc_2.18' not found chromedriver developers confirm glibc library dependency has been promoted 2.18, while centos 7 has version 2.17. related links: announcing chromedriver 2.31 chromedriver issue #1894 chromedriver issue #1772 is there way make work without switching os? the chromium developers aware of issue , working on fix: glibc dependency creeped 2.18 in m61, breaking el7 support during switch libc++ , accidentally referenced new symbol glibc version in sysroot, __cxa_thread_atexit_impl . introduce in glibc 2.18, , red hat enterprise linux 7 has version 2.17. apparently, use cases, libc++ works enough without symbol (similar libstdc++ gcc), need tweak build not use it, , chromium (and chrome driver , chrome unstable) should work again soon. as end user or software developer cannot rebuild software in question (or maybe not want invest such non-trivial effort), ...

scala - Why does my query fail with AnalysisException? -

i new spark streaming. trying structured spark streaming local csv files.i getting below exception while processing. exception in thread "main" org.apache.spark.sql.analysisexception: queries streaming sources must executed writestream.start();; filesource[file:///home/teju/desktop/sparkinputfiles/*.csv] this code. val df = spark .readstream .format("csv") .option("header", "false") // use first line of files header .option("delimiter", ":") // specifying delimiter of input file .schema(inputdata_schema) // specifying schema input file .load("file:///home/teju/desktop/sparkinputfiles/*.csv") val filterop = spark.sql("select tagshortid,timestamp,listenershortid,rootorgid,suborgid,first(rssi_weightage(rssi)) rssi_weight my_table rssi > -127 group tagshortid,timestamp,listenershortid,rootorgid,suborgid order timestamp asc") val outstream = filterop.writestream.outputmode("complet...

outlook - Uniquely identify Mailitem -

i need store model every used mailitem. i've written following method private readonly static dictionary<string, permitcustompaneviewmodel> viewmodellookup = new dictionary<string, permitcustompaneviewmodel>(); public static permitcustompaneviewmodel createorget(mailitem c) { if (c.entryid == null) c.save(); if (!viewmodellookup.containskey(c.entryid)) { var vm = new permitcustompaneviewmodel(c); c.unload += () => viewmodellookup.remove(c.entryid); viewmodellookup.add(c.entryid, vm); } return viewmodellookup[c.entryid]; } when model exists, , return it. if not created, create , remove entry after mailitem unloaded. however have observed mailitem object not vailid time untill unload called. in order reliable identify mailitem used entryid . problem works if item saved. so save item if no entryid found. automaticly saves item under draft. is there wa...

python - CeleryBeat Process consumes all OS memory -

we using django-celery==3.1.10 celery==3.1.20 python 2.7.13 we have written customdatabasescheduler schedule task, schedules task on time. running celerybeat process init script, celerybeat consumes full memory of system i.e. 24gb in day. i tried run pmap on celerybeat process, shows [anon] has took memory. can please debug , fix this. first of if on django 1.8 or above please use celery 4.0 , above. in case not require django-celery. in case follow tutorial. http://docs.celeryproject.org/en/latest/django/first-steps-with-django.html coming problem may 1 of following reasons: your workers overloaded. try using concurrency mentioned here check if django settings debug set true . can cause memory leakages , celery advises against when run it. check memory leak fixes in history . me seemed next version after yours, 3.1.21 precise has memory leak fixes. try upgrading latest 3.x version(only if cannot use 4.x reason.) if else fails, try monitoring tools debug...

ruby - rbenv install 2.4.0 fails in Mac OS Sierra 10.12.6 -

> rbenv install 2.4.0 ruby-build: use openssl homebrew downloading > ruby-2.4.0.tar.bz2... > -> https://cache.ruby-lang.org/pub/ruby/2.4/ruby-2.4.0.tar.bz2 installing ruby-2.4.0... ruby-build: use readline homebrew > > build failed (os x 10.12.6 using ruby-build 20170726) > > inspect or clean working tree @ > /var/folders/9_/xjrq9lv11hl_82pmlzqh3h0m0000gn/t/ruby-build.20170728015414.21759 > results logged > /var/folders/9_/xjrq9lv11hl_82pmlzqh3h0m0000gn/t/ruby-build.20170728015414.21759.log > > last 10 log lines: referenced from: /usr/local/bin/tar expected > in: /usr/lib/libsystem.b.dylib > > dyld: symbol not found: _utimensat referenced from: > /usr/local/bin/tar expected in: /usr/lib/libsystem.b.dylib > > /usr/local/bin/ruby-build: line 344: 21953 abort trap: 6 tar > $tar_args "$package_filename" > /var/folders/9_/xjrq9lv11hl_82pmlzqh3h0m0000gn/t/ruby-build.20170728015414.21759/ruby-2...

sql server - SQL assign variable with subquery -

i have question following 2 sql: declare @i1 bit, @b1 bit declare @i2 bit, @b2 bit declare @t table (seq int) insert @t values (1) -- verify data select case when (select count(1) @t n2 1 = 2) > 0 1 else 0 end -- result 0 select @i1 = 1, @b1 = case when @i1 = 1 or ((select count(1) @t n2 1 = 2) > 0) 1 else 0 end @t n n.seq = 1 select @i1, @b1 -- result 1, 0 select @i2 = 1, @b2 = case when @i2 = 1 or (0 > 0) 1 else 0 end @t n n.seq = 1 select @i2, @b2 -- result 1, 1 sql fiddle here before execute, thought case part should null = 1 or (0 > 0) , , return 0 . but now, wondering why 2nd sql return 1 i post answer quite large text training kit (70-461) : where propertytype = 'int' , cast(propertyval int) > 10 some assume unless precedence rules dictate otherwise, predicates evaluated left right, , short circuiting take place when possible. in other words, if first predicate propertytype = 'int' evaluates false, sql serv...

c++ - How to deal with MFC listcontrol window flashing -

i wrote mfc application program.i used listcontrol controls , radio buttons in dialog.i realize real-time-update data listcontrol when clicked single radiobutton triggering corresponding events. firstly,when dialog initialized,inserting data listcontrol , showing dialog. secondly,when clicked 1 radiobutton among these.the first step delete columns , items in listcontrol.the second step insert neccessary data listcontrol.by way,i used same variable relative listcontrol id. notice:the data changed time! finally found listcontrol window appeared fast flash , felt bad. there ways solve problem?and can suggest or advanced advice me?thanks lot!

html - Captializing S in stylesheet mentioned in rel attribute -

after deep search, there known me puts me think lot , couldn't idea of purpose serves. capitalizing s in stylesheet rel attribute value. what difference between, <link rel="stylesheet" href="/css/widgets/some.css"> and <link rel="stylesheet" href="/css/widgets/some.css"> what purpose serves? on-shore 15years experienced web application head insisting this. please explain , make me understand. there no difference, link types case insensitive . guessing colleague prefers them way reason.

ios - How to remove the ChildViewController from Parent View Controller in Swift 3 -

i developing ios application. have added uiviewcontroller in view pager. want reinitialize when language changed. here want remove child uiviewcontroller uiviewpager , again add uiviewcontroller viewpager. how can that? sample code viewpager = viewpagercontroller() viewpager.options = options viewpager.datasource = self viewpager.delegate = self self.addchildviewcontroller(viewpager) swift 3.1 xcode 8.3.3 after long search remove view controllers viewpager. did in following way. if self.childviewcontrollers.count > 0{ let viewcontrollers:[uiviewcontroller] = self.childviewcontrollers viewcontoller in viewcontrollers{ viewcontoller.willmove(toparentviewcontroller: nil) viewcontoller.view.removefromsuperview() viewcontoller.removefromparentviewcontroller() } } here self , current uiviewcontroller has view pager. need remove childview controllers view pager. so, list of view controllers current ui...

c# - MetroLog in UWP application is generating many unhandled exceptions -

windows 10 uwp app need logging file. chose metrolog. did lot of reading , followed suggestions wrap of logging methods , properties singleton class. project has variety of places log such pages, singleton or static classes , few background tasks/threads. understand, metrolog should thread safe though. i getting large amount of unhandled exceptions reported hockeyapp. large amount, mean several thousand per day. every 1 of them related metrolog. pulling hair out trying figure out causing , frustrating of things read show implementation not different or wrong @ loss here. to me exception sounds not thread safe , more 2 places trying log/access text file @ same time? here exception 0 sharedlibrary 0x0000000061defd41 system.runtime.exceptionservices.exceptiondispatchinfo.throw() in f:\dd\ndp\fxcore\corert\src\system.private.corelib\src\system\runtime\exceptionservices\exceptiondispatchinfo.cs @ 61:13 1 sharedlibrary 0x...

Adding a user to a WildFly server, results in error -

i trying add user wildfly server error: ./add-user.sh: 1: eval: /usr/lib/jvm/java-8-openjdk-amd64/jre/bin/java/bin/java: not found i suppose need change java_home location in .conf file have done in .conf files of wildfly/bin directory. how can solve issue? the add-user.sh script doesn't source configuration file, have provide java binary through environment. you can in multiple ways : through java variable pointing java executable : export java=/path/to/jdk_install/bin/java ./add-user.sh [...] through java_home variable pointing java installation directory : export java_home=/path/to/jdk_install/ ./add-user.sh [...] by including java's installation bin directory path : export path="/path/to/jdk_install/bin:$path" ./add-user.sh [...] note these may vary depending on wildfly or jboss eap version ; gathered these reading script of wildfly-8.1.0.final installation. if you're not sure applies own version , have basic un...