Posts

Showing posts from March, 2014

javascript - ReactJS: Sidebar with multiple views -

Image
i try build single-page react.js app sidebar. here desired effect: imagine main page (area text settings sidebar ) has button. when click on button, sidebar displays list of items. when click on item view details slides on list view. imagine right sidebar works iphone settings menu. each actions changes url (react-router). is there working example? question on how organize kind of app when using react. update: manuel bitto wrote example , works except url-changing. se example using react-router because sidebar holds heavy content , url must change when open sidebar , when go deeper. here basic example start, please note it's first time try use react improved lot: <script type="text/jsx"> var closemenubutton = react.createclass({ render: function() { return <button onclick={this.props.onclick}>{this.props.children}</button>; } }); var menuitem = react.createclass({ render: function() { return <div...

python - Update QWidget every minutes -

Image
is way possible update qwidget in pyqt4 every 15 minutes ? know qtimer possible make qwidget update @ specific time,for example 00h00 00h15 00h30 00h45 01h00,... . way make qtimer depend on time? the qtimer class has setinterval method. can utilize change wait time on fly. short example, block of code show current second. however, if second multiple of 10 wait 5 seconds before starting again: import sys pyqt4 import qtgui, qtcore time import strftime class main(qtgui.qmainwindow): def __init__(self): qtgui.qmainwindow.__init__(self) self.initui() def initui(self): self.timer = qtcore.qtimer(self) self.timer.timeout.connect(self.time) self.timer.start(1000) self.lcd = qtgui.qlcdnumber(self) self.lcd.display(strftime("%s")) self.setcentralwidget(self.lcd) self.setgeometry(300,300,250,100) def time(self): if int(strftime("%s")) % 10 == 0: self.ti...

java - Bind two Spinner controls into a TableView in JavaFX -

Image
how bind 2 spinner controls tableview ? according sreenshot below, : cola = colb / 2 ( and colb = cola x 2... ) : here snippet (deliberately simple) used expose problem : testapp.java public class testapp extends application { @override public void start(stage stage) throws exception { final tableview<mybean> tableview = new tableview<>(); final tablecolumn<mybean, integer> cola = new tablecolumn<>("col a"); final tablecolumn<mybean, integer> colb = new tablecolumn<>("col b"); cola.setcellfactory(col -> new spinnercell<mybean, integer>()); cola.setcellvaluefactory(new propertyvaluefactory<mybean, integer>("vala")); colb.setcellfactory(col -> new spinnercell<mybean, integer>()); colb.setcellvaluefactory(new propertyvaluefactory<mybean, integer>("valb")); tableview.setcolumnresizepolicy(tableview...

PHP OOP, undefined property. How can I get this to work? -

okay i'm trying improve php oop, i'm not sure how should this. please point out issue? the code returns following errors: notice: undefined property: registration::$userexist fatal error: call member function fetch() on non-object the class: class registration extends connect{ public function userexist(){ global $dsn; $userexist = $this->dsn->prepare(" select * accounts username= :username "); $userexist->bindparam(':username', $username); $userexist->execute(); $rows = $this->userexist->fetch(pdo::fetch_num); return $rows; } how i'm trying use class on page: $conn = new connect(); $registration = new registration(); $rows = $registration->userexist(); if($rows < 1){ // the error says cannit find variable $userexist, because on last line looking variable "$userexist" ins...

python - Can anyone explain this error? AttributeError: 'list' object has no attribute 'encode' -

from research i've been doing, code should write text csv file. import csv name = "x" score = "y" open('some.csv', 'wb') f: writer = csv.writer(f) data = [["name", "score"], [name,score]] f.write(data[0].encode('utf-8')) writer.writerows(data) at first, threw me encoding error. after hunting around on stack overflow, found needing encode text utf8. tried encoding x.encode(). got this: f.write(data[0].encode('utf-8')) attributeerror: 'list' object has no attribute 'encode' i can't find answer why happening. can explain why i'm getting error? use csv writer created. don't write f directly. drop f.write line: import csv name = "x" score = "y" open('some.csv', 'wb') f: writer = csv.writer(f) data = [["name", "score"], [name,score]] writer.writerow...

ios - Pass indexPath.row to button in a custom cell using SWIFT -

Image
i have simple table view, custom cell build in it, custom cell has 2 buttons ( later used down vote , upvote buttons ), there way pass indexpath.row value button, in order me identify cell button clicked? tablewviewcontroller.swift override func tableview(tableview: uitableview, cellforrowatindexpath indexpath: nsindexpath) -> uitableviewcell { let cell = tableview.dequeuereusablecellwithidentifier("cell", forindexpath: indexpath) customtableviewcell cell.piadatitulo.text = "lorem ipsum" cell.piadadescription.text = "lorem ipsum dolor sit amet, consectetur adipiscing elit. aenean commodo volutpat lectus, vitae semper tortor finibus at. cras erat ligula, egestas sed tincidunt eget, condimentum maximus lectus. aenean varius semper tellus, id congue lacus pretium a" return cell } customtableviewcell.swift @iboutlet weak var piadatitulo: uilabel! @iboutlet weak var piadadescription: uilabel! @ibaction fun...

asp.net - Receive error: Cannot find declaration element 'ActivityId' -

this error beyond skill set apologize if make incorrect assumptions: the activityid assigned when api call made client server, i'm assuming don't have control on how generated. assuming don't have control on assignment of activitid problem being caused handshaking between iis server , endpoint? is there modification can make in wsdl address problem? i've posted trace events of call , code, please let me know else required troubleshoot problem. below results found in trace viewer, further down code: <e2etraceevent xmlns="http://schemas.microsoft.com/2004/06/e2etraceevent"> <system xmlns="http://schemas.microsoft.com/2004/06/windows/eventlog/system"> <eventid>0</eventid> <type>3</type> <subtype name="information">0</subtype> <level>8</level> <timecreated systemtime="2015-04-22t15:34:40.7214893z" /> <source name="system.servicemodel.messageloggi...

vim - Setting background of GVim -

Image
i working dark background in both vim gvim. however, in gvim dark background not loaded automatically (through .vimrc ), stays light , need set automtically every session. see screenshots below. loading file in vim: loading file in gvim: executing set background=dark after loading file in gvim (note set background=dark indeed in .vimrc ): what can cause problem? as romainl indicates, background option tells vim background color looks like. enable background dark syntax higlighting. seems, you're using gui. consider following in .vimrc: hi normal guifg=grey guibg=black hi stands higihglighting. , guifg , guibg stands for, guessed it, gui foreground , background colors.

windows - server doesn't listen postgresql 9.1 after service change -

i did install postgresql 9.1 on 2012 r2 windows server did installed changed postgresql service account facing error when trying restart postgresql service ! the postgresql 9.1 service on local computer started , stopped. services stooped automatically if not in use other services or programs. when trying login postgresql database facing below errors server doesn't listen i checked config file listen_addresses = '*' port = 5432 don't know error please me guys pretty new postgresql

scala - Is TestActorRef deadlock possibility still relevant? -

in akka 2.3.9 documentation there warning: any message send testprobe actor runs on callingthreaddispatcher runs risk of dead-lock, if other actor might send probe. implementation of testprobe.watch , testprobe.unwatch send message watchee, means dangerous try watching e.g. testactorref testprobe . i tried reproduce described deadlock situation in test using testprobe , testactorref both using callingthreaddispatcher class deadlocktest extends testkit(actorsystem()) funsuitelike { test("deadlock attempt") { val b = testprobe() val = testactorref(new actor { override def prestart() = b.ref ! "pre" def receive = { case msg => sender ! msg context.stop(self) } }) b.watch(a) b.send(a, "foo") b.expectmsg("pre") b.expectmsg("foo") b.expectterminated(a) b.unwatch(a) } } i expected test hang passed. is warning still rel...

javascript - How to differ inputs with same class? -

Image
i have 1 button duplicates line choose more products. html: <td> <input type="hidden" class="cod_linha" name="cod_linha[]"style="width: 100%;" /> <input type="text" name="linha[]" class="linha" style="width: 100%;" /> </td> the problem is, have 2 functions find product , other fill fields want automatically, have differ filled field of empty field ? tried this: var table = $('#tabelapedido'); $(table).each(function() { if($(this).find('input.linha').val()=== ''){ executes function fill fields , add new line. } else{ } and : var counter = $(table).find("input.linha").length; for(var =0; < counter; i++){ if($(table).find('input.linha').eq(i).val()== ''{} but codes don't fill other empty line. see imagem : my code fill fields : function preenchercamposproduto(obj) { var table = $('#tabela...

regression - Discrepancies between lmerTest and lme4 results -

i have value dv (dependent variable), , interested in effect of bmi on dv. have multiple observations dv (i.e., every subject responds 5 times), wanted fit mixed model (for repeated measures of each id). so did was: use bodo winters tutorial - compute difference between complicated , simpler model. use lmertest now, results different, , cannot figure out why. m1 <- lmer(value ~ bmi + dummy + (1|id), data=data) m2 <- lmer( value ~ bmi + (1|id), data=data) anova(m1, m2) here, results highly significant require(lmertest) m3<-lmer(value ~ bmi + (1|id), data=data) anova(m3) here, results not significant @ all. sorry, cannot provide reproducible example, discrepancy happens bmi effect, not other effects of interest. wonder: why have suggestions, somewhere maybe made mistake? here output get > m1 <- lmer(value ~ bmi + (1|id), data=data, reml=false) > m2 <- lmer(value ~ 1 + (1|id), data=data, reml=false) > anova(m1, m2) data: data models: ...

excel - Can I use VBA to update a textfile or directly into access? -

i'm new programing in general , vba in particular. though have been assigned construct program. have managed of it, , thought finished until tested. program stopwatch started , stopped monitor process. data, kind of process monitored , how long time took, should saved , program should reset , ready next person monitor process. has worked quite okey, file saved excel-file timestamp make file unique. the problem have lot of different excel-files , problem compare them. therefore instead of saving them different excel-files save textfile continuously update every time operator saves. mean recorded data should saved new row in in textfile. have managed overwrite data in textfile, means 1 row updated. i have tried put data directly access can't hang of it. think problem excel-file changes name when saved. while writing realize might work if keep same name of file , store data in access. try when chance if there better solution i'm ears. keep in mind i'm new if poss...

class - how to convert a float to a fraction in python? -

this question has answer here: how convert floats human-readable fractions? 25 answers i trying define class fraction: def __init__(self,num=0,denom=1): self.num = num self.denom = denom and want define add method, def __add__(self,right): if type(right) int: return (self.num/self.denom) + right if type(right) fraction: return ((self.num/self.denom)+(right.num/right.denom)) def __radd__(self,left): return (self.num/self.denom)+left it works, , returns float. however, want return fraction. example: if test: f = frac(1,2) f + frac(1,3) f + 2 frac(1,3) + f 2 + f i get: *error: f+frac(1,3) -> 0.8333333333333333 should -> 5/6 *error: f+2 -> 2.5 should -> 5/2 *error: frac(1,3)+f -> 0.8333333333333333 should -> 5/6 *error: 2+f -> 2.5 should -> 5/2 are there methods can convert result ...

c# - Is there a storage library that abstracts away Azure, S3 and others? -

i developing application supports running in cloud, either amazon or azure. once of components need abstraction around storage apis (blobs , queues). can write abstraction layer, still end huge set of dependencies (all azure , amazon libraries). want component provides pure http access, don't need take external dependencies. such beast exist? edit what have done far build interface abstracts away basic operation on blobs. i've ended similar following: public interface iblobservice { task<stream> downloadblob(string container, string blob); ienumerable<string> listblobs(string container); void putblob(string container, string blob, stream data); } i understand different services have different behaviors, both support basic set of crud operations. i'm finding keep adding additional methods change calling behavior. example, addition void putblob(string container, string blob, stream data); i end needing void putblob(string container, string ...

javascript - I have this d3 code but Iwould like to insert lable number on the top of the yAixes here is my code -

generate array of data random values bounded between 0 , 100. need add text objects place labels above each rect svg object shows "y" value of entry function generate_random_ints( opts) { var num_possible_ints = opts.max_value - opts.min_value +1; var data = []; ( var = 0; < opts.num_values; i++ ) { var value = math.random() * num_possible_ints + opts.min_value; data.push( math.floor( value) ); } return data; } var data_option = { min_value: 0, max_value:50, num_values: 30 }; // generate rect objects within svg object each entry in array of data sized , positioned create simple bar graph. var svg = d3.select("body") .append("svg") .attr("width", "700px") .attr("height", "700px") ; //set width , height of div var svg_width = 700; var svg_height = 700; var ytextpadding = 20; var dataset = generate_random_ints(data_option); //console.log(datase...

php - Laravel 5 Queued Command -

i'm making app using laravel 5, @ moment i'm little problem (i hope). coded command implements shouldbequeued : class importdatacommand extends command implements selfhandling,shouldbequeued { use interactswithqueue, serializesmodels; public $filepath; /** * create new command instance. * * @return void */ public function __construct($filepath) { $this->filepath = $filepath; log::info('queued shit command contructor , have destinationpath => '.$filepath);//working echo "contructor ".$this->filepath; } /** * execute command. * * @return void */ public function handle() { $destinationpath = storage_path().'/app/gtfs/'; $zip = new ziparchive; echo "handle ".$this->filepath; /*$res = $zip->open($destinationpath.$this->filepath); if ($res === true) { $zip->extra...

c++ - glUniform3fv not working OpenGL -

i'm working on piece of code in opengl. i'm getting following error message while trying compile: myglwidget.cpp: in member function ‘virtual void myglwidget::initializegl()’: myglwidget.cpp:30:38: error: cannot convert ‘glm::vec3 {aka glm::tvec3<float, (glm::precision)0u>}’ ‘const glfloat* {aka const float*}’ in argument passing myglwidget.cpp:31:39: error: cannot convert ‘glm::vec3 {aka glm::tvec3<float, (glm::precision)0u>}’ ‘const glfloat* {aka const float*}’ in argument passing i have declared these locations in myglwidget.h follows: gluint llumloc, focusloc; and have initialize them in myglwidget.cpp as: llumloc = glgetuniformlocation (program->programid(), "llumambient"); focusloc = glgetuniformlocation (program->programid(), "posfocus"); "llumambient" , "posfocus" uniforms in vertex shader: uniform vec3 llumambient; uniform vec3 posfocus; i mentioned error message while trying call fo...

Running Fortify scan over multiple maven projects -

i have multiple projects bound single parent pom. if run fortify scan on parent pom using maven fortify plugin, fpr files each project generated. have single fpr file being generated projects. possible ? thanks , regards, saurav what want aggregate build. try setting same build id each module , pass -dfortify.sca.toplevel.artifactid artifactid of parent pom. should give single fpr file. should like: mvn clean mvn -dfortify.sca.buildid=acmeportal com.fortify.ps.maven.plugin:sca-maven-plugin:<version>:clean mvn -dfortify.sca.buildid=acmeportal package com.fortify.ps.maven.plugin:sca-maven-plugin:<version>:translate mvn -dfortify.sca.xmx=800m -dfortify.sca.buildid=acmeportal -dfortify.sca.toplevel.artifactid=acmeportal com.fortify.ps.maven.plugin:sca-maven-plugin:<version>:scan

How may I create list of lists in Python to store list of texts? -

i trying open bunch of files directory , trying put results in list of lists say, that say, have list of file names of directory, want read each 1 of them. after reading each 1 of them, want put results of each file in list. these lists again inserted create list of lists. to trying write follows: list_of_files = glob.glob('c:\python27\*.*') print list_of_files list1=[] list2=[] list_n=[list1,list2] i,j in zip(list_of_files,list_n): print i,j x1=open(i,"r").read() x2=j.append(x1) all_sent=list_n print all_sent am doing wrong? if 1 may kindly suggest? there smarter way it? using python2.7 on windows 7 professional edition. have many list of lists question in python have reviewed them. posting did not match. apology cross posting. if may direct me previous post, surely delete post. try using following list comprehension: list_of_files = glob.glob('c:\python27\*.*') data = [open(file,...

java - Remove elements from HashSet on iteration -

suppose have hashset : [1, 2, 3, 4, 5, 6] i want iterate on in such way, given sum, 6, while iterating on elements, if find 2 elements in set having sum = 6, want remove other one. e. g., if iterating on 1, should remove 5. trying this: hashset<integer> hs = new hashset(arr); int sum = 6; for(int num : hs) { if(hs.contains(sum - num)) { hs.remove(sum - num); } } obviously throws java.util.concurrentmodificationexception . approach use iterator removes current element , not take other element parameter. else can use? update: know techniques use additional set , all. wanted optimal solution without increasing time , space complexity, if that's possible. keep running set of numbers have found. this allow have one-pass solution. start empty running set, , iterate through set of numbers. each element iterate through, if sum-compliment in set, remove iterator. otherwise, add running set. hashset<integer> hs = new hashset(arr); h...

javascript - How do I clip a line segment between two known y values? -

Image
i implementing algorithm find optimal label location polygon. can found here. the gist must sort polygon's vertices y values. then, each y "draw" horizontal line @ point. divides polygon strips , ends looking this: once these strips created, must find midpoints of segments contained in each one. stuck. example, in strip #2, leftmost segment has no endpoints define in strip's scope. endpoints @ top of strip #1 , bottom of strip #3. how clip longer line segment segment contained entirely in upper , lower bounds of strip #2? more specifically, how determine 2 endpoints (top of strip 1, bottom of strip 3) endpoints line intersecting strip #2 on left side? the classical approach keep "active list" stores indexes of edges straddling current ordinate. when go ordinate next, edges can enter or leave list (they once only). keep updated. the list empty, ends empty , should contain number of edges @ times. if polygon edges never cross, can ...

Installing Package in Laravel VIA Composer -

i using laravel 4 project, download package turns youtube/vimeo urls embed, required package in composer , run composer update. however trying use package keep getting error: class 'embed' not found the code in helpers.php file: function embed_video($url, $width = 0, $height = 0) { $embed = embed::make($url)->parseurl(); if ($embed) { // set width of embed. if ($width > 0) { $embed->setattribute(['width' => $width]); } // set height of embed. if ($height > 0) { $embed->setattribute(['height' => $height]); } return $embed->gethtml(); } } i call function in view. link package: cohensive

runing VB.Net projects on other computers (.net framework required) -

well i'm not asking way run vb.net applications without .net framework or similar. i'm asking ideas or advices can make simpler user run programs ,because each way user tries run without framework it's gonna ask him download makes more annoying - know there simple , available way include .net framework in setup , or if don't make setup bunch of code , programs not important , mean example downloading 200mb file changes 1 or 2 registry keys isn't choice @ actually vista , win7 comes .net 4.0 pre installed should continue without thinking of problem or there can ? note : vb 6.0 isn't choice :d edit : make question more clear , i'm using visual studio 2008 , ok ( ok means programs gonna work on other computers without problems don't care advantages.) or should move earlier versions ? i think got it, vs2008 can not target .net 4.0 comes earlier versions of windows works on .net 3.5 sp1, guess should move vb2010 not face problems ru...

hdl - Verify Parameters in Verilog -

i have created module accepts single parameter specifying byte width of module's data lines. looks like: module wrapper# ( parameter data_byte_width = 1 ) ( din, dout, .. ); localparam data_bit_width = 8*data_byte_width; input [data_bit_width-1:0] din; output [data_bit_width-1:0] dout; ..... generate if( data_byte_width == 1 ) begin // various modules , interconnects 1-byte data else if( data_byte_width == 2) begin // various modules , interconnects 2-byte data else if.... // , on, 4, 8, , 16 else // data_byte_width not valid value // here want throw error end endgenerate // other code endmodule the problem valid widths 1, 2, 4, 8 or 16 bytes. if other value used data_byte_width, interconnects not generated @ all. xilinx doesn't seem care that. happily "generate" nothing if invalid value supplied: resulting design synthesize...

excel - Get a count of X in a column that has X and Y -

Image
i have column has values of x , y. want write formula in excel can calculate number of (x)s , (y)s in column. i've tried using if() formula haven't had sucess. your formula should d3 : =countif(a2:a100, "x") and e3 : =countif(a2:a100, "y")

angularjs - Add CSS class using angular -

i have following on angular controller scope model: $scope.model = { subscriber: { email: '', name: '' }, notice: { text: '', type: '' } } i need display p tag whenever notice.text not empty , add css class equal notice.type. have: <p class="notice" data-ng-bind="model.notice.text" data-ng-if="model.notice.text != ''"></p> p tag has class "notice". need add class contained in $scope.model.type if defined. how can this? side question: there better way show / hide p tag instead of using data-ng-if? you can use ngclass directive the ngclass directive allows dynamically set css classes on html element databinding expression represents classes added. code ng-class="model.notice.text != '' ? model.notice.type : ''"

objective c - What Cocoa Views and Controls Will Create Something like Part of the Network Prefs Display (Mac OS)? -

Image
this question has answer here: nstableview +/- buttons in system preferences using interface builder 1 answer i'm building osx app , want create set of controls similar what's found @ bottom of standard network preferences configuration panel. i'm running layout problems wouldn't have expected. these specific questions: what contains 3 buttons there's similar shading way across row buttons positioned? in particular, what's causing area without buttons have shading? how do without getting double border row of buttons meets table? i want xib file. may incredibly simple, i'm missing guess. i find if make button style "gradient" , type "momentary change", looks other buttons not respond clicks, can use area after last button. (the nsmomentarychangebutton documented changing image , title when clicked, ...

javascript - How to make a login button with facebook account -

i want make button stack-overflow.com website facebook account log in website,i new guy,and english not good,can u me? like stack-overflow.com log in button facebook provides "login facebook" on developer page here or more specific websites here basicaly have create facebook app-id , include facebook javascript sdk provide "login facebook" functionality.

c# - How to make ConfuserEx "more" secure? -

i've been using awhile noticed uses same constants, such module name koi constants protection. is there way make more secure? i've tried downloading source , changing things either, the obfuscator crashes during obfuscation or... my obfuscated application crashes @ startup. my knowledge of stuff extremely limited why i'm looking alternative methods of making "more" secure.

Drools error using hibernate -

i have drools project have connect hibernate (meaning need read facts database using hibernate) when run project following error : java.lang.arrayindexoutofboundsexception: -1 @ org.eclipse.jdt.internal.compiler.parser.parser.consumecastexpressionwithnamearray(parser.java:1984) @ org.eclipse.jdt.internal.compiler.parser.parser.consumerule(parser.java:5992) @ org.eclipse.jdt.internal.compiler.parser.parser.parse(parser.java:9272) @ org.eclipse.jdt.internal.compiler.parser.parser.parse(parser.java:9500) @ org.eclipse.jdt.internal.compiler.parser.parser.parse(parser.java:9457) @ org.eclipse.jdt.internal.compiler.parser.parser.dietparse(parser.java:8102) @ org.eclipse.jdt.internal.compiler.compiler.internalbegintocompile(compiler.java:696) @ org.eclipse.jdt.internal.compiler.compiler.begintocompile(compiler.java:376) @ org.eclipse.jdt.internal.compiler.compiler.compile(compiler.java:420) @ org.drools.commons.jci.compilers.eclipsejavacompiler....

javascript - Responsive Menu Issues -

ok have no near enough knowledge on js know possibly be. my navigation menu has stopped working in mobile. if resize browser mobile desktop mobile menu shows menu icon 3 times, if repeat keeps duplicating, open , doesnt close after first time.. you can see live here qubecatering.com i have no idea code be.. any great! im using flexymenu plugin, , use on many sites , never have issues. here html: <div class="flexy-menu"><ul id="menu-primary" class="flexy-menu"><li id="menu-item-20" class="menu-item menu-item-type-post_type menu-item-object-page current-menu-item page_item page-item-6 current_page_item menu-item-20"><a href="http://qubecatering.com/">home</a></li> <li id="menu-item-19" class="menu-item menu-item-type-post_type menu-item-object-page menu-item-19"><a href="http://qubecatering.com/about/">about</a></li> <l...

c - How to delete the first digit of a given number? -

how can delete first digit of given number using user defined function (suppose function deltop ) ? for ex., x=deltop(1748); i want value of x 748 . would tell me how write function ? you can divide number ten, until number < 10. 1748/10 = 174 174/10 = 17 17/10 = 1 now know iteration count 3 , have 1 multiplier , can use following formula: yournumber - 1 (this 1 "multiplier") * 10^3 (the 3 "iteration count") = 748

spring - Drools 6.2.0.Final: EntityManager is closed -

migrating drools 6.2.0.final v5, having issues jpa persistence. environment: jta transactions managed spring. environment configuration: // transaction manager spring jtatransactionmanager. seems activate kiespringtransactionmanager/kiespringjpamanager env.set(environmentname.transaction_manager, transactionmanager); env.set(environmentname.entity_manager_factory, entitymanagerfactory); it seems triggerupdatetransactionsynchronization.beforecompletion() method accesses entitymanager retrieve objects session. however, entity manager has been closed spring in it's own beforecompletion transaction synchronization, hence exception. is normal behavior? doing wrong? any appreciated. exception: java.lang.illegalstateexception: entitymanager closed @ org.hibernate.ejb.entitymanagerimpl.getsession(entitymanagerimpl.java:95) ~[hibernate-entitymanager-4.2.7.final.jar:4.2.7.final] @ org.hibernate.ejb.abstractentitymanagerimpl.contains(abstractentitymanagerimpl.java:95...

javascript - modify CSS of elements created via .load() -

first time using jquery. i'm using load content of external element onto page. loads fine, i'm finding normal traversal methods don't work on loaded elements. instance, have is: <div id="area"></div> <script type="text/javascript"> $("#area").load("externalpage.html #externalelement > *"); $("#area").find("ul").first().css("display","none"); </script> the second line of script appears nothing. have order in operations completed? i'm loading custom html module on blackboard lms, can behave strangely if scripting gets complicated, 1 of times. thank helping me figure out! the call load() asynchronous. means find() being run before request completes , elements created in dom. to workaround can put logic in callback parameter of load() . means not called until request completes , dom in state expect. try this: $("#area").loa...

Could not access the Package Manager. Is the system running? -

i'm trying install app on phone using pm function time error: "error: not access package manager. system running?". cannot run command starts pm without getting error. how can fix this? root@tblte:/storage/emulated/0/tmp # ls ls du.log logcat.apk sulog_247.txt root@tblte:/storage/emulated/0/tmp # pm install logcat.apk pm install logcat.apk error: not access package manager. system running? root@tblte:/storage/emulated/0/tmp # pm list pm list error: not access package manager. system running? root@tblte:/storage/emulated/0/tmp # thank you. solved installing latest supersu.

linux - How to specify libcurl SFTP hmac option -

i have version of libcurl compiled libssh2 (fairly recent versions, openssl v1.0.2 , libssh2 v1.4.3) supports uploading/downloading files sftp. have limited experience ssh , sftp know on linux there additional options can specified sftp command such mac (message authentication code). simple connect can this: sftp -ociphers=... -omacs=... myuser@myhost the above command works. here 1 reference found. however, need same thing using libcurl can test on windows. need test different cipher/mac combinations, example 3des-cbc or aes128-cbc ciphers hmac-md5 or hmac-sha1 . does libcurl sftp support specifying hmac option? , if how tell use? i got on libcurl , libssh2 mailing lists , asked question , told option looking not exist in libssh2 , therefore not exist in libcurl. libssh2 compiled support particular hmac ciphers (like md5 or sha1). so, compiling different versions of libssh2 library targeted specific hmac cipher looks way need do.

java - Matrix Multiplication MPI not compiling -

im trying compile below code in jdk doesnt seem compile, getting error not statement on line 41 though is. the line causing error is: long endtime = system.currenttimemillis(); here code: import mpi.*; public class multidimmatrix { public static final int n = 10; public static void main (string args[]){ mpi.init(args); long starttime = system.currenttimemillis(); int rank = mpi.comm_world.rank(); int size = mpi.comm_world.size(); int tag = 10, peer = (rank==0) ? 1:0; if(rank == 0) { double [][] = new double [n][n]; for(int = 0; < n; i++) for(int j = 0; j < n; j++) a[i][j] = 10.0; object[] sendobjectarray = new object[1]; sendobjectarray[0] = (object) a; mpi.comm_world.send(sendobjectarray, 0, 1, mpi.object, peer, tag); } else if(rank == 1){ double [][] b = new double [n][n]; for(int = 0; < n; i++) for(int j = 0; j < n; i++) b[i][j] = 0; object[] recvobjectarray = new object[1]; mpi.comm_world.recv(recvobjectarray, 0, 1, mpi.object, peer, tag)...

sql - INSERT INTO an Integer after Insert -

i have big problem , need help! i have trigger on table table a updates few lines , @ end making insert into table table b data table table a have trigger on it. everything fine, have int column docid in table b can't fill int column table (verid) . if insert nvarchar variable column docid , it's working. can take nvarchar field vom table a , insertit in int column docid . no way int int . here code: declare @stichwortid varchar(50) select @stichwortid= isnull(verid,'') inserted insert [dbo].[baufin_kostenstellen] (docid, dwkeyword) values(@stichwortid, 'test') also trying declare @stiwchwortid int didn't work either. filling second column dwkeyword no problem. how using insert . . . select ? insert [dbo].[baufin_kostenstellen] (docid, dwkeyword) select verid, 'test' inserted; your code, written, should work. despite statement otherwise, culprit data type different in 2 tables -- can cause other sor...

javascript - onepage scroller apple mouse wheel doesn't work -

i using jquery 1 page scroll now got work rails app, noticed later want scroll next page when scroll mouse wheel 1 step. am doing wrong here ? since demo doesn't work when scroll mouse wheel. did read documentation , default mouse wheel option on, still wont work. here jsfiddle <script> $(document).ready(function() { $(".main").onepage_scroll({ sectioncontainer: "section", easing: "ease", animationtime: 1000, pagination: true, updateurl: false }); }); </script> <div class="main"> <section class="n1 section" > <p class="n1_text_top">first</p> <p class="n1_text_sub">second</p> </section> <section class="n1 section" > <p class="n1_text_top"></p> <p class="n1_text_sub"></p> </section> </div>

swift - How to animate a simple movement UIKit -

i trying animate uiimageview moves down on screen, can't figure out how code or organize new swift. use imageview called mrock. . want move down in straight line. would use like blank.movetopoint and coordinates don't know. as greg says in answer, uiview methods who's names start animatewithduration start. if you're using autolayout, however, animating view's center or frame property doesn't operate expected, since constraints can take on , move views layout-based positions. with auto-layout, instead should create 1 or more position constraints on view in ib, control-drag constraints view controller create outlets. then change constraint's constant setting , call layoutifneeded inside animation block.