Posts

Showing posts from September, 2015

asp.net mvc 4 - Bootstrap a value on two lines -

with code have menu (i should have 5 entries) in example have 3 menu, , on right want have email address of client + log off, problem email + log off on 2 lines, want on 1 line how it's possible have on 1 line thanks <body id="page-top" data-spy="scroll" data-target=".navbar-fixed-top"> <nav class="navbar navbar-default navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header page-scroll"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-ex1-collapse"> <span class="sr-only">toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>

javascript - Give Entire D3 Map Event Listener -

i have map of featured cities plotted. states , cities have own click events. clicking state zooms state , displays more cities within state. when clicking city plots new city , draws path new city while zooming bring 2 cities in view. while being zoomed 2 cities able click anywhere on map have reset. able without removing , restoring existing click events if possible. anyone know way put invisible layer on whole svg it's own click event? add <rect> element covers whole map. if make fill="none" invisible. add click event handler reset function when <rect> clicked on. you can manipulate pointer-events property make catch or not catch events. setting pointer-events="all" make catch events while pointer-events="none" make pass through events. switch attribute around depending on whether map zoomed or not.

css - there is a white margin on the right side of my site -

there other questions regarding issue. however, each 1 seems have individual answer, because answers found not work. just scroll right on site , see white space through site: http://highcatering.wpengine.com/ not nice! any ideas? have tried following: body{width:100%;} body{margins:0 0 0 0;} thanks! the offending line in style.css: .post ol, .post ul { margin:0 0 30px 20px; padding:0;} it adding margin ol , ul within main body section. if remove it, white space disappear. i'm not sure if needed somewhere else on site.

html - Float 5 Different Size Boxes In Order And Make Fill Wrapper With CSS -

Image
i'm trying float 5 boxes in specific order, shown in first diagram. boxes same size except 1 same height 2 boxes + space between them (but seems killer): key points here are: a: each of 5 'boxes' div element, , crucially has border drawn css (we'll shortly see causes issues padding/margins) b: red circle 1 - image 3 cannot exact correct height still need bottom border of box 3 in line bottom border of box 2 my html is: <div class="hpcategorypagewrapper"> <div class="hpcategorytopwrapper"> <div class="hpcategorytopleftwrapper"> <div class="hpcategory"> <h1 class="hpcategory">title one</h1> <h3 class="hpcategory">subtitle one<br /><img src="/image1.jpg" /></h3> </div> <div class="hpcategoryspacer"> </div> <

Looped If/Then Functions in Excel VBA -

i'm starting learn excel vba , i'm running problems particular exercise. given column of 20 randomly generated integers between 0 , 100 in column, want write vba program writes in column next "pass" if number greater or equal 50 , "fail" if number less 50. my approach involved using looping function = 1 20 if statement each cell (i,1) write pass or fail in (i,2). sub commandbutton1_click() 'declare variables dim score integer, result string, integer 'setup loop function, if/then function = 1 20 score = sheet1.cells(i, 1).value if score >= 60 result = "pass" sheet1.cells(i, 2).value = result next end if end sub could insight i'm doing wrong? thanks in advance! try this... sub commandbutton1_click() 'declare variables dim score integer, result string, integer 'setup loop function, if/then function = 1 20 score = sheets("sheet1").cells(i, 1).value if score >= 60

windows - Output All SQLite3 Database Tables in Command Line Shell -

Image
i trying use sqlite3 command line shell application print out tables in database. my problem: when type command .tables nothing gets print out? unsure connecting/opening database because application doesn't print out status such 'opened db' or anything. one thing know sure database file exists , contains tables , rows. know because c# application updating , querying db fine. below commands. how can print out databases tables? doing wrong? full size picture your .open created database somewhere else. use command prompt, , run instead: sqlite3.exe "full_filename_of_your_db_file" this works me. -- edit: alternatively, .open single quote can job .open 'full_filename'

How can I calculate the mode of a floating point array in Ruby? -

i have array of floating point data, pick out probable value. called "mode" in descriptive statistics. how can calculate in ruby, or of gem. [0.0, 0.1, 0.2, 0.1, 0.3, 0.3, 0.1] .group_by{|e| e}.max_by{|k, v| v.length}.first # => 0.1

css - Adding background image in HTML5 Boilerplate -

i've downloaded html5 boilerplate , trying grasp on how incorporate css codes in side of main.css of html5 boilerplate. need know how can add background image page? html { background:url(images/laptop.jpg) no-repeat center center fixed; -webkit-background-size: cover; -moz-background-size: cover; -o-background-size: cover; background-size: cover; } try this: body { background-image:url(../images/laptop.jpg) no-repeat center center fixed; // rest of code } your css file should in css folder , image should in different folder. therefore, used ../ before path. here brief description of file paths: ./ means current directory ../ means parent of current directory, not root directory / root directory myfile.text in current directory, ./myfile.text ../myfile.text 1 level above , /myfile.text lives in root directory.

What is the point of "examples" in the go (golang) testing framework? -

i reading on testing , examples in go testing framework , did not understand for. see documentation says: the package runs , verifies example code. example functions may include concluding line comment begins "output:" , compared standard output of function when tests run. (the comparison ignores leading , trailing space.) however, don't appreciate reason exist. write tests, seems should more clear how use code reading unit tests , benchmarks. additional motivation example section provide? seems redundant me, however, sure inventors of go put reason, specially because seem empathizes programming practice design of language. hope understand either motivation or how part of language can used in positive way in golang project! :) in go, source code used generate documentation. examples not meant testing rather documentation. having compiled examples, can make sure working using them. examples found in standard libraries can run directly in browser whe

html - Javascript onClick Doesnt work on Chrome -

good evening. i have following code: <script type="text/javascript"> function action1() { var x = document.getelementbyid('marcagravadapedra'); x.style.display = "inline"; document.getelementbyid('estruturasagrada').style = "display: none;" document.getelementbyid('objectosagrado').style = "display: none;" hideall(); } </script> and on html itself, have form, , buttons inside it: <input type="button" id="objectosagradobutton" value="objecto sagrado" onclick="action1();"/> though, code works on firefox, not on ie or chrome. i've tryed everything, cant seem make work. that button make divs appear, , others disappear. <div id="marcagravadapedra">testing1</div> i can't imagine code work in browser. you've couple of these odd lines overriding style object string: document.getelementby

html - Responsive banner image -

i developing responsive website has large banner image spans edge edge. problem supposed static height regardless of screen size. when set image width:100% looks great in full size, start shrink screen image gets shorter width needs be. how can set image height appears never change , when screen size smaller image size zooms in , crops edges? http://bit.ly/1qxmzir html <div id="hd-img"> <img src="http://72.52.242.20/~camacoll/wp-content/uploads/2014/05/inner-hd.jpg"> </div> css #hd-img { max-height: 352px; } img { width: 100%; height: auto; left: 100%; margin-left: -200%; position: relative; } one way this . /* css */ #hd-img { height: auto; overflow: hidden; } #hd-img img { /* optional max width: 600px; */ display: block; margin: 0 auto; }

java - Has anyone succeeded in autocomplete ComboBox for list cell? -

as standalone element, this solution works fine. but in custom listcell (mirrored comboboxlistcell sources), gives sometimes: exception in thread "javafx application thread" java.lang.nullpointerexception @ com.sun.javafx.scene.control.skin.comboboxpopupcontrol.positionandshowpopup(comboboxpopupcontrol.java:100) @ com.sun.javafx.scene.control.skin.comboboxpopupcontrol.show(comboboxpopupcontrol.java:74) @ com.sun.javafx.scene.control.skin.comboboxbaseskin.handlecontrolpropertychanged(comboboxbaseskin.java:115) @ com.sun.javafx.scene.control.skin.comboboxlistviewskin.handlecontrolpropertychanged(comboboxlistviewskin.java:245) @ com.sun.javafx.scene.control.skin.behaviorskinbase$2.call(behaviorskinbase.java:189) @ com.sun.javafx.scene.control.skin.behaviorskinbase$2.call(behaviorskinbase.java:187) @ com.sun.javafx.scene.control.multiplepropertychangelistenerhandler$1.changed(multiplepropertychangelistenerhandler.java:55) @ javafx.beans.value.weakchangelistener.changed(w

parsing - How to parse a string in python -

without 3rd party libraries (such beautiful soup) cleanest way parse string in python. given text below i'd content of "uber_token" parsed out ie. "123456789" .... <form id="blah" action="/p-submi.html" method="post"><input type="hidden" id="" name="uber_token" value="123456789"/><div class="container-info"> .... thanks! regular expression solution. use import re >>> import re >>> s = '<form id="blah" action="/p-submi.html" method="post"><input type="hidden" id="" name="uber_token" value="123456789"/><div class="container-info"' >>> regex=re.search(r'name="uber_token" value="([0-9]+)"',s) >>> print regex.group(1) 123456789

increment - Java Incremental operator query (++i and i++) -

this question has answer here: is java “pass-by-reference” or “pass-by-value”? 74 answers java never pass-by-reference, right?…right? [duplicate] 6 answers i have following code: public class book { private static int sample1(int i) { return i++; } private static int sample2(int j) { return ++j; } public static void main(string[] arguments){ int = 0; int j = 0; system.out.println(sample1(i++)); //0 system.out.println(sample1(++i)); //1 system.out.println(sample2(j++));//1 system.out.println(sample2(++j));//2 system.out.println(i);//2 system.out.println(j);//2 } } my expected output in comments. actual output below: 0 2 1 3 2 2 i'm getting confused function calls

javascript - how to get ng-grid in modal working? -

i tryin nggrid working in modal: $scope.open = function() { $modal.open({ templateurl: 'mymodalcontent.html', backdrop: true, windowclass: 'modal', controller: function($scope, $modalinstance) { $scope.submit = function() { $modalinstance.dismiss('cancel'); } $scope.cancel = function() { $modalinstance.dismiss('cancel'); }; } }); }; but getting error: typeerror: cannot set property 'griddim' of undefined plunkr ref: http://plnkr.co/edit/2cijicdra2k3nqew7w56?p=preview see plunker, http://plnkr.co/edit/t22v7ma8rwsqick5oimg?p=preview i believe mistake had added data , ng-grid initialisation not within scope of $modal, if @ plunkr moved scopes inside controller of $modal , worked.

Running Multiple Tor Instances in Windows from C# Application -

i'm trying start multiple tor instances via c# .net application. first instance starts great, rest exit immediately. i using different data directory each instance, , have in fact made copy of entire tor directory each instance. here code: pprocess = new process(); process.startinfo = new processstartinfo(exepath); process.startinfo.workingdirectory = path.getdirectoryname(exepath); process.startinfo.arguments = "datadirectory \"" + process.startinfo.workingdirectory + "\\data\""; process.start(); i have tried "runasdaemon 1" , "--service" arguments , made no difference. i can see unique data directories being used, tor creates state/lock/etc files in them. else missing? perhaps should note, able start 1 instance code, , 1 instance manually opening "start tor browser.exe" thanks

c++ - Is it possible to query a privileged windows service from a user mode java application? -

background i working on application need query files available on harddisk using java. performance major requirement, have written native application accesses windows master file table ($mbt) valid file entries. i planning modify native windows service (running admin privileges.. needed accessing mft) , use user mode java application contact via ipc technique (specifically shared memory or named pipe or sockets... need evaluate). the target application windows specific , java used text processing (i know python/perl @ haven't used them long time). questions now question - whether possible query privileged windows service limited user level application? if not workaround achieve this? i think sockets possible ipc mechanism other 2 fail access denied . correct in assuming that? is converting native code jni/dll , using correct on planning? in case have start java app admin privilege having custom manifest file. platform windows 7 enterprise visual studio

java - What is the pattern for this date format? -

this question has answer here: what time format “date”: “2014-08-20 00:00:00 -0500”? 2 answers you can't parse timestamp without knowing simpledateformat pattern first , i'm not sure be: 1980/01/30 10:36:42 -0400 i think yyyy/mm/dd hh:mm:ss , i'm not sure -0400 part or if should capitalizing mm , hh . mm months, mm minutes hh 24 hour time, 0-23 hh 12 hour time z timezone, final field you're looking for in api documents here , there's lovely table listing of pattern letters.

java - Hibernate 4.3.5 is not working with Oracle10g Database -

Image
i trying out hibernate 4.3.5 oracle database. during run getting following problem(the same code working fine mysql database). org.hibernate.engine.jdbc.connections.internal.drivermanagerconnectionproviderimpl configure info: hhh000115: hibernate connection pool size: 20 (min=1) jun 26, 2014 10:35:46 org.hibernate.engine.jdbc.internal.jdbcservicesimpl configure warn: hhh000341: not obtain connection metadata : unsupported feature jun 26, 2014 10:35:46 org.hibernate.engine.jdbc.internal.lobcreatorbuilder usecontextuallobcreation info: hhh000422: disabling contextual lob creation connection null exception in thread "main" java.lang.nullpointerexception @ org.hibernate.engine.jdbc.internal.jdbcservicesimpl.configure(jdbcservicesimpl.java:244) @ org.hibernate.boot.registry.internal.standardserviceregistryimpl.configureservice(standardserviceregistryimpl.java:111) @ org.hibernate.service.internal.abstractserviceregistryimpl.initializeservice(abstractserviceregistryimpl.java

c# - MSBUILD .NET v4 teamcity -

i have installed teamcity professional 8.1.3 (build 30101) onto clean box , trying run new build. have copied on msbuild tools local dev machine new server , placed them in x86 folder. have installed iis web role, .net feature, registered iis cmd line, , installed msbuild tools 2013. reason, still unable compile anything. following error sgen attempt made load assembly incorrect format: c:\windows\microsoft.net\assembly\gac_64\system.data\v4.0_4.0.0.0__b77a5c561934e089\system.data.dll. is familiar error? trying build app in .net v4 using msbuild tools v4. i getting error building project targeted .net framework 4.5.1. resolved issue installing microsoft .net framework 4.5.1 developer pack you can sdk (aka targeting pack, aks developer pack) other versions may want target @ .net sdks , downloads

javascript - Why ‘orientationchange’ event is not firing on browser resize? -

i using below javascript code. it’s not working on browser resize. , used foundation (zurb) framework in project. <script type="text/javascript"> $(window).on("orientationchange", function () { alert("the orientation has changed!"); // want other stuff here depend on landscap or portrait }); </script> please let me know missed here. thanks orientation change portrait / landscape change resize different event you can load required event in similar cases load fired when page loads first can initial adjustments. $(window).on("orientationchange load resize", function () { alert("the orientation has changed!"); // want other stuff here depend on landscap or portrait });

Noise Detection in audio signal -

Image
i have 1 min clip of audio signal sampled @ 44.1khz. spectrogram of same provided below. there of background noise in clip the link original clip provided here what best possible way either a) reduce background noise or b) enhance speech signals only. also, how can noise identified in spectrogram? generating spectrogram have used following commands [x, fs] = wavread('cpp_part.wav'); spectrogram(x,512,400,512,fs,'yaxis');

ios - How to implement UIVisualEffectView in UITableView with adaptive segues -

Image
i implement uivisualeffectview apply blur effect view show view lies behind it. this view should have background blurred uitableviewcontroller embedded in uinavigationcontroller , , either presented in popover on ipad or presented full screen modally on iphone, ios 8 adaptive segues (present popover). when view controller in popover want background blur what's underneath popover, , when it's presented full screen want background blur previous view controller. i have tried implement , have not been successful. cannot blur effect work popover. thought code should trick: //in viewdidload on uitableviewcontroller subclass: let effectview = uivisualeffectview(effect: uiblureffect(style: .light)) effectview.frame = tableview.frame tableview.addsubview(effectview) i tried adding subview tableview.backgroundview , tried setting backgroundview effectview , tried using autolayout constraints instead of setting frame, nothing has worked. can me accomplish desired behavior?

Lyx - how to Insert hyperlink of file -

the insert> hyperlink file option not appear work in lyx version 2.1.0beta1. any attempt @ inserting full file specification in target box comes message "unknown parameter name" i trying insert .webm video in link. video resides in same directory. thanks in advance samar

PHP contact form - making a field not mandatory -

how can make "email" field not mandatory? if not filling field, form should submit. in below code, "email" field mandatory. i tried add if !isset email field $email_from word "empty", didn't work me. <?php if(isset($_post['name'])) { // edit 2 lines below required $email_to = "aaaaa@aaaaa.com"; $email_subject = "messeage site"; function died($error) { ?> <?php die(); } // validation expected data exists if(!isset($_post['name']) || //!isset($_post['email']) || /* tried comment line, didnt work. */ !isset($_post['telephone'])) { died('we sorry, there appears problem form submitted.'); } $name = $_post['name']; // required $email_from = $_post['email']; // required $telephone = $_post['telephone']; // not required $error_message =

In python, accessing global variables of one file in another -

i have 2 python scripts, 1 of contains global variable globvar wish use in file. file structures follows: file1.py from file2 import * globvar = [] def func1(a,b): globvar.append(range(a,b)) printlast() def main(): in range(1,10): j in range(1,5): func1(i,j) if __name__=="__main__": main() file2.py from file1 import globvar def printlast(): element = globvar[-1] print 'latest element ',element dont' bother productivity of code, it's example sample problem @ hand. on running script file1.py , error pops up, globvar[-1] list index out of range . or simply, list empty . why so? edit : this question, posted, contained "from file2 import printlast" first line of file1.py . syntax resulting in importerror pointed out @user2357112 in comments. now has been changed from file2 import * , error indexerror, trying point out begin with. any reasonable explanation appreciated. this because main mo

java - testng eclipse plugin shows only last test class result when run from factory annotation -

i have test class instances created @factory annotation different parameters. when run them in eclipse testng plugin or window shows output/results shows results last test class run. other test results other test class instance runs? testng.xml : <!doctype suite system "http://testng.org/testng-1.0.dtd"> <suite name="all tests suite"> <test name="factory test" group-by-instances="true"> <classes> <class name="unittest.testngtestcases.factorytest"></class> </classes> </test> </suite> my factory annotated class: package unittest.testngtestcases; import java.util.arraylist; import java.util.list; import org.testng.annotations.factory; public class factorytest { @factory public object[] factory2() { system.out.println("running factory2"); list<testngtest2> list=new arraylist<>();

jQuery opacity animation aliasing in Chrome -

Image
i trying animate text opacity jquery animate. i've noticed when opacity value set 1, bad anti-aliasing effect appears after animation in chrome (version 35.0.1916.153): see image below. $('#good').animate({ opacity:'0.99' }, 2000); $('#bad').animate({ opacity:'1' }, 2000); jsfiddle i've tested in safari (version 5.1.7), firefox (version 18.0.1) , works well. i've tried add font smoothing filter suggested here doesn't seem work. known issue? jsfiddle div $( document ).ready(function() { $('#good').animate({opacity: 0.4}, 2000, false, null); $('#bad').animate({opacity: 1}, 2000, false, null); }); jsfiddle <p> your mistake dont use ready event i recomended use css animation without js css animation jsfiddle .pick-opacity_1 { -webkit-animation: opacity_1 2s; -webkit-animation-direction: alternate; -webkit-animation-iteration-count: 1; } @-webkit-keyframes opa

Using Newton Raphson for Root Finding and Parameters' Estimation in Matlab -

i have cubic root equation. wrote matlab code using newton-raphson find roots. want parameter estimation (tuning of cubic root equation parameters able give better prediction) using experiment data. can me on how this? thanks anticipated regards, isa if understand correctly, should using roots find roots of cubic polynomials, this: roots([4 -2 3 -1]) 4x^3 - 2x^2 +3x -1. you can calculate how root changes respect each coordinate. in p(x)=0, 1 finds dp/da + p'(x)*dx/da = 0 parameter a. if a_3 coefficient of x^3, 1 gets dx/d(a_3) = -(x^3)/p'(x). can use gradient of root respect coefficients, , conduct gradient descent or better method move roots toward targets.

regex - Uploads with white space in file name is causing errors on my server -

i have server used allow people upload files. unfortunately script allows people upload files blank spaces in file name. when links these files generated (also script) file name output these empty spaces. these files can not downloaded python script (which attached). question how best fix problem. not sure if to: a: use sort of regular expression change file name upon uploading, or b: if there way can reference actual file name on server (which not know because when ssh in looks correct file path have spaces in it). i interested in best solution problem is. thanks. here server code: var http = require('http'), url = require('url'), util = require('util'), path = require('path'), fs = require('fs'), qs = require('querystring'); var formidable = require('formidable'), mime = require('mime'); function dirtree(filename) { var stats = fs.lstatsync(filename), info = {

php - Will my `post` data passed via SSL with CURL be safe enough? -

i developing api , want secure. please consider function code public function send_ok($tdata, $mdata) { $url = str_replace('http://', '', $mdata['api_transaction_return_url']); $url = str_replace('http://', '', $url); $url = 'https://'.$url; $process = curl_init($url); curl_setopt($process, curlopt_ssl_verifypeer, false); curl_setopt($process, curlopt_ssl_verifyhost, false); curl_setopt($process, curlopt_post, 1); curl_setopt($process, curlopt_postfields, $tdata); curl_setopt($process, curlopt_returntransfer, 1); $return = curl_exec($process); } this function sending response remote server payment confirm. so, pass data via ssl safe enough , other methods can use make data secure? ssl provides encryption of data in transit, it's safe prying eyes (let's skip whole bunch of caveats broken cipher suites , on) . makes ssl connections secure such. however, can sure who you&

html - Prevent iframe loading again after going back in history -

for ecommerce tracking in virtuemart (joomla extension, latest versions), except using google's, have use tracking code of local company. their code iframe this <iframe src="http://...v=<?php echo $total; ?>"></iframe> this code on "thank page" of virtuemart track order information. if refresh thank page, you're redirected homepage. if left "thank page" , went in browser history, you'd thank page again , iframe executed again - @ least that's think reason orders tracked twice. is there simple solution issue? add iframe dynamically either using javascript or php shows if has gone there directly. here's how detect if has landed on page via button... how detect if user has got page using button? if have, don't show iframe.

asynchronous - Android: FTP client file transfer in passive mode taking time to close connection after 100% upload -

android: ftp client file transfer in passive mode taking time close connection after 100% upload while transferring files through ftp client, in passive mode, using async task. after progress update specified 100% of file has been uploaded, still ftp connection holds async task coming on post execute. the time taken directly proportional internet speed , size of file uploaded. tried standalone application upload zip files, tried ftp both in active , passive modes. still issue persists. public class uploadzipfiles extends asynctask<object, integer, object> { arraylist<string> zipfiles; string username, password; weakreference<servicestatuslistener> listenerreference; private context mcontext; private long totalfilesize = 0; protected long totaltransferedbytes = 0; final numberformat nf = numberformat.getinstance(); private customftpclient ftpclient = null; public uploadzipfiles(conte

Strange behaviour when passing values from a float array to a double array (C, C++) -

i developing application uses ni-daq , below methods given provider. void somemethod(calibration *cal, float myarray[], float result[]) { newmethod(&cal->rt,myarray,result,cal->cfg.tempcompenabled); } void newmethod(rtcoefs *coefs, double myarray[],float result[],bool tempcomp) { float newmyarray[6]; unsigned short i; (i=0; < 6; i++) { newmyarray[i]=myarray[i]; } } i call somemethod(), providing array 6 elements ( [6] ) both myarray[] , result[]. can see in code, afterwards newmethod() called, , float myarray[6] passed double myarray[] argument (i not understand why developer of code chose use double array, since array declared inside newmethod() float type). now here comes problem: inside loop, values passed without problem, when fourth , fifth values passed newmyarray[], receives "-1.#inf0000" both values. @ first glance, thought garbage value, "-1.#inf0000" there @ every execution. i know c language can

marquee - IOS scrollview is not clickable -

here code: int = 0; self.userinteractionenabled = yes; self.exclusivetouch = yes; self.cancancelcontenttouches = yes; self.delayscontenttouches = yes; self.translatesautoresizingmaskintoconstraints = yes; uitapgesturerecognizer *tapgesturerecognizer = [[uitapgesturerecognizer alloc] initwithtarget:self action:@selector(gototest)]; tapgesturerecognizer.numberoftapsrequired = 1; [self addgesturerecognizer:tapgesturerecognizer]; (nsstring *message in self.messages) { uilabel * label = [[uilabel alloc] initwithframe:cgrectzero]; self.userinteractionenabled = yes; label.text = message; label.tag = i; cgsize size = [message sizewithfont:label.font]; cgfloat width = size.width + kpadding; label.frame = cgrectmake(xpos, 0.0, width, self.frame.size.height); [self addsubview:label]; i++; xpos += width; nslog(@"%@",nsstringfromcgrect(label.frame)); } self.messageswidth = xpos; self.contentsize = cgsizemake(xpos, self.frame.siz

PowerShell - Form button click unsets variable outside the closing brackets -

i trying make blackjack game in powershell sole purpose learn language. not i've started testing forms (to select hit/stand) , found following issue in form test file: [system.reflection.assembly]::loadwithpartialname("system.windows.forms") | out-null $form = new-object system.windows.forms.form $form.text = "debug." $form.autoscroll = $true $form.autosize = $true $form.autosizemode = "growandshrink" $form.backcolor = "red" # $form.icon = [system.drawing.icon]::extractassociatedicon("c:\scripts\private\svtserv.ico") ### commented out because other people don't have file. $form.minimizebox = $false $form.maximizebox = $false $form.windowstate = "normal" $form.sizegripstyle = "hide" $form.showintaskbar = $false $form.opacity = 0.7 $form.startposition = "centerscreen" $label = new-object system.windows.forms.label $label.text = "debug, trigger: @null." $label.autosize = $true $form.

java - Google Cloud Endpoints passes object with null fields when calling dev server (on localhost) -

i face strange situation when invoking google cloud endpoints ios client whereby service receives legit object when instance on appspot.com called, same object's fields set null when instance on dev server on localhost (launched inside eclipse) called. the java.version on appspot.com 1.7.0 , on localhost 1.7.0_45 (i.e. oracle java 7 on os x). log files json passed in http request looks okay , deserialization reports normal activity in both cases. has else encountered situation , solved problem development server (i.e. on localhost )? have tried set httpmethod of "post" method annotation? example: @apimethod(name = "setmyobject", path = "myobjectmethod", httpmethod = "post") public myresponse setmyobject(myclass obj) {}

Access SQL: Pull Related Information From Another Table Alongside Group By -

this question involves following code: select a.`fsr name` [last name], min(a.`actual tep in`) [date in], max(b.site) site, max(b.position) position, max(b.comments) comments deployments inner join deployments b on a.id = b.id a.`actual tep in` > now() group a.`fsr name`; the point of code query first date beyond today each person, , pull 1 record. example there can many smiths dates before , after today, , want show record smith after today. idea show each person's next date on cascading list. @ least part, code works. the problem having information needs come alongside it. group forces aggregates keep pulling wrong site/position/comments fields when min or max them. i'm not sure should doing @ point seems i'm bit on head. appreciated! note: i'm doing in access 2013. edit: adding rough table fsr name date in site position comments bob 7/3/2014 op notes joe 10/11/2013 b op joe

node.js - Arduino Serial and Socket -

i m trying send serial data arduino using node.js , socket.io , code. and html page have 1 button. work node , html side .but not send serial data. var express = require('express'); var app = express(); var server = require('http').createserver(app); var io = require('socket.io')(server); var port = process.env.port || 3000; server.listen(port, function () { // console.log('server listening @ port %d', port); }); // routing app.use(express.static(__dirname + '/public')); var serialport = require("serialport").serialport var serialport = new serialport("/dev/ttyacm3", { baudrate:9600 }, false); // openimmediately flag [default true] io.on('connection', function (socket) { socket.on('my other event', function (data) { console.log(data); serialport.open(function () { console.log('open'); serialport.on('data', function (data) {

java - Spring DATA JPA example for multiple foreign keys in a single entity -

below table design. can explain me how configure entity using spring data jpa? parent_table( id primary key, name ) second_child_table( id primary key, second_child_name, parent_id references id on parent_table, first_child_id references id on first_child_table ) first_child_table( id primary key, first_child_name, parent_id references id on parent_table ) @entity @table(name="parent_table") public class parent { @id @column(name="id", nullable=false, unique=true) // require generator config private long id; @column(name="name", nullable=false) private string name; @onetomany(orphanremoval = true, cascade = {cascadetype.all}, fetch = fetchtype.lazy) @joincolumn(name = "candidacy_id", nullable = false) @getter @setter private list<firstchild> firstchild = new arraylist<>(); @onetomany(orphanremoval = true, cascade = {cascadetype.all}, fetch = fetchtype.lazy) @joincolumn(name = "candidacy_id", nullable

css - i can't fit <div> container to 50% -

i have simple code: <!doctype html> <html lang="pl"> <head> <meta charset="utf-8" /> <style type="text/css"> html{ background-color: red; height: 100%; } body { background-color: black; min-height: 50%; padding: 10px; } .wrap{ width: 100%; height: 50%; background-color: green; } </style> </head> <body> <div class="wrap"> test </div> </body> </html> i expect fit .wrap container 50% of parent container (body). doesnt work... if change height property ex. height: 150px; , css working fine... don't understand why. thank response! examle, not real layout. idont understand why cannot wrap .wra

classcastexception:android.Widget.EditText cannot be cast to android.view.viewgroup -

here layout file. when try run android app on emulator crashes , in logcat logcat error : classcastexception: android.widget.edittext cannot cast android.view.viewgroup. i searched on google error , found out occurs when view not closed. checked , didnt find mistakes.any , advice appreciated. thank you. <relativelayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/relativelayout1" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical" tools:context="com.example.form_app.mainactivity" tools:ignore="mergerootframe" > <textview android:id="@+id/textview1" android:layout_width="match_parent" android:layout_height="44dp" android:layout_alignparentleft="true" android:layout_alignparenttop

node.js - Notating Multiple Modules in the Same Package.json File -

i trying package modules have been working on. have 5 modules, split in 5 files. 4 of them actual outward-facing modules want user able install. other 1 support module need function correctly. stored in same directory. want able specify each separate module in same directory. far can tell, 1 can define single module in package.json . is there way specify multiple modules? if not, means must bad practice. how should structure module's exports move in 1 main module? currently there's not supported way of having separate package.json file each module you'll publishing within same directory. , really, makes sense, each package deploy may have issues, feature requests, bugs, etc need handled separately , don't force updates of others. separating these out allow focus on maintenance of each independently, , allow consumers of these modules include them separately. lot of larger scale projects have started creating think people like, end having thing use ran

Android, takes one second to get String from Sharedpreferences -

i have following simple test try fetch data sharedpreferences: long begin = system.currenttimemillis(); long end = 0; log.d(tag, "getsharepreferences: " + begin+""); sharedpreferences settings = cordova.getactivity().getsharedpreferences(preferencelib, context.mode_private); end = system.currenttimemillis(); log.d(tag, "getsharepreferences end 2: " + (end - begin)); string returnvalue = settings.getstring(preferencename, ""); // <- took 1 sec !!!! end = system.currenttimemillis(); log.d(tag, "getsharepreferences end 3: " + (end - begin)); and results: 06-29 23:31:41.269: d/meetercalendar(21327): getsharepreferences end 2: 4 06-29 23:31:42.300: d/meetercalendar(21327): getsharepreferences end 3: 1031 why fetch string sharepreferences takes 700-1000 milliseconds? the string simple: "true" sharedpreferences stored in xml files on internal storage. call getpreferences

SSH to OpenShift times out -

i can't ssh openshift. timeout: $ ssh xyz@xyz-xyz.rhcloud.com ssh: connect host xyz-xyz.rhcloud.com port 22: operation timed out i'm not behind proxy. ssh server running on port 22? have valid ssh key pair , public key added openshift. thank support i think there environment variable tmout. so, might try export tmout=

javascript - jQuery Web Socket not connecting and not sending -

i'm trying convert php function jquery function can use tcp/ip socket local connection straight browser. i use this: $socket = @fsockopen('xxx.xxx.xxx.xxx', '8810', $err_no, $err_str); if(!$socket){ return 'errore #'.$err_no.': '.$err_str; }else{ fwrite($socket, '["d";"c";"?st";200]'); $read = fread($socket, 2024); //other stuff... return $read; fclose($socket); } this works fine. downloaded github jquery websocket 0.0.4 google code site , followed example not successfully. i tried make connection , send data way: ws = $.websocket("ws://95.110.224.199:8810/"); ws.send('string', '["d";"c";"?st";200]'); this gives me "undefined not function" error. i tried see if connection establishing (without sending data) way: var ws = $.websocket("ws://xxx.xxx.xxx.xxx:8810/", { open: function() {con