title
stringlengths
13
150
body
stringlengths
749
64.2k
label
int64
0
3
token_count
int64
1.02k
28.5k
C: using realloc for high performance with an array of structs
<p>I am using realloc to adjust the size of an array of structs containing 3 points x, y and z. This struct is encapsulated inside another struct that contains the array, the length of the array and a "reserved" value that is used for a pre-allocation strategy for even faster performance when it is evident that more s...
3
2,100
Shared Compass/Lucene Index in JDBC Store
<p>Using the searchable plugin in Grails (which uses Compass/Lucene under the hood) we're trying to share a search index between two different web applications. One application accesses the data only in a read-only fashion. The other application allows to modify the data and is in charge of updating the index on any ch...
3
1,306
My map function is not working in react js
<pre><code>import React, { Component } from &quot;react&quot;; import { TextField } from &quot;@material-ui/core&quot;; import SearchResult from &quot;./SearchResult&quot;; class Search extends Component { constructor() { super(); this.state = { data: [], }; this.renderRes = this.renderRes....
3
1,281
Near Protocol NFT add string values mapped to a TokenId. i.e. tokenizing an ipfs hash
<p>I am trying to learn how to use the Near protocol and Rust by recreating my NFT Dapp which mapped string values (ipfs hash's to be exact) which I call a &quot;sketch&quot;. I have already done this successfully using Solidity on Ethereum. example shown at bottom of this page.</p> <p><strong>I am simply trying to map...
3
2,804
How to filter rows with non ascii encoding characters?
<p>I am dealing with Chinese characters excel. After I read the excel using</p> <pre><code>data = pd.read_excel(file, encoding = 'utf-8') </code></pre> <p>, I can print the file normally (I can read the character).</p> <p>But, when I want to filter the rows by a value, I got the following error:</p> <p><code>Index ...
3
2,386
Listview button click throws null pointer exception
<p>Inside my <code>UpdateSupervitionActivity</code> class <code>CallAdapter()</code> method is called to generate the <code>listview</code>. The <code>listview</code> has a button for each <code>item</code> to remove an <code>item</code>. After the <code>listview</code> is loaded, when I try to remove an item from the ...
3
3,325
Angular 5 - How to dynamically add event on a DOM element?
<p>I'm try to implement a search input as the one on "Medium" website by adding a new suggestion (based on the input context for full text search) at the top of the list of the current suggestions. I'm on an angular 5 project and I use typeahead for research module. </p> <p>So this is how I add new suggestion on top...
3
1,067
Slow reading from CSV file
<p>I'm trying to read from a csv file but it's slow. Here's the code roughly explained:</p> <pre><code>private static Film[] readMoviesFromCSV() { // Regex to split by comma without splitting in double quotes. // https://regexr.com/3s3me &lt;- example on this data var pattern = Pattern.compile(",(?=(?:[^\\...
3
1,247
How to append an element to a dynamically generated element
<p>I have several forms one clone after another depends on the user input. in each form I have button to add a row of input:</p> <pre><code>&lt;h4&gt;3.3.5 Input Parameters&lt;/h4&gt; &lt;table id="input_param" data-role="table" class="ui-responsive table-stroke"&gt; &lt;thead&gt; &lt;tr&gt; &l...
3
1,358
Error while running JDBC on postgres
<p>This is my CreateQuery.java class .</p> <pre><code>package DbConnect; import java.io.FileNotFoundException; import java.io.IOException; import java.sql.Connection; import java.sql.PreparedStatement; import java.sql.ResultSet; import java.sql.SQLException; public class CreateQuery { Connection conn; ...
3
1,439
Java reflection vs non reflection performance comparison
<p>So I tried to test the performance of java reflection. I want to add every value of every field in a class into a map.</p> <pre><code> public static class testClass { String monday = &quot;Monday&quot;; String tuesday = &quot;Tuesday&quot;; String wednesday = &quot;Wednesday&quot;; String thursday = ...
3
1,350
Why does the Oracle database query (Long datatype in Oracle database table's column) not execute in QueryDatabaseTable Apache Nifi?
<p>I have a Oracle database with a column setup as '<code>long</code>' data type. The column has <code>XML</code> data. I am trying to transfer the data from Oracle to Bigquery.</p> <p>I tried the following setup and it worked perfectly: </p> <pre><code>ExecuteSQL -&gt; AvroToJson -&gt;PutBigQueryBatch </code></pre> ...
3
1,440
How to debug with GDB on RT Linux: fails with SIGTRAP
<p>I am trying to debug a multi threaded application on RT Linux. On regular Linux, the app runs fine, and GDB also runs fine. On RT Linux the app runs fine, but under GDB, the app runs for several seconds then terminates and prints:</p> <p><code>Program terminated with signal SIGTRAP, Trace/breakpoint trap. The prog...
3
1,117
Python multiprocessing issue with arguments set/list completion of processes
<p>This other post is exactly, I think, regarding what i want to do. <a href="https://stackoverflow.com/questions/5442910/python-multiprocessing-pool-map-for-multiple-arguments">Python multiprocessing pool.map for multiple arguments</a></p> <p>How I am trying to implement is in my pseudo code:</p> <h1>called by another...
3
1,627
Reading response text in Ajax using JQuery
<pre><code>function upload_file(){ var file =document.getElementById('computer_image').files[0]; if(file!==null){ if(file.type==='image/jpeg' || file.type==='image/png' ||file.type==='image/jpg'){ $('#progressbar').show(); var formData = new FormData(); ...
3
1,640
Javascript calculator equal function failing
<p>I have created a calculator using JavaScript. When I chain together multiple math problems I get the answer I desire until I try and get the end result with the = button. When I do only two numbers the = button works perfectly fine. I have my code set up to set the a mathHoldOne and mathHoldTwo. Both contain a numb...
3
5,570
Popup in style of ContentControl not updating
<p>I have a ContentControl with a style that contains a popup that wraps a textbox. I know it sounds a little confusing but I will post some code below. When the caps lock key is on the popup is shown, but when the window is dragged the popup does not move with it. </p> <p>I need to figure out how to update the locati...
3
1,214
Java Applet Grid Game Flashing On Refresh/Keypress
<p>I made a simple game on a grid in java that involves controlling a white square with the WASD keys. Whenever I press W,S,A, or D, the screen sometimes flickers before drawing the grid again. I am fairly new to coding, so the more you can dumb it down for me, the better.</p> <pre><code>import java.applet.*; import j...
3
4,016
rails : gmaps4rails gem not showing sidebar after deployment
<p>I have a really tiny problem that is a huge feature for the site. Just a quick overview I developed the rails app in development mode and used the gmaps4rails app which worked fine. However I deployed the app to Heroku and now the gmaps4rails does not show the sidebar.</p> <p>Below is an image of how it should look...
3
1,111
Why does this node.js app runs locally by Heroku however is not loading in Heroku?
<p>I'm trying to deploy an app for the first time using Heroku, after successfully committing the repo and pushing to the changes to Heroku, the app still doesn't load.</p> <p>Heroku Logs: </p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> ...
3
4,168
Adding transition to CSS
<p>I want to add smooth animated transition to drop down in this CSS. Which code and where I should place? I have tried some "webkit-transition" variants but none worked with my skills in programming. Anyone can solve this problem?</p> <pre><code> ul.jb_free_dropdown, ul.jb_free_dropdown li, ul.jb_free_dropdo...
3
1,957
scrape multiple clubs per player in one cell of the java script table - display both in the same list element
<p>My problem is, that in the last cell of the javascript table, I get the clubs the player played for via the &quot;img&quot;.</p> <pre><code>injury_list = [] season_list = [] day_list = [] missedgame_list = [] team_list = [] player_list = [] </code></pre> <pre><code> url = 'https://www.transfermarkt.ch/emre-can/verl...
3
1,121
how to resolve the problem that hovering mouse on chart will appear old data/charts?
<p>I used react hooks useEffect for rendering a chart from chart.js to canvas. However, I found problem of old chart showing when I hover my mouse on the chart. From the sources I found online I realized the problem might be able to solve by chart.destroy(), but I just do not know where and how to use it in my case of ...
3
1,712
How to add several fields in a module that belong to two tables in the same form or other - Prestashop 1.7
<p>I have followed the steps of a tutorial to create a module to edit invoices specifically this: <a href="https://blog.floriancourgey.com/2018/04/edit-your-invoices-in-prestashop" rel="nofollow noreferrer">https://blog.floriancourgey.com/2018/04/edit-your-invoices-in-prestashop</a></p> <p>But the module only allows up...
3
1,940
Use directions service of Google Maps API to show blue line for all routes
<pre><code>function placeDistanceMarkers( coordinates, in_between_distance, unit, departure_time ) { if (coordinates.length &lt; 2) { throw new Error(&quot;Invalid length of marker coordinates&quot;); } // the elements are the functions to be called with lat() and lng() let start_coord = coordinates[0], ...
3
1,281
while loop issues in expect script
<p>I have written a expect script which works as follows:</p> <ol> <li>ssh to server1 </li> <li>From server1 ssh to another server server2</li> <li>From server2 to server3 and then sudo into a user and run the commands.</li> </ol> <p>In the script I read the hostnames and commands to be executed from two files called...
3
1,546
tizen emulator not running on debian
<p>I failed to run Tizen Emulator on debian 8 with intel processor, i'm using Tizen Studio 1.2. I don't get any error messages on window alert and logs file, I tried to delete and re-create the emulator but it not work.</p> <p>thanks in advance</p> <p><strong>Update :</strong> i'm getting error messages from logs on ...
3
2,637
jquery issue using multiple selector in Animated Circle Menu
<p>i am using Animated Circle Menu that works for one menus , but when using multiple one i could not make it work</p> <p>working one with one selector menu : <a href="https://jsfiddle.net/gruts8Lv/2/" rel="nofollow">https://jsfiddle.net/gruts8Lv/2/</a></p> <p>not working with two selector : <a href="https://jsfiddle...
3
1,996
Listview item got highlighted on click (not wanted)
<p>I've a TabHost with items and I want that they are only highlighted on click.</p> <p>I had it before and I changed nothing on the ListViews itself but on the TabHost (and I think that shouldn't matter..)</p> <pre><code>&lt;RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="h...
3
1,573
Iterate json with multiple values per key for matching pattern: Set dataframe column value depending on value of other column (Faster Python Solution)
<p>Below is the Problem statement.</p> <p><strong>Inputs: -</strong></p> <ol> <li>csv containing Time when a particular URL is hit.</li> <li>json containing multiple url_categories with the matching url patters for each url_categories.</li> </ol> <p><strong>Required Output: -</strong> csv, containing Time, url, and url...
3
1,826
SVG not loading properly
<p>I am simply trying to render the svg on the page however it is not loading.</p> <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false"> <div class="snippet-code"> <pre class="snippet-code-html lang-html prettyprint-override"><code>&lt;svg viewBox="0 0 28 28" xmlns="http://www...
3
1,328
ADO.Net retrieving autoincrement values for MS Access database in strongly typed DataSets
<p>I write a database client application in C# using MS Access as a DB server.</p> <p>Users insert new rows using a <code>DataGridView</code>. I need to retrieve autoincrement values of the inserted rows on </p> <pre><code>this.MyTableTableAdapter.Update(MyDataSet.MyTable) </code></pre> <p>operation.</p> <p>I can't...
3
1,050
sql clr c# function to make rest api call
<p>I am trying to write a SQL CLR C# function/store procedure to get data from an api server but I'm not getting proper results. Probably I never wrote and never done this. I have searched a lot and found the following code, but this returns data in a full page format where as I want only data in xml format so that I c...
3
1,899
Vuetify using VueI18n results in [Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined"
<p>Implementing Vue i18n into Vuetify is failing. I think I've followed the guide fairly well. </p> <p>The below config results in the following error:</p> <blockquote> <p>[Vue warn]: Error in render: "TypeError: Cannot read property '_t' of undefined"</p> </blockquote> <p><strong>vuetify.js</strong></p> <pre cla...
3
1,238
Hover on column and rows, with multiple background colors
<p>I know this can be done with rows, but I haven't been able to make it also work for columns. I need to be able to color code my columns, but keep the same hover color across all columns. Below is the code I have so far, I need to color the background on the 1st column grey, and leave everything else the same white. ...
3
1,031
Neural network is not being trained, cross-entropy stays about the same
<p>I have written the following multilayer perceptron model in TensorFlow, but it is not training. The accuracy stays around 9%, which is equivalent to random guessing, and cross-entropy stay around 2.56 and does not vary much.</p> <p>The architecture is as follows:</p> <pre><code>def create_model(fingerprint_input, ...
3
1,045
Can't get jquery-masonry to work
<p>HTML</p> <pre><code>&lt;div id="container"&gt; &lt;div class="item"&gt; &lt;p&gt;AAAAAAAAA amet tail frankfurter brisket, meatloaf beef ribs doner pork prosciutto ball tip rump tenderloin tongue. Pastrami fatback beef, sausage beef ribs venison tenderloin swine. Fatback leberkas kielbasa drumstick pork venison be...
3
1,281
How can I create a 50/50 vertical layout with stacked GridViews?
<p>One of my DialogFragments implements two equal-sized GridViews, one stacked on top of the other. Ideally, my layout would look like this (as seen in Android Studio): <img src="https://i.stack.imgur.com/Hn433.png" alt="The layout as seen in Android Studio"></p> <p>Unfortunately, when I load up the layout on an actua...
3
1,439
wrong url is not triggering error using combine
<p>I am using the code here. But I couldn't figure out how to use the code here.</p> <p><strong>Stack Overflow <a href="https://stackoverflow.com/questions/65126447/error-is-not-triggering-on-url-session-using-combine">link</a></strong></p> <p>How can I run this function with combine? How can I run a function with retu...
3
2,707
Unpermitted parameters in Rails strong params from related Model on create
<p>I'm using a form in Rails to create an instance of one Model and create a join table to another model on create. In my <code>Accounts</code> controller, after verifying the new instance of <code>Account</code> has been created, I create a new join table based on checkboxes chosen in the form from another model. </p>...
3
2,373
Reducing nested array
<p>I am receiving this JSON from my backend and i need to work out the count of "concrete_compressive_cylinder_100"'s where picked_up = false</p> <p>concrete_samples (can be multiple per work order) can be null ( key is always present )</p> <p>sample_specimens ( 1 per concrete_sample) can be null ( key is always pres...
3
1,815
cant upload to datastore in ckan 2.5.1: using postgres user instead of configured one
<p>I followed the instructions to install ckan as a package on Ubuntu 12.04 LTS. </p> <p>I also configured the datastore extension. The databases have been created and the default users and passwords have been configured in /etc/ckan/default/production.ini</p> <p>My problem is that every time I want to upload a datas...
3
1,498
Laravel 4, Eloquents pagination method
<p>Hello! I am having a problem when trying to use the paginate method on an eloquent model. The problem being that calling <code>{{ $model-&gt;links() }}</code> in my view file will throw me a <code>Call to undefined method Illuminate\Database\Query\Builder::links()</code> which didn't really get me anywhere due to it...
3
1,516
Trying to add a JComboBox dropdown into a JTextField area
<p>I have spent many hours digging around the web and cannot seem to find a straightforward answer or method to add a dropdown selection into my main panel that houses the various text fields, in this case, I am trying to add a paint color selection to the panel so that color can then be used as a variable in determini...
3
3,000
decompression error while putting together parts with macHacha
<p>OK I have app for iPad that reads magazines. All previous issues works fine. I manage to make new issue (before it was done by other guy that left the firm) and to run it in simulator and on device without problems.</p> <p>Now I add row for new issue of magazine in database and compress all pictures and multimedia ...
3
3,015
Merging multiple csvs the right way in panda
<p>I have been trying to work out how to combine several (variable amount of) csvs that all contain one same column and column data in Python. I have been looking at panda and have had only a limited success using merge, join or concat. My closest attempt was with concat (see code below). This brought together all the ...
3
1,034
Running a Selenium webscraper in AWS Lambda using Docker
<p>I am trying to create a simple python Lambda app using SAM CLI that gets the number of followers for a particular handle. Have looked at ALL tutorials and blog posts and yet have not been able to make it work.</p> <p>The build and local test works fine using <code>sam build</code> and <code>sam local invoke</code>, ...
3
2,073
Why base64 image in SVG cannot be shown in Adobe Illustrator?
<p>I created an SVG: a grey rectangle filled with <code>&lt;pattern&gt;</code>. The icons in the pattern are <code>&lt;image&gt;</code> with base64 svg image. I then saved this svg as a .svg file with my code.</p> <p>I found the .svg I got can be correctly shown in the browser. However, when I used Adobe Illustrator to...
3
2,501
Class not serializable exception when creatin an inner class in java
<p>My code is similar to this thread. <a href="https://stackoverflow.com/questions/6662529/class-not-serializable-after-methods-are-overridden?newreg=89e2c3fc5b4541b6ad23d7a76ae54b62">Class not serializable after methods are overridden</a></p> <p>But my goal is to send a method to be processed on another computer. So,...
3
1,191
How to pass state from parent to child as props then from that child to it s child as props in React.js
<p>For now everything is static data .</p> <p><strong>I have a parent sate: an array containing 4 objects like so :</strong></p> <pre><code> function App(){ const [searchResults,setSearchResults] = useState([ { name: 'name1', artist: 'artist1', album: 'album1', id: 1 }, { ...
3
1,024
Asterisk - macro GotoIf or operator
<pre><code>Asterisk 16.13.0 </code></pre> <p>Want to switch action between (primo, secondo, terzo and bo) based on the caller number.</p> <pre><code>[macro-gigi] exten =&gt; s,1,NoOp(macro-gigi: ${CALLERID(num)} - ${CALLERID(all)} - ${CHANNEL}) exten =&gt; s,n,GotoIf($[&quot;${CALLERID(num)}&quot;=&quot;207&quot;]?pri...
3
2,469
Causedby:java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.ListView.setAdapter' on a null object reference
<h1>DisplayActivity.java</h1> <p>I'm relatively new to android.I am trying to make a list view that contains music.The app is perfectly build but then when i try to run it on the device it crashes.I try to debug the app and it gave me the above error.Here are my following code</p> <pre><code>package com.bytetex.azmusic...
3
1,873
Microsoft.Azure.Mobile Client - Handling Server Error using custom IMobileServiceSyncHandler - Xamarin Forms
<p>I have implemented the Azure - Offline Sync based on the documentation / Sample provided by Microsoft <a href="https://github.com/Azure/azure-mobile-apps-quickstarts/blob/master/client/xamarin.forms/ZUMOAPPNAME/TodoItemManager.cs" rel="nofollow noreferrer">Sample</a> in my Xamarin Forms Application.</p> <p>In the s...
3
2,017
How can i change color in a table when i changes values in the table? I get the values from db with json
<p>When I click on the <code>checkbox</code> and the value of that row changes or when i add a new workout and the table changes i want it to change color... I don't know how to proceed. </p> <p>Please help me :)</p> <p>I think it could be something like this: <code>$('#TblWorkouts input').on('change'</code> but I'...
3
1,848
getting blackscreen between activities using a timer
<p>i have read multiple links and tried various things yet i can not get the black screen to dissapear any suggestions here is my manifest the activity that is calling the next activity and xmls,code</p> <p>its basically a splash screen that after 5 seconds it opens another activity it was working two days ago and las...
3
1,503
Python and Webkit, watching serial port thread, how to avoid core dump running javascript
<p>I'm writing a game that uses python and webkit, and a webpage is the front-end/GUI. The PC is connected to an Arduino that controls a coin hopper and other i/o. When the Arduino sends 'coinin' over serial, I capture this in a serial-watching thread, then run some javascript on the webpage to 'add' a coin to the ga...
3
2,473
Invalid precision value writing to Oracle wth VBSript
<p>Since you all led me in the right direction yesterday, I'm back. I am migrating from windows 2003 to windows 2012. A couple of small, but vital, apps are written in asp (VBScript) and an Oracle 11g DB. Many of the DB calls are failing. The latest is a procedure call. I don't write VBScript so I'm struggling here. Th...
3
4,041
Read text file and name buttons VB.NET
<p>What I wan't to do is to read a text file with 1, 2, 3, 4 or 5 lines. If the text file is completely full (5 lines) then the code works.</p> <p>But the code needs to work when there are only 3 lines in the text file. So eventually you get 3 buttons with names and 2 without.</p> <p>The code:</p> <pre><code>Private Su...
3
1,339
NullPointerException in spring boot on making request
<p>Please help! I use MySQL <a href="https://i.stack.imgur.com/QOLq7.jpg" rel="nofollow noreferrer">Table structure</a></p> <p><a href="https://i.stack.imgur.com/7QT8e.jpg" rel="nofollow noreferrer">Table</a></p> <pre> java.lang.NullPointerException: null at com.example.accessingdatamysql.controllers.MainController...
3
6,656
RecyclerView pagination does not load properly?
<p>I need to do pagination for recyclerview. That load 20 data firstly. After scroll, it must load 20 data more. But it load this 20 data as a new list and delete old 20 data. How can add them end of first 20? I tried some different ways but I couldn't get JsonArray succesfully.</p> <pre><code> FirstFragment.java pub...
3
1,369
Is it possible to combine mapAreas from ArcGISOnline in one offline map on android?
<p>I try to create an offline map using ArcGIS Runtime SDK for Android 100.5.0. I follow preplanned workflow according the guide <a href="https://developers.arcgis.com/android/latest/guide/take-map-offline-preplanned.htm" rel="nofollow noreferrer">https://developers.arcgis.com/android/latest/guide/take-map-offline-prep...
3
1,448
Trying to make a basic parallax website with css
<p>So here's my HTML</p> <pre><code>&lt;!DOCTYPE HTML&gt; &lt;html&gt; &lt;head&gt; &lt;div class=&quot;topbar&quot;&gt;&lt;/div&gt; &lt;link rel=&quot;stylesheet&quot; href=&quot;new.css&quot;&gt; &lt;/head&gt; &lt;body&gt; &lt;div class=&quot;pic1&quot;&gt;&lt;/div&gt; &lt;header class=&quot;headings&quo...
3
1,069
How to make search bar using js
<p>WHAT I WANT TO DO : I want to make a search bar for my table using js.</p> <p>WHAT I HAVE : I have a html table having data from database .</p> <p>WHAT I TRY : I tried this code to retrieve result but its not working. Here is my full code:</p> <pre><code>&lt;div class="box-tools"&gt; &lt;div clas...
3
1,491
ng-repeats mutliple times when i call try call this
<p>I am calling ng-repeat on my laravel view ng-repeat call a function from controller that gets the data from database and do some calculations and then reuturing the array but it keeps on returning the data i don't know why can anyone can help me on this why http requests execute multiple times?</p> <p><strong>Here ...
3
1,180
how to run terasort with flink?
<p>i just configure my flink cluster (1.0.3 version) and i whanted to run tersort with the flink framework, but its me returned the next erreor, i used this comamnde to run my programm:</p> <pre><code>/bin/flink run -c --class es.udc.gac.flinkbench.ScalaTeraSort flinkbench-assembly-1.0.jar hdfs://192.168.3.89:8020/ter...
3
1,123
Catch Jquery UI dialog box event
<p>I am having an ajax call. In that ajax call I am passing a json to the server. This happens when the person clicks on the delete button. So, before deleting I am creating a Jquery UI dialog box. In that I am asking user whether he is sure to delete. </p> <p>Now, my problem is when the user clicks I am not able to c...
3
2,669
iOS App Crash: Thread 9: Fatal error: UnsafeBufferPointer has a nil start and nonzero count
<p>App is crashing at following line</p> <p><code>cid = &quot;CID: \(String(describing: Singleton.shared.settings.userName ?? &quot;NA&quot;))&quot;</code></p> <p>Crashing Code:</p> <pre><code>static func clientIdFor(basicToken: String) -&gt; String { var cid: String = &quot;&quot; if let encodedData = ...
3
1,649
How to enlarge tableView on scroll?
<p>I'm sorry if this is a duplicate. I tried to review similar questions in SO - still doesn't quite make me understand how to deal with this.</p> <p>I have a tableView, three textViews and a UIButton. When the user scrolls the tableView, the tableView should pushes the textFields and the button out the image and take...
3
1,816
Swift URLSession.shared.dataTask GET Request -1001 returns timeout
<p>Sending a POST request to our NGINX Server works good with <code>URLRequest</code> and <code>URLSession.shared.dataTask</code>. I can login to my app but when I try a GET request my server has no log that the request reached him. Finally I get the timeout error. Important, I am using https. I also tried to use http ...
3
1,199
Declaring integers in actionPerformed java
<p>So I'm trying to create this program in Java that's supposed to keep track of how much stock there is. Like if you wanted to cook pancakes, you would click a button that said "pancakes" and 1xmilk, 2xtimes egg would be removed from the stock every time you click the button, the problem is that I have to declare the ...
3
1,074
Import doesn't work
<p>I have a wierd problem. There are two apps in my django project . In one app one of the imports made in views.py is fine but in the other one the same import shows me an error. </p> <p>Here is views.py where import is fine: </p> <pre><code>from django.shortcuts import get_object_or_404, render_to_response from m...
3
1,193
yarn run error : Command failed with exit code 1
<p>I was trying to follow this <a href="https://lorisleiva.com/create-a-solana-dapp-from-scratch/getting-started-with-solana-and-anchor#:%7E:text=build%0Aanchor%20deploy-,anchor%20run%20test,-Well%2C%20it%20turns" rel="nofollow noreferrer">tutorial</a><br /> This is a tutorial on Solana program dev using anchor and the...
3
1,074
Having difficulty with my Monty Hall stimulator code (python)
<p><strong>What the Monty Hall game is:</strong></p> <p>The stage is set up with three large doors labeled #1, #2, and #3. Behind two of the doors is a goat. Behind the other door is a new car. You don’t know which door has the car, but Monty Hall wants you to pick a door. Suppose you pick door #1. Monty Hall then ope...
3
1,929
signing into seedr.cc using requests
<p>I am trying to sign into the website seedr.cc, I got names for email and pasword and I don't know the value of submit button, So I gave it <code>Submit</code> as the value and after post() I am checking if it is logged in but it isn't and there happens to be no error so I don't know why it isn't logging in.</p> <pr...
3
2,077
Create and fill database from java
<p><strong>EDIT: I am using now preparedStatement with the following code:</strong></p> <pre><code>Statement st = con.createStatement(); st.executeUpdate("CREATE TABLE IF NOT EXISTS Xbox_One (id INT AUTO_INCREMENT, " + "PRIMARY KEY(id), Thumb VARCHAR (500), Juego VARCHAR(500), URL VARCHAR (20...
3
7,948
How to fix value update delay in vuejs after axios request?
<p>I am retrieving a list of data from an api and need to fill the specific <code>&lt;select&gt;&lt;/select&gt;</code> tags, which is associated to a few radio button, with some of the data as <code>&lt;options&gt;&lt;/options&gt;</code>. The radio buttons waiting for an event (<code>@change</code>/<code>@click</code>)...
3
1,100
Count and filter with Group By; and Rows to Columns conversion
<p>I have two Tables</p> <ol> <li>Task</li> <li>TaskDetail</li> </ol> <p>Task:</p> <pre><code>| TaskName |Department|TaskStatus|DetailID | |--------- |--------- |--------- |--------- | | T1 | D1 | 31 | 1 | | T1 | D2 | 32 | 2 | | T1 | D3 | 31 | 3 ...
3
1,413
How do I access the $ref in the JSON recursively as to complete the whole JSON?
<p>I have this schema, which has <code>$ref</code> in it. I need to recursively (assuming there are no infinite cycles) fill in references. That is, wherever <code>$ref</code> is present, the whole object is replaced with what it points.</p> <p>Note, I can't use any libraries and need to write the Class/function on my...
3
1,894
How to implement specification pattern?
<p>In my project; I have included specific pattern classes that are given below. I dont know how to implement this. These codes are included by previous developers.</p> <pre><code>public interface ISpecification&lt;T&gt; { Expression&lt;Func&lt;T, bool&gt;&gt; SpecExpression { get; } bool IsSatisfiedBy(T obj);...
3
1,834
AngularJS and WordPress API display data from single post
<p>I'm using the WordPress API as a data service to an AngularJS/Ionic app. I have a post type called programmes and have a list of programmes (posts) and the JSON looks like:</p> <pre><code>var programmes = [ { id: 6, title: "A post", slug: "a-post" }, { id: 7, title: "Another post", slug: "another-pos...
3
1,199
*ngFor not showing any data
<p>I'm creating a chatting app. I have a slight problem, <code>ngFor</code> doesnt seem to work for me.</p> <p>I have 2 components, 1 is the feed which holds the other component which is the message. So feed shows a list of message components.</p> <p>Feed .ts</p> <pre><code>import { Component, OnInit, OnChanges } f...
3
1,223
Configuration issue in HermesJMS - java.lang.NoClassDefFoundError for BeanSupport class
<p>I am trying to test a message using HermesJMS. I am getting a <code>java.lang.NoClassDefFoundError</code> for the <code>BeanSupport</code> class. What could be the issue?</p> <p>I have configured the required jars under specific path and configured the same in hermes-config.xml within the tag <code>&lt;/classpathGr...
3
1,745
Print to the IDLE Shell when a tkinter button is pressed
<p>I am trying to create a small window that shows up in the corner of your screen. The window will have a keyboard on it. I want to be able to make the computer think that you pressed a button on your keyboard when a button in the window is pressed. This is the code I have so far:</p> <pre><code>from tkinter import *...
3
1,076
No load data anymore except refresh action
<p>I couldn't find a solution to my problem on the search engine, So i decided to ask here.</p> <p>I have navigation tab with 3 fragments <code>fragmentA, fragmentB, fragmentC</code>. Each fragment load data from parsed data. i have opened fragment a and load data on listview, then i want to change to fragment b, and ...
3
2,751
Combining CSS Animations. What next?
<p>I am trying to make an animation of a stack of folders, where they will raise up, and then open to reveal the inside of the folder on hover (all but the bottom folder need to rise). </p> <p>So far I have made the all top folders rise, and I've made the bottom folder open. Where I'm stuck is how to get the top folde...
3
1,258
what does this line do in this code?
<p>i have found following code on online for suffix tree</p> <pre><code>#include &lt;stdio.h&gt; #define E 0 struct suffix_tree_node; struct suffix_tree_link { // 0 is e - global index of during string's end unsigned long start; unsigned long end; suffix_tree_link(suffix_tree_node* source, suffix...
3
1,216
Handling a Many-to-Many Dimension when all dimensional values have 100% importance
<p>I'll at least try to keep this succinct.</p> <p>Let's suppose we're tracking the balances of accounts over time. So our fact table will have columns such as...</p> <p><strong>Account Balance Fact Table</strong> </p> <ul> <li>(FK)AccountID </li> <li>(FK)DateID</li> <li>...</li> <li>Balance</li> <li>...</li> </u...
3
1,088
Uploading a Image Works on some devices but returns Stream FixedLengthSource .inputStream()
<p>I am developing an android application that uploads an image to a specified directory using PHP and okhttp . Well , the frontend and backend work fine on my personal device , but it crashes on non-Samsung devices.</p> <p>When I dug into the problem I found out that the server returns :</p> <p>com.android.okhttp.int...
3
5,910
Vertically merge dataframes
<p>I have a query regarding merging 4 dataframes For example i have 4 dataframes as below :</p> <pre><code>print(df1) SET I Violations Rule 1 1 Rule 2 1 Rule 3 6 print(df2) SET II Violations Rule 1 2 Rule 2 3 Rule 3 6 print(df3) SET III...
3
1,296
Normalize data for colormap
<p>I am plotting color for geopandas shape with 2 array data:</p> <p>Here's my first array.</p> <pre class="lang-py prettyprint-override"><code> newI = array([ -467, -415, -414, -1001, -246, -147, -523, -327, -583, -541, -290, -415, -453, -505, -791, -812, -672, -558, -559, -1055...
3
3,494
Loop to get model fields, create new model instances based on API returned values
<p>I'm using a couple of different API calls to populate (create_or_update) a particular Model's fields. Instead of having to create a new series of create_or_update fields for every API call, I am trying to make a loop to get rid of boilerplate code. There is a small caveat in the fact that some of the fields returned...
3
3,379
The samples read from the AVAssetReader is not in order
<p>I have a trouble while reading the sample buffers from a file using AVAssetreader. The timestamps of the samples read seem to be out of order. Is this the expected result or is there something I am doing wrong. Below is the reading and writing code I am using -</p> <pre><code>[assetWriterInput requestMediaDataWhenR...
3
1,232
create another instance 'B' after saving an instance 'A' automatically
<p>i'm using <code>Django 1.7</code> with <code>django_rest_framework 3.0</code> to develop a restful backend for my application.</p> <p><strong><em>The scenario:</em></strong> On the client the user will authenticate with a social network, say facebook. The <code>token</code> is sent back to the server which creates ...
3
1,487
jQuery form submission handler - odd behaviour
<p>Edit: answered, was a syntax error, see below for fixed code...</p> <p>Hi all, long time reader, first time asker.</p> <p>The below code is <em>always</em> allowing form submission, even given that I've overidden the return value at the end of the function, outside of any conditional statements. Form submission is...
3
1,537
Fetching different data from the same query in GraphQL
<p>For background, we're using HotChocolate in C#, with Apollo Angular and graphql-codegen.</p> <p>We want to fetch some data from a query, but twice within one named query with different criteria, for instance:</p> <pre><code> query getTeamMembers($organisationId: UUID!, $cursor: String) { teamMembers(organisation...
3
1,109
Efficient controlled random walks in gremlin
<h2>Goal</h2> <p>The objective is to efficiently generate random walks on a relatively large graph with uneven probabilities of going through edges depending on their type.</p> <h2>Configuration</h2> <ul> <li>Ubuntu VM, 23Go RAM</li> <li>JanusGraph 0.6.1 full</li> <li>Local graph (default <code>conf/remote.yaml</code> ...
3
1,373
How to create login endpoint for serverless app with aws cognito service?
<p>I need to create login endpoint using cognito and serverless framework, i already created signUP and confirm email endpoints, but whatever i do with logIn endpoint i get error <code>&quot;message&quot;: &quot;Internal server error&quot;</code>. I try everything but still get this error. Help me, please.</p> <p>This ...
3
1,825
class variable reference problem in pygame little game
<p>i am self learning pygame, so with help of tutorials i have created following little game :</p> <pre><code>import numpy as np import matplotlib.pyplot as plt from pygame.locals import * from pygame import mixer from os import path import pickle import pygame pygame.mixer.pre_init(44100,-16,2,512) mixer.init() pygam...
3
8,171
xdmp:spawn-function() Alternative
<p>we have around &quot;20 million&quot; documents in the database and we have created badges of &quot;10000&quot; and use <strong>xdmp:spawn-function()</strong> to query over these 20 million documents and perform delete operations according to some conditions . But running it through query console, query is getting t...
3
1,035
Toggling State while using react router
<p>By default, I want to show the temperature of the current gps location. But if the user wishes to see the temperature of any other specific country he can do so by providing the country name.</p> <p>I have used HomeLocation as the toggle, such that whenever '/' is rendered the HomeLocation is set to <code>true</co...
3
1,025