I am getting the following error when trying to generate a lift chart for a random forest model being run through rattle: Error in prediction(crs$pr, no.miss) : Number of classes is not equal to 2. ROCR currently supports only evaluation of binary classification tasks. My code is as follows: # Evaluate model performance. # Lift Chart: requires the ROCR package. library(ROCR) # Obtain predictions for the rf model on TBA_jul21c.csv [**train**]. crs$pr <- predict(crs$rf, newdata=na.omit(crs$dataset[crs$sample, c(crs$input, crs$target)]), type="prob")[,2] # Remove observations with missing target.
I have a JTable filled with data about students (student id, name...), and when I select a row from a table, the form opens and its field need to be filled with same values (eg. if Johny Bravo was selected from the table. Then his name should be shown in text filed Name on the form, I did like this txtfieldName.setText(student.getName). My question is how do I set my Radio button automatically (my radio button is Male or Female) when I clicked the field. enter code here tableGuest.addMouseListener(new MouseAdapter() { public void mouseClicked(MouseEvent e) { try{ int row = tableGuest.getSelect
What would be the best data type for storing Integer, Float values altogether in SQL Server. I need to store normal integer and point (float) decimal values in a single column. Ex. ColumnNameValues 15 15.5 12.3 17 19.8
Cenário Estou otimizando uma página onde é exibida cerca de 200 Imagens (muito pequenas não necessita paginar) de parceiros, estas imagens estão envoltas em uma tag <a> e todos os sites dos parceiros abrem em nova aba (target="_blank"). Obs: Vi materiais relacionados no site porem o Javascript usado para responder a pergunta (que também não eram tão semelhantes a esta) era demasiadamente grande o que tiraria toda a economia obtida e necessitariam adaptações ao problema. Pergunta Como posso suprimir o target="_blank" e ainda manter as página abrindo em uma nova aba Código HTML <div id="minor_pa
In my Windows application, there are many screens with grid. I have used a DataTable as data source of the grid, and the DataTable has some really large data sets (> 50,000), which take a lot time to load data onto the screen if we load all at a time while loading the UI get un-responsive till all data not get loaded. I have implemented incremental loading in that grid using a background worker. Here is the code: // DoWork Event of the background Wroker. private void backgroundWorker1_DoWork(object sender, DoWorkEventArgs e) { try { while (bgstop) { e.Result = addNewRecord(); if (Convert.ToBoo
I try get position of click relative to element, but event doesn't have offsetX. onClick(e) { console.log(e.offsetX) // returns undefined console.log(e.target.offsetX) // returns undefined } render() { return <img src='http://placehold.it/1000x500' onClick={this.onClick} /> } How I can get position of click in element?
I'm on Windows Server 2008 R2 Standard (Microsoft Windows Server Version 6.1 Build 7601: Service Pack 1), running IIS 7.5.7600.16385 In IIS Manager for a Site assigned an ApplicationPool with Identity = ApplicationPoolIdentity (the default setting), how do I determine the Windows account the site uses for directory operations? In previous versions of IIS, Application Pools run under the Network Service account. What is default account for ApplicationPoolIdentity? IIS Manager > Server Instance > Application Pools > Application Pool > right-click Set Application Pool Defaults... --OR-- Advanced
I have done the code like this in view page and controller done in codeigniter. While pressing enter key multiple times data saving to the table. How can I solve this problem? View Page <form> <div class="cmt-box"> <textarea class="form-control" name="txtArea" id="txtArea<?php echo $row->id;?>" onkeypress="onTestChange(1)" rows="1"></textarea> </div></form> script function onTestChange(id) { $("#txtArea"+id).keypress(function(e) { if(e.which == 13) { dataString=document.getElementById("txtArea"+id).value; $.ajax({ type: "POST", url: "<?php echo site_url('show/insertcomment'); ?>", data: { comm
This article of the PHP manual uses mysqli_prepare() here but mysqli_stmt_* for everything else. However, in this article of the PHP manual, it uses mysqli_stmt_prepare() What is the difference between these? Can I use either? And if mysqli_prepare() is valid, does that mean mysqli_bind_param() is valid? OK, this article for mysqli_bind_param() says it's an alias for mysql_stmt_bind_param(). I guess it's safe to assume it's the same with mysqli_prepare() and the rest of the mysqli_* functions?
Based on this question I discovered Priceline's Last Minute offers. You need to pay for it in advance though. The process is a bit fuzzy and there are obviously no guarantees. Assuming I "request" a travel for the next week when do I get an answer? Is it possible to cancel my request before I get a result?
I need a to populate textFields dynamically in the web page and I have used listview for this: Form <BenificiaryFormModel> registerForm = new Form<BenificiaryFormModel>("registerForm", Model.of(new BenificiaryFormModel())); ListView listView = new ListView("registerListView", benificiaryRegFieldsList) { @Override protected void populateItem(ListItem item) { LOG.debug("Incrementer value {}", incrementer); BenificiaryRegFieldsBean listViewBean = (BenificiaryRegFieldsBean )item.getModelObject(); item.add(new Label("beneficiaryLabel", listViewBean .getLabel())); item.add(new TextField("beneficiary
Naming variables is quite important and being a non-native English speaker I wonder what the difference would be for using element, item and entry to name things within data structures or variables/parameters.
Given the circumstances I have to use a node list to get at elements that I need to work with. I am able to use .textContent (or .nodeValue) to return a string that I need, but I am having trouble finding a way to get that string into any type of number. I need to have it in number form so I can perform calculations with it. I have tried Number(), parseInt(), etc. All return NaN. I am pretty new to JS so hopefully this is an easy issue to solve. var siteActual = tdNodeListActual[36].textContent; // location of data console.log(siteActual); // returns the value 1 as it should var asd = Number(s
I'm working on a Shopify website, and I need to create a couple of image slideshows (for mobile layout only): (1) One for the product collection (2) One for the thumbnails of the product on the product page itself Anybody have any idea how to accomplish either? Thanks.
Whenever I set the crossorigin attribute on an image Firefox doesn't render the image. <img crossorigin="anonymous"> I'm using fabric.js which sets this attribute for me via JavaScript. I need to be able to render cross origin images. It works fine in Chrome and even IE. It seams as if Firefox previously have had some problems with CORS and I'm not sure if it's related, but I can seem to find any solutions to the problem. Since I am using a PHP proxy I have set the the headers: header("Access-Control-Allow-Origin: *"); This works fine in Chrome and even IE. So do any of you know why the image
Our Confluence database have over 100 tables and it is over 3 GB large. In initial setup the database was created with default characterset (WE8MSWIN1252). But now we want unicode characters to display on Confluence and, so that we want our database characterset to be AL32UTF8. But we don't want to lose any of the data because, it is in production environment. Our confluence 5.7.3 web application is supporting UTF-8 but database does not. How can I converert the Database to AL32UTF8, without loosing any data?
I have a navigation bar set up on my website, I have set up a search bar towards the right of the navigation bar, see code below <nav class="navbar navbar-trans navbar-fixed-top" role="navigation"> <div class="container"> <div class="navbar-header"> <button type="button" class="navbar-toggle" data-toggle="collapse" data-target="#navbar-collapsible"> <span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span> </button> <a class="navbar-brand text-danger" href="index.php">Network TV</a> </div> <div class="navbar-coll
How can I send gzip data as part of body using restclient or postman?. I used apache restclient 3.2.2 also couldn't able to get the response. I have attached images for reference. Basically I have an xml file, want to convert it to gzip first and then send as part of body. To convert to GZip I used online tools to first convert my xml file to gzip and included the converted gzip file as part of body in my restclient. I got following java code and with code I'm getting response properly. But not able to get it working in restclient tool! ! restclient body URL url = new URL(String.format("%s?tid
I want to catch events on link click on node. I know how to set link click on column item, it's like: DATA: ls_layout TYPE lvc_s_layi, lt_layout TYPE lvc_t_layi. ls_layout-fieldname = 'Fieldname from table passing to alv tree'. ls_layout-class = cl_gui_column_tree=>item_class_link. APPEND ls_layout to lt_layout. o_cl_gui_tree->add_node( EXPORTING "other parameters... it_item_layout = lt_layout "other parameters... ). But I don't know how to set link click on node. Could you help me? Thanks.
Is there a way to automatically zip certain files at the build time with Node.js and npm? For example, I have a project, that file structure looks like this: Project/ --lib/ --node_modules/ --test/ --index.js --package.json I want to be able to zip lib folder, certain modules from node_modules and index.js into some zip archive to upload it on the AWS Lambda, for example. I do not need test folder or test Node.js modules (mocha and chai) to be zipped. I have even created a bash script for generating zip file, but is there a way to automatically execute this script, when 'npm install' is called
Some Background: I am trying to setup reverse proxy for my internal business users for site validation when the external route is down. I am able to setup multiple routes with corresponding virtualhosts entries in httpd.conf for port 80 : anonymous user. Am afraid am stuck at SSL route and unable to make progress. I have been to multiple forums but unable to find a response which assists me in moving further. Server Details: Apache version: Apache/2.2.29 (Unix) Linux Version: $ cat /etc/*-release Enterprise Linux Enterprise Linux Server release 5.8 (Carthage) Oracle Linux Server release 5.8 Re
Is there a way to change the gateway address of the AP hot-spot feature of Android from 192.168.43.1 to something else such as 192.168.43.3 without recompiling anything? I have a rooted Android device.
org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mongoTemplate' defined in class com.socketcruiter.config.SpringMongoConfig: Instantiation of bean failed; nested exception is org.springframework.beans.factory.BeanDefinitionStoreException: Factory method [public org.springframework.data.mongodb.core.MongoTemplate org.springframework.data.mongodb.config.AbstractMongoConfiguration.mongoTemplate() throws java.lang.Exception] threw exception; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'mappingMong
I can do the following in bash: declare -A data data[A]="aaa" data[C]="ccc" data[B]="bbb" for i in "${!data[@]}" ; do printf "%-20s ---> %s\n" "$i" "${data[$i]}" done Which outputs: A ---> aaa B ---> bbb C ---> ccc That is, the associative array is reordered (I assume using lexicographic ordering on the keys, but I am not sure), and loses the original order in which I created the data. I wanted instead: A ---> aaa C ---> ccc B ---> bbb In python I would use an OrderedDict instead of a plain dict for that. Is there a similar concept in bash?
I have an user control in AJAX for the date calendar and I want to disable the future dates in the Calendar. I have tried to do it by using the Maximum Value property but that doesn't disables the control. Any suggestions or help? <%@ Control Language="C#" AutoEventWireup="true" CodeFile="usrCtrlDatePicker.ascx.cs" Inherits="UserControls_usrCtrlDatePicker" %> <table cellspacing="0" cellpadding="0" border="0" style="height:18px;"> <tr> <td style="text-align:center; vertical-align:middle; height:16px"> <asp:TextBox ID="txtDateEntry" runat="server" Width="75px" MaxLength="1" style="text-align:jus
I'm currently writing a script to batch compress a bunch of .tif files in python, however some of them are already compressed and some of them aren't. If you go into the properties of a .tif file you can see what compression, if any, is already applied to the file. How can I check this metadata so I can apply some if/then logic in my script to determine whether a .tif file is compressed?
I started to setup spring project by following this spring-boot article. But suddenly application could not start successfully, instead I am getting the following stack trace: Exception in thread "main" org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration: Invocation of init method failed; nested exception is org.springframework.dao.InvalidDataAccessApiUsageException: ERR Unsupported CONFIG parameter: no
While executing teradata query in proc sql (SAS), I am getting this error ERROR: Teradata row not delivered (trget): Numeric overflow occurred during computation. I am using SAS EG 9.3. I tried increasing the spool space and I tried with mode=teradat The query is large and has a lot of sum, max and count functions. Can anybody tell me how to troubleshoot this?