Posts

Showing posts from September, 2015

filehandler - java open files not cleaned, even when the process is killed -

there java program read files folder, processing , write output files in folder. ran 4 hours , produced few files failed after throwing following error: "too many files" then modified program close (bufferreader , bufferwriter) , started process again. time process failed after starting throwing following error: java.io.filenotfoundexception: <file> (too many open files) then tried running lsof , searched process having no of open files. realized networkmanager. not sure whether should kill process or not. restarted machine. after when ran java program, still got same error. in worst case might possible code still having leaks in terms of not closing everything, still failing after starting process. have feeling lying in system previous run. if start same process in other machine, runs hours before failing. you cannot retain resource between runs of program, if wanted to. leave system without enough resources in theory, though unlikely, restarting

windows - Python - how to run the application and leave until it end? -

how can run application , leave instead of waiting when ended? example : /var/tmp/runme.sh & following code working waits forever when google chrome exit. how can run google chrome let script exit? import subprocess import sys import time line = sys.argv[1] print line def kill_chrome(): subprocess.call(['taskkill', '/im', 'chrome.exe', '/f']) def run_chrome(): subprocess.call(['c:/program files (x86)/google/chrome/application/chrome.exe', '--kiosk']) def run_java(): subprocess.call(['java', '-cp', 'c:/python27/pdfbox-app-2.0.0-rc3.jar;c:/python27/jprint.jar', 'jprint']) try: if line.startswith("myjava:website"): print "google chrome - idle" run_chrome() elif line.startswith("myjava:a4"): print "printing - java" run_java() elif line.startswith("myjava:kill"): print "killer" kill_chrome() except

How to read bytes line by line in Java using NIO or apache commons IO? Whichever is more efficent -

i have bunch of bytes written line line file each line can have varying number of bytes , need read them line line wondering how in efficient way using nio or apache commons io? trying see if there way api can take care of allocation , deallocation of buffers since dont know length of bytes in each line. can read string , .getbytes().length() sounds bit awkward. if file consists of lines, can read millions of lines second bufferedreader.readline(). don't need else. in case nio doesn't support reading lines in way shape or form.

Rails: Pie Charts legend in Chartkicks -

in highcharts show percentage along pie_charts , legend can customized this: legend: {labelformat: '{name} : {y} ({percentage}%)'} but in chartkicks can't find how this? if @ documentation specified on chartkick gem homepage, says: you can pass options directly charting library with: <%= line_chart data, library: {backgroundcolor: "#eee"} %> so in scenario, should try like: <%= pie_chart data, library: {legend: {labelformat: '{name} : {y} ({percentage}%)'}} %>

Spring Cloud Config Server without Spring Boot -

i have looked @ spring-cloud-config client without spring boot , many others , have not found convincing answer. here goes again: question : possible, in spring app, use spring cloud config server/client without automagic configuration of spring boot? using spring boot requirement using these frameworks? if is: is there documentation describes needs done in order enable spring cloud config server/client without spring boot? is there sample project describes needs done in order enable spring cloud config server/client without spring boot?? i'm not aware of documentation or sample project. doing in our projects. you need include configuration server uri property source, assuming using propertysourcesplaceholderconfigurer: <bean class="org.springframework.context.support.propertysourcesplaceholderconfigurer" id="propertyplaceholder"> <property name="locations"> <list> <value>http:/

Jointjs creating link once it is deleted -

i have started working jointjs. have not seen example/tutorial on website mentioning creating of link again once deleted. example on link. http://jointjs.com/demos/org i wonder if possible create link again between 2 members once deleted. i tried code in function function (x, y, rank, background, textcolor) : '.rank': { text: rank, fill: textcolor, 'word-spacing': '-5px', 'letter-spacing': 0, magnet: true, pointerevents:'none' } but not working. i not sure if member type has ports. if yes need add ports recreate links once rendered. if @ source code, links created during render if refresh page or run code again links come back.

php - insert data to mysql using populate dropdown list -

i'm trying insert data database table name dokter , populate dropdown list poliklinik. when i'm trying insert it,the notification keep showing "undifined vaiable : kodep" here form code <select class="form1" name="kodecrot"> <?php $query = mysql_query("select * poliklinik"); if(mysql_num_rows($query) != 0) { while($tampil = mysql_fetch_array($query)){ echo "<option value=".$tampil['namapoli'].">".$tampil['namapoli']."</option>"; } } ?> </select> here process code <?php include'../koneksi.php'; $kodedokter = $_post['kodedokter']; $nmdokter = $_post['nmdokter']; $almdokter = $_post['almdokter']; $telp = $_post['telp']; $kodepoli = $_post['kodecrot']; $kodejadwal = $_post['kodeja

Inno Setup Studio - Install the main application executable file to subfolder -

Image
i using inno setup quickstart pack 5.5.6 , perfect. i installed inno 5.5.8 quickstart pack 5.5.8 , i'm having problem. ok if start inno can select appname, company , can select path of program , program exe file, screen: like can see selected main .exe in \binaries\win32\ located not in main folder of program in sub-folder. now code have inno script studio automatically write wrong exe path, not main folder of program said in \binaries\win32\ . but why did ? worked inno quickstart pack 5.5.6 , never seen problem , correct path correct if exe in sub-folder. you have these 2 entries in [files] section. [files] source: "c:\temp\life strange episode 5\binaries\win32\lifeisstrange.exe"; \ destdir: "{app}"; flags: ignoreversion source: "c:\temp\life strange episode 5\*"; \ destdir: "{app}"; flags: ignoreversion recursesudirs createallsubdirs this not make sense. entries overlap. it seems believe selectin

python - c pointers and ctypes -

so, have c++ class wrap in c can use in python using ctypes. declaration of c++ class: // test.h class test { public: static double add(double a, double b); }; //test.cpp #include "stdafx.h" #include "test.h" double test::add(double a, double b) { return + b; } c wrap: // cdll.h #ifndef wrapdll_exports #define wrapdll_api __declspec(dllexport) #else #define wrapdll_api __declspec(dllimport) #endif #include "test.h" extern "c" { wrapdll_api struct testc; wrapdll_api testc* newtest(); wrapdll_api double addc(testc* pc, double a, double b); } //cdll.cpp #include "stdafx.h" #include "cdll.h" testc* newtest() { return (testc*) new test; } double addc(testc* pc, double a, double b) { return ((test*)pc)->add(a, b); } python script: import ctypes t = ctypes.cdll('../debug/cdll.dll') = t.newtest() t.addc(a, 2, 3) result of t.addc(a, 2, 3) negative integer. there problem pointer,

javascript - Traversing up and finding a child element with attribute equal to a specific value -

i have list ul contains element article has attribute data-level . traversing in javascript through articles. adding replyto symbol comments have data-level larger 1, username of parent, need traverse comment list , find article element has data-level="0" , username element. i can't use jquery closest() because doesn't check inside element. if use parent().parent() run closest() on parent, not good. how can run closest() function or familiar on article element (red arrow in image) find first article element above has attribute equals 0 ( data-level="0" ). here's html code: <ul> <li> <article itemprop="comment" itemscope="itemscope" itemtype="http://schema.org/comment" data-user-id="28" id="comment-40" data-comment-id="40" class="comment-wrapper" data-level="0"> <header> <p class="comment-title">

PySpark : how to split data without randomnize -

there function can randomize spilt data trainingrdd, validationrdd, testrdd = rdd.randomsplit([6, 2, 2], seed=0l) i'm curious if there way generate data same partition ( train 60 / valid 20 / test 20 ) without randommize ( let's use current data split first 60 = train, next 20 =valid , last 20 test data) is there possible way split data similar way split not randomize? the basic issue here unless have index column in data, there no concept of "first rows" , "next rows" in rdd, it's unordered set. if have integer index column this: train = rdd.filter(lambda r: r['index'] % 5 <= 3) validation = rdd.filter(lambda r: r['index'] % 5 == 4) test = rdd.filter(lambda r: r['index'] % 5 == 5)

java - Editing value of TableView column -

i encountered problem unable solve. thing is, tableview populated , need cells match criteria set value zero. have variable korzemljiste , if condition fullfilled cells in column colosnovica need set value 0.00. here tried: if (korzemljiste < 10000) { tbltabela.getitems().stream().foreach((o) -> { colosnovica.setcellfactory(textfieldtablecell.fortablecolumn()); colosnovica.setoneditcommit( new eventhandler<celleditevent<nepokretnost, number>>() { @override public void handle(celleditevent<nepokretnost, number> t) { ((nepokretnost) t.gettableview().getitems().get( t.gettableposition().getrow()) ).setosnovica(t.getnewvalue()); } });});} sorry, ugly end of code, couldn't make copy properly. this part modified oracle example , error: error: incompatible typ

jspdf - Generate multiple tables using ajax call -

i using jspdf , jsautotable generate pdf table in dom. first of want create multiple tables present in dom using button click. secondly want create pdf file multiple tables using ajax call server using button. have tried around tutorial have not found specific. can please. i have been able create multiple tables. since needed create 2 tables in pdf file, needed call autotablehtmltojson function twice after getting information html tables. after doing can define options each of table also. since there limited assistance available js auto table if needs in regard comment below, might able help. var elem = document.getelementbyid('employee-table'); var data = doc.autotablehtmltojson(elem); var elem2 = document.getelementbyid('employee-table2'); var data2 = doc.autotablehtmltojson(elem2);

JavaScript - pass string variable to eval -

part of code generates string, suppose used function generated chuck in voxeljs. an example string "(y == 1)? 1 : 0" which need added function this, eg. "function(x, y, z){return (y == 1)? 1 : 0}" i thought using eval change string needed code, this: gtest = function(x, y, z){return eval(generationstring) }; but misunderstood how eval used, , realized needed try else. if @ gtest in javascript console says it's structure function (x, y, z){return eval(generationstring) } when want function (x, y, z){return return (y == 1)? 1 : 0}} . attempting pass code containting eval causes voxeljs crash/freeze when tries generate new chunks. how can convert string javascript code code in function in way want? i realize might hard understand question, sorry that, i'm not sure how describe other way. i found answer literally 30 seconds after posting this, use function() constructor. given string describing javascript function, convert javasc

classcastexception - How does class casting work? -

consider c1 base class of c3. below code works perfectly. c1 obj1=new c3(); c3 obj2=(c3)obj1; but, there classcastexception in below one c1 obj1=new c1(); c3 obj3=(c3)obj1; what have missed? i think what's happening creating obj1 instance of c1, , trying cast class further down inheritance chain c1. in first example, c1 base type of c3 , can create instance of c3 type c1..that's fine. c3 child of c1 , inherits properties , methods. in 2nd example, however, creating instance of c1 type of c1. trying cast child. child class may have additional properties , methods parent doesn't have. to summarise, child can of parent type , cast it, however, parent cannot child , cannot cast such. if need further clarification, let me know.

java - Odata V4 Client: getEntityCreate method -

i developed odataclient in java in order create new entities. encountering difficulties create new entities. took initiative see messages sent client fiddler. odataentitycreaterequest<cliententity> request= client.getcudrequestfactory() .getentitycreaterequest(new uri("http://localhost:8888/"), cliententity); request.addcustomheader("content-type", "application/json;odata.metadata=minimal"); request.setaccept("application/json;odata=minimalmetadata"); odataentitycreateresponse<cliententity> response = request.execute(); below first line of body obtained fiddler: 17b {"@odata.type":"#odatademo.product", ....} i tested manually fiddler create new entity , first line of message body should be: {"odata.type":"odatademo.product", ....} i know if possible set body of request odata in order delete "@" , "#". thanks

android - Strange Black Background after setMeasuredDimension in Custom ImageView -

Image
i have library allows circularimageview have problem can't fix. i add in layout way: <linearlayout android:layout_width="match_parent" android:layout_height="match_parent" android:gravity="center" android:orientation="vertical"> <linearlayout android:layout_width="match_parent" android:layout_height="0dp" android:layout_weight="1" android:gravity="center" android:orientation="vertical"> <com.mikhaellopez.circularimageview.circularimageview android:id="@+id/circularimageview" android:layout_width="wrap_content" android:layout_height="wrap_content" android:src="@drawable/test" app:civ_border="true" app:civ_border_color="#3f51b5" app:civ_border_width="8dp" app:civ_shadow="

android - choose photo from gallery for s7, s7 edge, note 5 not working -

i have app uploading image gallery. working fine note 4, os 6.0, not working note 5, s7, s7 edge. what mean not working is i can see gallery, when select image, gallery dismissed only. nothing ahead happened. did happened before? right not posting code because might know why happening. post code incase if needed. targetsdkversion 21, means don't worry permissions now. problem lies somewhere else. the problem device when choose image gallery onactivityresult() call in normal case when choose image devices oncreate() method call , nothing happens due oncreate() solution write below properties in androidmanifest file of activity.this works me. android:configchanges="orientation|keyboardhidden|screensize"

How to insert text from RTF to Word Document in c# -

i using winservice creating word docs. problem have paste rtf word selection. i have code: private static void pastertf(object bookmarkname, office.application wordapplication, document worddocument, string rtftext, bool winservice) { if(bookmarkname == null || wordapplication == null || worddocument == null) return; if (!winservice) { clipboard.clear(); clipboard.settext(rtftext, textdataformat.rtf); idataobject formatedtext = clipboard.getdataobject(); if (formatedtext != null) { worddocument.bookmarks[bookmarkname].range.select(); selection sel = wordapplication.selection; sel.paste(); } clipboard.clear(); } else { ???? } } do have idea how without using clipboard? if rtf text

typescript - Angular2 build in Visual Studio Team Services (was Visual Studio Online) -

Image
i have angular2 client visual studio vnext (asp.net 5) project. trying create build in visual studio team services, , getting errors on build step: cannot find module 'angular2/core' this problem typescript compiler. have tsconfig.json in project not sure if team services using it. i don't have problem building locally in visual studio. any idea how should handle this? you need add "npm" task run "npm install" command in build definition install npm packages before vs build. otherwise, angular won't installed during build. remember set "working directory" project folder npm configuration file "package.json" placed.

python - nosetest error: ValueError: dictionary update sequence element #0 has length 4; 2 is required -

i noob , w/r/t python 2.7 , exercise i'm working through on learn python hard way ( link ex47 ) - file below named ex47_tests.py , error related running nosetests directory i'm working in. according nosetests , error test_map() function @ line west.add_paths({'east', start}) , states: valueerror: dictionary update sequence @ element #0 has length 4; 2 required cannot understand problem is... here's test file: from nose.tools import * ex47.game import room def test_room(): gold = room("goldroom", """this room has gold in can grab. there's door north.""") assert_equal(gold.name, "goldroom") assert_equal(gold.paths, {}) def test_room_paths(): center = room("center", "test room in center.") north = room("north", "test room in north.") south = room("south", "test room in south.") ce

java - How to make a program ask for a input date multiple times if wrong -

hi im trying fix program, write java program displays calendar of month of year between 1900 , 2099. the program must: 1. prompt user specific month meaningful message. if input value valid date (i.e. 3 characters designating desired month (i.e. jan, feb, ..., in combination of lower , upper case letters, followed space , integer between 1900 , 2099), calendar given date must displayed 2.1. if input value not valid date, user must informed date not acceptable, , prompted again date. if more 3 consecutive erroneous dates given, program must terminated appropriate error message. 2.2. after displaying calendar, program must ask whether or not user wants enter date (do want continue?) 2.3. user must answer either yes, no, y or n, in combination of lower , upper case letters 2.4. if invalid answer given, user must informed answer not acceptable, , prompted again answer. if more 3 consecutive erroneous answers given, program must terminated appropriate error message

angularjs - Angular Material and Handsontable -

Image
i trying use handsontable angular , nghandsontable. there seems weird interaction, when dialog first appears see first column then when select 1 of these cells: and when item within row changed formatting after: has seen similar , there can around apart form hacking css of handsontable? js: // nghandsontable vm.minsparerows = 1; vm.rowheaders = false; vm.db = { items: items }; vm.settings = { colheaders: true, contextmenu: ['row_above', 'row_below', 'remove_row'] }; // overflow ellipsis js vm.mycustomrenderer = function (hotinstance, td, row, col, prop, value, cellproperties) { var max_length = 4; if ((value + '').length > max_length) { value = value.substr(0, max_length) + '...'; } td.innerhtml = value; } html: <hot-table settings="vm.settings" row-headers="vm.rowheaders" min-spare-rows="vm.minspar

ios - How to convert milliseconds to UTC time in Objective C? -

i getting milliseconds time backend guys. have convert utc time zone because can convert time zone easily. or there way change time according country out changing utc time zone. i using code nsdate *currentdate = mydate; double secsutc1970 = [currentdate timeintervalsince1970]; nsdate *date = [nsdate datewithtimeintervalsince1970:secsutc1970]; nsdateformatter *format = [[nsdateformatter alloc]init]; nstimezone *inputtimezone = [nstimezone timezonewithabbreviation:@"utc"]; [format settimezone:inputtimezone]; [format setdatestyle:nsdateformatterfullstyle]; [format settimestyle:nsdateformatterfullstyle]; nslog(@"%@",[format stringfromdate:date]); nstimezone *outputtimezone = [nstimezone localtimezone]; nsdateformatter *outputdateformatter = [[nsdateformatter alloc] init]; [outputdateformatter settimezone:outputtimezone]; [outputdateformatter se

R All possible sub-combinations -

i have data this: basin <- c("volta","seine","limpopo") c1 <- c("ben","bel","sa") c2 <- c("burk","fra","moz") c3 <- c("ivc","lux","zim") c4 <- c("gha","na","bots") c5 <- c("mali","na","na") c6 <- c("togo","na","na") df <- data.frame(basin, c1, c2, c3, c4, c5, c6) basin c1 c2 c3 c4 c5 c6 1 volta ben bur ivc gha mali togo 2 seine bel fra lux na na na 3 limpopo sa moz zim bots na na each basin has k countries. example in first row, need generate combinations of 5 countries, combinations of 4 countries, , on. second row need generate combinations of 2 countries , third row combinations of 3 countries , 2countries. add these subsets new rows in data. i tried use function: allsubs <- function(x, k) { if(k > l

algorithm - how to sum edge weights with graphx -

i have graph[int, int], each edge has weight value. want is, each user, collect in-edges , sum weight associated each of them. say data like: import org.apache.spark.graphx._ val sc: sparkcontext // create rdd vertices val users: rdd[(vertexid, (string, string))] = sc.parallelize(array((3l, ("rxin", "student")), (7l,("jgonzal", "postdoc")), (5l, ("franklin", "prof")), (2l, ("istoica", "prof")))) // create rdd edges val relationships: rdd[edge[int]] = sc.parallelize(array(edge(3l, 7l, 12), edge(5l, 3l, 1), edge(2l, 5l, 3), edge(5l, 7l, 5))) // define default user in case there relationship missing user val defaultuser = ("john doe", &qu

html - i want my shell script to generate a file with the output in it -

so basically, instead of writing on , on again html code website building (install page need 1 each app offer download)so made script. want output in file generated so, on console asks should name file (e.g: hi.html) , output in file in specific directory on mac. # prompt input. app=$1 if [ -z "${app}" ] read -p "app: " app fi report=$2 if [ -z "${report}" ] read -p "report app: " report fi appicon=$3 if [ -z "${appicon}" ] read -p "appicon: " appicon fi plisturl=$4 if [ -z "${plisturl}" ] read -p "plist url: " plisturl fi description=$5 if [ -z "${description}" ] read -p "description: " description fi version=$6 if [ -z "${version}" ] read -p "version: " version fi dev=$7 if [ -z "${dev}" ] read -p "developer: " dev fi # generate p-list read -r -d '' html << endofhtml ==========================

java - Not able to generate same output image from source input -

i reading .jpg file integer array(source) , trying generate new image same data, code producing black image. should produce duplicate image source. string srcname = "input.jpg"; file srcfile = new file(srcname); bufferedimage image = imageio.read(srcfile); system.out.println("source image: " + srcname); int w = image.getwidth(); int h = image.getheight(); int[] src = image.getrgb(0, 0, w, h, null, 0, w); system.out.println("array size " + src.length); bufferedimage dstimage = new bufferedimage(w, h, bufferedimage.type_int_argb); // generating destination image same source array dstimage.setrgb(0, 0, w, h, src, 0, w); string dstname = "output.jpg"; file dstfile = new file(dstname); imageio.write(dstimage, "jpg", dstfile); system.out.println("output image: " + dstname); you need use same co

javascript - HTML5 Determine drop drop object -

in w3school example can lots of data event , target object how determine object dropped on target? <!doctype html> <html> <head> <style> #div1 {width:350px;height:70px;padding:10px;border:1px solid #aaaaaa;} </style> <script> function allowdrop(ev) { ev.preventdefault(); } function drag(ev) { ev.datatransfer.setdata("text", ev.target.id); } function drop(ev) { ev.preventdefault(); var data = ev.datatransfer.getdata("text"); ev.target.appendchild(document.getelementbyid(data)); } </script> </head> <body> <p>drag w3schools image rectangle:</p> <div id="div1" ondrop="drop(event)" ondragover="allowdrop(event)"></div> <br> <img id="drag1" src="img_logo.gif" draggable="true" ondragstart="drag(event)" width="336" height="69"> </body> </html> in

NetLogo - How to give memory to agents -

here give problem , code. problem: each agent attaches each position m (each m has fixed amount of food, worse, better) score u_im updated in course of time. scores set zero. every time player chosen access resources, probability epsilon choses position @ random, otherwise choses positions sequentially in order of highest score registered far. every position visited, score updated u_im -> u_im - c (the cost) if position found occupied , u_im -> u_im + u_mi if found free. how can create array u_mi? (that saves best resources (=the ones more food) have visited far) edit//: ok, did it! if needs kind of code, feel free contact me :) that's impressive code 1 day's experience ! yes, list of payoff-memory nomads_own variable how it. have keep both position , payoff or won't able sort them. may want limit memory (eg last 5 or best 5 or similar) if starts slowing down because asking every turtle keep list of patches. on question of 'not doing a

angularjs - same ui-sref generates different href -

what logic behind generation of href ui-sref? got situation when different places (states), same ui-sref generates different href, causes bug. one of ui-sref, which have same abstract ancestor state pointing to, appends id generated href, other (which outside) not. from documentation on ui-sref : a directive binds link ( tag) state. if state has associated url, directive automatically generate & update href attribute via $state.href() method. clicking link trigger state transition optional parameters. so looks url of state pointing to, , generates href accordingly. why 2 ui-sref , same parameters, pointing same state can generate different result? more details

Linkedin get connection's emails list PHP -

i wants email list of connections linkedin...currently permission "r_basicprofile, r_emailaddress,rw_company_admin,w_share". please share me rest api or xml i'm getting self emailaddress. wants fetch email emailaddress of connections. you need r_network permission. permission requires special request linkedin. take here linkedin new api - can't r_network permission

C# Sending log to email after closing application -

i have troubles sending log email using nlog. need nlog sends errors email after closing application,not everytime when nlog calling. real ? there code using : <target xsi:type="bufferingwrapper" name="mailbuffer" slidingtimeout="false" buffersize="100" flushtimeout="-1"> <target name="heelpadsimport_patrick_email" xsi:type="mail" smtpserver="xxxxx" smtpport="25" smtpauthentication="basic" smtpusername="yyyyyy" smtppassword="*zzzzzz" enablessl="false" from="dddddddddd" to="eeeeeeeeeee" layout="${longdate} ${uppercase:${level}} ${callsite:classname=true:includesourcepath=true:methodname=true} ${message}${newline}" /> </target>

javascript - Google Sheets Script only working on one file -

Image
i trying have google forms on our website auto-notify when user completes form , return data entered in concise email. not way google notifies links form view response. searched online , found code: function sendformbyemailprayer(e) { // remember replace xyz own email address var email = "admin@communionchapelefca.org"; // optional change following variable // have custom subject google docs emails var subject = "prayer form form submitted"; // variable e holds form values in array. // loop through array , append values body. var s = spreadsheetapp.getactivesheet(); var headers = s.getrange(1,1,1,s.getlastcolumn()).getvalues()[0]; var urltodoc = spreadsheetapp.getactive().geturl(); var body = ""; body = body + "link document: " + urltodoc; var message = body + "\n\n" + ""; // credit henrique abreu fixing sort order for(var in headers) message += headers[i] + ' = '+

c# - What is wrong with this file or code? -

what happening \ difference ? i'm trying return specific node xml file. xml file: <?xml version="1.0" encoding="utf-8"?> <jmf senderid="inkzone-controller" version="1.2"> <command id="cmd.00695" type="resource"> <resourcecmdparams resourcename="inkzoneprofile" jobid="k_41"> <inkzoneprofile id="r0013" class="parameter" locked="false" status="available" partidkeys="signaturename sheetname side separation" descriptivename="schieberwerte von di" zonewidth="32"> <inkzoneprofile signaturename="sig1"> <inkzoneprofile locked="false" sheetname="s1"> <inkzoneprofile side="front" /> </inkzoneprofile> </inkzoneprofile> </inkzonepro

sql server - SQL iterate for each group -

i have table: |id| gruopid | status | date | | 2| 1 | s1 | 7/29/2011 | | 3| 1 | s2 | 7/30/2011 | | 9| 1 | s1 | 8/02/2011 | | 7| 1 | s1 | 8/03/2011 | | 8| 1 | s1 | 8/04/2011 | | 1| 2 | s1 | 7/28/2011 | | 4| 2 | s2 | 7/30/2011 | | 5| 2 | s3 | 8/01/2011 | | 6| 3 | s1 | 8/02/2011 | and specific date outside source: 7/31/2011 i need query give me for each groupid closest upper , lower date, result be: |id| gruopid | status | date | | 3| 1 | s2 | 7/30/2011 | | 9| 1 | s1 | 8/02/2011 | | 4| 2 | s2 | 7/30/2011 | | 5| 2 | s3 | 8/01/2011 | | 6| 3 | s1 | 8/02/2011 | can please me , show me query? straightforward approach: select t1.id, t1.groupid, t1.status, t1.date mytable t1 t1.date in ( select max(t2.date) mytable t2 t2.groupid = t1.groupid , t2.date <= '7/31/2011

java - Passing data from spinner to TextView depending on user selection -

so have spinner contains 2 possible options. have 1 textview in other activity user selection show. the problem is, how set in second activity? tried numerous times various if - statements, nothing worked. here's code of spinner public void onitemselected(adapterview<?> parent, view view, int position, long id) { if (position == 0){ intent.putextra("ciljjepovecanjetezine", cilj.getselecteditem().tostring()); } else if (position == 1){ intent.putextra("ciljjemrsavljenje", cilj.getselecteditem().tostring()); } } @override public void onnothingselected(adapterview<?> parent) { } }); and here's second activity in want text appear string prehrana = intent.getstringextra("ciljjepovecanjetezine");

c - Configuring multiple UDP sockets on a single port -

i'm trying implement peer-to-peer chat application using udp , wondering how scale program multiple users. as understand it, udp needs 1 socket send , receive data using recvfrom , sendto functions. using data address fields passed these functions, can determine user i'm communicating with. i wondering if create multiple udp sockets on same port each peer i'm talking to. way, if data comes peer x, data goes udp port , gets passed appropriate socket 'bound' x's address. is there anyway while still using udp? yes, can specify so_reuseaddr (so_reuseport on linux) before binding udp socket ( all sockets including first), , connect each socket appropriate target, it's not necessary. dispatch each message arriving on single socket according source-address.

mysql - System.IndexOutOfRangeException: Index was outside the bounds of the array Database - Game.cs -

it seems thank phil allison has has fixed first issue new error line 246. if (tamer.digimonlist.length >= 3) { if (tamer.digimonlist[3] == null) qry.add("mercenary3", null); else qry.add("mercenary3", tamer.digimonlist[3].digiid); } hello there sorta new if can give me decent advice on improving post or me issue appreciated! the game crashes after loading game error seems on line 245 below if (tamer.digimonlist[3] == null) qry.add("mercenary3", null); else qry.add("mercenary3", tamer.digimonlist[3].digiid); the error system.indexoutofrangeexception: index outside bounds of array. @ digital_world.sqldb.savetamer(client client) in c:\users\digimon master\dropbox\digimon master project\dmofrosty'spost\server\serverbuildingsection\digitalworld\database - game.cs:

windows 10 - Visual Studio Community 2015 blurry on second monitor to Surface Pro 4 -

my surface pro 4 display 2736×1824, scaling 200%. external monitor plugged in on hdmi 1920x1080, scaling 100%. other apps (such chrome) display ok on external monitor, visual studio text editor blurry - blurry eyes kept trying refocus , became tired quickly. so had turn off large monitor , work on surface's own display. what can fix it? this worked me: ensure high resolution display not primary. set 1 of other / full hd displays primary, , reboot -- reboot unfortunately required.

go - File name convention for compound words? -

is there common convention in go name files contain compound words? for example wrote implementation of weighted union find algorithm , put own source file. how should name file? // mixed case weightedunionfind.go // lower case weightedunionfind.go // snake case weighted_union_find.go i found convention regarding package names , following question file naming conventions in general, what conventions filenames in go? . therefore grepped through go package source files , ended weightedunionfind.go . although it's not formally specified in https://golang.org/doc/code.html#overview - snake_case convention across of standard library , third party libraries.

c# - CALL_STATE.CS_OFFERING not works at TAPI programming -

i using tapi programming in order communicate device , send-receive calls. @ moment able make external calls, , "see" calling me when pick phone. reason can't see number @ event < call_state.cs_offering > (when phone rings). post code below (it similar 1 found on internet). appreciated! using system; using system.collections.generic; using system.componentmodel; using system.data; using system.drawing; using system.linq; using system.text; using system.windows.forms; namespace tapisample { public partial class form1 : form { static public iasyncresult result; public form1() { initializecomponent(); tapi = new tapi3lib.tapiclass(); tapi.initialize(); foreach (tapi3lib.itaddress ad in (tapi.addresses tapi3lib.itcollection)) { cblines.items.add(ad.addressname); } tapi.eventfilter = (int)(tapi3lib.tapi_event.te_callnotification | tapi3lib.tapi_event.te_callinfochange |

excel vba - Conditional formating in VBA, same color, multiple strings? -

i have code conditionnal formating, i'm changing string: cells.formatconditions.delete range("$a$1:$h$17").formatconditions.add(type:=xltextstring, string:="cpa", textoperator:=xlcontains) .interior.color = rgb(105, 191, 44) end with range("$a$1:$h$17").formatconditions.add(type:=xltextstring, string:="cpn", textoperator:=xlcontains) .interior.color = rgb(105, 191, 44) end with range("$a$1:$h$17").formatconditions.add(type:=xltextstring, string:="css", textoperator:=xlcontains) .interior.color = rgb(105, 191, 44) end with range("$a$1:$h$17").formatconditions.add(type:=xltextstring, string:="rl", textoperator:=xlcontains) .interior.color = rgb(105, 191, 44) end is there alternative these lines, can write in shorter , more effective way? this macro colors cells wich contains "cpazergfzergfer". how can write macro color cells containing exact string ? you use a

c# - How to avoid that WPF ListBox updates block buttons? -

i have wpf window listbox , bound public observablecollection<string> , being updated thread ( backgroudworker ). <listbox name="listbox" itemssource="{binding mycollection}" ... /> in same window have button click handler: <button content="close" click="button_logwindow_closebutton_click" ... /> this handler not called when click button while listbox being updated. although works when background thread has finished , listbox not being updated more. this looks me button click event being removed queue before it's handler can called. right? do know how fix this? it's hard without seeing code, gui thread busy updating listbox on every call observablecollection's add method mouse click event not handled. if background thread using dispatcher.invoke or dispatcher.begininvoke add items observablecollection, can lower priority (to dispatcher.background, exa

javascript - Error while binding the selected value with DevExtreme and KnockOut -

i trying develop little app. i have made login view , works, able bind data written user. after this, show 2 select box. first binded list (correctly) , second has bind list populated after value selected first. i'm not able read value selected first list. i have html: <div class="dx-fieldset"> <div class="dx-field"> <div class="dx-field-label">rete</div> <div class="dx-field-value" data-bind="dxlookup: { datasource: is_retistisource, value: rete, displayexpr: 'nome', title: 'retisti associati', placeholder: 'selezionare rete', onselectionchanged:setrete }" /> </div> <div class="dx-field"> <div class="dx-field-label">impianto</div> <div class="dx-field-v

unity3d - Disabling a Script attached to a game object in Unity C# -

i have update function check if equal true , if equal true run code want whole script disabled. please help, thanks! you should use enabled field. try following gameobject.getcomponent<emailsender >().enabled = false;