title stringlengths 13 150 | body stringlengths 749 64.2k | label int64 0 3 | token_count int64 1.02k 28.5k |
|---|---|---|---|
foreach loop to populate multiple radio buttons from a database in a php string | <p>UPDATE:
Thanks to the answers provided by SeanWM and Styphon, I offer the full, working code to those who are looking for a similar answer:</p>
<pre><code><?
if (isset($_GET['id'])) {
include "connect_to_mysql.php";
$id= preg_replace('#[^0-9]#i','',$_GET['id']);
$sql=mysql_query("SELECT * FROM angler3 WHERE id... | 1 | 2,040 |
Can javascript listen for the result of a confirm dialogue from a separate method? | <p>I know that the usual JS way of taking an action only if a confirmation dialog is to have the confirmation inside the function, like this jQuery example:</p>
<pre><code><script type="text/javascript">
$(function () {
$("#dropdown").change(function () {
var success = confirm('Are you sure want to c... | 1 | 1,191 |
Maintaining complex state in Haskell | <p>Suppose you're building a fairly large simulation in Haskell. There are many different types of entities whose attributes update as the simulation progresses. Let's say, for the sake of example, that your entities are called Monkeys, Elephants, Bears, etc..</p>
<p>What is your preferred method for maintaining these... | 1 | 1,333 |
How to open a txt file [EMU8086/Assembly] | <p>I've written a simple program, in which one I press </p>
<ol>
<li>the program makes a text file</li>
<li>it shows a sentence about the program</li>
<li>the program gets finished.</li>
</ol>
<p>These three buttons work perfectly fine, now I what I want is this: when I press "4" the program reads that text file (tha... | 1 | 1,444 |
Facing issues while running cucumber with serenity | <p>To integrate Cucumber with Serenity, I have created below Gardle file. Serenity is working fine, however I am not able to use it with Cucumber. When I use @RunWith(CucumberWithSerenity.class) in runner class, it gives me unresolved type error.</p>
<p>build.gradle:</p>
<pre><code>apply plugin: "java"
apply plugin: ... | 1 | 2,060 |
Unresolved reference @HiltAndroidApp or any other Hilt annotation in Android | <p>I have done everything properly but still, I can't use Hilt in my project.</p>
<p><strong>build.gradle(:app)</strong></p>
<pre><code>apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.goo... | 1 | 1,941 |
Eclipse cannot build Android projects | <p>It's always give that error:</p>
<pre><code>[-] Starting full Post Compiler.
[-] /home/marcos/dev/programs/android-sdk-linux_x86/platform-tools/aapt package -v -S /home/marcos/dev/workspace/WebTest/bin/res -S /home/marcos/dev/workspace/WebTest/res -f --no-crunch --auto-add-overlay --debug-mode -M /home/marcos/dev/w... | 1 | 2,733 |
Error: connect ECONNREFUSED 127.0.0.1:5432 | <p>I'm trying to make request to a postgreSQL DB being accessed by a Node + Express server that I've deployed on Heroku. This is the error im getting when running 'heroku logs': Error: connect ECONNREFUSED 127.0.0.1:5432, along with a couple other errors. I'm using axios on the frontend to make request.</p>
<p>Here is ... | 1 | 1,095 |
Error inflating class fragment (using google maps android api v2) | <p>I am having trouble getting this example working from the developers site and am stuck (probably with something simple) here is my xml layout</p>
<pre><code><?xml version="1.0" encoding="utf-8"?>
<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.andr... | 1 | 3,340 |
JSON data returned from WCF service contains escape characters | <p>I have a working WCF - WPF application working, however I'm looking for some optimization.
Below is my code where a WCF restful service is exposing a JSON array, and a WPF UI is receiving it without any problem.</p>
<p>WCF: </p>
<pre><code>public clsStatus[] GetAllStatus()
{
DataTable dt = new DataTable();
... | 1 | 1,150 |
Add a colspan to a JS generated cell | <p>I have some JavaScript that creates a row in a table and adds cells to it. I need to put an colspan=2 on the second cell added (A.K.A the select cell), but I can't figure out the best way to do this with the least change in the code because this affects a entire page of more code. Suggestions? (table id=table5 clas... | 1 | 1,401 |
serial port not responding | <p>I wrote a program that communicate with serial port, using termios, this program will read serial port in non-blocking mode and write response to serial port once it read data. If there is no data read from serial port, the program will do other thing, on next loop, the program read serial port again.</p>
<p>now th... | 1 | 3,775 |
How to sort recyclerView right | <p>I created a <code>recyclerView</code>(see in this image) <a href="https://i.stack.imgur.com/TIb9h.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/TIb9h.png" alt="enter image description here"></a></p>
<p>But I'm not getting result that I want. I need get this:</p>
<p><a href="https://i.stack.img... | 1 | 2,213 |
WPF two-way binding XML | <p>I'm struggling to get to grips with WPF, more specifically performing two way binding of an xml file. Should I be using XMLDataProvider or is their another(better) option?
The data is displaying fine but when I change an entry the changes aren't reflected in the xml file.</p>
<p>The XML:</p>
<pre><code> <?xm... | 1 | 1,220 |
Sending multiple messages through a socket in c | <p>So in this program I am trying to send the file content and file name from client to server in two steps. I tried using <code>memset()</code> to empty the buffer so as to use it for storing the filename, however then I realised that the filename is being passed into the buffer along with the content, so there is no ... | 1 | 2,006 |
Parse "<tbody> / <tr> / <td>" with python's BeautifulSoup | <p>I have the following HTML code:</p>
<pre><code><tbody>
<tr>
<td><a href="/block_explorer/address/1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa">1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa</a></td>
<td><a href="/block_explorer/address/hash/62e907b15cbf27d5425399ebf6f0fb50ebb88f18/"... | 1 | 1,058 |
WP Show wp die error as an alert | <p>I have the following function in a project im working on and everything up to now works well apart from im stuck with showing error message in alert popup when the function die. </p>
<p>This is Ajax Script</p>
<pre><code> jQuery(window).load(function() {
action = jQuery.QueryString["action"];
co... | 1 | 1,773 |
listview with checkbox single clickable | <p>i have a listivew with custom arrayadapter and custom layout, it have a Checkbox.
I want to make this listview only one checkbox enabled but i dont know how can i do it.</p>
<p>This is my adapter, but the check and uncheck dont works fine. Any exmple please.</p>
<pre><code>public class gremioAdapter extends ArrayA... | 1 | 1,553 |
UnicodeDecodeError: Django Generate PDF with weasyprint | <p>I am making an app with Django. I want to generate pdf when I browse select link. So I used <strong>weasyprint</strong> module for convert my pdf. I import weasyprint module. But When I run that app, I found some error.
This is <strong>views.py</strong> file</p>
<pre><code>def customersProfile(request, customer_id,... | 1 | 6,041 |
Shutdown boost threads correctly | <p>I have x boost threads that work at the same time. One producer thread fills a synchronised queue with calculation tasks. The consumer threads pop out tasks and calculates them. </p>
<p><img src="https://i.stack.imgur.com/YWfzy.png" alt="Synchronised Queue">
Image Source: <a href="https://www.quantnet.com/threads/c... | 1 | 1,375 |
Java EE web application "remember me" auto login done right? | <p><strong>The Situation:</strong><br /></p>
<ul>
<li>A java EE web application with user authentication based on username/password</li>
<li>Password verification is not done by the application itself. It uses <a href="http://download.oracle.com/javaee/6/api/javax/servlet/http/HttpServletRequest.html#login%28java.lang... | 1 | 1,514 |
How to attach a disk image to QEMU containing root filesystem for linux kernel? | <p>I am able to launch the linux kernel on QEMU using <code>-kernel</code> and that's pretty straight-forward and simple.</p>
<p>But now I am attempting something different. I am simulating the combination of UEFI + GRUB + Kernel.</p>
<p>I have built OVMF and GRUB2 from source and also able to load the kernel image, bu... | 1 | 3,550 |
C# OpenFileDialog open zip folder containing single file? | <p>I have an application which currently provides the user with the ability to view a PDF file inside the application by using File->Open, browsing to the location of the PDF file using a <code>Microsoft.Win32.OpenFileDialog</code>, and then displaying that PDF file in a <code>System.Windows.Controls.WebBrowser</cod... | 1 | 2,488 |
cublasSgemm row-major multiplication | <p>I'm trying to use cublasSgemm to multiplicity two non-square matrices that are stored in row-major order. I know that this function has one parameter where you can specify that if you want to transpose the matrices (CUBLAS_OP_T) but the result is stored in column-major order and I need it in row-major too. </p>
<p>... | 1 | 1,329 |
Converting expressions from Prefix to Postfix ( Facing Problems with Precedence) | <p>I have been attempting to write a code that converts Prefix expressions to Postfix expressions.</p>
<p>So far here's what I have made (note that I am new and hence may not be efficient!) </p>
<pre><code>/***************************************************
NOTE: This code fails to realise the precedence
of par... | 1 | 3,847 |
Redux can reducer accept multiple actions | <p>Both <strong>AddToCart</strong> and <strong>RemoveFromCart</strong> actions update num and qty, while both <strong>HandleClick</strong> and <strong>InputQuantity</strong> actions update qty.</p>
<p>I have problem with these two lines of code: </p>
<p><code>num: productsReducer(state.productsReducer.num, AddToCart)... | 1 | 1,707 |
CEF3 with WINAPI | <p>I don't know if the subject of this topic makes sense.
I've een trying some work around with CEF3.
I just started using C++ and I'm having a hard time. Sorry about that.</p>
<p>The initial target is to make the popup window full-screen as described in this topic: <a href="http://www.magpcss.org/ceforum/viewtopic.... | 1 | 1,373 |
Word/Excel files corrupted when downloading from PHP | <p>I'm building a simple file upload/file download functionality into my database. The only complicated part is that all files need to be encrypted using my fancy-shmancy encryption methods.</p>
<p>So what I do is make an SQL entry that stores things like: id_file, filename, extension, size, dateadded, etc</p>
<p>Th... | 1 | 1,604 |
'System.Windows.Data.Binding' is not a valid value for property 'SelectedIndex' | <p>Can someone please shed some light on this error?</p>
<p>At first I thought SelectedIndex is probably just not a DependencyProperty and cannot be bound, but I was wrong.</p>
<p>If I use a normal binding instead of the markup extension <code>src:ValidatedBinding</code>, or if I keep the markup extension but bind <c... | 1 | 2,707 |
gdb weird backtrace | <p>My program is statically compiled with dietlibc. It is compiled on ubuntu x64 (compiled for x86 using the -m32 flag) and is run on a centos x86.</p>
<p>The compiled size is only about 100KB. I compile it with -ggdb3 and no optimization flags.</p>
<p>My program uses signal.h to handle a SIGSEGV signal and then call... | 1 | 1,286 |
Smart Way to Handle Voice Commands in Code to Action a Command | <p>Rather than using Switch/Case or IF Boolean checks that can get very long and awfully tedious, I wonder if a better way can be sought for handling and processing Commands.</p>
<p>E.G:</p>
<pre><code>if(settings.getName == Command)
{
Speak("I am here");
}
if("Get News Feed" == Command)
{
MyRSSFeed RSSNewsFeed = ne... | 1 | 3,377 |
Exception thrown by type initializer for 'Microsoft.TeamFoundation.Framework.Server.ByteArray' | <p>Please anyone has an idea what is causing this error while checking in files on tfs:</p>
<p>"The type initializer for 'Microsoft.TeamFoundation.Framework.Server.ByteArray' threw an exception."</p>
<p>this is the stack trace from the event Viewer:</p>
<pre><code>**TF53010: The following error has occurred in a Tea... | 1 | 1,405 |
How do I extract and parse quoted strings in Perl? | <p>Good day.</p>
<p>My text file content below. tmp.txt (a very big size file)</p>
<pre><code>constant fixup private AlarmFileName = <A "C:\\TMP\\ALARM.LOG"> /* A Format */
constant fixup ConfigAlarms = <U1 0> /* U1 Format */
constant fixup ConfigEvents = <U2 0> /* U2 Format *... | 1 | 1,131 |
How can I link executable with dylib in Mac OS X command line? | <p>I'm trying to figure out how to compile things on command line without a and ide. This is my first time building a project using command line. And, I get stomped on linking dependencies on a simple project.</p>
<p>I have this tree structure:</p>
<pre><code>.
├── include
...
...
├── lib
│ ├── libopencv_calib3d.3.... | 1 | 1,075 |
Error Creating IPA File for Enterprise Distribution: "PackageApplication failed with exit code 1" | <p>I am running XCode 4.2 and when I Build, Archive, and then attempt to create the IPA file in Organizer, I get the following error message:</p>
<pre><code>PackageApplication failed with exit code 1.
Packaging application: '/Users/Brad/Library/Developer/Xcode/Archives/2011-08-06/*** 8-6-11 4.21 PM.xcarchive/Products/... | 1 | 1,918 |
Using recursion and dynamic memory allocation of multidimensional arrays to find the determinant of an NxN matrix | <p>I'm trying to write a program that can calculate the determinant of any NxN matrix regardless of the size but there's something wrong with the program and it crashes for any matrix with size greater than 1.</p>
<p>I'd be very grateful to anyone who can tell me what I'm doing wrong. I'm new to c++ and dynamic memory... | 1 | 1,188 |
How to implement a test bench file for a 8x1 Multiplexer with 32-bit line width? | <p>I'm writing a VHDL code to model an 8x1 multiplexer where each input has 32-bit width. So I created an array to model the MUX but now I'm stuck with the Test Bench, it's gotten so complicated. Here is my original file (I'm sure it has so many redundancies) How can I actually make the test bench to recognize my array... | 1 | 1,499 |
AdminLTE Sidebar Active menu doesn't change dynamically | <p><strong>Bug | Help</strong>
The jquery just doesn't fire up correctly when I try to change the class on nav-link. Maybe this has been blocked by other js?</p>
<p>I am creating my <strong>index.php</strong> file which includes once <em>header.php, sidebard.php, and footer.php</em>
Some page is called up with conditi... | 1 | 2,921 |
Flutter :[cloud_firestore/unknown] NoSuchMethodError: invalid member on null: 'includeMetadataChanges' (Flutter Web) | <p>I am trying to fetch data from Friebase-firestore and then convert it to model, I used the same code and approach to another project (web project) ,it works fine , but with this project it doesn't work ,I don't know why. I upgrade flutter version, run Flutter doctor , and nothing wrong with the environment setup.
he... | 1 | 1,309 |
Flutter 'Unhandled Exception: type 'List<dynamic>' is not a subtype of type 'List<class>' | <p>I'm getting data from an API and i'm trying to push that data into two variables. I can access part of the data being returned but not all of it, I can print all of the data but when I try to access a specific part of it, it doesn't work.</p>
<p>E.G:
res = response from API</p>
<pre><code>print(res.data); // This wo... | 1 | 1,543 |
Running new Bluetooth Low Energy sample causes RuntimeException | <p>I've implemented the code in the <a href="http://developer.android.com/guide/topics/connectivity/bluetooth-le.html" rel="nofollow">Android 4.3 Bluetooth Low Energy</a> samples to find devices.</p>
<pre><code> final BluetoothManager bluetoothManager =
(BluetoothManager) getSystemService(BLUE... | 1 | 1,898 |
Android dynamically creating textview in a fragment | <p>I´ve a problem with my Android app which does´t make what I want.</p>
<p>Im trying to create in a fragment dynamically TextViews. But somehow I´m not getting to code to work.</p>
<p>So let´s start with my fragment opening activity:</p>
<p><div class="snippet" data-lang="js" data-hide="false">
<div class="snippet-... | 1 | 2,877 |
Grunt conditional option | <p>I'm attempting to create a Jade task that will have a build and dev task that have very similar options, except a dev boolean, and a different destination. The simplest way I've been able to achieve this is:</p>
<pre><code>jade: {
dev: {
options: {
data: {
dev: true, // dev t... | 1 | 1,087 |
When running the 'hello world' test container for new installation of Docker, i get an OCI runtime error | <p>I've installed Docker on Centos 7 using the yum process. Below is the output for <code>systemctl status docker.service -l</code>:</p>
<pre><code> ● docker.service - Docker Application Container Engine
Loaded: loaded (/usr/lib/systemd/system/docker.service; disabled; vendor preset: disabled)
Active: acti... | 1 | 2,293 |
How can I close a Material UI Modal using an X icon rather than just by clicking outside the modal? | <p>I am using the Material UI Modal component in my React app, and it will take up the majority of the screen (about 95%). As a result, I would like to give users a more intuitive way of closing the modal by adding a small "X" icon in the upper right of the modal and allowing that to close it. I am passing the same <co... | 1 | 1,811 |
How can I publish an NPM module with both commonjs and es6 versions? | <p>I have a module I want to publish to npm. I have found some "solutions" that are 4+ years old, examples using babel 5.x, and other problems that made the examples not work as shown.</p>
<p>Ideally I want to write my code using es6 and build/transpile with babel such that it can be imported with <code>requ... | 1 | 1,176 |
How do I catch google.auth.exceptions.RefreshError in python subscriber? | <p>I am trying to catch the following exception but am not having any luck.</p>
<pre><code>ERROR 2019-03-04 16:31:50,522 _plugin_wrapping 15 140108141426432 AuthMetadataPluginCallback "<google.auth.transport.grpc.AuthMetadataPlugin object at 0x7f6dd8330b70>" raised exception!
Traceback (most recent call last):
F... | 1 | 1,255 |
sort multidimensional array by date | <p>I have this <code>array</code>:-</p>
<pre><code>array (size=8)
0 =>
array (size=2)
'date' => string '17/05/2016 00:00:00' (length=19)
'reason' => string 'DNA' (length=3)
1 =>
array (size=2)
'date' => string '10/05/2016 00:00:00' (length=19)
'reason' => string ... | 1 | 1,385 |
Lazy initialize in Spring MVC | <p>Despite using configuration below I got lazy initialize error:</p>
<blockquote>
<p>org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: beans.Restaurant.tags, no session or session was closed</p>
</blockquote>
<p>and here the </p>
<p>web.xml:</p>
<pre><code><?xml vers... | 1 | 5,288 |
How to parse nested arrays / sub tables in TOML? | <p>I'm starting with <strong>Go</strong> and the official <a href="https://golang.org/doc/" rel="nofollow noreferrer">documentation</a> seems more for people who know Go already and just want to look stuff up. I'm hoping for a little nudge in the right direction here.</p>
<p><strong>What I'm looking to do:</strong> Pa... | 1 | 1,584 |
How to execute powershell script in sitecore from remote with parameter | <p>I am having a curious case about Sitecore Powershell Extensions. I have created a .net based Cmdlet which I can execute after using import command with required parameters.
Now I want to automate this cmdlet by scheduling it in external system as I don't trust the Sitecore Scheduler. So for that I write a new functi... | 1 | 2,457 |
What's wrong with my code? Zeller's Congruence algorithm code | <p>What's wrong with my code? For some reason I keep on getting the day off by one day? For example, today is the 26th of 2013 and it's a Tuesday, but the program tells me it's a Wednesday. I am using Zeller's Congruence algorithm.</p>
<pre><code>import javax.swing.JOptionPane;
public class zeller {
public static ... | 1 | 1,285 |
How do I pass data to modal view in ASP.NET MVC | <p>I am having problems passing data to modal view. Either modal view doesn't open at all or reads data from first item every time I open it.
The biggest problem I have is that I don't know jQuery.
I want a button to open a modal that reads a variable of my item in this case item.Code. Items are in a foreach loop.</p>
... | 1 | 1,449 |
Ldap query only returning 1000 users... yes I am using paging | <p>I have a simple GetStaff function that should retrieve all users from active directory. We have over a 1000 users so the directory searcher is using paging because the default for the AD MaxPageSize is 1000. </p>
<p>Currently the search works 'sometimes' when I build and sends back all 1054 users, and other times... | 1 | 1,123 |
Tracking Prevention blocked access to storage for https://appsforoffice.microsoft.com/lib/1.1/hosted/office.js | <p>I wrote an Excel add-in using the OfficeJS API about a year and a half ago and it has been working until about two weeks ago. It seems like Excel has had an update where I'm now allowed to right click on the taskpane and see dev tools, where I wasn't able to do that before and had to run an external MS Edge devtools... | 1 | 1,328 |
Async socket crashes when I close the socket | <p>The code shown below appears to almost work. If I create an instance of it and call "Connect" all works fine. When I call "Disconnect", sometimes everything is fine (mainly if I add a breakpoint and step through the function slowly). If I don't use a breakpoint the class(being hosted as a win forms app) seems to dis... | 1 | 1,949 |
Form label/input alignment not as expected in IE7 | <p>I have a html5 form which displays as expected in IE8 and above, also in Chrome, Safari, Forefox and Opera. But in IE7 the label alignment is completely different - the labels are displayed above the input fields rather than to the left of them and horizontally aligned which is what I'm after.</p>
<p>I haven't foun... | 1 | 1,529 |
Perl Tkx examples or tutorials | <p>I been trying to create Perl GUI using Tkx but I'm having trouble with a couple of issues.</p>
<p>i have been looking at these sites:</p>
<p><a href="http://rainbow.ldeo.columbia.edu/documentation/tkperl/" rel="nofollow">http://rainbow.ldeo.columbia.edu/documentation/tkperl/</a></p>
<p><a href="http://docs.active... | 1 | 1,236 |
git flow vs cherry-picks | <p>We have branches <strong><code>prod</code></strong> for production releases and <strong><code>dev</code></strong> for ongoing development.</p>
<h2>Our current flow:</h2>
<p>We work mainly in <strong><code>dev</code></strong> branch and from time to time, customer decides which features/bugfixes he wants to come to <... | 1 | 1,572 |
Trying to GRANT ASP.NET access to sample Database from my book | <p>I am trying to set up this book to run database apps under IIS, and grant
ASP.NET access to the database. The name of the book is:</p>
<p>Murach's ASP.NET 4 Web Programming with C# 2010 (Murach: Training & Reference)</p>
<p>The book came with two files to do this:</p>
<blockquote>
<p>"grant_access_windows_... | 1 | 1,142 |
Openssl in windows issue | <p>While I try to create lib files for windows.The following error came.
Please help on this issue.</p>
<p><strong>CODE Explanation</strong></p>
<p>This Line I actually typed in visual studio command prompt.This will create the obj and dll files for OpenSSL.</p>
<pre><code> X:\dev\openssl>nmake -f ms\ntdll.mak
... | 1 | 3,552 |
Java: Using Try/Catch Exception to check if user input is Double | <p>I am writing a simple program that allows a user to enter two separate doubles for a foot and inch measurement. The program is intended to take these values and convert them to centimeters and output them. Additionally I am to include two exceptions: one to make sure the numeric values are positive and not negative ... | 1 | 1,280 |
jquery autocomplete doesn't work on localhost | <p>I hope you can help me.</p>
<p>I have used on a localhost aspx page the following code so it autocompletes.</p>
<p>It works perfect.</p>
<pre><code><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
"http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<scri... | 1 | 1,630 |
std::cout not working inside a for-loop | <p>I'm new to C++, and right now I'm learning from the book called <em>Accelerated C++</em>. I finished the third chapter (vectors), and I came to this exercise:</p>
<p>"Write a program to count how many times each distinct word appears in its input."</p>
<p>After some thinking, I started working on it. I wanted to t... | 1 | 1,055 |
removeClass("has-error") when field was changed Bootstrap, javascript | <h3>My Javascript</h3>
<pre><code>$('.input-group').each(function() {
$mainElement = $(this);
$sibling = $mainElement.next('.form-control');
$sibling.change(function($mainElement) {
return function() {
$mainElement.removeClass('has-error');
}
}($mainElement)); });
</code></pre>
<h3>My Form</h3... | 1 | 1,128 |
how to create user profile in ionic with firebase | <p>I am new to Ionic and Angular. I am developing an order placement app, but I m having trouble with creating a new user profile. </p>
<p>I m following this <a href="https://www.youtube.com/watch?v=uESqBwFVf1Q&t=307s" rel="nofollow noreferrer">video</a>, but data is not saving in Firebase. Also, I already have a ... | 1 | 1,338 |
Binding Color in Xamarin listView | <p>I've checked some answers before but nothing helped me. I'm trying to change background color of ViewCell in ListView by binding StackLayout BackgroundColor.
For now it looks like this<a href="https://i.stack.imgur.com/Dncce.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Dncce.png" alt="enter ima... | 1 | 2,138 |
Help for creating a random String | <p>I need to create a random string which should be between the length of 6 to 10 but it sometimes generates only about the length of 3 to 5.
Here's my code. Can anyone would be able to find out the problem? :(</p>
<pre><code> int lengthOfName = (int)(Math.random() * 4) + 6;
String name = "";
... | 1 | 1,575 |
Can't change Bootstrap pagination color | <p>I want to change the bootstrap pagination color but I can't in any way, It is blue no matter what I do. i want o change the .pagination li a.active to red and the .pagination li a to black. What have I done wrong? ... | 1 | 1,215 |
How to create functional buttons in flutter? | <p>I am new to flutter and I am trying to create a functional calculator. I have got my layout right. However, for some reason, I am not able to change the state of my main.dart when I click the buttons and ask the app to do some operations. I have created a separate class for my buttons and call them in the main.dart ... | 1 | 3,800 |
knockout observable array not updating after ajax addition | <p>I have an observable array of a complex object. The initial load is fine, and all the expected data looks fine. Now I am working on POSTing new items to that array. NOTE: The observable array is being loaded via ASP.NET ajax web api call.</p>
<p>posting a new item works fine as far as saving it to the database, but... | 1 | 1,923 |
rake db:migrate not working on my postgres db | <p>Ok so i have a rails application that I am attempting to run the migrations on a postgres db and I usually use mysql and all is good but when i run the command i get this</p>
<pre><code>rake db:migrate
(in /Users/tamer/Sites/my_app)
/Users/tamer/.rvm/gems/ruby-1.9.2-p290@my_app/gems/activerecord-3.0.3/lib/active_re... | 1 | 7,092 |
Google Firebase Authentication Android Studio | <p>Im attempting to configure the new google firebase authentication in my app.</p>
<p>I am receiving <code>cannot resolve 'addOnCOmpleteListener'</code> when running the following within the <code>OnClickListener</code> for the button.</p>
<p>If i move the <em>firebase</em> call out of the buttons <code>onClickListe... | 1 | 1,693 |
How to use flex/grid to center grid in a container? | <p>Even though there are a lot of questions on centering divs and what not, for some reason none of them seem to work. Being the css noob that I am with flex/grid, all I know is that I want to have:</p>
<ul>
<li>fixed header</li>
<li>fixed middle content (both horizontally and vertically centered)</li>
<li>fixed footer... | 1 | 1,101 |
Flask login without database | <p>I need to implement a simple login functionality to one of the applications that I a working on using <code>flask-login</code>. The authentication checking is hardcoded if condition and it is validating whether username password equals to a string given. The code is like the following:</p>
<pre><code>@auth_bp.route(... | 1 | 1,087 |
JavaFx Stuck in while loop | <p>I am new to JavaFx and am trying to code my hangman game. I am at the point where I have to check to see if the file that holds my lexicon is there. If not ask user to enter its location. I am trying to do this in a popup windows that asks the user to enter the location and hit a button, This button in turn will cau... | 1 | 2,209 |
Android Scroll View not working programmatically? | <p>I tried the following code hoping to scroll horizontally.
A total of four buttons are created, Two should be on screen and the other two should come once scrolled.
Additionally, i want circular wrapping in both side.</p>
<pre><code>public class MainActivity extends Activity
{
@Override
protected void onC... | 1 | 1,859 |
SoundPlayer throws an Exception that wave header is corrupt but it is not | <p>I am developing a simple real time audio library. Where the programmer can make calls to methods that can play audio in real-time. In addition, the programmer can call methods that can play a sine wave at specific frequency and duration in real-time. The audio format that is being played in realtime is WAV. The prob... | 1 | 1,640 |
We're using some code from twitter bootstrap and our divs are off in Internet Explorer (7-9) | <p><img src="https://i.stack.imgur.com/UNj8i.png" alt="enter image description here">The code we used is from the less file that's related to positioning. The website looks great in safari, firefox, and chrome and looks off in IE version 7, 8, and 9. Does bootstrap have a known issue with IE? Probably not since it's so... | 1 | 1,902 |
Trigger based partition creation | <p>I have a list partitioned table on a foreign key. So if I want to insert a new entity the missing partition throws an exception on insert. I thought I am a cool duke and use a trigger to create new partitions :-) But the partition will not become available during execution. If you wait a bit everything works fine (b... | 1 | 1,075 |
How to grant db_owner permissions to an application role? | <p>How can grant all the rights and privileges of the <code>db_owner</code> fixed database role to an application role?</p>
<h1>Short Version</h1>
<p>The command:</p>
<pre class="lang-sql prettyprint-override"><code>GRANT CONTROL ON [DatabaseName] TO [ApplicationRoleName];
</code></pre>
<p>would be what I want, but... | 1 | 3,392 |
Rotate CMSampleBuffer by arbitrary angle and append to AVAssetWriterInput in swift 3 | <p>I convert the sample buffer to a <code>CGContext</code>. Then I apply a transformation to the context and create a <code>CIImage</code> from that, which in turn gets displayed in an <code>UIImageView</code>. </p>
<p>At the same time I want to append this to the <code>AVAssetWriterInput</code> to create a movie of t... | 1 | 1,947 |
Making a GET request of a JSON RPC API instead of a POST request | <p>Is it possible to make a GET request to a JSON RPC API? I'm trying to do this using the random.org api (<a href="https://api.random.org/json-rpc/1/" rel="nofollow noreferrer">https://api.random.org/json-rpc/1/</a>). It's functioning if I use a POST request but I need to make GET requests for all APIs that I'm using ... | 1 | 1,103 |
D3 y-axis percent display | <p><a href="http://jsfiddle.net/9fd92y9x/38/" rel="nofollow">D3 Fiddle</a> </p>
<pre><code>/**
* A bar chart. Required data format:
* [ { name : x-axis-bar-label, value : N }, ...]
*
* Sample use:
* var bargraph = d3.select('#bargraph')
* .append('svg')
* .chart('BarChart')
* .yFormat(d3.format("d"))
* ... | 1 | 3,626 |
Change calculator | <p>i have a tusk where i have been asked to write a program that calculate change to be given to a customer after a cash transaction, and determines the number of bank notes and coins in each denomination.</p>
<p>the user has to put in the cost of goods and the amount received from the customer. </p>
<p>I must have a... | 1 | 1,482 |
Check if div has opacity of 1 jquery | <p>I am trying to check whether a slide has the opacity of 1 if it does i want to remove a class and then add a class, it works only on the first one currently this is my code .</p>
<pre><code>$(document).ready(function () {
if ($('#slide1').css('opacity') == 1) {
alert("slide1");
$('#slide1 img').rem... | 1 | 1,866 |
Refresh RecyclerView fragment from another fragment's adapter | <p>I am making an Android e-commerce app connected to WordPress. In my app I have <em>two Fragments</em>: a <strong>Shop fragment</strong> (with products fetched from the website in it) and <strong>My Wishlist fragment</strong> (with wishlist products in it). I also have <em>two lists</em>: one for the <strong>retrieve... | 1 | 1,389 |
how to create new directory everyday having its name as current date | <pre><code>Date dir = new java.util.Date(System.currentTimeMillis());
String baseDir = "/home/gaurav/usr/logs/ESBegin/";
String newDir = createDateBasedDirectory(baseDir, dir);
Logger logger = Logger.getLogger("MyLog1");
FileHandler fh;
try {
// This block configure the logger with handler and formatter
... | 1 | 1,456 |
Why is Android ignoring the creation of the Notification? | <p>I have code, and it just does not work, so I ask anyone to help me out. There is very little info on this specific matter.</p>
<p><strong>MainActivity</strong></p>
<hr>
<pre><code>public class MainActivity extends Activity {
public final int PENDING_INTENT_ID = 8;
@Override
public void onCreate(Bundle savedInstan... | 1 | 1,597 |
OpenSSL verify fails, can't find root certificate | <p><strong>Important Note:</strong> The method of validating certificates in my question below is incorrect, and will result in both false positives and false negatives. See my answer for the correct method.</p>
<hr>
<p>I'm in the process of testing a tool I wrote to test all of the certificates in our environment, a... | 1 | 1,609 |
How can I optimize my basic physics simulator? | <p>I've written a simple physics modeler that allows me to bounce balls around the screen. You can click and drag to launch a ball, or you can generate balls hundreds at a time and watch them interact with each other.</p>
<p><a href="https://i.stack.imgur.com/xRoTW.png" rel="nofollow noreferrer"><img src="https://i.s... | 1 | 1,582 |
Rails: Permission denied - bind(2) for "127.0.0.1" port 3000 (Errno::EACCES) | <p>I follow a tutorial on how to get started with rails, but end up with different outcome than the video. Here is the message I get back when using the command rails s:</p>
<pre><code>C:/RailsInstaller/Ruby2.3.0/lib/ruby/gems/2.3.0/gems/puma-3.8.2/lib/puma/binder.rb:269:in `initialize': Permission denied - bind(2) fo... | 1 | 1,528 |
Heroku[router]: at=error code=H10 desc=”App crashed“ method=GET path=/favicon.ico” | <p>I have a simple MERN APP, that works fine on localhost, but when I deploy it to Heroku I see a page with this error:</p>
<blockquote>
<p>Application error An error occurred in the application and your page
could not be served. If you are the application owner, check your logs
for details. You can do this from the He... | 1 | 4,685 |
How can I fix Prolog Syntax error: Operator expected error? | <pre>PROLOG: “Syntax error: Operator expected”
ERROR: c:/users/zulfekarali/Desktop/KBS/kbs.pl:2:3: Syntax error: Operator expected
% c:/Users/ZulfekarAli/Desktop/KBS/kbs.pl compiled 0.00 sec, 27 clauses
--------
domains
disease,indication = symbol
Patient,name = string
predicates
hypothesis(string,diseas... | 1 | 1,712 |
GridView SelectedIndexChanging event, find text in TemplateField | <p>i have grid and it's selectIndexchanging event.</p>
<p>my aspx code:</p>
<pre><code> <asp:GridView ID="gvClients" runat="server" AutoGenerateColumns="False" BackColor="LightGoldenrodYellow"
BorderColor="Tan" BorderWidth="1px" CellPadding="2" ForeColor="Black" GridLines="None"
OnRowEditing="gv... | 1 | 1,605 |
Get a screenshot of a window that is cover or not visible or minimized with Xcomposite extension for X11 | <p>I have the follow starting code to get a screenshot of a X window (the window can be covered, not visibled, or minimized).</p>
<pre><code>#include <stdlib.h>
#include <stdio.h>
#include <X11/Xlib.h>
#include <X11/X.h>
#include <X11/extensions/Xcomposite.h>
#include <X11/extensions/... | 1 | 1,089 |
React: How to maintain caret position when editing contentEditable div? | <p><strong>Currently</strong></p>
<ol>
<li>I have a react component that stores a <code>newValue</code> when the user clicks on a contentEditable <code><div></code>, and updates <code>newValue</code> as the user types. <em>Note: there are 2 main reasons why I have set up this behavior this way: (1) I do not want... | 1 | 1,180 |
glassfish: while deploying the app IOException: invalid zip file | <p>In deploying the EAR through the CLI, this error occurs:</p>
<pre><code>Exception while deploying the app [EnterpriseLegacy] : java.io.IOException: invalid zip file: file:/home/thufir/glassfish-4.1/glassfish/domains/domain1/application /EnterpriseLegacy/lib/RemoteEJB.jar
</code></pre>
<p>and yet, Netbeans deploys ... | 1 | 6,863 |
Vue - Render components depending on state of parent data | <p>I'm trying to render components depending on the state of an array in the parent (App.vue). I'm not sure at all that this is the correct approach for this use case (new to Vue and not experienced programmer) so I will gladly take advice if you think this is not the right way to think about this.</p>
<p>I'm trying t... | 1 | 1,806 |
How to Convert Json Array To PHP Array | <p>these are my two functions used in model for save & retrieve the data in my database </p>
<p>Here is my function for save data //</p>
<pre><code> public function save_po($supid,$cart,$total)
{
$num=rand(1,99999);
$date=Date('Y-m-d');
$array_string=json_encode($cart);// $cart is an multi dim... | 1 | 1,446 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.