Posts

Showing posts from September, 2013

How to make HTTP Requests over WiFi directly from Android Wear? -

how can execute http requests or open socket on android wear? used think that's impossible web browser android wear app says folloing: "[..] works when phone off if have smartwatch android wear 5.1 , wifi"*. i tested , app can connect internet when paired phone powered off. whenever open socket or try http requests on android wear connectexception saying failed connect http://foo.com (similar stack trace here ). i'm doing different app doing , i'd understand is. context: i'm working on proof-of-concept , want able execute http requests , open sockets. i'd love know if there's way that. if includes rooting watch , doing adb magic. to clarify: know data layer api , i'd still able http requests , open sockets. if watch has wifi , set correctly, can make network calls on watch when watch disconnected phone; when connect phone via bt, wifi disabled. while enabled, should able treat usual network connectivity , make networ

Collision between enemy characters and bullets shot - (Cocos2dx, C++, Android) -

my problem collision detection wrote enemy character objects , bullet objects. the symtoms: when 1 enemy character spawns , shoot bullets, enemy character destroyed normal. but, if 2 or more enemy characters spawn , shoot first enemy spawned nothing. last character spawned , shot destroyed without issue. how tried fix it: i decided give each enemy character unique id creating int variable , randomize each time enemy spawned. ensures me each enemy character object definately have unique identifier if shoot them, can somehow match unique id bullet. however, dont know how work around that. code below deletes every enemy character associated randomized tags my question: how can set bullet objects hold every unique id of enemy characters, when bullet hits 1 (doesn't matter specific order) search compare unique ids has enemy character id has shot? apologies if question unclear or if coding style horrible. gamescene.cpp /** * @param enemy_spawn_frequency value 0

java - Spring aspect now working with identical configuration in similar project -

i have 2 war project similar project have common configuration: <?xml version="1.0" encoding="utf-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/xmlschema-instance" xmlns:util="http://www.springframework.org/schema/util" xmlns:aop="http://www.springframework.org/schema/aop" xsi:schemalocation="http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.1.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd"> <aop:aspectj-autoproxy proxy-target-class="true" /> <bean class="config.store.persistentaspect"> </bean> aspect method is: @afterreturning("@annotation(org.sprin

angular - How to update view after change in angular2 after google event listener fired -

i trying update view after event listener fired. however, change not detected , isn't update until change detected. import { component, view, bootstrap } 'angular2/angular2'; @component({ selector: 'app' }) @view({ template: '{{keyword}} <input id="keyword" /><br/><span (click)="update()">{{click}}</span>' }) class app { keyword; autocomplete; click; constructor() { var _this = this; var input = (document.getelementbyid('keyword')); this.autocomplete = new google.maps.places.autocomplete(input); google.maps.event.addlistener(this.autocomplete, 'place_changed', function(){ console.log('place change'); _this.keyword = "updated text"; _this.click = "not clicked"; }); this.keyword = "original text"; this.click = "click me after selection made force change";

javascript - How to replace an image on the page with another image by clicking on the image? -

i not javascript or html expert. know basic. here code click on image open file chooser , choose new image , append previous image. works fine need replace image previous 1 instead of appending. appreciate if 1 can tweak i'm not sure how it: <div id="current-user"></div> <br> <input type="file" id="choose" multiple src="/logo.png" /> <script> function readimage(file) { var reader = new filereader(); var image = new image(); reader.readasdataurl(file); reader.onload = function(_file) { image.src = _file.target.result; // url.createobjecturl(file); image.onload = function() { var w = this.width, h = this.height, t = file.type, // ext only: // file.type.split('/')[1], n = file.name, s = ~~(file.size/1024) +'kb'; $('#uploadp

Elasticsearch how can I do online re-index without missing newly documents after scan & scoll? -

i don't want elasticsearch taken offline while re-indexing (using scan , scoll api), strategy re-indexing online , in end check if number of documents in new index not less old index. note, did flush after re-index document counts correct. however, re-indexing, new documents added old index. in end of re-index, documents missing (which aren't missing, added after start of re-indexing). i don't dare alias new index official index name @ start of re-index. because, in case there documents missing, newly added documents during re-index in new index. want effect if new index fails, can delete without affecting old index. this won't problem if either diff 2 indices or if retrieve documents added after checkpoint time. i saw post @ diff indices in elasticsearch asks how diff 2 indices no answers that.

winforms - What does Controls.Add() do in c#? -

what code in c# winforms, can give me detailed explanation on how works? controls in statement. controls.add(btn); controls instance of control.controlcollection class, represents collection of control objects, inheritance hierarchy system.windows.forms.control.controlcollection note: the add, remove, , removeat methods enable add , remove individual controls collection. can use addrange or clear methods add or remove controls collection. you can determine if control member of collection passing control contains method. index value of location of control in collection, pass control indexof method. collection can copied array calling copyto method. example of removing control collection using 1 of it's method. // remove radiobutton control if exists. private void removebutton_click(object sender, system.eventargs e) { if(panel1.controls.contains(removebutton)) { panel1.controls.remove(removebutton); } } refer control.controlcollecti

How to refresh a parent from a partialview in ASP.NET MVC? -

i have page shows collection of objects. each item in collection, there "edit" button loads details item in partial view (via jquery.load) in modal. users make changes in partial view , save; happens within partial view via ajax. how make changes show in parent page well? i guess location.reload(true) etc, there has better way?.

Error when adding Tabpages in vb.net -

i having issues adding tab pages tab control. using visual studio 2012. when execute code below 4 tab pages following captions - index 4, index 2, index 3, index 4. 4 tabs. loose frist tab should "index 1" , tab 4 repeated first tab. below code. index = 0 3 itemname = "index " + convert.tostring(index) tabpage.text = itemname frmconsole.tbcmain.tabpages.add(tabpage) next you need make new tabpage each iteration. for index = 1 4 dim tabpage new tabpage tabpage.text = "index " & index.tostring frmconsole.tbcmain.tabpages.add(tabpage) next

SQL Server, cross-apply, and DISTINCT -

i had earlier problem cross apply, solved nicely ( using cross apply ). here part. want 1 newest cardata row (all columns!) cars have new line within 24 hours. assume, first select should distinct carindexes cars have updated events within 24 hours, , second select gives newest row. anyhow dont know put distinct word properly, list of carindexes instead of cardata rows using query: select distinct cd.carindex [dvm_data].[dbo].[cardata] cd cross apply ( select top 1 * [dvm_data].[dbo].[cardata] carindex = cd.carindex order id desc) md cd.datetimeoccurred > (getdate()-1) so, how make distinct , whole rows work?

python - How can I set the width of a QTreeWidgetItem? -

does exist equivalent function of qtreeview.setcolumnwidth() qtreewidgetitem ? qtreewidget inherits qtreeview , can use function of qtreeview in qtreewidget .

asp.net - Chart.js . ASP . Legend Template -

i have looked everywhere answer this. more likely, simple , stupid people wouldn't run it. new using javascript/jquery, , work in .net ... c# , web apps. my question follows. i using chart.js draw donut chart in asp web application. works fine. when go set options legend, not recognize few values, i'm assuming defined in chart.js file. name.tolowercase() segements.length.. ect. . . states "unknown entity" here line: legendtemplate: <%=name.tolowercase()%>-legend\"><% (var i=0; i<segments.length; i++){%><li><span style=\"background-color:<%=segments[i].fillcolor%>\"></span><%if(segments[i].label){%><%=segments[i].label%><%}%></li><%}%></ul>" note : when use standard html file, works fine. i'm assuming it's because of '<%' need escaped or something, due them being used in server-side code-behind. any appreciated. try

Instantiating JSF Managed Bean in Servlet and Passing Request (With Bean) to JSF -

this stupid question, simple answer. have been googling around past week attempting understand this, however, , have come empty. i have simple servlet allows user access article posted user. servlet uses request url determine article get, , follows pattern: http://www.example.com/ servlet / article# by using number in url, fetches article, puts corresponding article object, request-scoped managed bean, , attempts pass request jsf, article.xhtml, responsible rendering article page. despite best efforts, appear unable pass article bean created in servlet jsf page. method pass article follows: //import , package declaration public class articleservlet extends httpservlet { //various methods protected void processrequest(httpservletrequest request, httpservletresponse response) throws servletexception, ioexception { //retrieve article # article article = //create/fetch article using # request.setattribute("article", article);

mysql - Error involving subquery in SQL UPDATE statement -

i'm trying update value of field specific row in mysql i'm getting error don't understand. here have 2 tables customer_tbl , orders_tbl , , want update customer_tbl cust_name customer made order ord_num equal 23e934 'davids market'. here 2 tables: mysql> describe customer_tbl; +--------------+-------------+------+-----+---------+-------+ | field | type | null | key | default | | +--------------+-------------+------+-----+---------+-------+ | cust_id | varchar(10) | no | pri | null | | | cust_name | varchar(30) | no | | null | | | cust_address | varchar(20) | no | | null | | | cust_city | varchar(15) | no | | null | | | cust_state | char(2) | no | | null | | | cust_zip | int(5) | no | | null | | | cust_phone | char(10) | yes | | null | | | cust_fax | varchar(10) | yes | | null | | +--------

r - Why am I not getting the index value of a matrix using the which function? -

i have matrix of thousands of coordinate values. , want find index of chosen value. use this: which(long == -118.1123, arr.ind=true) but don't value. blank row , column. however, when this, values. which(long < -118.1123, arr.ind=true) i know value exists because have manually checked in rstudio pane printed out value using long[1,2] etc. dput(long) doesn't work matrices. hope can help. diagnosis per comments - long[1,1] [1] -118.0981 - long[1,1]==-118.0981 [1] false here's example of using test allows "fuzz-factor" difference ignored: > m <- matrix(rnorm(10) , 5,2) > m [,1] [,2] [1,] -0.2382021 2.1698010 [2,] -1.1617644 -1.1513516 [3,] 1.3597808 0.9365208 [4,] 0.7460694 -1.7216410 [5,] -0.2413117 -0.1780468 > which(m==-0.2382021, arr.ind=true) row col > which(abs(m - -0.2382021) < 0.0000001, arr.ind=true) row col [1,] 1 1 my comment suggesting all.equal didn't work matr

javascript - AJAX Message Clear -

i finishing form user registration, , wanted know how clear messages generated dynamically ajax, when user clears input (backspace). example, let's enter valid input, clear backspaces - code shows valid input message, want switch empty string / no message when happens: if ($namecheckcount < 1) { if (preg_match("/^\w+@[a-za-z_]+?\.[a-za-z]{2,3}$/", $email)) { echo 'this email available.'; exit(); } else { echo 'you entered email invalid format.'; exit(); } } else { echo 'this email taken.'; exit(); } is there way can change above code have clear message if there no input after backspace? secondly, once input validated (i have 1 main html file form, , 3 php files check username, password, , email validity through use of mysql, or in case of passwords, simple string match), can set sort of flag allow user submit? example, code checks email such: function checkemail() { "

c# - DataSet within class is not being refreshed asynchronously? -

tl;dr sorry if question title misleading; it's work in progress try root of issue. i making .single( row => ... ... ) call against .asenumerable( ) extension of datatable throwing exception. looking table, there 2 rows present impossible because, looking @ source table (the 1 on data base datatable should populated), seeing 1 of these rows. in effort narrow down problem, assigning primary key table, generating impossible exception telling me primary key exists within table, should not case table should have been just created. why happening? did read: i'd hoped in course of forming question have come upon solution in 1 of "talking colleague/cardboard cutout aha " moments; not much. there quite bit of code going on here, , explain best able trying accomplish (i apologize, not know precisely of proper terminology trying describe). i working on project component act intermediary between online data base , desktop application. portability primar

java - Maven can't compile using rt.jar -

my project uses sun.security.tools.keytool generate certificate under jdk 1.8 , package can found in rt.jar . according introduction dependency mechanism, system dependencies , can add rt.jar dependency project: <dependency> <groupid>sun.jdk</groupid> <artifactid>rt.jar</artifactid> <version>1.8</version> <scope>system</scope> <systempath>${java.home}/lib/rt.jar</systempath> </dependency> i'm pretty sure maven found jar file. when import sun.security.tools.keytool.main , still generates error. moreover, strange thing if copy rt.jar someplace , fill path in pom.xml , works! switch use original rt.jar , fails! can tell me how happen? i created maven project , added <dependency> of question pom. first got: [error] compilation error : [info] ------------------------------------------------------------- [error] .../so-31353565/src/main/java/igb/so/so31353565.java:[6,34]

When full screen is applied in javaFx the controllers doesnt adjust to the screen -

Image
im doing 1st javafx project using scene builder 2.0. when set fullscreen method true, anchor pane goes full screen controllers inside container doesn't adjust according adjusted pane size. great if point me out have messed up. code have used in main program. public void start(stage stage) throws exception { parent root = fxmlloader.load(getclass().getresource("fxmldocument.fxml")); javafx.geometry.rectangle2d r = screen.getprimary().getbounds(); scene scene = new scene(root,r.getwidth(), r.getheight()); string css = this.getclass().getresource("newcascadestylesheet.css").toexternalform(); stage.setscene(scene); scene.getstylesheets().add(css); stage.show(); } ive set sizes padding , using scene builder options. in advance. i think missing fit parent setting in view. using scenebuilder, suggest try following: in hierarchy view (left side) right-click component , select fit parent . example (taken this aw

Python Program Not Reading in File -

trying create simple program counts number of lines, words, , characters in file. can't seem file read in though, returns name of file , not contents of file. have been passing file name in on command line without quotation marks. print("this program count number of line, words, , characters in file.") user_in = input("please enter file counted: ") infile = open(user_in, "r") lc = 0 wc = 0 w_len = 0 line in infile: usr_list = user_in.split(" ") print(usr_list) lc += 1 x in usr_list: w_len += len(x) wc += 1 #avg = w_len//wc print("there {} lines, {} words, , {} characters in file.".format(lc, wc, w_len)) infile.close() you're doing usr_list = user_in.split(" ") seems like usr_list = line.split(" ")

objective c - How to release or hide UIImageView in iOS? hidden is not working -

my purpose when drag object, small uiimageview shows, when touch ended, uiimageview released. - (ibaction)tlmove:(uipangesturerecognizer *)sender { //add uiimage view show scaled dot uiimageview *scaleupview = [[uiimageview alloc] initwithframe:cgrectmake(200, 30, 100, 100)] ; scaleupview.layer.zposition = 300 ; [scaleupview setimage:self.originimage] ; [self.view addsubview:scaleupview] ; self.topleftpoint.center = [sender locationinview:self.topleftpoint.superview] ; targettl = self.topleftpoint.center ; if (sender.state == uigesturerecognizerstateended || sender.state == uigesturerecognizerstatecancelled || sender.state == uigesturerecognizerstatefailed) { [scaleupview sethidden:yes] ; // not working still shows [scaleupview removefromsuperview] ; //not working still shows } } but not working @ all, tried scaleupview.hidden =yes , still not working. scaleupview show, want deallocated in arc mode, can't release when enabling reference counting. u

javascript - Removing a particular polygon from maps data -

i generating polygons using addgeojson method not sure how can remove particular polygon later when needed. here code var __layers; var layer = new google.maps.data(); $.ajax({ url: url, type: 'post', success:function(data) { __layers = layer.addgeojson(data); layer.setmap(map1); layer.setstyle(style); } }); i trying remove data not working map1.data.remove(__layers[0]); the way _layers has been initialized looks culprit here. may either try layer.setmap(null) or modify code following var __layers = []; var layer = new google.maps.data(); $.ajax({ url: url, type: 'post', success:function(data) { __layers.push(layer.addgeojson(data)); layer.setmap(map1); layer.setstyle(style); } }); and use map1.data.remove(__layers.pop());

dom - document not defined error javascript -

i'm learning javascript , have created html within javascript file test simple function takes in nodes parameters. keep getting 'document not defined' error. need within js file/code define document? i tried things listed here: referenceerror: document not defined (in plain javascript) var div1 = document.createelement("div"); var text1 = document.createtextnode('<div id="one">some<span>node <em>contents</em> for</span>comparison</div>'); div1.appendchild(text1); document.body.appendchild(div1); var div2 = document.createelement("div"); var text2 = document.createtextnode('<div id="two">some<span>node contents for</span>comparison</div>'); div2.appendchild(text2); document.body.appendchild(div2); var div3 = document.createelement("div"); var text3 = document.createtextnode('<div id="one">some<span>node <str

css - Element is not horizontally centered in IE11 with Flexbox when parent has flex-flow: column wrap; -

jsfiddle link .thing { background-color: tomato; max-width: 300px; padding: 30px; display: flex; margin: 0 auto; flex-flow: column wrap; } .not-centered { max-width: 150px; background-color: #fefefe; margin: 0 auto; } <div class="thing"> <div class="not-centered"> im not centeredi in ie11 </div> </div> i supposed work because if max-width , margin: 0 auto set. can see, not horizontally centered because parent .thing has flex-flow: column wrap . any ideas fix in setup? p.s. works in chrome/ff wrapping .not-centered in div block display resolves issue in ie11

c++ - Can we take input in array (a1,a2) in this way? -

suppose if having 2 integer array a1[2] , a2[2] , want take input int a1[2],a2[2]; int i; cout<<"enter values in array a1\n"; for(i=0;i<2;i++) { cin>>a1[i]; // taking input in a1 separatly using loop } cout<<"enter values in array a2\n"; for(i=0;i<2;i++) { cin>>a2[i]; // taking input in a2 separatly using loop } but can minimize using cin statements in code .. for(j=1;j<3;j++) // loop taking input in a(j) array , value of j 1 first time input in array a1 { cout<<"enter values in array a"<<j<<endl; for(i=0;i<2;i++) { cin>>a(j)[i]; // can can take input using loop inside loop } } i don't know should correct question title wants edit question title can do. do mean following? #include <iostream> #include <functional> int main() { const size_t n = 2; int a1[n]; int a2[n]; size_t j = 1; ( auto &

android - ORMLite get Could not get next result for class Error -

i'm using ormlite library in android , error random , dont know whats , how modrate: caused by: java.lang.illegalstateexception: not next result class [ljava.lang.string; @ com.j256.ormlite.stmt.selectiterator.next i error when i'm using method single column : public static list getsinglecolumn(string query) { list<string> columnes = null; try { columnes = g.category.queryraw(query, new rawrowmapper<string>() { @override public string maprow(string[] columnnames, string[] resultcolumns) throws android.database.sqlexception { return resultcolumns[0]; } }).getresults(); } catch (sqlexception e) { e.printstacktrace(); } return columnes; } or code: list unread_messages = g.dbhelper.getsinglecolumn("select sum(read_status) messageslist"); try change method this: public static

ruby on rails - Destroy doesn't destroy -

i've 3 models user formation & achat (let's translate sort of billing ) . a user cand buy formation , create achat . reasons need delete 1 achat . didn't succeed. tried following work-flow check code: irb(main):048:0> u.achats.length => 1 irb(main):049:0> u.achats.first.destroy! (0.1ms) begin (0.1ms) commit => #<achat id: 8, formation_id: 14, created_at: "2015-06-29 16:08:39", nom_formation: "foo", prix: 0.0, quantite: 1, chapitre_id: nil, user_id: 10, taux_commission: 35, updated_at: "2015-06-29 16:08:39", numero_facture: nil, bon_reduction_id: nil> irb(main):050:0> u.achats.length => 1 so isn't deleted database. how should destroy achat ? here (simpler) version of models: # coding: utf-8 class user < activerecord::base rolify :role_cname => 'role' # include default devise modules. others available are: # :confirmable, :lockable, :timeoutable , :omniauthable devis

database - Do transaction in Django make things faster -

i have django application. this django application makes api call twitter , gets 100 recent tweets. need insert tweets database. i have method act on 100 tweets. method has loop create model instance out of each tweet , call instance.save() on each instance separately. i found things slower , thought transactions might make things faster. so outside method added @method_decorator(transaction.atomic) . still have loop created model instance , instance.save() method decorated transaction.atomic. is transaction.atomic supposed make insertions database faster me? will each instance.save() call still issue database call? if makes things faster, how? in atomic transaction, series of database operations either all occur, or nothing occurs. decorating method atomic guarantee atomicity on database block of code within method. if method completed, changes committed database. if there exception, changes rolled back. 1. transactions not make code faster per use ca

implementing pygtk and matplotlib together -

i want write program plot different graphs user input. know how use pygtk , matplotlib. there ways me implement these 2 module create such kind of programs? if not, should use? heard pygtk not common anymore. module popular among all(for writing gui)? you should not use pygtk anymore, newer gtk+-api called pygobject. have tutorials here: gtk3-matplotlib-cookbook and program written same way: a pygobject program

ruby on rails - Display content through ActiveRecord_Association_CollectionProxy -

i have products model 'has_many' relationship microposts. likewise, microposts has 'belongs_to' relationship products. throught relationship want populate row in table available microposts product. can tell association works fine , rows have potential display content, "#micropost::activerecord_associations_collectionproxy:0x007fa5ba8b4d60" displayed instead of actual content. micropost.rb class micropost < activerecord::base belongs_to :product default_scope -> { order(created_at: :desc) } validates :product_id, presence: true validates :content, presence: true end product.rb class product < activerecord::base before_save{ self.name = name.downcase.humanize} before_save{ self.oem = oem.downcase.humanize} validates :ta_code, presence: true, length: { maximum: 4, minimum: 3 } validates :tatr, presence: true, length: { maximum: 4, minimum: 4 }, uniqueness: true validates :name, presence: true validates :oem, presence: true

How can I find a most active users of my Facebook page? -

Image
please, me find active users of facebook fan page. maybe there useful app? i suggest top fan app: http://applodis.com/apps/topfan application determination of active page , group subscribers on facebook. rating based on likes, comments , shares fans on community pages per month, year or chosen period. top fan benefits: increased activity and, consequently, number of active subscribers; opportunity brand applications; fine tuning , blacklist availability; daily rankings update.

io - writing Beautiful Soup output to a file -

okay i'm having issue writing extracted information want file. tested simple print statement , giving exact output want. however. when attempt write information file writes nothing , file shows empty the input wiki file in xml format , list of strings corresponding page titles wish pull out of wiki file. here code, page_titles list ['anarchism','adam , eve', ...] : new_wiki = open('new_wiki.xml', 'w') soup = beautifulsoup(wiki) wiki_page = soup.find_all('page') item in wiki_page: title = item.title.get_text() if title in page_titles: new_wiki.write('\n' % (item)) this might sound silly, did forget new_wiki.close() ?

r - RStudio shows a different $PATH variable -

possible duplicate question, don't know startup process of rstudio tell if problems same. i'm using rstudio desktop v0.99.442 on linux. console inside rstudio, run system("echo $path") /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games however, real $path (which see when echo $path console) has lot of other programs on i'd able call using system() r. example, in .bashrc, have tabix appended $path . the weird thing when run same command r session within console, get system("echo $path") /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:/usr/local/games;/path/to/bcftools-1.2/htslib-1.2.1/tabix which correct. there difference between r session inside rstudio , r session in console. not load same environment variables. how rstudio use correct version of $path? when start r command line , run system(echo $path) , inheriting bash environment command line session. when launch

Android Studio 1.3 RC1 NDK Unable to load native library -

tonight switched ndk application work new android studio 1.3 preview. have 2 devices nexus 5(5.1.1) , motog(4.4.4). when compiled via ndk-build application works on both devices. using gradle build nexus 5 executes correctly on motog exception: 07-11 04:13:58.509 16751-16751/com.mbyan.android e/androidruntime﹕ fatal exception: main process: com.mbyan.android, pid: 16751 java.lang.runtimeexception: unable start activity componentinfo{com.mbyan.android/com.mbyan.android.gl2jniactivity}: java.lang.illegalargumentexception: unable load native library: /data/app-lib/com.mbyan.android-1/libgl2jni.so @ android.app.activitythread.performlaunchactivity(activitythread.java:2198) @ android.app.activitythread.handlelaunchactivity(activitythread.java:2257) @ android.app.activitythread.access$800(activitythread.java:139) @ android.app.activitythread$h.handlemessage(activitythread.java:1210) @ android.os.handler.dispatchmessage(handler.java:102)

java - Apache Commons Math: Stepwise Regression -

i using olsmultiplelinearregression apache commons math in order curve fitting , works pretty , performant. however, way overfit variables included in model. deleting least predictive independent variables not solve problem. question: looking stepwise regression procedure in java or information how implement apache commons math. need pure java solution, cannot use r.

verilog - What are the uses of force - release statements? -

from hardware point of view, force - release statements model? uses of force - release statement? the force/release statements used aid in simulations . one scenario avoid x-propagation in gate simulations. rtl code contains registers without asynchronous resets. although rtl simulations run cleanly, gate simulations not. either x's never resolved, or take many cycles resolve make simulations take impractical amount of time run. forcing , releasing random known value register during reset, simulation allowed proceed cleanly , complete in timely manner. another scenario involves large counters . example, see 32-bit counter roll over, requires 4 billion cycles. typically, want roll on several times in 1 simulation. again, take impractically long time simulate. force/release can used deposit random value counter close roll-over value. another scenario involves boosting code coverage results. can difficult achieve 100% coverage on metrics, when using ip ca

r - Importing long character field with numbers with read.table() -

i try import large data set column representing document number. field contains number leading zeros of 25 digits. tried import data using read.table(), got specific field "1e+19", when assigning "character" class during import. # import elyte colnames<-c("patnr","name","birthday","sex","casenr","bew","art","docnr","date","time","none","na","k","cl","ca","corca") classes <- rep("character",length(colnames)) elyte <- read.table(file="elyte.txt",skip=3,comment.char="",sep="|",col.names=colnames, header=false, colclasses=classes) the original data looks this: 0010000005|weber|19091220|1|0000337340|00000|lab|0000010000000000000011524|20000127|084800||140|3.7|100|2.1| 0010000005|weber|19091220|1|0000337340|00000|lab|0000010000000000000011541|20000127|080200|

html - Bootstrap carousel moves down when in mobile mode when i press the toggle navbar -

in mobile view , when navbar collapses , press on toggle , navbar behaves should carousel moves down along it. there 70px gap between navbar , carousel , used fix adding negative margin-top on carousel goes force, how do naturally? thank you! you can make position of .carousel absolute , tweak top value: .carousel { position: absolute; top: 50px; } you can make top of .navbar-default 0 or doing this: .navbar-default { top: 0; }

php - How to preselect/check a default radio button in yii2 RadioList()? -

i want radio button preselected in form. <?= $form->field($model, 'config')->radiolist(['1'=>'automatic entry',2=>'manual entry']) ->label('barcode/book no generation'); ?> the preselected values taken $model->config . means should set attribute value want preselected : $model->config = '1'; $form->field($model, 'config')->radiolist([ '1' => 'automatic entry', '2' => 'manual entry', ]); the relevant doc in activeform class.

java - generics method for closing resource files -

i have cursors, inputstreams, outputstreams instead of doing .close() each one, call method on them closes them. i tried : private static void closeresource ( object<t> item ) { try { if ( item != null ) { item.close(); } } catch ( exception e ) { throw new runtimeexception( e ); } } it doesn't work.. object not generic. object not generic type can't use object<t> . the object class has no close method defined in it. the generics-oriented solution define generic method type parameter bound closeable interface declares close method: private static <t extends closeable> void closeresource ( t item ) { try { if ( item != null ) { item.close(); } } catch ( exception e ) { throw new runtimeexception( e ); } }

jquery - How is this bootstrap menu showing the drop down on hover? -

i'm having bit of trouble difference between bootstrap theme wordpress , bootstrap theme plain old web pages. the main menu (topmost menu) on wordpress showing perfectly, styled nice , drops down when mouse on it...but on main page it's nightmare , shows on click only. i've compared css , js files both bootstraps , can't find reason why wp 1 showing on hover , allowing me click hover links , regular 1 not. differences between files colours. can please me figure out? wordpress menu: http://www.nextlevelsmf.com/news/ regular menu (only page): http://www.nextlevelsmf.com/testing.html the css styles have selector of class navbar-main not present in menu non wordpress pages. add css: .navbar li.dropdown:hover > ul.dropdown-menu { display: block; -webkit-animation: fadeinup 300ms; -moz-animation: fadeinup 300ms; -ms-animation: fadeinup 300ms; -o-animation: fadeinup 300ms; animation: fadeinup 300ms; } .navbar .dropdown-menu { backgro