Posts

Showing posts from July, 2014

What happens if I manually delete one of the VMs that Dataflow created? -

i see gce instances dataflow created job in gce console. happens if delete them? manually altering resources provisioned google cloud dataflow unsupported operation. interfere dataflow’s clean-up process , might result in leftover resources , therefore cost. in particular, deleting vms of streaming dataflow job might leave persistent disks around, still billed. using dataflow provisioned vms or persistent disks other purposes dataflow job not supported. not attempt reattach disks other machines, or vms run other independent programs. dataflow service might rid of these resources @ point, without warning, , data on these resources lost.

vb.net - How do I get my Windows Forms drawn user control to resize larger without clipping? -

Image
i in process of creating own user control in windows forms application using vb.net, , having change in size along form containing it. looks okay long window size stays constant , control stays within original bounds. however, if resize window make larger, control's contents resize end getting clipped @ original size. unsure coming , have not found way far fix it. below quick sample code user control can reproduce problem i'm having: thecircle.vb : public class thecircle private _graphics graphics public sub new() ' call required designer. initializecomponent() ' add initialization after initializecomponent() call. _graphics = creategraphics() setstyle(controlstyles.resizeredraw, true) backcolor = color.red end sub private sub thecircle_paint(sender object, e painteventargs) handles me.paint _graphics.fillrectangle(brushes.blue, clientrectangle) _graphics.fillellipse(brushes.lime

javascript - Reformatting for Angular style guide 1.5 -

i using angular spyboost utility wrapper. trying reformat angular 1 style guide . i'm having hard time parts of it. think have of correct angular.foreach function throwing me off. , getting error `expected '{' , instead saw 'result'. me please ? angular .module('mymod') .factory('myservice'); myservice.$inject = ['$rootscope', 'atmosphereservice', 'atmosphere']; function myservice ($rootscope, atmosphere) { return { subscribe: subscribe, getmessage: getmessage }; function subscribe (r) { var responseparameterdelegatefunctions = ['onopen', 'onclienttimeout', 'onreopen', 'onmessage', 'onclose', 'onerror']; var delegatefunctions = responseparameterdelegatefunctions; var result = {}; delegatefunctions.push('ontransportfailure'); delegatefunctions.push('onreconnect'); angul

Solr - EDisMax pf/pf/pf3 Fields Vs ShingleFilterFactory -

is there benefit in using shinglefilterfactory with edismax pf/pf2/pf3 fields? example, if have untokenized index (via keywordtokenizerfactory ) following values: 1. "jeans" 2. "skinny jeans" 3. "red blazer" and query "red skinny jeans" , match "jeans" , "skinny jeans" . edismax , using pf fields should implicitly generate shingles, there benefit in plugging in shinglefilterfactory well? thanks

junit - Unit Testing based on JNDI , ejb and spring -

in application injecting of services based on ejb use of spring ioc through jndiobjectfactorybean below mentioned during run junit getting exception "java.lang.illegalargumentexception: jndi operation not implemented jndi provider." could please let me know how i'll configure junit. <bean id="xxxmenuitemservice" class="xxxmenuitemserviceyyy"> <property name="xxxmenuitemdelegator" ref="xxxmenuitemdelegator" /> </bean> <bean id="approvemenuitemserviceremote" class="org.springframework.jndi.jndiobjectfactorybean"> <property name="jndiname" value="ejb/xxxxxxxx" /> have @ simplenamingcontextbuilder org.springframework.mock provides full context builder can bind mock or other objects use spring's jndi lookup. one thing though make sure build simplenamingcontextbuilder in static @beforeclass of junit 4. means initialized

php - Laravel file downloaded from AWS S3 with Filesystem gets corrupted -

i uploading files amazon s3 laravel filesystem. upload process works great, however, when download files corrupted. have manually downloaded files s3 bucket , way files don't corrupted, figured problem not upload. i uploading files this: /** * upload file amazon s3. * * @param uploadedfile $file * @param $path * @return $this|bool */ protected function upload(uploadedfile $file, $path) { $this->filename = $path . '/' . time() . '_' . str_replace(' ', '-', $file->getclientoriginalname()); $disk = storage::cloud(); if ($disk->put($this->filename, fopen($file, 'r+'))) { $this->save(); return $this; } return false; } and download have tried this: /** * @param document $document * @return response */ public function download(document $document) { $file = storage::cloud()->get($document->path); $file_info = new finfo(fileinfo_mime_type); return response

backend - Is Firebase's built-in authentication able to be used on a 3rd party server? -

i'm looking create game server backend game i'm creating. we're using firebase handling of data , ads, , firebase has built in authentication. possible have user log our app via firebase's auth system, confirm user's authentication when connect game server ensure it's are? basically, after logs our firebase, can use authentication information separate server, , protocol/method need used (if there's specific one) i've figured out 2 steps need information required auth, 1 clientside , 1 serverside. note: following examples java apis, can use of firebase's equivalents. clientside : in firebase-auth package, there's firebaseuser object. contains information auth state, unique details, etc. there method here called gettoken(), grab token current authentication. once have this, want send server when need auth. serverside : on server, there's firebaseauth object. once token client, can use verifyidtoken(), confirm valid token ,

vim - Create New Line While in Insert Mode -

i use shift + enter create new line in vim . so if | cursor, here do: <%= some.code("in here") | %> now, press shift + enter (or similar) , output: <%= some.code("in here") %> , new line here | is possible? escape normal mode there number of ways want, 1 option use ctrl-o escape normal mode insert line. example ctrl - o o open new line below current line , place cursor there. if want map rather use one-off, can use imap set mnemonic of choice. example: :imap \nn <c-o>o will create insert-mode mapping \ n n same thing.

c# - Best option to draw thousands of triangles -

i'm developing small 2d triangulation application , need draw on screen thousands os triangles , points (may reach 500k points) , need able pan , zoom using mouse middle button. the application must wpf i found many way that, ask more experienced users best: 1) opengl (sharpgl or opentk): looks it's best option far, never worked opengl , i'm not sure how easy implement 2) wpf drawingvisual class: far read have implement won event handlings zoom , pan needs 3) wpf drawing on canvas: tried first application stared loose performance @ 25k points + lines 4) writeablebitmapex: could'n find examples out there i'm not sure of capabilites. saw there shape drawing features, have performance , pan , zoom easy implement?

Python 3.5 Can't write xml using via minidom -

i'm newb python , xml parsing, i've spent amount of time (over 20 hours) rummaging through forums find how achieve i'm after. of threads i've seen had solutions problem, dated , python version different can't use them; didn't work when tried. what want do: parse xml alter contents based on conditions rewrite out entire xml changes new xml formatting retained what i'm using: python 3.5 minidom , tkinter modules here error i'm getting when trying write out new xml: this_xml.write(ofile) attributeerror: 'document' object has no attribute 'write' i've tried elementtree , lxml, i've made progress minidom prefer use it. here (i think) pertinent code: import tkinter tkinter import * tkinter import messagebox tkinter import filedialog xml.dom.minidom import parse import xml import os import xml.dom.minidom root = tk() root.withdraw() file_path = filedialog.askopenfilename(filetypes=[("xml",".x

ios - UILabel keeps resizing to a height of 0 regardless of the text -

Image
i have uilabel following constraints and set number of lines equal 0. layout on ib can seen below. want uilabel expand dynamically based on text receive views below pushed down based on height of uilabel. however, not happens. as seen below, uilabel doesn't appear @ all. seems have height of 0 regardless of set text be. know need modify make happen? know why uilabel has height of 0? updates: things tried given comments below. word wrap, nothing changed adding height constraint on uilabel, text gets cut off after first line height constraint greater or equal constant, text still gets cut off after first line i created dummy view according requirement. button has fixed constraints : leading width ,height, top space. for label : leading, trailing, topspace button 3.for view below label: give leading, trailing, height , top space label so here label height not fixed .so change according text.

sql - Creating an attribute that can store the same value as another attribute -

just quick question! i implementing database using oracle sql developer school , i've come across requirement i'm not quite sure how implement. basically database student management system , i'm working on assessment table currently. here requirement "the maximum_mark attribute stores maximum possible raw mark assessment(e.g., 30), while weight attribute stores percentage weight of assessment paper whole (e.g., 10%). if maximum_mark not specified,then front-end applications should use weight both." does mean should set default value maximum mark whatever entered weight? if so, how go this? far have isn't working. create table assessment ( assessment_id number(10), ... ... weight number(3) constraint assessment_weight_null not null constraint assessment_weight_invalid check(weight between 0 , 100), maximum_mark number(3) default (weight), constraint assessment_pk primary key (assessment_id) ); any appreciated

swift - iOS Learning with Lynda: Getting error can't invoke 'init' with argument of type @lvalue String -

Image
i'm trying follow lynda's (not sure if nonmembers can see it) tutorial on ios 9 , swift, i'm getting error doesn't match screencast. if anyone's familiar, tutorial: "controlling when tapped numbers should not appear in calculator" this basic calculator i'm trying build. basic idea take number inside label string , convert number , putting string when pressing button "0" won't have multiple zeros on calculator. func updatetext() { let labelint:int = int(labelstring) --> cannot invoke 'init' argument of type '@lvalue string' label.text = "\(labelint)" } in screencast error different: func updatetext() { let labelint:int = int(labelstring) --> value of optional type 'int?' not unwrapped; did mean use '!' or '?'? label.text = "\(labelint)" } edit: screenshot you need unwrapped labelstring value ! sign, write like, func updat

android Drag and Drop don't Functionality to Move Objects on Finger Touch in Android(Especially zoom in, zoom out don't function) -

this xml : <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:app="http://schemas.android.com/apk/res-auto" android:layout_width="match_parent" android:layout_height="match_parent" xmlns:tools="http://schemas.android.com/tools" android:orientation="vertical" android:gravity="center" > <android.support.design.widget.appbarlayout android:layout_width="match_parent" android:layout_height="wrap_content" android:theme="@style/themeoverlay.appcompat.dark.actionbar" app:elevation="0dp"> <android.support.v7.widget.toolbar android:id="@+id/toolbar" android:layout_width="match_parent" android:layout_height="?attr/actionbarsize" android:background="?attr/colorprim

c++ - expected';' before '[' token -

i absolutely can not understand possibly wrong code, missing something. have searched similar problems regarding other tokens, have been useless me. since code not long, go ahead , post here. unsigned int value; #include <adafruit_neopixel.h> #ifdef __avr__ #include <avr/power.h> #endif #define pin 6 #define num_leds 60 #define brightness 10 adafruit_neopixel strip = adafruit_neopixel(60, pin, neo_grb + neo_khz800); void setup (){ serial.begin(9600); serial.settimeout(50000); strip.begin(); strip.setbrightness(brightness); strip.begin(); strip.show(); // initialize pixels 'off' } void loop () { boolean lights; int value[100]; for(int i=0;i<100;i++){ value[i] = analogread(0); } int j=smallestelement(value); if(value[j-1]-value[j]>=2 , value[j-1]-value[j]<=30) , value[j-2]-value[j-1]>=2 , value[j-2]-value[j-1]<=30 , value[j+1]-value[j]>50 , value[j+2]>value[j+1]){ //the compiler not okay line lights = true; //the compiler has problem li

javascript - how to alert after all images loaded? -

im beginner in javascript i`m building javascript game , want alert after images loaded tried code not working function loadeverything(){ var imgnumber = 0; img1 = new image(); img1.src= "1.png" img1.onload = function(){ imgnumber =imgnumber+1; } img2 = new image(); img2.src= "2.png" img2.onload = function(){ imgnumber =imgnumber+1; } img3 = new image(); img3.src= "3.png" img3.onload = function(){ imgnumber =imgnumber+1; } if(imgnumber==3)alert("done") } the images loading asynchronously. checker code run before of images loaded. suggest checks for each image load . like: function loadimages(urls,callback){ //counter var counter = 0; //checking function function check(){ counter++; if(urls.length === counter) callback(); } //for each image, attach handler , load for(var = urls.length; i--;){ img = new image(); img3.onload = check; img.src= urls[i] } } loadimages([/*array of urls*/

How to split tuple in python -

how split tuple dictionary dic = {('k30', 'k56'): 1} to output in text file: k30 k56 1 what tried is for k,v in dic.items(): a,b = k.split(',') print >>f, a+'\t',b+'\t',v f.close() but got error: attributeerror: 'tuple' object has no attribute 'split' you need not split can say a,b = k

javascript - Automated collision detection and rectification for a force directed wordcloud in D3.js -

i have been experimenting creating force directed layout using d3.js. in following code, populate series of objects later rendered text elements. wish avoid collision between words, , adjust representation on grid accordingly. i utilised code written eric dobbs here http://bl.ocks.org/dobbs/1d353282475013f5c156 still not working me. objects end flying on screen. have spent many hours puzzling on , appreciate available. here code <!doctype html> <html> <head> <script src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script> </head> <body> <script> //arguments passed in when class modularised var metadataobject = {"type":"wordcloud","label":"data1","data":"data2","color":"color"}; var dataobject = {"data1":["apple","orange","pear","grapes","mango","

bash - Send command to open process in Shell file -

in bash how can issue command running process started? for example; # start bluez gatttool connect bluetooth device gatttool -b $mac -i connect # send 'connect' gatttool process? currently shell script doesn't connect line because gatttool process running. if want send string "connect\n" process, can use standard pipe: echo "connect" | gatttool -b $mac -i if want engage in more complex "conversation" gatttool process, take @ expect (1) , chat (8) tool, allow send sequence of strings, , wait responses.

sql - Finding and running FindSQLInstall.vbs script file -

i have problem , i'm trying resolve following link https://support.microsoft.com/en-ca/kb/969052 however, when says "to complete steps in procedure, have copy findsqlinstalls.vbs script "more information" section local folder on computer trying update sql server installation." i'm confused on how find "findsqlinstall.vbs" file , how run it. i'm beginner, appreciated. i encountered error while trying put sp3 on sql 2008 r2. research lead me same article https://support.microsoft.com/en-ca/kb/969052 , findsqlinstall.vbs script. i not have lot of experience command prompt or .vbs have coworkers have worked through same issue. if have found microsofts kb/969052, in theory need there. if me need bit more. did. note very lucky, have share folder keep copies of of upgrade/updates install. .vbs found , copied many of missing things ( though took me while figure out ) create folder on server working on issue 'c:

syncfusion - Windows UWP SFChart - Column or Bar chart plot color based on value? -

is possible set color of bar based on value, example min 0 , max 10, if value between 0 , 3 color bar green, if between 3 , 7 colour blue, , if between 7 , 10 color yellow. yes. possible set color based on value. can able achieve requirement customizing individual bar/column template color customtemplate property per below code snippet. code snippet [xaml]: <grid.resources> <local:colorconverter x:key="conv1"/> <datatemplate x:key="columntemplate1"> <canvas> <rectangle canvas.left="{binding rectx}" canvas.top="{binding recty}" height="{binding height}" width="{binding width}" stretch="fill" fill="{binding converter={staticresource conv1}}"></rectangle> </canvas> </datatemplate> </grid.resources> <grid.datacontext> <local:testingvaluescollection/> </grid.datacontext> <syncfusion:sfchart x:name="chart&quo

python - How to call JavaScript in XML? -

we struck 1 point. is, created demo module, inside created manifest files, views, models , static folders. inside static --source folder, --javascript folder, --css folder inside views: created new xml file , created template , called java script file inside template. followed above producer. how check our javascript, whether running in our browser or not? in page reflecting? how find that? and how override calendar in our java script , call in xml? what purpose of using q web? should use re-designing calendar? you can check odoo documentation : qweb primary templating engine used odoo. xml templating engine1 , used generate html fragments , pages. although uses few others, either historical reasons or because remain better fits use case. odoo 8.0 still depends on jinja , mako if creating or modifying template (i.e.: calendar template), can write javascript code directly. can use html code well. if modifying or creating new view or report

java - Hibernate freezes/stands still during request when trying to flush: doesn't throw exception or error, just does nothing -

i using spring 4.2.5, hibernate 5.1.0.final, c3p0 0.9.5.2, , postgresql 9.4. problem has been occurring since started using connection pooling (c3p0), before using basic spring datasource. [info] [talledlocalcontainer] 1143785 [http-nio-8080-exec-30] debug org.hibernate.engine.internal.collections - collection found: [com.thebrandsapp.pojo.product.bellplatformcategories#193], was: [com.thebrandsapp.pojo.product.bellplatformcategories#193] (uninitialized) [info] [talledlocalcontainer] 1143785 [http-nio-8080-exec-30] debug org.hibernate.engine.internal.collections - collection found: [com.thebrandsapp.pojo.product.configurablefields#193], was: [com.thebrandsapp.pojo.product.configurablefields#193] (uninitialized) [info] [talledlocalcontainer] 1143785 [http-nio-8080-exec-30] debug org.hibernate.engine.internal.collections - collection found: [com.thebrandsapp.pojo.product.descriptionfields#193], was: [com.thebrandsapp.pojo.product.descriptionfields#193] (uninitialized) [info] [

In Excel, format header row's color based on last cell value in a consecutive range -

Image
i'm overthinking this, i've been @ hours , can't work. my worksheet set contact log, rows (ones contain id# in column a) serve "headers". underneath each "header" row, logging dates in column b. normally, header rows green. i'd excel check last date in column b under each "header" (e.g., 5/24/16 id# 101, 5/13/16 id# 102, etc.). if last date more 1 week old today's date (currently 5/25/16), want "header" row turn red: a b id# date 101 (green) 5/1/16 5/20/16 5/24/16 102 (red) 5/2/16 5/13/16 103 (green) 5/7/16 5/19/16 and if add row , enter today's date under 102, header row change green. a b id# date 101 (green) 5/1/16 5/20/16 5/24/16 102 (green) 5/2/16 5/13/16 5/25/16 103 (green) 5/7/16

ios - How to install custom AlertViews to my xcode project? -

Image
i found great alert view style on github : https://github.com/dogo/sclalertview . how install xcode project ? open terminal , follow these steps : sudo gem install cocoapods then change path project want install pod cd your_project_path once path set in terminal : pod init serach pods (this may take time): pod search library_name [open pod file ] copy pod line , paste in pod file pod lines this: pod 'sclalertview-objective-c' [copy ] the on terminal again pod install and close current project , open .workspace file onwards.

neo4j - Configure output path for tNeo4jOutput - Talend Component -

i loading data neo4j using talend. can see default destination location path tneo4joutput in talend access data @ path through java. thanks! saurabh tneo4joutput talend connector write neo4j. means either write existing store files. in "basic settings" tab of component have ability specify path these store files. make sure no other process accessing these @ same time component. write "remote server". means talking running server's rest api, there no "location" specify other http link (eg." http://yourserver.com:7474/db/data "). reuse existing connection (this of time): use tneo4jconnection (to open connection) , tneo4jclose (to close connection). have same options above, apply of neo4j components connect it. does make sense? let me know. rik

ios - how to transfer text or pdf file with URL Scheme -

Image
i want inter app communication in between 2 appliocation url scheme. have gone through apple documentation,but won't help. i have make 2 projects, in sender there 1 method in added { uiapplication *ourapplication = [uiapplication sharedapplication]; nscharacterset *set = [nscharacterset urlhostallowedcharacterset]; nsstring *urlencodedtext = [@"test" stringbyaddingpercentencodingwithallowedcharacters:set]; nsstring *ourpath = [@"readtext://" stringbyappendingstring:urlencodedtext]; nsurl *oururl = [nsurl urlwithstring:ourpath]; if ([ourapplication canopenurl:oururl]) { [ourapplication openurl:oururl]; } else { uialertcontroller * alert= [uialertcontroller alertcontrollerwithtitle:@"receiver not found" message:@"the receiver app not installed" preferredstyle:uialertcontrollerst

css - Remove the vertical grid lines of a QTableView -

Image
i have qtableview shown below: i want remove vertical lines table. tried set gridline-color property equivalent background-color , removed grid lines. i want horizontal grid lines stay, , remove vertical ones. how can achieve ? you can't. there no option qtableview that. however, can setting gridline-color property background-color (like did) and then setting border items of qtableview ; want horizontal grid lines, : qtableview::item{ border-top : 1px solid black border-bottom : 1px solid black }

javascript - How to imitate Trello board click & drag to scroll -

i'm looking javascript plugin allow me add same functionality trello has on boards, can click on background, , drag either side scroll, in similar way on mobile finger. i have found javascript works, need able click , drag child elements, without whole board scrolling. in other words, in trello when you're moving card between lists, background doesn't scroll, there needs ability add exception children elements. any ideas? thanks. so in process of creating jsfiddle give example of issue having. made it, decided try , fix it, , turns out wasn't hard. i've kept fiddle , saved it, can see implementation. it's simple. var curypos = 0, curxpos = 0, curdown = false; $('.wall')[0].addeventlistener('mousemove', function(e) { if (curdown === true) { window.scrollto(document.body.scrollleft + (curxpos - e.pagex), document.body.scrolltop + (curypos - e.pagey)); } }); $('.wall')[0].addeventlistener(&#

windows - Catching a single step exception from VEH in x86 assembly -

i'm writing 32-bit windows assembly detect edits program. i'm not sure why, using veh debug checked address causes crash (there nothing against debugging yet, memory edits), throwing exception_single_step in middle of checking code. i'm not using breakpoints, i'm tracing accesses. how can "catch" without attaching own debugger? may have implemented wrongly makeshift exception handler nothing when raised ( mov fs:[0], 0 , even, not cause crash 1 expect).

ios - How to add percent sign in string format? -

this question has answer here: how add percent sign nsstring 7 answers i want string "99.99%" double ,and used format this: let rate = 99.99999 let str = string(format: "%.2f%", rate) // output 99.99 and \% not allowed. how add percent sign in string format, please me! write 2 time %: rate = 99.99 let str = string(format: "%.2f%%", rate)

Loop over javascript object whilst running async calls within -

i'm trying load multiple files using three.xhrloader , when completes want take key of object , add along file object (loadedfiles). problem have whenever try retrieve key object loaded returns last key in object array because callback load function gets called after loop has ended. i've got this: var loader = new three.xhrloader(); var loaded = 0; (var k in filestoload) { loader.load(filestoload[k], function(file) { console.log(k); // return last key when want //it return key loaded instead! loadedfiles[k] = file; loaded++; if (loaded == object.keys(filestoload).length) { console.log(loadedfiles); } }); } you wrap three calls in promise use promise.all resolve once have. (pseudo code) let promises = object.keys(filestoload) .map(k => { return new promise((res, rej) => { loader.load(filestoload[k], res, rej); //assuming loader has success, error callbacks }); }); pro