Datasets:
title stringlengths 10 150 | body stringlengths 17 64.2k | label int64 0 3 |
|---|---|---|
Parsing json directly using input stream | <p>I am doing a api call and in response i am getting json. So for that I want to parse it directly through input stream so that there would not be need of storing it in memory.
For this I am trying to use JSONReader but that i am unable use for api's less than 11.
So i dont know how to proceed with. I want it to be d... | 0 |
ZXing convert Bitmap to BinaryBitmap | <p>I am using OpenCV and Zxing, and I'd like to add 2d code scanning. I have a few types of images that I could send. Probably the best is Bitmat (the other option is OpenCV Mat).</p>
<p>It looks like you used to be able to convert like this:</p>
<pre><code>Bitmap frame = //this is the frame coming in
LuminanceSourc... | 0 |
Bundle ID in android | <p>What is meant by <strong>bundle ID</strong> in android, What is its usage, And can two android apps have same bundle ID? if YES then why? and if NO then why</p> | 0 |
"sdkmanager: command not found" after installing Android SDK | <p>I installed via <code>apt-get install android-sdk</code>.</p>
<p>However, doing a <code>find / -name sdkmanager</code> reveals there is no such binary anywhere on the system.</p>
<p>On my Mac, the binary exists in <code>$ANDROID_HOME/tools/bin</code>.</p>
<p>However, on the Ubuntu system (the system with the issu... | 0 |
Switch Case in c++ | <p>How can I compare an array of char in c++ using switch-case?
Here is a part of my code:</p>
<pre><code>char[256] buff;
switch(buff){
case "Name": printf("%s",buff);
break;
case "Number": printf("Number "%s",buff);
break;
defaul : break
}
</code></pre>
<p>I receive the error :" error: sw... | 0 |
Adding new property to each document in a large collection | <p>Using the mongodb shell, I'm trying to add a new property to each document in a large collection. The collection (Listing) has an existing property called Address. I'm simply trying to add a new property called LowerCaseAddress which can be used for searching so that I don't need to use a case-insensitive regex for ... | 0 |
How to create dialog which will be full in horizontal dimension | <p>When I use in layout, which specifies this dialog <code>android:layout_width="match_parent"</code> I get this dialog:</p>
<p><img src="https://i.stack.imgur.com/UzjUR.png" alt="small dialog"></p>
<p>I need dialog which will be wider. Any ideas?</p> | 0 |
Kotlin 2d Array initialization | <p>Please take a look at my 2D-Array-Initialization. The code works.</p>
<pre><code>class World(val size_x: Int = 256, val size_y: Int = 256) {
var worldTiles = Array(size_x, { Array(size_y, { WorldTile() }) })
fun generate() {
for( x in 0..size_x-1 ) {
for( y in 0..size_y-1 ) {
w... | 0 |
Oracle 11g - query appears to cache even with NOCACHE hint | <p>I'm doing some database benchmarking in Python using the cx_Oracle module. To benchmark results, I'm running 150 unique queries and timing the execution of each one. I'm running something like this:</p>
<pre><code>c = connection.cursor()
starttime = time.time()
c.execute('SELECT /*+ NOCACHE */ COUNT (*) AS ROWCOUNT... | 0 |
Gradle: Project "x" not found in root project "myProject" | <p>Having upgraded to Android Studio from Eclipse I wanted to update my TouchDB library which is now <a href="https://github.com/couchbase/couchbase-lite-android" rel="nofollow">Coubasebase-lite-android</a>. I removed TouchDB from my project, git cloned couchbase-lite-android added to my project in Android Studio via F... | 0 |
Permanently Delete Empty Rows Apache POI using JAVA in Excel Sheet | <p>I'd like to permanently delete those rows that are empty have no data of any type! I am doing this like:</p>
<pre><code> private void shift(File f){
File F=f;
HSSFWorkbook wb = null;
HSSFSheet sheet=null;
try{
FileInputStream is=new FileInputStream(F);
wb= new HSSFWorkbook(is);
sheet = ... | 0 |
How to get IP Address of Docker Desktop VM? | <p>I'm in a team where some of us use docker toolbox and some user docker desktop. We're writing an application that needs to communicate to a docker container in development. </p>
<p>On docker toolbox, I know the docker-machine env command sets the docker host environment variable and I can use that to get the ip of ... | 0 |
Getting application version from within application | <p>Is there a simple way of obtaining the application version information from the resource file at runtime? </p>
<p>Effectively what I'd like to do is be able to have a "Version X.Y.Z" displayed at runtime without having a separate variable somewhere that I'd have to keep in sync with my ProductVersion and FileVersio... | 0 |
Trigger control's event programmatically | <p>Assume that I have a WinFoms project. There is just one button (e.g. <code>button1</code>). </p>
<p>The question is: is it possible to trigger the <code>ButtonClicked</code> event via code without really clicking it?</p> | 0 |
How to change width and height of Button in Android | <pre><code><Button android:text="Layer 1"
android:layout_width="wrap_content"
android:id="@+id/button1"
android:layout_height="wrap_content"
android:layout_alignParentTop="true"
android:layout_alignParentLeft="true"
android:layout_marginLeft="10dp"
andro... | 0 |
Android MediaPlayer error -1004 (ERROR_IO) | <p>My application plays audio stream<br>
Here the code: </p>
<pre><code>MediaPlayer mediaPlayer = new MediaPlayer();
mediaPlayer.setAudioStreamType(AudioManager.STREAM_MUSIC);
mediaPlayer.setDataSource(url);
mediaPlayer.prepare();
mediaPlayer.start();
</code></pre>
<p>url is local file (127.0.0.1)<br>
I use... | 0 |
How to hex edit an exe file safely? | <p>I am working on a small puzzle/wargame which involves coding <strong>Windows Forms in C#</strong>.. </p>
<p>To get to a certain level I need a password which is stored in an exe. The same exe allows me send that password to a default person which is stored in a <strong>variable</strong>. The password sending is acc... | 0 |
Docker: How to fix "Job for docker.service failed because the control process exited with error code" | <p>I'm trying to use docker in Manjaro (my kernel version is 4.19) and it is not working.</p>
<p>After running <code>sudo pamac install docker</code> I run <code>sudo systemctl start docker.service</code> and receive this message:</p>
<pre><code>Job for docker.service failed because the control process exited with er... | 0 |
FragmentTransaction.replace() not working | <p>I have a <code>ListFragment</code> displaying a list of items that created by the user. I have a <code>ListView</code> with it's id set to "@android:id/list" and a <code>TextView</code> with the id "@android:id/empty". </p>
<p>I have an action bar button to display a fragment to allow the user to create more entri... | 0 |
open source image filter library like Instagram? | <p>I am developing an application(android) that want to do some image filter effect like in Instagram, just wondering if there is any open source library available?</p> | 0 |
How to use sed to remove the last n lines of a file | <p>I want to remove some <em>n</em> lines from the end of a file. Can this be done using sed?</p>
<p>For example, to remove lines from 2 to 4, I can use</p>
<pre><code>$ sed '2,4d' file
</code></pre>
<p>But I don't know the line numbers. I can delete the last line using </p>
<pre><code>$sed $d file
</code></pre>
... | 0 |
sSMTP no longer works - 'Invalid response: 501 5.5.4 HELO/EHLO argument MYEMAILADDRESS@gmail.com invalid, closing connection.' | <p>As the title/tags say, I run sSMTP on Linux for a PHP server.</p>
<p>Whenever I try to send an email, I get these errors (that do not show up in PHP, only in the logs/ 'sudo service sendmail status' or 'sudo service php5-fpm status')</p>
<p>From /var/log/mail.log</p>
<pre><code>Mar 31 03:34:34 ip-172-31-22-38 sSM... | 0 |
NuGet Package Restore Not Working on Build Server | <p>I have set up NuGet Package Restore on my solution and it works nicely on my local machine. I followed the instructions supplied here:</p>
<p><a href="http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages">http://docs.nuget.org/docs/workflows/using-nuget-without-committing-packages</a></p>
<... | 0 |
Setting text color in ComboBoxItem | <p>I want to set the text color for <em><code>PASS</code></em> as <code>GREEN</code> and the text color for <em><code>FAIL</code></em> as <code>RED</code>. I can't seem to find the solution. I need to do this in pure XAML.</p>
<pre><code><ComboBox x:Name="LocatedCorrectly" Width="100"
Height="25" Grid.Co... | 0 |
R - Extract summary table from Survfit with Strata | <p>I'm new to R and survival analysis, and I am interested to export into a dataframe the results from survfit where there is strata. </p>
<p>This site has provided an excellent solution but not to one with strata (<a href="https://stat.ethz.ch/pipermail/r-help/2014-October/422348.html" rel="noreferrer">https://stat.e... | 0 |
How to remove the cause of an unexpected indentation warning when generating code documentation? | <p>The documentation code with the problem is at the beginning of a method:</p>
<pre><code>"""
Gtk.EventBox::button-release-event signal handler.
:param widget: The clicked widget (The Gtk.EventBox).
:param event: Gdk.EventButton object with information regarding
the event.
:param user_data: The Gtk.LinkButton ... | 0 |
C# .net Make checkboxes to behave as a radio button | <p>I have a group box which has some radio buttons. I am trying to implement serialization with the help of a tutorial from Code Project. That tutorial supports serialization of checkboxes and not radio buttons. So i need to make the radio buttons in my app as checkboxes (that is they should be check boxes but work lik... | 0 |
Singleton pattern with combination of lazy loading and thread safety | <p>I was doing some research about singletons, specifically regarding lazy vs eager initialization of singletons.</p>
<p>An example of eager initialization:</p>
<pre><code>public class Singleton
{
//initialzed during class loading
private static final Singleton INSTANCE = new Singleton();
//to prevent cr... | 0 |
How to solve the error: assignment to expression with array type | <p>I am asked to create a <code>carinfo</code> structure and a <code>createcarinfo()</code> function in order to make a database. But when trying to allocate memory for the arrays of the brand and model of the car, the terminal points out two errors. </p>
<p>For: </p>
<pre><code>newCar->brand =(char*)malloc(sizeof... | 0 |
Is it possible to pass parameters to a .dtsx package on the command line? | <p>I am currently executing an SSIS package (package.dtsx) from the command line using <code>Dtexec</code>.
This is as simple as:</p>
<pre><code>dtexec /f Package.dtsx
</code></pre>
<p>However, I have some parameters that I would like to pass to the package for it to use during execution. The documentation implies th... | 0 |
How to assign a new class attribute via __dict__? | <p>I want to assign a class attribute via a string object - but how?</p>
<p>Example:</p>
<pre><code>class test(object):
pass
a = test()
test.value = 5
a.value
# -> 5
test.__dict__['value']
# -> 5
# BUT:
attr_name = 'next_value'
test.__dict__[attr_name] = 10
# -> 'dictproxy' object does not support item ... | 0 |
(Rails) What is "RJS"? | <p>I've seen "RJS" and "RJS templates" mentioned in passing in blog posts and tutorials. I did a search, but I'm still unsure about it. Is it a technology specific to Rails, rather than a standard like JSON or YAML?</p>
<p>I understand it's used for "generating JavaScript." Does it generate generic JS or Rails-specifi... | 0 |
Static constructor equivalent in Objective-C? | <p>I'm new to Objective C and I haven't been able to find out if there is the equivalent of a static constructor in the language, that is a static method in a class that will automatically be called before the first instance of such class is instantiated. Or do I need to call the Initialization code myself?</p>
<p>Tha... | 0 |
Effect of NOLOCK hint in SELECT statements | <p>I guess the real question is: </p>
<p>If I don't care about dirty reads, will adding the <strong>with (NOLOCK)</strong> hint to a SELECT statement affect the performance of:</p>
<ol>
<li>the current SELECT statement </li>
<li>other transactions against the given table</li>
</ol>
<p>Example:</p>
<pre><code>Sele... | 0 |
Since SQL Server doesn't have packages, what do programmers do to get around it? | <p>I have a SQL Server database that has a huge proliferation of stored procedures. Large numbers of stored procedures are not a problem in my Oracle databases because of the Oracle "package" feature.</p>
<p>What do programmers do to get around the lack of a "package" feature like that of Oracle?</p> | 0 |
Stop Excel from automatically converting certain text values to dates | <p>Does anyone happen to know if there is a token I can add to my csv for a certain field so Excel doesn't try to convert it to a date?</p>
<p>I'm trying to write a .csv file from my application and one of the values happens to look enough like a date that Excel is automatically converting it from text to a date. I'v... | 0 |
SUM() based on a different condition to the SELECT | <p>Hi is there a way that I can do the SUM(total_points) based on a different condition to the rest of the SELECT statement, so I want the SUM(total_points) for every row which is <= to $chosentrack? but the rest of the conditions of the SELECT statement to be what they are below. I need them to all be returned toge... | 0 |
An efficient way of making a large random bytearray | <p>I need to create a large bytearry of a specific size but the size is not known prior to run time. The bytes need to be fairly random. The bytearray size may be as small as a few KBs but as large as a several MB. I do not want to iterate byte-by-byte. This is too slow -- I need performance similar to numpy.random... | 0 |
How to get rid of zeros in the section numbering in LATEX report document class? | <p>So I'm writing a report using Latex and the document class I am using is report:
\documentclass[a4paper]{report}</p>
<p>But for some reason the section numbering is written so that it is preceded with "0.", for example it looks like:</p>
<pre><code>0.1 Introduction
0.2 Theory
0.3 Experimental Method
</co... | 0 |
Submit form to action php file | <p>I have a form where when the user clicks submit, I need a php file to be ran. below is the form and the php file.</p>
<pre><code><form action="php_scripts/test.php" method="POST">
<input name="feature" type = "text" placeholder="Feature" />
<input name="feature2" type = ... | 0 |
Pattern matching string prefixes in Haskell | <p>Let's say I want to make a special case for a function that matches strings that start with the character 'Z'. I could easily do it using pattern matching by doing something like the following:</p>
<pre><code>myfunc ('Z' : restOfString) = -- do something special
myfunc s = -- do the default case here
</code></pre>
... | 0 |
What is the best way to manage configuration data | <p>I am working on a product suite which has 4 products. Right now, all of the configuration data is either in the XML or properties files.This approach is not maintainable as we have to manage different configuration file for different environment(for e.g. Production, Development etc).</p>
<p>So, <strong>what is the ... | 0 |
What is a good 64bit hash function in Java for textual strings? | <p>I'm looking for a hash function that:</p>
<ol>
<li>Hashes <strong>textual strings</strong> well (e.g. few collisions)</li>
<li>Is written in Java, and widely used</li>
<li>Bonus: works on several fields (instead of me concatenating them and applying the hash on the concatenated string)</li>
<li>Bonus: Has a 128-bit... | 0 |
HTTP debugging proxy for Linux and Mac | <p>I use the <a href="http://www.fiddler2.com/fiddler2/" rel="noreferrer">Fiddler</a> proxy to debug all kinds of HTTP issues on Windows. It's great for inspecting headers and responses across multiple pages.</p>
<p>Is there a good HTTP debugging proxy for Mac and Linux? I found <a href="http://www.charlesproxy.com/" ... | 0 |
SPARQL query to get all class label with namespace prefix defined | <p>I want to get all class that stored in sesame repository. </p>
<p>This is my query</p>
<pre><code>SELECT ?class ?classLabel
WHERE {
?class rdf:type rdfs:Class.
?class rdfs:label ?classLabel.
}
</code></pre>
<p>It's return all URI of class with label. For example, </p>
<pre><code>"http://example.com/A_Class" "A_C... | 0 |
Accept a word then print every letter of that word on new line in java? | <p>I need to write a program in Java that will accept a string/word then print every letter of that word on a new line. For example, the machine accepts <code>zip</code> then outputs:</p>
<pre><code>Z
I
P
</code></pre>
<p>How do you do this in java? Any simple method or way of doing this would be appreciated.</p>
<p... | 0 |
Using Distinct with Linq to SQL | <p>How would this query be changed from sql to linq?</p>
<pre><code>category
select distinct prodCategory from table4
subcategory
SELECT distinct [prodSubCat] FROM [table4] WHERE ([prodCategory] = @prodCategory)
prodCategory prodSubCat
-------------------------------------
Home Cassette Receiver
Home ... | 0 |
"img" must be terminated by the matching end-tag | <p>When parsing some an XSL XML file using docx4j, I keep receiving this error: </p>
<blockquote>
<p>'The element type "img" must be terminated by the matching end-tag <code>"</img>"</code>. Exception Error in Docx4JException'</p>
</blockquote>
<p>I have tried all sorts of combinations to solve the issue but ... | 0 |
cmake is not working in opencv c++ project | <p>I need your help !
I have this C++ code in this link </p>
<p>[link] <a href="https://github.com/royshil/FoodcamClassifier" rel="noreferrer">https://github.com/royshil/FoodcamClassifier</a></p>
<p>and I've been trying since two days to compaile it , and I've failed
they say that I have to use cmake , I've tried the... | 0 |
PCL: Visualize a point cloud | <p>I'm trying to visualize a point cloud using <a href="http://pointclouds.org/" rel="nofollow noreferrer">PCL</a> CloudViewer. The problem is that I'm quite new to C++ and I have found two tutorials <a href="https://pcl.readthedocs.io/projects/tutorials/en/latest/writing_pcd.html#writing-pcd" rel="nofollow noreferrer"... | 0 |
SQLite: group_concat() multiple columns | <p>I has a problem:</p>
<p>In my SQLite (sqlite3 on android) database I have a table like so</p>
<pre><code>company | name | job
--------------------------
1 | 'Peter' | 'Manager'
1 | 'Jim' | (null)
2 | 'John' | 'CEO'
2 | 'Alex' | 'Developer'
3 | 'Lisa' | (null)
</code></pr... | 0 |
Hangfire recurring job daily on specific time | <p>I am trying to run hangfire recurring job daily on 9.00 AM. Here is what I want to do-</p>
<pre><code>RecurringJob.AddOrUpdate(() => MyMethod(), "* 9 * * *");
</code></pre>
<p>Where should I put this line of code?</p>
<p>Sorry if this is a foolish question.</p> | 0 |
Exclude file from "git diff" | <p>I am trying to exclude a file (<code>db/irrelevant.php</code>) from a Git diff. I have tried putting a file in the <code>db</code> subdirectory called <code>.gitattributes</code> with the line <code>irrelevant.php -diff</code>
and I have also tried creating a file called <code>.git/info/attributes</code> containing ... | 0 |
Xampp : server certificate does NOT include an ID which matches the server name | <p>I had both apache and mysql ok and running in xampp control panel. But then when i tried to load one of my php pages i was getting a fatal error : </p>
<pre><code>Call to undefined function mysql_connect().
</code></pre>
<p>Upon searching about this error i came across some answers. Mostly people suggested in the... | 0 |
How does setMaxResults(N) in Hibernate work? | <p>I am using MS SQL server 2008 with Hibernate. the question I have is how Hibernate implements <code>setMaxResults</code></p>
<p>Take the following simple scenario. </p>
<p>If I have a query that returns 100 rows and if I pass 1 to <code>setMaxResults</code>, will this affect the returned result from the SQL server... | 0 |
<GoogleMaps/GoogleMaps.h> file not found Google Maps SDK for iOS | <p>Yesterday I recived an email from google saying that I could acces to the map api for ios, I generated my key from the app console and I follow the steps of <a href="https://developers.google.com/maps/documentation/ios/start" rel="noreferrer">https://developers.google.com/maps/documentation/ios/start</a> but xcode t... | 0 |
Finding out the version of git on remote server | <p>I am looking for the git command on my local machine which i can run to find out the version of git running on the remote server?
If this is even possible.</p> | 0 |
How to rotate an image using Flutter AnimationController and Transform? | <p>I have star png image and I need to rotate the star using Flutter AnimationController and Transformer. I couldn't find any documents or example for image rotation animation. </p>
<p>Any idea How to rotate an image using Flutter AnimationController and Transform?</p>
<p>UPDATE:</p>
<pre><code>class _MyHomePageStat... | 0 |
Amazon WorkSpaces client "unable to connect" error message after login screen | <p>WorkSpaces client is showing the above error message after giving credentials in loginscreen and clicking on login.</p>
<pre><code>Amazon WorkSpaces
Unable to connect
We couldn't launch your WorkSpace. Please try again.
If you need help, contact your administrator.
</code></pre> | 0 |
cannot unpack non-iterable object / iteraing through array of objects in python | <p>I want to iterate through all objects in an array of URL objects I've got </p>
<pre><code>class Url(object):
pass
a = Url()
a.url = 'http://www.heroku.com'
a.result = 0
b = Url()
b.url = 'http://www.google.com'
b.result = 0
c = Url()
c.url = 'http://www.wordpress.com'
c.result = 0
urls = [a, b, c]
for i, u i... | 0 |
Nothing to commit, working tree clean after calling git checkout | <p>I tried to delete my last commit. I thought that <code>git checkout</code> followed by the hash of the <code>commit</code> would replace my current code with the code of the <code>commit</code>. This didn't work and I get now a message which says <code>Nothing to commit, working tree clean</code>. How can I get rid ... | 0 |
how to call href in Link Button in asp.net | <p>How to call href tag in Link Button</p>
<p>Suppose </p>
<pre><code> <asp:LinkButton ID="lnkViewAll" CssClass="button" runat="server" >
<span>View All</span>
</asp:LinkButton>
</code></pre>
<p>then How to Call The... | 0 |
Searching for HTML elements in Chrome DevTools | <p>On this website, there's a <code>div</code> with the attribute <code>class="item"</code>. When I clicked <kbd>F12</kbd> to bring up the Developer Tools. I pressed <kbd>Ctrl</kbd> + <kbd>F</kbd> and typed in <code>class="item"</code> and no results came back. I also tried <kbd>Ctrl</kbd> + <kbd>Shift</kbd> + <kbd>F</... | 0 |
Protect PDF docs from being directly accessed in URL | <p>I want to protect a pdf file from being directly linked but instead have my logged in users be able to access it. I have a link which currently goes to a javascript function which posts a form:
$('nameofdoc').setProperty('value',doc);
document.getElementById('sendme').submit();</p>
<p>where sendme is the... | 0 |
'CSV does not exist' - Pandas DataFrame | <p>I'm having difficulty reading a csv file into the pandas data frame. I am a total newcomer to pandas, and this is preventing me from progressing. I have read the documentation and searched for solutions, but I am unable to proceed. I have tried the following to no avail...</p>
<pre><code>import pandas as pd
import ... | 0 |
Curl authorization | <p>I have spring security with https settings.</p>
<p>I'm seeing an unexpected behavior when trying to run curl GET on a URL in a secure way.</p>
<p>When curl first sends a request to the server, it does it with no authorization data (why? I specifically added it). Then, the server reply with Authentication Error (40... | 0 |
Springboot could not extract ResultSet | <p>Currently I am getting a problem with fetching mysql data for my springboot project:</p>
<p>There was an unexpected error (type=Internal Server Error, status=500).
could not extract ResultSet; SQL [n/a]; nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet</p>
<p><strong>Tes... | 0 |
Add http(s) to URL if it's not there? | <p>I'm using this regex in my model to validate an URL submitted by the user. I don't want to force the user to type the http part, but would like to add it myself if it's not there.</p>
<pre><code>validates :url, :format => { :with => /^((http|https):\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+).[a-z]{2,5}(:[0-9]{1,5})?(\/... | 0 |
merge two arrays (keys and values) into an object | <p>Is there a common Javascript/Coffeescript-specific idiom I can use to accomplish this? Mainly out of curiosity.</p>
<p>I have two arrays, one consisting of the desired keys and the other one consisting of the desired values, and I want to merge this in to an object.</p>
<pre><code>keys = ['one', 'two', 'three']
va... | 0 |
LINQ to find the closest number that is greater / less than an input | <p>Suppose I have this number list:</p>
<pre><code>List<int> = new List<int>(){3,5,8,11,12,13,14,21}
</code></pre>
<p>Suppose that I want to get the closest number that is less than 11, it would be 8
Suppose that I want to get the closest number that is greater than 13 that would be 14.</p>
<p>The number... | 0 |
OpenCV Kalman Filter python | <p>Can anyone provide me a sample code or some sort of example of Kalman filter implementation in python 2.7 and openCV 2.4.13 </p>
<p>I want to implement it in a video to track a person but, I don't have any reference to learn and I couldn't find any python examples.</p>
<p>I know Kalman Filter exists in openCV as c... | 0 |
Disable editing in a JTextPane while allowing visible cursor movement | <p>I have a <code>JTextPane</code> which is populated by reading from a file, after which the data is parsed and formatted. The user is not allowed to edit the <code>JTextPane</code>, but I want them to be able to navigate in it with a visible cursor.</p>
<p>If I use <code>setEditable(false)</code>, the cursor is inv... | 0 |
Codeigniter, Call SweetAlert in Controller | <p>I have searching in various webpages, but no one has clear or solve my problem... I come with the expertes, because i need your help... :(</p>
<p>This is my User Controller Method</p>
<pre><code><?php
defined('BASEPATH') OR exit('No direct script access allowed');
class UserController extends CI_Controller {
... | 0 |
NLTK tokenize - faster way? | <p>I have a method that takes in a String parameter, and uses NLTK to break the String down to sentences, then into words. Afterwards, it converts each word into lowercase, and finally creates a dictionary of the frequency of each word.</p>
<pre><code>import nltk
from collections import Counter
def freq(string):
... | 0 |
ComboBox DataBinding causes ArgumentException | <p><br>
I several objects of class:</p>
<pre><code>class Person
{
public string Name { get; set; }
public string Sex { get; set; }
public int Age { get; set; }
public override string ToString()
{
return Name + "; " + Sex + "; " + Age;
}
}
</code></pre>
<p>and a class that has a proper... | 0 |
Java Extracting values from text files | <p>I have many text files (up to 20) and each file has it's contents like this </p>
<pre><code>21.0|11|1/1/1997
13.3|12|2/1/1997
14.6|9|3/1/1997
</code></pre>
<p>and every file has approximately more than 300 lines.</p>
<p>so the problem I'm facing is this, how can I extract all and only the first values
of the fil... | 0 |
printf raw data -- get printf or print to NOT send characters | <p>I have a Xilinx Virtex-II Pro FPGA board that is attached via RS232 to an iRobot Create.</p>
<p>The iRobot takes a stream of byte integers as commands.</p>
<p>I've found that printf will actually send over the serial port (Hypterminal is able to pick up whatever I print), and I figure that I can use printf to send... | 0 |
AWS Glue Crawler - Reading a gzip file of csv | <p>Can you please help me with reading a tar.gz file using Glue Data crawler please? I have a tar.gz file which contains couple of files in different schema in my S3, and when I try to run a crawler, I don't see the schema in the data catalogue. Should we use any custom classifiers? The AWS Glue FAQ specifies that gzi... | 0 |
Local Temporary table in Oracle 10 (for the scope of Stored Procedure) | <p>I am new to oracle. I need to process large amount of data in stored proc. I am considering using Temporary tables. I am using connection pooling and the application is multi-threaded. </p>
<p>Is there a way to create temporary tables in a way that different table instances are created for every call to the stored ... | 0 |
What is the difference between wsHttpBinding and ws2007HttpBinding? | <p>On the MSDN we can read :</p>
<blockquote>
<p>The WS2007HttpBinding class adds a system-provided binding similar to WSHttpBinding but uses the Organization for the Advancement of Structured Information Standards (OASIS) standard versions of the ReliableSession, Security, and TransactionFlow protocols. No changes ... | 0 |
What is best practice for serializing Java enums to XML? | <p>Hi I have a Java enum and I want serialize a variable containing an enum value back and forth from XML for persistence. My enum is defined like this...</p>
<pre><code>public enum e_Type
{
e_Unknown,
e_Categoric,
e_Numeric
}
</code></pre>
<p>My variable is declared like this...</p>
<pre><code>private ... | 0 |
How would I use ON DUPLICATE KEY UPDATE in my CodeIgniter model? | <p>I have a CodeIgniter/PHP Model and I want to insert some data into the database.</p>
<p>However, I have this set in my 'raw' SQL query:</p>
<pre><code>ON DUPLICATE KEY UPDATE duplicate=duplicate+1
</code></pre>
<p>I am using CodeIgniter and am converting all my previous in-controller SQL queries to <strong>Active... | 0 |
How to load ~/.bash_profile when entering bash from within zsh? | <p>I've used bash for two years, and just tried to switch to zsh shell on my OS X via homebrew. And I set my default (login) shell to zsh, and I confirmed it's set properly by seeing that when I launch my Terminal, it's zsh shell that is used in default.</p>
<p>However, when I try to enter bash shell from within zsh, ... | 0 |
PHP iMagick image compression | <p>I'm fairly new to iMagick and have only found very limited documentation on the PHP library. I'm happily resizing images and writing them back to the hard drive, but I'm failing completely to compress the images using JPG for instance.</p>
<p>This is the code I'm using so far:</p>
<pre><code>function scale_image($s... | 0 |
How to get all the variables of a groovy object or class? | <p>To see list of methods in a class I can do this - </p>
<pre><code>String.methods.each {println it}
</code></pre>
<p>How do I list all the variables of an instance or all the static variables of a class?</p>
<p><strong>Edit1:</strong></p>
<p><img src="https://i.stack.imgur.com/hWDJJ.png" alt="enter image descript... | 0 |
Using Google Guice to inject java properties | <p>I want to use google guice to make properties available in all classes of my application. I defined a Module which loads and binds the properties file <em>Test.properties</em>.</p>
<pre><code>Property1=TEST
Property2=25
</code></pre>
<p>package com.test;</p>
<pre><code>import java.io.FileNotFoundException;
import... | 0 |
List all websites in IIS c# | <p>Is there a way to list all active websites that exist within IIS using c#?</p>
<p>Thanks</p>
<p>Sp</p> | 0 |
Is there a data structure like the Java Set in JavaScript? | <p>I want to use a data structure in JavaScript that can be used to store number of IDs. I should be able to check if a key already exists in that set, something like Java Sets.</p>
<p>I want to achive same behaviours as follows (this code is in Java):</p>
<pre><code>Set<String> st = new HashSet<String>()... | 0 |
How can I always round up decimal values to the nearest integer value? | <p>On a report I have the following code for a field:</p>
<pre><code>=Sum([PartQty]*[ModuleQty])
</code></pre>
<p>Example results are <code>2.1</code> and <code>2.6</code>. What I need is for these value to round up to the value of <code>3</code>. How can I change my field code to always round up the results of my ... | 0 |
HTML5 Audio stop function | <p>I am playing a small audio clip on click of each link in my navigation</p>
<p>HTML Code:</p>
<pre><code><audio tabindex="0" id="beep-one" controls preload="auto" >
<source src="audio/Output 1-2.mp3">
<source src="audio/Output 1-2.ogg">
</audio>
</code></pre>
<p>JS code:</p>
<pre><... | 0 |
Prevent p:inputNumber adding a decimal point and 2 zeros when not explicitly entered? | <p>need help with primefaces input number</p>
<pre><code><p:inputNumber id="test" value="#{test}" thousandSeparator=""/>
</code></pre>
<p>If my input is like this:</p>
<pre><code>100
</code></pre>
<p>The number field adds a decimal point and 2 zeros like this:</p>
<pre><code>100.00
</code></pre>
<p>Is there... | 0 |
experimental_list_devices attribute missing in tensorflow_core._api.v2.config | <p>Am using tensorflow 2.1 on Windows 10. On running</p>
<pre><code>model.add(Conv3D(16, (22, 5, 5), strides=(1, 2, 2), padding='valid',activation='relu',data_format= "channels_first", input_shape=input_shape))
</code></pre>
<p>on spyder, I get the this error:</p>
<pre><code>{ AttributeError: module 'tensorf... | 0 |
Redux Toolkit and Axios | <p>I'm using Redux Toolkit to connect to an API with Axios.
I'm using the following code:</p>
<pre><code>const products = createSlice({
name: "products",
initialState: {
products[]
},
reducers: {
reducer2: state => {
axios
.get('myurl')
.th... | 0 |
Spring Rest Controller find by id/ids methods | <p>I have the following method in my Spring RestController:</p>
<pre><code>@RequestMapping(value = "/{decisionId}", method = RequestMethod.GET)
public DecisionResponse findById(@PathVariable @NotNull @DecimalMin("0") Long decisionId) {
....
}
</code></pre>
<p>Right now I need to add the possibility to find a set ... | 0 |
remote: Forbidden fatal: unable to access | <p>I have access to repo, I clone it by https, then I made my changes and I commit those change and create <code>new_branch</code> and try to push I got this:</p>
<pre><code>git push origin new_branch
remote: Forbidden
fatal: unable to access 'https://username@bitbucket.org/main-account/repo.git/': The requested URL r... | 0 |
sencha touch :: adding a background-image to a Panel | <p>I try to add an image to the background of a panel. the image comes from loaded data.
i tried the following code, which did not work:</p>
<pre><code>var topPanel = new Ext.Panel({
flex:1,
title:'topPanel',
style:'style="background-image: url('+this.jsonData.picURL+');'
});
</code></pre>
<p... | 0 |
phpunit mock method multiple calls with different arguments | <p>Is there any way to define different mock-expects for different input arguments? For example, I have database layer class called DB. This class has method called "Query ( string $query )", that method takes an SQL query string on input. Can I create mock for this class (DB) and set different return values for differ... | 0 |
Is there a WEBGL Manual? | <p>Is there some kind of WebGL manual that lists all the functions etc. ? I tried Google but found nothing.</p> | 0 |
How to change text color and console color in code::blocks? | <p>I am writing a program in C. I want to change the text color and background color in the console. My sample program is - </p>
<pre><code>#include <stdio.h>
#include <stdlib.h>
#include <windows.h>
#include <dos.h>
#include <dir.h>
int main(int argc,char *argv[])
{
textcolor(25);
pri... | 0 |
Get list of filenames in assets folder with Typescript | <p>How do I get all filenames in a folder using Typescript?
It's for an angular 2 project.</p>
<p>To be more specific, what I'm trying to do is set the images for a bootstrap carousel using images from my photos folder. Currently I'm doing this:</p>
<pre><code>private _images: Image[] = []
ngOnInit(): void {
thi... | 0 |
Dataset Card for [Stackoverflow Post Questions]
Dataset Description
Companies that sell Open-source software tools usually hire an army of Customer representatives to try to answer every question asked about their tool. The first step in this process is the prioritization of the question. The classification scale usually consists of 4 values, P0, P1, P2, and P3, with different meanings across every participant in the industry. On the other hand, every software developer in the world has dealt with Stack Overflow (SO); the amount of shared knowledge there is incomparable to any other website. Questions in SO are usually annotated and curated by thousands of people, providing metadata about the quality of the question. This dataset aims to provide an accurate prioritization for programming questions.
Dataset Summary
The dataset contains the title and body of stackoverflow questions and a label value(0,1,2,3) that was calculated using thresholds defined by SO badges.
Languages
English
Dataset Structure
title: string, body: string, label: int
Data Splits
The split is 40/40/20, where classes have been balaned to be around the same size.
Dataset Creation
The data set was extracted and labeled with the following query in BigQuery:
SELECT
title,
body,
CASE
WHEN score >= 100 OR favorite_count >= 100 OR view_count >= 10000 THEN 0
WHEN score >= 25 OR favorite_count >= 25 OR view_count >= 2500 THEN 1
WHEN score >= 10 OR favorite_count >= 10 OR view_count >= 1000 THEN 2
ELSE 3
END AS label
FROM `bigquery-public-data`.stackoverflow.posts_questions
Source Data
The data was extracted from the Big Query public dataset: bigquery-public-data.stackoverflow.posts_questions
Initial Data Collection and Normalization
The original dataset contained high class imbalance:
label count 0 977424 1 2401534 2 3418179 3 16222990 Grand Total 23020127
The data was sampled from each class to have around the same amount of records on every class.
Contributions
Thanks to @pacofvf for adding this dataset.
- Downloads last month
- 1,296