Posts

Showing posts from April, 2011

osx - IntelliJ - does a new version overwrite -

simple question hopefully. i have mac , want install intellij 13.1. if download latest version overwrite current version , keep settings? it not override current version. automatically detects there existing version of intellij , asks whether want import settings. source : once had mac 2 versions of intellij(version 11 , 12) idea running on same machine.

Ansible: is it possible to feed a remote task with local files (avoid first uploading the file) -

suppose have ansible task : - name: run etl 2 shell: psql -u {{dbuser}} -d {{dbname}} -f /tmp/data-cleansing2.sql sudo_user: postgres i have many of them these, , first have upload file - name: upload etl script copy: src=../data-cleansing2.sql /tmp/data-cleansing2.sql it nice if there way tell ansible must first upload file, ex: - name: run etl 2 shell: psql -u {{dbuser}} -d {{dbname}} -f {{/abc/xyz.sql | upload_file}} sudo_user: postgres you might want check out script module. module runs local script on remote node after transferring it. the script module takes script name followed list of space-delimited arguments. local script @ path transferred remote node , executed. given script processed through shell environment on remote node. using module, however, you'd have first add calls psql script files. see here more info .

javascript - Bootbox modal scrolls to top of page before opening -

i using bootstrap 3 , bootbox.js filterable portfolio, , want able scroll down when modal longer browser window, should not able scroll past modal. by default when click portfolio item modal scroll top of page open it. used javascript:void(0); on portfolio links fix this. position:absolute on .modal breaks that. but position:absolute , overflow:auto allows me scroll modal way need (just dont know how limit scrolling till end of modal) check out css: .modal { top: 10%; left: 50%; margin-left: -280px; -webkit-background-clip: padding-box; -moz-background-clip: padding-box; background-clip: padding-box; outline: none; display: table; position: absolute; } .modal-open { overflow: auto; } you can @ live version of site here (scroll portfolio , click project) i have set fiddle make easier everyone: http://jsfiddle.net/p4yw2/ so need: another way fix "scroll top before alert opened" issue besides javascript:void(0); a way limit scrolling until little b

java - Closing unused modules in intellij idea like in eclipse -

Image
as know there no feature in intellij idea. dont know why dont support that, @ least result found researching. maybe of manage problem different ways. how work multiple modules in intellij? how should increase performance while working multiple projects? closing unused modules in intellij idea in eclipse? you can make module directory excluded project. right clicked on directory, goto mark directory as -> click excluded it to add module back, click on project structure button, goto modules section, can add them back

PHP .zip file download error when opening in windows explorer -

Image
i'm getting weird error while trying open php, created .zip file in windows explorer. it works fine in winrar. what creating sds sheet download site can checkbox kinds of pdf documents want , zip them. the procedure works fine , have no errors file creation. when opening windows explorer error occurs. error message : "windows cannot open folder. compressed (zipped) folder 'filename' invalid." error opening in windows explorer." the site http://www.premiere-produkter.no/pp/datablad/index.php if want test out yourselves. heres code: <?php $error = ""; //error holder if(isset($_post['createpdf'])){ $post = $_post; $file_folder = "files/"; // folder load files if(extension_loaded('zip')){ // checking zip extension available if(isset($post['files']) , count($post['files']) > 0){ // checking files selected $zi

Javascript for loop doing bad math -

this question has answer here: is floating point math broken? 20 answers does know how core, fundamental functionality of programming language can lose ability calculations properly/precisely? http://jsfiddle.net/krazyjakee/v3xcq/ var html = ''; for(var = 0; <= 1; += 0.01){ html += + '<br />'; } document.body.innerhtml = html; my question why happen , how can stop happening? 0 0.01 0.02 0.03 0.04 0.05 0.060000000000000005 0.07 0.08 0.09 0.09999999999999999 0.10999999999999999 why don’t numbers, 0.1 + 0.2 add nice round 0.3, , instead weird result 0.30000000000000004? because internally, computers use format (binary floating-point) cannot accurately represent number 0.1, 0.2 or 0.3 @ all. when code compiled or interpreted, “0.1” rounded nearest number in format, results in small rounding error before calculation happe

unity3d - Objects not colliding in 2D project -

i've set 2d project in unity (4.3.4). has ball , ground. ball in air. to ball i've added box collider 2d , rigidbody 2d, standard values. to ground i've added box collider 2d. when run game, ball falls, instead of stopping when hitting ground, continues , keep falling. where did go wrong? tutorials should work? check if 1 of 2 colliders has checkbox istrigger checked. should both unchecked collisions work. first time happened me took me whole day figure out xd

How can I efficiently add a GET parameter with either a ? or & in PHP? -

i have add variable url. url might have variables. what's efficient way add new variable? example urls: http://domain.com/ http://domain.com/index.html?name=jones i need add: tag=xyz : http://domain.com/?tag=xyz http://domain.com/index.html?name=jones&tag=xyz what's efficient way know whether prepend string ? or &? here's version of function have far: // arradditions looks array('key1'=>'value1','key2'=>'value2'); function appendurlquerystring($url, $arradditions) { $arrquerystrings = array(); foreach ($arradditions $k=>$v) { $arrquerystrings[] = $k . '=' . $v; } $strappend = implode('&',$arrquerystrings); if (strpos($url, '?') !== false) { $url .= '&' . $strappend; } else { $url = '?' . $strappend; } return $url; } but, looking ? in existing url problematic? example, possible url includes ? not act

php - Excluding specific half hour from the list of half hours -

i have loop gives outcome of number of half hours between given start time , end time $start = new datetime('09:00:00'); // add 1 second because last 1 not included in loop $end = new datetime('16:00:01'); $interval = new dateinterval('pt30m'); $period = new dateperiod($start, $interval, $end); $previous = ''; foreach ($period $dt) { $current = $dt->format("h:ia"); if (!empty($previous)) { echo "<input name='time' type='radio' value='{$previous}|{$current}'> {$previous}-{$current}<br/>"; } $previous = $current; } the outcome of above loop following 09:00am-09:30am 09:30am-10:00am 10:00am-10:30am 10:30am-11:00am 11:00am-11:30am 11:30am-12:00pm 12:00pm-12:30pm 12:30pm-01:00pm 01:00pm-01:30pm 01:30pm-02:00pm 02:00pm-02:30pm 02:30pm-03:00pm 03:00pm-03:30pm 03:30pm-04:00pm what trying achieve exclude of time mentioned below if exist in arr

android - Is it possible to dynamically add AndroidAnnotation @EViewGroups instead of using the traditional inflate directly? -

i'm trying use android annotations , dynamically add layout components when createnewrow button clicked. app runs , displays default rows defined in activity_main.xml and, after clicking createnewbutton see children attached dynamictable in debugger new children not displayed. here main activity xml: activity_main.xml <linearlayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" android:id="@+id/inflatelayout" android:orientation="vertical" android:layout_width="match_parent" android:layout_height="match_parent" android:paddingleft="@dimen/activity_horizontal_margin" android:paddingright="@dimen/activity_horizontal_margin" android:paddingtop="@dimen/activity_vertical_margin" android:paddingbott

UIProgressView custom images doesn't work in iOS 7.1 -

i have app using progress views custom images. use code below: [cell.prostatus settrackimage: [[uiimage imagenamed:@"circlegrey.png"] resizableimagewithcapinsets:uiedgeinsetszero]]; [cell.prostatus setprogressimage: [[uiimage imagenamed:@"circlepurple.png"] resizableimagewithcapinsets:uiedgeinsetszero]]; it works fine in ios 6 , 7.0 - when updating ios 7.1 doesn't show images - small little thin line (the standard progress view). do? i have searched , read here in stack overflow of course. , have found following: uiprogressview custom track , progress images in ios 7.1 but can't work? i'm little new programming. can please tell me (simple , basics) have work? in thread linked answer implement jeprogressview github. maybe i'm beginner understand how that. have googled , tried, won't work. okay have worked out. know must basic xcode stuff - if there others have same issue had, here did. download jeprogressview files github

mysql - php - get sum of clicks for past 7 days -

i have table xeon_users_rented , with: clicks0 , clicks1 , clicks2 , clicks3 , clicks4 , clicks5 , clicks6 each day, clicks0 increase, , every day @ midnight, cronjob run, making clicks0 = clicks1 (setting todays clicks, yesterday clicks), , set clicks0 zero. what trying achieve is want make graph, shows sum of clicks0, clicks1 etc., clicks0 todays date. i have query below: $data = array(); ($x = 0; $x <= 6; $x++) { $date = date("y/m/d", time() - ($x * 86400)); $querye = $dbh->prepare("select sum(clicks$x) xeon_users_rented user_by=:username"); $querye->bindparam(":username", $userdata['username']); $querye->execute(); $row = $querye->fetch(pdo::fetch_assoc); $dates[] = date("y/m/d", time() - ($x * 86400)); $data[] = ($row['clicks'.$x.''] > 0 ? $row['clicks'.$x.''] : 0); } $days = array('today'); ($i = 0; $i < 6; $i++) { $days[$

javascript - Pass object context back to controller callback from AngularJS Directive -

i'm trying recreate ng-change add delay in (auto-save on change frequency timeout). so far, have following directive: myapp.directive('changedelay', ['$timeout', function ($timeout) { return { restrict: 'a', require: 'ngmodel', scope: { callback: '=changedelay' }, link: function (scope, elem, attrs, ngmodel) { var firstrun = true; scope.timeouthandle = null; scope.$watch(function () { return ngmodel.$modelvalue; }, function (nv, ov) { console.log(firstrun); if (!firstrun) { console.log(nv); if (scope.timeouthandle) { $timeout.cancel($scope.timeouthandle); } scope.timeouthandle = $timeout(function () { //how can pass person?? scope.call

java - Need to add proxy to URLConnection in scribe -

i using scribe obtain accesstoken. works fine in normal environment, sometimes, must use proxy obtain connection. however, in scribe, urlconnection (actually httpurlconnection) down in request.java , there no access it. must override many methods able set proxy on urlconnection. has used scribe in environment proxy required? how did urlconnection set proxy? it seems accessors on request class , response class changed allow this, or getters added request, suspect there reasons why not case. how providing way set proxy on urlconnection? take into: use scribe behind proxy java networking , proxies there third link on scribe faq se won't let me post. hope using java 1.5 or superior.

ios - Memory Usage Difference b/w Debug and Release Configuration -

i'm using taskinfo amount of memory app using programmatically. code basically kern_return_t result = task_info(mach_task_self(), task_basic_info, (task_info_t)&info, &num); if (result == kern_success ) { memoryused = (double)(info.resident_size/1000000.0); when run app on debug configuration reports far more memory being used compared when run on distribution (~100mb of difference). since there other third party libraries being linked i'm not sure if doing weird stuff. my question assuming app not doing weird normal have such huge difference? p.s. : i'm using cocos2d think that's pretty safe. i expected behavior. @ least has been way in projects compared memory usage between debug , release builds. one reason in debug builds lot more things being done , possibly kept in memory. debugging stuff mostly, yours , framework's (ie cocos2d). various assertions , logs add more (temporary) memory usage well. connected deb

How to get the CQ5 userInfo in java or jsp by using jackrabbit -

how cq5 userinfo using org.apache.jackrabbit.api.security.user name , group information in java or jsp .? in jsp / java can adapt resource usermanager class , current user or list down users , groups per requirement. session session = resourceresolver.adaptto(session.class); usermanager usermanager = resourceresolver.adaptto(usermanager.class); /* current user */ authorizable auth = usermanager.getauthorizable(session.getuserid()); /* property of authorizable. use relative path */ value[] names = auth.getproperty("./profile/familyname"); /* groups member of */ iterator<group> groups = auth.memberof(); to list users or groups, can use findauthorizables() method available in usermanger. you can obtain user info in js using cq.user.getcurrentuser() return instance of current user , can access user's properties.

jquery - How can I change the background color of multiple divs by dragging over them with the (clicked) mouse? -

please have @ this example . i have 4 divs here white background. when click on div, background changes blue. when click again background switches white. now want highlight multiple divs dragging on them: click on first div , hold mouse button down. div gets blue. clicked button can drag on other divs , color changed cursor on element. i haved tried things jquery's .mousedown function did not work. html : <div class="box"></div> <div class="box"></div> <div class="box"></div> <div class="box"></div> css .box{ float: left; height: 100px; width: 100px; border: 1px solid #000; margin-right: 10px; } .highlight{ background: #0000ff; } js $(document).ready(function(){ $('.box').click(function(){ if($(this).hasclass('highlight')){ $(this).removeclass('highlight'); } else{ $(this).a

visual studio - Cannot install ClickOnce - Certificate Not Trusted -

i trying publish small microsoft office customization using visual studio 2013. purchased code-signing certificate godaddy (issued starfield technologies) , used sign program. however, when user tries install clickonce manifest, following error: customized functionality in application not work because certificate used sign deployment manifest riskmp or location not trusted. contact administrator further assistance. the program being downloaded same server private key generated , same url specified in publish. the solution have found far add url list of trusted sites in ie internet options, isn't solution requires lot of steps on part of user. i'd simplify installation as possible. appreciated.

ios - predicate is getting nil, nscoredata, objective -

what doing fetch data core data following nsstring *str; nspredicate *predicate; switch (typecube) { case newcubes: { str = [nsstring stringwithformat:@"type == %d",newcubes]; break; } case allcubes: { str = [nsstring stringwithformat:@"type != %d",customcubes]; break; } case customcubes: { str = [nsstring stringwithformat:@"type == %d",customcubes]; break; } } predicate = [nspredicate predicatewithformat:@"%@ , (accounts.keychainid == %@)", str, accountkeychainid]; however, result of predicate nil. following works predicate = [nspredicate predicatewithformat:@"(type == %d) , (accounts.keychainid == %@)", type, accountkeychainid]; ( type either newcubes or allcubes or customcubes) please if have ideas. comments welcomed. thanks there class called nscompoundpredicate allows construct predicates and, or , not operators. here need [nscompound

mathematical optimization - R DEoptim() function: How to select parameters to be opimised? -

i wish estimate parameters following example: but how can make deoptim optimise 2 of 3 parameters? - there direct method this? rm(list=ls()) t <- seq(0.1,20,length=100) hobs <- 20 + 8*exp(-0.05*t) hsim <- function(p,t) {p[1] + p[2]*exp(-p[3]*t)} upper <- c(30,10,1) lower <- -upper resfun <- function(p, t, hobs) { r <- hobs - hsim(p,t) return(t(r)%*%r) } deoptim(resfun, lower, upper, hobs = hobs, t = t, deoptim.control(np = 80, itermax = 200, f = 1.2, cr = 0.7, trace =false)) i found workaround cf below. there more elegant way of doing this? rm(list=ls()) t <- seq(0.1,20,length=100) hobs <- 20 + 8*exp(-0.05*t) #hkorr <- rnorm(100,0,0.2) hsim <- function(p,t) {p[1] + p[2]*exp(-p[3]*t)} upper <- c(20,10,1) lower <- c(1,1,0.001) sel = c(0,1,1) ini = c(20,na,na) # correct upper , lower selected parameters upper <- upper[which(sel==1)] lower <- lower[which(sel==1)] resfun <- function(p

python - Fetch and write CLOB type values from oracle to a file -

i new python, , have questions, , please: i trying processing on data in python. need connect db , data, 300,000 rows of type clob. column in db has content (text), urls , html tags, thats how have set up, cant change that. project (phase one) go through column in table in db , extract urls, using beautifulsoup url extraction, have part done. getting data (clob) out of db , storing file (i guess doesn't have csv, 1 decided try csv) thats having problems with. how row of data after fetching code, notice double quotes, in actual db there 1 double quote only: () here code: import csv import cx_oracle sql = """select target_values temp_ip_url_backup"""; filename="results.csv" results=csv.writer(file, dialect='excel') connection = cx_oracle.connect('db connection stuff') cursor = connection.cursor() cursor.execute(sql) rows = cursor.fetchall() row in rows: results.writerow(row) cursor.close

vb.net - How to return two objects (including one list) in JSON with WCF -

i trying resolve issue. this service contract (iservice1.vb) <operationcontract()> _ <webinvoke(method:="get", bodystyle:=webmessagebodystyle.wrapped, responseformat:=webmessageformat.json, uritemplate:="/getbooks")> _ function getbooks() list(of book) <datacontract()> _ class book public property bookchapter() list(of chapter) return m_bookchapter end set(value list(of chapter)) m_bookchapter = value end set end property private m_bookchapter list(of chapter) public property success() integer return m_success end set(value integer) m_success = value end set end property private m_success integer end class <datacontract()> _ class chapter public property description() string return m_description end set(value string) m_description = value

Logic of indefinitely nested rows in ACCESS -

i've been month trying figure out maybe simple: i have similar recipes table product     ingredient  qty lemonade    lemon     2 lemonade    water     1 lemonade    sugar     6 breakfast    lemonade    1 breakfast    sandwich    1 sandwich    bread      2 sandwich    lettuce      1 sandwich    ham       3 and table, product, properties of each one concept     type lemonade    product breakfast    action sandwich    product lemon     supplie water     supplie sugar     supplie bread     supplie lettuce     supplie ham      supplie this indefinitely nested examp. adding day, , nest breakfast, dinner, lunch etc. each 1 nested products , each products nested supplies it possible in 1 query supplies used in breakfast? or have change logic? this call “bom” in database land. (bill of materials). might have “electric motor assembly” , goes fan assembly , hat goes air condition unit. ability “

javascript - Dynamically create and assign id to an input? -

my code below i'm unable verify if it's correct, or if is, why can't access created text inputs id for (i=0;i<t;i++) { div.innerhtml=div.innerhtml+"<input id="+i+"\" type='text' value="+(i+1)+">"+"<br>"; div1.innerhtml=div1.innerhtml+"<input id=a"+i+"\" type='text' value=a"+(i+1)+">"+"<br>"; gont.innerhtml=gont.innerhtml+i; } var t = 2; var div = document.getelementbyid('iddiv'); (i = 0; < t; i++) { div.innerhtml = div.innerhtml + "<input id=" + + "\" type='text' value=" + (i + 1) + ">" + "<br>"; div1.innerhtml = div1.innerhtml + "<input id=a" + + "\" type='text' value=a" + (i + 1) + ">" + "<br>"; gont.innerhtml = gont.innerhtml + i; }

ipc - Interactive Process Communication in Haskell -

i trying write haskell program executes interactive program (also written in haskell), sending , receiving lines of text. interactive program reads stdin , writes stdout using standard haskell library. however, proved more complicated anticipated, due haskell lazyness or other misterious thing happening on background. program apparently goes deadlock, , not receive line of text expected receive. receive text fine if interactive program terminates result of sending line of text, need program keep running , receive more data (it's called interactive reason). prints expected output after kill program receiving message. code looks this: main = (hin,hout,herr,pl) <- (runinteractivecommand "./playermain") hsetbinarymode hin false hsetbinarymode hout false hsetbuffering hin linebuffering hsetbuffering hout nobuffering hputstr hin "start\n" out <- hgetline hout putstrln out i tried replacing lazy strings strict data.text,

jdbc - with-connection: What happened? -

in clojure project, changed dependency [org.clojure/java.jdbc "0.2.3"] [org.clojure/java.jdbc "0.3.3"] i have received following error: clojure.lang.compiler$compilerexception: java.lang.runtimeexception: no such var: sql/with-connection, compiling:(/volumes/hd2/env/prj/restore/src/restore/db.clj:80:5) what happened? function deprecated? background: needed execute! 0.2.3 didn't have it. 0.3.3 has it, lacks with-connection ?!? please help. with-connection not considered harmful reasons leonardoborges mentioned, makes working connection pools harder. decoupling function database access specific connections makes easier model. forcing queries use same connection should exception, not rule. clojure.core/java.jdbc 0.3.0 designed deprecate with-connection . accomodate that, whole api needed changed. each database access function takes db spec parameter. if db-spec connection pool function executed on 1 of it's connections, otherwise

java - Amazon ads api crashing my app? -

the following classes not instantiated: - com.amazon.device.ads.adlayout (open class, show error log) see error log (window > show view) more details. tip: use view.isineditmode() in custom views skip code when shown in eclipse java.lang.noclassdeffounderror: not initialize class android.os.environment @ com.amazon.device.ads.debugproperties.readdebugproperties(debugproperties.java:75) @ com.amazon.device.ads.internaladregistration.<init>(internaladregistration.java:52) @ com.amazon.device.ads.internaladregistration.getinstance(internaladregistration.java:64) @ com.amazon.device.ads.adlayout.initialize(adlayout.java:185) @ com.amazon.device.ads.adlayout.initialize(adlayout.java:176) @ com.amazon.device.ads.adlayout.<init>(adlayout.java:120) @ sun.reflect.nativeconstructoraccessorimpl.newinstance0( @ sun.reflect.nativeconstructoraccessorimpl.newinstance( @ sun.reflect.delegatingconstructoraccessorimpl.newinstance( @ java.lang.ref

Delete app from OSX simulator in Xcode -

how delete app osx simulator on ios simulator?? want delete app due change of core data xcdatamodeld can't find way. in advance as playitgreen mentioned in 1 of comments, way delete data relating osx app removing folder/.storedata file from: ~/library/application support/<your osx app bundle name>/ for example: ~/library/application support/com.yourcompany.yourapp/ all credit playitgreen

Nginx - multiple/nested IF statements -

what want do: check if request comes facebook check if url domain.com/2 if above conditions true - show content /api/content/item/$1?social=1 if above conditions false - show "normal page" it single page app. before changes configuration looked (and worked): location / { root /home/eshlox/projects/xxx/project/project/assets/dist; try_files $uri $uri/ /index.html =404; } i've tried use if statements: location / { set $social 1; if ($http_user_agent ~* "facebookexternalhit") { set $social ua; } if ($uri ~* "^/(\d+)$") { set $social "${social}url"; } if ($social = uaurl) { rewrite ^/(\d+)$ /api/content/item/$1?social=1; } root /home/eshlox/projects/xxx/project/project/assets/dist; try_files $uri $uri/ /index.html =404; } with configuration works expected if both conditions true or false. if 1 of conditions true , second false (or vice versa)

asp.net mvc - Validate Form with DataAnnotations and JQuery Ajax submission -

i trying send , validate form via jquery ajax. know if possible , how achieve this. what have? view: @using (html.beginform("index", "home")) { <section id="result"> @html.validationsummary(false) </section> <section> @html.labelfor(model => model.isbn) @html.textboxfor(model => model.isbn) @html.validationmessagefor(model => model.isbn) </section> <section> @html.labelfor(model => model.booknumber) @html.textboxfor(model => model.booknumber) @html.validationmessagefor(model => model.booknumber) </section> <section> @html.labelfor(model => model.title) @html.textboxfor(model => model.title) @html.validationmessagefor(model => model.title) </section> <section>

nuget - Visual Studios "extra" build files -

i looking create "publish" configuration vs solution build project , include files wish distribute. i have switched off enable visual studios hosting process , set debug info in advanced build settings none . i trying stop xml files , source browser database files come nuget packages getting copied publish directory (i assume these aren't required) - know how? is there else should doing? in end used post build event delete files didn't want.

vector - Drag and throw in Unity3D -

so, i'm developing game pretty bowling in unity3d. the user has pickup object , throw it, in bowling. user has limited area throw it. my question is: how calculate vector apply in rigidbody? read in question have subtract atualposition lastposition vector. , it. but, how lastposition? mean, user sliding gameobject 1 spot until decides throw it. can verify mean in glow hockey game: https://play.google.com/store/apps/details?id=com.natenai.glowhockey https://itunes.apple.com/pt/app/glow-hockey-2-free/id346453382?mt=8 and pretty i'm trying do. are developing mobile game, i.e. have touch input or mouse input? you need gesture recognizer. can write 1 , track touch/mouse position last frame , interpret cursor movement. want interpret whether user has made drag or swipe gesture , use add forces gameobjects. there gesture interpreters available in asset store. search "gestures" or "touch gestures" there: https://www.assetstore.unity3d.com

python - Terminate the Thread by using button in Tkinter -

in gui code, tried run loop1 , loop2 @ same time clicking 1 button. thus, used thread achieve this. tried stop clicking button , failed. after searching on stackoverflow, found out there no directly way kill thread . here part of code: def loop1(): while true: call (["raspivid -n -op 150 -w 640 -h 480 -b 2666666.67 -t 5000 -o test.mp4"],shell=true) call (["raspivid -n -op 150 -w 640 -h 480 -b 2666666.67 -t 5000 -o test1.mp4"],shell=true) def loop2(): while true: call (["arecord -d plughw:1 --duration=5 -f cd -vv rectest.wav"],shell=true) call (["arecord -d plughw:1 --duration=5 -f cd -vv rectest1.wav"],shell=true) def combine(): thread(target = loop1).start() thread(target = loop2).start() def stop(): thread(target = loop1).terminate() thread(target = loop2).terminate() i tried use these 2 buttons control it. btn1 = button(tk, text="start recording", width=16, height=

sql - Can Powerpivot be used to present data without pivoting it? -

this isn't coding question, functionality question. i'm bit new powerpivot , i'm attempting use powerpivot way deliver reports team rather ssrs because in our company, ssrs reportserver can use officially "owned" team hostile team. i have written numerous sql ad-hoc queries using reports in ssrs, been i've trying migrate them powerpivot. of reports, i've been able paste sql query powerpivot window , make pivottable out of these. however, i'd able have workbooks contain results of query (they don't deal numbers, of them data dump or large collection of text strings), powerpivot window's dataset, can filtered, sorted, etc. possible, or can use pivottables? can't seem find way can excel directly display in powerpivot window without pivoting - know called power* pivot * because pp window shows query results itself, i'm hoping there way use alternative ssrs. also there anyway check if our sharepoint server capable of running powerp

networking - Java IP Multicast issue when sender and receiver on different node -

hi trying out java multicast. i have wifi router @ - 10.0.0.1 (gateway) and 2 nodes: node_1 - 10.0.0.4 node_2 - 10.0.0.3 my ip multicast sender looks like: private static class sender extends thread { // create socket don't bind going send data private multicastsocket s; private static int senderport = 15000; private static string group = "225.4.5.6"; public sender() throws ioexception { s = new multicastsocket(senderport); s.setinterface(inetaddress.getlocalhost()); s.joingroup(inetaddress.getbyname(group)); } @override public void run() { integer data = 1; while(true) { try { s.send(new datagrampacket(data.tostring().getbytes(), data.tostring().getbytes().length, inetaddress.getbyname(group), senderport)); thread.sleep(3000); data++; } catch (unknownhostexception e) { // todo auto-gen

How to use android emulator for testing bluetooth application? -

i developing application send request bluetooth printer printing. code working fine real devices, want run on android emulator. how can use emulator bluetooth testing? you can't. emulator not support bluetooth, mentioned in sdk's docs , several other places. android emulator not have bluetooth capabilities ". you can use real devices. emulator limitations the functional limitations of emulator include: no support placing or receiving actual phone calls. however, can simulate phone calls (placed , received) through emulator console no support usb no support device-attached headphones no support determining sd card insert/eject no support wifi, bluetooth, nfc refer documentation

dart - Wanted: Rikulo UXL example(s) -

i want uxl working dart editor. i'm afraid feel sample code on uxl overview either out of date or lacks critical steps let perform. (see also: what rikulo dart really? , directs people blogs). i want speed uxl mark-up dart environment. examples i've found on blog/documentation , seem incomplete. https://github.com/rikulo/uxl and seems may not ' just me ' find examples confusing. uxl mark-up 'abc.uxl' or 'abc.uxl.xml' file? i'm looking @ rikulo because see kind of extremely helpful framework see. that said, please rikulo people, provide 3 or 4 examples work few tweaks , bit of thought. i'll put same thing out there others wanting doing tools , frameworks. examples teach . , make sure examples work. make them part of unit testing. cheers, will. afaik, samples in the document shall work fine. if changed spec, update document accordingly. you can name .uxl or .uxl.xml , i'd suggest .uxl.xml if editor su

ios - AVAudioplayer not working when app is in background -

i developing app plays recordings depending on user position. having problems when trying use app in background. have enabled background modes play audio in background , working nice in simulator. problem when autoplayrecord method called app in background doesn't play record. here code: - (void) autoplayrecord { autoplayingrecord = [_autoplaylist objectatindex:0]; dispatch_async(dispatch_get_global_queue(dispatch_queue_priority_background, 0), ^{ loadingsong = yes; dispatch_async(dispatch_get_main_queue(), ^{ [self showtitle:autoplayingrecord.title]; [audioplayer stop]; //make sure system follows our playback status [[avaudiosession sharedinstance] setcategory:avaudiosessioncategoryplayback error:nil]; [[avaudiosession sharedinstance] setactive: yes error: nil]; [[uiapplication sharedapplication] beginreceivingremotecontrolevents]; [self becomefirstresponder]; }); nserror *error; nsdata

java - Jar file too big -

i created simple project using windowbuilder in eclipse , goal send email. don't know kind of computer person using, exported project 'runnable jar file' , checked option 'extract required libraries generated jar'. the problem generated jar file 20mb in size!!! project has 1 simple window - nothing complicated or fancy. i found people use proguard include needed. i know if there way optimize 'manually'? there libraries automatically included when creating windowbuilder project, , how may determine libraries can remove? thank you. i've had same problem using windowbuilder. solution imports in .java file, e.g.: import org.eclipse.swt.swt; in project explorer in eclipse can see there more imports needed. 'build paths' can removed carefully. rightclick on .jar import "com.ibm.icu_52.1.0.v201404241930.jar" , click on "build path" , "remove build path". unfortunately, can't remove or delete packa

Inter-class use of variables in ruby -

i'm trying create class instance variables can linked , manipulated separate class. here's code: class product attr_accessor :name, :quantity def initialize(name, quantity) @name = name @quantity = quantity end end class production def initialize(factory) @factory = factory end def create "#{@name}: #{@factory}" end end basically, i'd able use attributes instance of product class in production class. if = product.new('widget', 100), want able call a.name variable in instance of production. test have: a = product.new('widget', 100) b = production.new('building 1') puts b.create('building 1') however, it's returning following: : building 1 instead of widget: building 1 any ideas what's going wrong? i'd add, subtract, etc. quantity. i'm hoping if figure out how link name property can same quantity pretty easily. first of all, want produce product during produc

java - Accumulate Observables from different Streams for polling -

i'm trying accumulate observables server calls, flatmapping them , make server call. private observable poll(observable<taskstatus> taskobservable) { observable.add(taskobservable) //pseudocode .buffer(3 sec) .flatmap(...) ... } how can observable accumulation ("add") achieved? you're looking merge() operator. for more information on combining observables, see this: https://github.com/netflix/rxjava/wiki/combining-observables

Export Test Cases including Steps & Results from Rally to TFS -

i export test cases (including steps & expected results) rally tfs. of now, see can export test cases using plug in or rally-tfs connector. the best way export test cases steps , expected results using excel add-in. select test case step query type following columns should information looking for: creationdate,expectedresult,input,stepindex,testcase,testcase.formattedid,testcase.type,testcase.workproduct you can find more information on excel add-in here: http://help.rallydev.com/rally-add-excel as importing them tfs, please note tfs connector not provide support test case steps.

sql - update query using select statement -

update dcc set drr= (select cast((cast((sum(emi)/100) decimal(2,2))+cast((sum([repo arrear])/100) decimal(2,2))) decimal(2,2))/((total*35)/100)/0.01 dcc (curr_date between '2014-01-01' , '2014-01-03') group total ) this query have store value in drr using select query. error: subquery returned more 1 value. not permitted when subquery follows =, !=, <, <= , >, >= or when subquery used expression. statement has been terminated. replace line select cast((cast((sum(emi)/100) decimal(2,2) with select top 1 cast((cast((sum(emi)/100) decimal(2,2) when update row's column value, need provide single scalar value it.

c# - No Code First option when adding new model -

i following tutorial on code first migrations existing database ( http://msdn.microsoft.com/en-nz/data/dn579398 ). the tutorial described when adding new data model select ado.net entity data model. once click "add" provided 4 options 1 being "code first existing database" tell select. problem have 2 options. 1 "generate database" , empty model, none of mention code first. i using vs2013 , new asp , mvc. need install sdk or other add on. cheers, kevin. db code first part of new ef 6.1 tooling. can download here: http://www.microsoft.com/en-us/download/details.aspx?id=40762 wrote blog post on here if want quick overview: http://thedatafarm.com/data-access/first-look-at-beta-of-ef-6-1-designer/

templates - TFS 2012 Work Item State Transition for multiple groups -

right @ moment i'm customizing process template , there should transition work item state b, should restricted multiple tfs groups, presice should 2 groups. are there ways in process template? http://msdn.microsoft.com/en-us/library/aa337653%28v=vs.120%29.aspx as far know for-attribute can used single tfs group. workaround i'd know assign group member of other. regards, marcel the trick use create tfs group specific for clause , add tfs or windows groups need members. possible script using tfssecurity command.

c# - Use HtmlAgilityPack to parse HTML variable, not HTML document? -

i have variable in program contains html data string. variable, htmltext , contains following: <ul><li><u>mode selector </u></li><li><u>land alt</u></li> i'd iterate through html, using htmlagilitypack, every example see tries load html document. have html want parse within variable htmltext . can show me how parse this, without loading document? the example i'm looking @ right looks this: static void main(string[] args) { var web = new htmlweb(); var doc = web.load("http://www.stackoverflow.com"); var nodes = doc.documentnode.selectnodes("//a[@href]"); foreach (var node in nodes) { console.writeline(node.innerhtml); } } i want convert use htmltext , find underline elements within. don't want load document since have html want parse stored in variable. you can use loadhtml method of htmldocument class

r - 'Embedded nul in string' error when importing csv with fread -

so, have large file (3.5g) i'm trying import using data.table::fread . it created rpt file opened text , saved csv. this has worked fine smaller files (of same type of data-same columns , all. 1 longer timeframe , wider reach). when try , run mydata<-fread("mycsv.csv") i error: error in fread("mycsv.csv") : embedded nul in string: 'y\0e\0a\0r\0' what mean? that's strange file! can remove null terminators on command line using like: sed 's/\\0//g' mycsv.csv > mycsv.csv

ProcessBuilder throwing java.lang.Exception: -

i trying figure out why code below throwing java.lang.exception: no such file or directory exception processbuilder send = new processbuilder("/bin/bash","/opt/ftp/scripts/xfer.sh | /opt/ftp/myftp -c /opt/ftp/ftp.conf >> /logging/ftp.log2>&1"); process sendprocess = send.start(); br = new bufferedreader(new inputstreamreader(sendprocess.geterrorstream())); builder = new stringbuilder(); line = null; while ( (line = br.readline()) != null) { builder.append(line); builder.append(system.getproperty("line.separator")); } if(!builder.tostring().isempty()){ throw new exception( "error xfer.sh: "+builder.tostring() ); } i've tried isolating arguments within string array, did not work either. ideas may causing stacktrace? i have success using following code. maybe have use -c option: private static int

apache - Service Temporarily Unavailable under load in OpenShift Enterprise 2.0 -

using openshift enterprise 2.0, have simple jbossews (tomcat7) + mysql 5.1 app uses jsp files connected mysql database. app created non-scaled app (fwiw same issue happens when scaling enabled). using jmeter driver single concurrent user , no think time, chug along 2 minutes (at 200 req/sec) , start returning "503 service temporarily unavailable" in batches (a few seconds @ time) on , off remainder of test. if change nothing (don't restart app) if wait moment , try again, same thing--first seems fine, start errors. the gear far fully-utilized (memory/cpu), , log can find shows problem /var/log/httpd/error_log, fills these entries: [tue mar 25 15:51:13 2014] [error] (99)cannot assign requested address: proxy: http: attempt connect 127.8.162.129:8080 (*) failed looking @ 'top' command on node host @ time errors start occur, see several httpd processes surge top on , off. so looks somehow running out of proxy connections or similar. however, i'm not