This is the folder structure of my app
.idea
.vscode
android
build
fonts
Oxygen-Bold.tff
Oxygen-Light.tff
Oxygen-Regular.tff
images
pizza0.png
pizza1.png
ios
lib
ui
home.dart
main.dart
test
..
I'm facing this error for multiple variables even treating missing values.
For example:
le = preprocessing.LabelEncoder()
categorical = list(df.select_dtypes(include=['object']).columns.values)
for c..
I just started programming Python. I want to use scrapy to create a bot,and it showed
TypeError: Object of type 'bytes' is not JSON serializable when I run the project.
import json
import codecs
c..
I'm trying to do an api call from my angular app. What I want to do is send a post request to the api with a command param. I have done a lot of server side testing as well as going through the outgoi..
I am getting
TypeError: unhashable type: 'slice'
when executing the below code for encoding categorical data in Python. Can anyone please help?
# Importing the libraries
import numpy as np
imp..
I use KerasClassifier to train the classifier.
The code is below:
import numpy
from pandas import read_csv
from keras.models import Sequential
from keras.layers import Dense
from keras.wrappers.scik..
I am trying to encode some information to read into a Machine Learning model using the following
import numpy as np
import pandas as pd
import matplotlib.pyplot as py
Dataset = pd.read_csv('filenam..
A bunch of the tweets I am importing are having this issue where they read
b'I posted a new photo to Facebook'
I gather the b indicates it is a byte. But this is proving problematic because in my ..
It may be a duplicate but i am facing some problem to convert the image into Base64 for sending it for Http Post. I have tried this code but it gave me wrong encoded string.
public static void main(..
I have a spring boot web app with spring security configured. I want to disable authentication for a while (until needed).
I add this to the application.properties:
security.basic.enable: false
..
I am setting up Spring Security to handle logging users in. I have logged in as a user, and am taken to an Access Denied error page upon successful login. I don't know what roles my user has actually ..
I am working on a text encryption and decryption project (following Struts 2)
Whenever I enter the password and the plain text I get a Invalid AES Key Length error.
The Service Class
package com.an..
I use Spring boot+JPA and having a problem while starting the service.
Caused by: java.lang.IllegalArgumentException: Not an managed type: class com.nervytech.dialer.domain.PhoneSettings
at org.h..
I'm trying to send a confirmation email after user registration. I'm using the JavaMail library for this purpose and the Java 8 Base64 util class.
I'm encoding user emails in the following way:
byte..
I'm trying to use scikit-learn's LabelEncoder to encode a pandas DataFrame of string labels. As the dataframe has many (50+) columns, I want to avoid creating a LabelEncoder object for each column; I'..
This is the code I currently have:
public class FileStatus extends Status{
FileWriter writer;
public FileStatus(){
try {
writer = new FileWriter("status.txt",true);
} catch (IOExcepti..
I am using Python-2.6 CGI scripts but found this error in server log while doing json.dumps(),
Traceback (most recent call last):
File "/etc/mongodb/server/cgi-bin/getstats.py", line 135, ..
So I was attempting to use this String in a URL :-
http://site-test.com/Meetings/IC/DownloadDocument?meetingId=c21c905c-8359-4bd6-b864-844709e05754&itemId=a4b724d1-282e-4b36-9d16-d619a807ba67&am..
I'm using Spring Security 3.2 and Spring 4.0.1
I'm working on converting an xml config into a Java config. When I annotate AuthenticationManager with @Autowired in my Filter, I'm getting an exception..
I send String-messages to Kafka V. 0.8 with the Java Producer API.
If the message size is about 15 MB I get a MessageSizeTooLargeException.
I have tried to set message.max.bytesto 40 MB, but I still ..
I am using d3 to draw a line from a relative svg position and hence want to access the coordinates of the element itself. I tried something like this (where "this" refers to the element)
.attr("x1",..
I tried to cut the video using the start and end time of the video by using the following command
ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4
By using t..
I have an HTML 5 video in a div. I then have a custom play button - that works fine.
And I have the video's visibility set to hidden on load and visible when the play button is clicked, how do I retur..
As of Spring Security 3.1.4.RELEASE, the old org.springframework.security.authentication.encoding.PasswordEncoder has been deprecated in favour of org.springframework.security.crypto.password.Password..
I've created an API in Go that, upon being called, performs a query, creates an instance of a struct, and then encodes that struct as JSON before sending back to the caller. I'd now like to allow the..
I'm getting a decrypting error in java class:
javax.crypto.IllegalBlockSizeException :
Input length must be multiple of 16 when decrypting with padded cipher.
What can I do to solve this probl..
I have a simple player and recorder. Everything works great but have a one problem. I want to add seek bar to see progress in playing record and use this seek bar to set place from player should play..
I want to serialize my queryset, and I want it in a format as this view outputs:
class JSONListView(ListView):
queryset = Users.objects.all()
def get(self, request, *args, **kwargs):
..
I trying to consume a WCF web service using stand alone application. I am able to view this service using Internet Explorer also able to view in Visual studio service references.
This is the error I..
I am doing some scripts in python. I create a string that I save in a file. This string got lot of data, coming from the arborescence and filenames of a directory.
According to convmv, all my arboresc..
The below code snippet is using to call my web service using restful API.
ClientConfig config = new DefaultClientConfig();
Client client = Client.create(config);
String uri= "https://127.0.0...
I've done a lot of googling but not had much luck with my issues. I am new to network programming and trying to learn, I've attempted to set up a simple server & client that communicate (following..
I am getting The remote server returned an error: (400) Bad Request error while running the following code.
I am trying to upload xml file on the http server.
My xml file contains tag for the username..
I need to encode some data in the Base64 encoding in Java. How do I do that? What is the name of the class that provides a Base64 encoder?
I tried to use the sun.misc.BASE64Encoder class, without s..
I am trying to load and parse a JSON file in Python. But I'm stuck trying to load the file:
import json
json_data = open('file')
data = json.load(json_data)
Yields:
ValueError: Extra data: line 2 ..
I have just installed ffmpeg and I am trying to encode all my uploaded videos to .mp4 file. Most of the users currently upload .mov and I want to convert every video to .mp4.
I am running the command..
Buiding MVC3 solution went well but have got an error in browser:
Compiler Error Message: CS0234: The type or namespace name 'Html' does not exist in the namespace 'System.Web.Mvc' (are you missing a..
Background: I am writing a python program which should manage my music files. It crawls directories and puts the files and their meta data (via mutagen), encoded in JSON, in a file as a simple "databa..
Say I have a URL
http://example.com/query?q=
and I have a query entered by the user such as:
random word £500 bank $
I want the result to be a properly encoded URL:
http://example.com/quer..
I am developing an application with Hibernate and I get an Exception when I connect with database. The exception is:
Unable to instantiate default tuplizer [org.hibernate.tuple.entity.PojoEntityTupli..
I am trying to add text subtitles to an .mp4 container using ffmpeg:
ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4
When I am trying to run this line, it gives me an error :..
I have a case like getting an XML and convert the XML elements to document object and getting the element values and attributes which i have been created already
Here is the piece of code i have trie..
I have a Python set that contains objects with __hash__ and __eq__ methods in order to make certain no duplicates are included in the collection.
I need to json encode this result set, but passing ev..
I've got a basic HTML form from which I can grab a bit of information that I'm examining in Firebug.
My only issues is that I'm trying to base64 encode the file data before it's sent to the server whe..
I want to encode a Javascript object into a JSON string and I am having considerable difficulties.
The Object looks something like this
new_tweets[k]['tweet_id'] = 98745521;
new_tweets[k]['user_id']..
I'm developing game app and using Symfony 2.0. I have many AJAX requests to the backend. And more responses is converting entity to JSON. For example:
class DefaultController extends Controller
{ ..
I've been trying to get some working Java code to use for encrypting Paypal buttons. This is no easy task! Even when I get some code, from Paypal, I'm faced with errors..ugh..
So here is what I have ..
I'm trying to pass a JavaScript variable to the server-side using jquery.ajax method.
I'm trying to create a json string, but when the length of variable reaches 10000, no more data is appended to th..
How can I configure Logback to log different levels for a logger to different destinations?
For example, given the following Logback configuration, will Logback record INFO messages to STDOUT and ERR..
I'm working on web application that needs to render a page and make a screenshot on the client (browser) side.
I don't need the screenshot to be saved on the local HDD though, just kept it in RAM an..
For this two imports;
import sun.misc.BASE64Encoder;
import sun.misc.BASE64Decoder;
I got this error:
Access restriction: The type BASE64Decoder is not accessible due to restriction on required li..
How does one encode query parameters to go on a url in Java? I know, this seems like an obvious and already asked question.
There are two subtleties I'm not sure of:
Should spaces be encoded on th..
I've got a WCF Service running on my local IIS server. I've added it as a service reference to a C# Website Project and it adds fine and generates the proxy classes automatically.
However, when I try..
I am expecting
System.out.println(java.net.URLEncoder.encode("Hello World", "UTF-8"));
to output:
Hello%20World
(20 is ASCII Hex code for space)
However, what I get is:
Hello+World
Am I using ..
I would like to run an external command line program from my Mono/.NET app.
For example, I would like to run mencoder. Is it possible:
To get the command line shell output, and write it on my text ..
I have the following logback.xml file:
<configuration debug="true">
<appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
<encoder>
<pattern>%d{HH:mm:ss.SS..
How do you encode a URL in Android?
I thought it was like this:
final String encodedURL = URLEncoder.encode(urlAsString, "UTF-8");
URL url = new URL(encodedURL);
If I do the above, the http:// in ..
When creating JSON data manually, how should I escape string fields? Should I use something like Apache Commons Lang's StringEscapeUtilities.escapeHtml, StringEscapeUtilities.escapeXml, or should I us..
Okay, so I'm going to take the off chance that someone here has used zxing before. I'm developing a Java application, and one of the things it needs to do is encode a byte array of data into a QR Code..
Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to t..
I would like to generate POST request to a server which requires authentication. I tried to use the following method:
private synchronized String CreateNewProductPOST (String urlString, String encode..
I'm trying to resize an image while preserving the aspect ratio from the original image so the new image doesn't look squashed.
eg:
Convert a 150*100 image into a 150*150 image.
The extra 50 pi..
I am using Java NIO for my socket connections, and my protocol is text based, so I need to be able to convert Strings to ByteBuffers before writing them to the SocketChannel, and convert the incoming ..
In a URL, should I encode the spaces using %20 or +? For example, in the following example, which one is correct?
www.mydomain.com?type=xbox%20360
www.mydomain.com?type=xbox+360
Our company is lean..
I'm trying to create a Python script that would :
Look into the folder "/input"
For each video in that folder, run a mencoder command (to transcode them to something playable on my phone)
Once menco..
This seems to be a bit of an infamous error all over the web. So much so that I have been unable to find an answer to my problem as my scenario doesn't fit. An exception gets thrown when I save the im..
I have the following code in a sample file:
#include "SkCanvas.h"
#include "SkDevice.h"
#include "SkGLCanvas.h"
#include "SkGraphics.h"
#include "SkImageEncoder.h"
#include "SkPaint.h"
#include "SkPi..
I am trying to read a CSV file with accented characters with Python (only French and/or Spanish characters). Based on the Python 2.5 documentation for the csvreader (http://docs.python.org/library/csv..
My Java standalone application gets a URL (which points to a file) from the user and I need to hit it and download it. The problem I am facing is that I am not able to encode the HTTP URL address prop..
I've been experimenting with various bits of Java code trying to come up with something that will encode a string containing quotes, spaces and "exotic" Unicode characters and produce output that's id..
I am trying to get a java.net.URI object from a String. The string has some characters which will need to be replaced by their percentage escape sequences. But when I use URLEncoder to encode the Stri..
I have a list of items
John ID
Matt ID
John ID
Scott ID
Matt ID
John ID
Lucas ID
I want to shove them back into a list like so which also means I want to sort by the highest number of duplicates.
..
I want to send a URI as the value of a query/matrix parameter. Before I can append it to an existing URI, I need to encode it according to RFC 2396. For example, given the input:
http://google.com/re..
I had created the xml document with xml version="1.0".
In that document I need to use the greater than symbol > and less than symbol <.
How should I include those symbols? It's not working.
&..
I get the following warning when using java.net.URLEncoder.encode:
warning: [deprecation] encode(java.lang.String)
in java.net.URLEncoder has been deprecated
What should I be using instead?..
I have been searching all over the internet but I couldn't seem to find an answer that I can understand.
So kindly, if somebody could explain to me with the help of examples what is cardinality in da..
I have a text file with a large amount of data which is tab delimited. I want to have a look at the data such that I can see the unique values in a column. For example,
Red Ball 1 Sold
Blue Bat..
I am trying to allow the user to edit a list of items by using ngRepeat and ngModel. (See this fiddle.) However, both approaches I've tried lead to bizarre behavior: one doesn't update the model, and ..
I've looked through a couple of questions to find out if an HTML5 element is playing, but can't find the answer. I've looked at the W3 documentation and it has an event named "playing" but I can't see..
I'm trying to make something like this:
private String getStringIfObjectIsPresent(Optional<Object> object){
object.ifPresent(() ->{
String result = "result";
..
The problem is that I need to know if it's version 3.5 SP 1. Environment.Version() only returns 2.0.50727.3053.
I found this solution, but I think it will take much more time than it's worth, so I'm ..
For example I have a table with 2 columns, first_name and last_name with these values
Ali Khani
Elizabette Amini
Britney Spears
,...
I want to write a select query that generate ..
I have installed C++SDK that have Qt but when I try compiling a code linking QApplication it gives me the error:
Error QApplication: no such file or directory
How do I link these libraries? I searc..
This standard code for an IFRAME, is there a way to replace the src URL with Just html code? so my problem is simple, I have a page it loads an HTML body from MYSQL I want to present that code in a fr..
I'm trying to disassemble a program to see a syscall assembly instruction (the INT instruction, I believe) and the handler with GDB and have written a little program (see below) for it that opens and ..
I'm working with an Oracle database, and I would like to read the contents of a BLOB. How do I do this?
When I do a simple select statement, it merely returns "(BLOB)" (without the quotes). How do I..
If I have a list of lists and just want to manipulate an individual item in that list, how would I go about doing that?
For example:
List1 = [[10,13,17],[3,5,1],[13,11,12]]
What if I want to take..
I am wondering why the method String.valueOf(int i) exists ? I am using this method to convert int into String and just discovered the Integer.toString(int i) method.
After looking the implementation..
I have made some repetitive operations in my application (testing it), and suddenly I’m getting a weird error:
OperationalError: database is locked
I've restarted the server, but the error persi..
With Spring Boot I can instantiate a JdbcTemplate with the following:
Code:
@Autowired
private JdbcTemplate jdbcTemplate;
Properties:
spring.datasource.url=jdbc:postgresql://my_url:my_port/my_oth..
I am working through some code done by a previous developer. I'm pretty new to PHP so I am wondering if there is any well known pattern or solution to this problem.
Basically the original author does ..
I've set up this simple version of the Bootstrap accordion:
Simple accordion:
http://jsfiddle.net/darrenc/cngPS/
Currently the icon only points down, but does anyone know what JS would be needed to ..
When compiling a specific Android project, and only on my Windows machine, I get a java.nio.BufferOverflowException during from dex. The problem occurs both when using Eclipse and when using Ant.
The..
Is there a way to add css from a string in the javascript file to the head of a document with javascript?
Let's say we have a webpage, which has a lightbox script, this script requires a css file to ..
What is the difference between a static array and a dynamic array in C++?
I have to do an assignment for my class and it says not to use static arrays, only dynamic arrays. I've looked in the book an..
I'm building an ASP.NET MVC site where I'm using Lucene.Net for search queries. I asked a question here about how to properly structure Lucene.Net usage in an ASP.NET MVC application and was told that..
I have made 3 git commits, but have not been pushed.
How can I amend the older one (ddc6859af44) and (47175e84c) which is not the most recent one?
$git log
commit f4074f289b8a49250b15a4f25ca4b4601745..
I'm trying to draw down the formula that's in cell M3 to the end of the data set.
I'm using column L as my base to determine the last cell with data. My formula is a concatenation of two cells with a..
I am looking for a JavaScript array insert method, in the style of:
arr.insert(index, item)
Preferably in jQuery, but any JavaScript implementation will do at this point...
When i click on map, which will be best way to find nearest marker or markers? is there some functions in api that will help me to do that?
it's google map api v3...
I'm trying to create a mixin for placeholders in sass.
This is the mixin I've created.
@mixin placeholder ($css) {
::-webkit-input-placeholder {$css}
:-moz-placeholder {$css}
::-moz..
Can you please tell me if there is any DOM API which search for an element with given attribute name and attribute value:
Something like:
doc.findElementByAttribute("myAttribute", "aValue");
..
I've been writing some shell script and I would find it useful if there was the ability to halt the execution of said shell script if any of the commands failed. See below for an example:
#!/bin/bash
..
Can someone give me step by step guide to add the Gson library to an Android project?
I tried the JSON built-in library but that seems to be a bit tedious right now. I saw a couple of examples based..
I'm doing development on MongoDB. For totally non-evil purposes, I sometimes want to blow away everything in a database—that is, to delete every single collection, and whatever else might be lying a..
I'm trying to implement a KeyListener for my JFrame. On the constructor, I'm using this code:
System.out.println("test");
addKeyListener(new KeyListener() {
public void keyPressed(KeyEvent e) { S..
I've been Googling and trying all the solutions I could find or think of myself. The site I'm trying to load is running TLS1.2 as is a few other sites I tried to test with to make sure it wasn't a TLS..
JQuery and other frameworks add the following header:
X-Requested-With: XMLHttpRequest
Why is this needed? Why would a server want to treat AJAX requests differently than normal requests?
UPDAT..
I have an app that uses radio buttons. The default for this button is set in the main.xml file, ie:
android:id="@+id/rb_sat1E"
android:checked="true"
In the Java file I have:
final RadioButton ra..
Note: I realise this could be seen as a duplicate but i have looked at the other responses and they didn't fix the problem for me.
I have recently installed Zend Studio and Zend Server with the mys..
How do I display a TextArea for my android project? From xml, the only choice is TextField, multi lined. But thats editable. I need a TextArea which is only for displaying messages/text can't be edit/..
I have installed node modules by npm install, then I tried to do gulp sass-watch in command prompt. After that I got the below response.
[18:18:32] Requiring external module babel-register
fs.js:27
c..
Does Python have a built-in, simple way of encoding/decoding strings using a password?
Something like this:
>>> encode('John Doe', password = 'mypass')
'sjkl28cn2sx0'
>>> decode('s..
I am trying to convert my output into a pandas data frame and I am struggling. I have this list
my_list = [1,2,3,4,5,6,7,8,9]
I want to create a pandas data frame that would have 3 columns and thre..
I have got a span with dynamic data in my page, with ellipsis style.
.my-class
{
text-overflow: ellipsis;
overflow: hidden;
white-space: nowrap;
width: 71px;
}
<span id="myId" class="m..
I'm having a hard time finding and answer to this. If I had to hypotheitcally remove the Windows license key from a VM that's been specifically setup for a partner, and it needs to be removed before t..
I am building a jQuery mobile site, and I am trying to insert a scalable image into the background, which would adjust to screen size of the phone.
This is my code:
<!DOCTYPE html>
<html>..
In Angular 2 templates safe operator ?. works, but not in component.ts using TypeScript 2.0. Also, safe navigation operator (!.) doesn't work.
For example:
This TypeScript
if (a!.b!.c) { }
compiles t..
I have written a script to retrieve certain value from file.json. It works if I provide the value to jq select, but the variable doesn't seem to work (or I don't know how to use it).
#!/bin/sh
#this..
I need to store image and resume of user in the data base.
I am using mysql data base and php5. I need to know which data types I should use.
And also how do I set a limit (maximum size) for upload..
I'm sure this question has been answered already, however I was unable to find an answer using the search tool.
Using c# I'd like to run a .sql file. The sql file contains multiple sql statements, so..
I am a new comer to the android world and with a .NET background. I am trying to install the Android Studio but I am having a mismatch on Android.com about the JDK version required for developing Andr..
Question
How to navigate from one view controller to another simply using a button's touch up inside event?
More Info
What I tried in a sample project, in steps, was:
Create the sample single vie..
I currently have a local Git repository, which I push to a Github repository.
The local repository has ~10 commits, and the Github repository is a synchronised duplicate of this.
What I'd like to d..
Possible Duplicate:
Simple statistics - Java packages for calculating mean, standard deviation, etc
I have a vector of some doubles (1.1,2,3,5). How can I calculate the variance, median, an..
I'm finishing up a WP theme, and I'm on the single.php template. I'm having some issues because I need to access the parent category that a post is in in order to display certain images and XML conten..
I have table which class is forum. My jquery code:
<script type="text/javascript">
$(document).ready(function() {
$('.forum').bind("mouseover", function(){
var color = ..
I'm having a problem always when I'm trying to close a window through the window.close() method of the Javascript, while the browser displays the below message on the console:
"Scripts may close only..
I have pgAdmin version 1.16.1
So, for exporting table dumm I do:
Right click on table, then in menu click on backup, then in Format choice Plain and save file as some_name.sql
Then I remove table..
We always write code like this formal:
void main(){
if(){
if()
}
But when I use Notepad++, the display is:
void main(){
if(){
if()
}
How do I use Notepad++ to auto indent?
Thanks ..
I'm trying to replace multiple words in a string with multiple other words. The string is "I have a cat, a dog, and a goat."
However, this does not produce "I have a dog, a goat, and a cat", but inst..
What's a good algorithm for calculating frames per second in a game? I want to show it as a number in the corner of the screen. If I just look at how long it took to render the last frame the number c..
File "C:\Python27\lib\socket.py", line 224, in meth
return getattr(self._sock,name)(*args) gaierror: [Errno 11004]
getaddrinfo failed
Getting this error when launching the hello world sample..
How can i store and display the images in a MySQL database. Till now i have only written the code to get the images from the user and store them in a folder, the code that i wrote till now is:
HTML FI..
I'm attempting to use the ESLint linter with the Jest testing framework.
Jest tests run with some globals like jest, which I'll need to tell the linter about; but the tricky thing is the directory ..
I have Range object called DistinationRange which contains reference to range B3:H63
I want to apply the following two conditional formatting rules using Excel VBA code dynamically. (Because the rang..
I'm developing an application (a kind of social network for my university). I need to add a comment (insert a row in a specific database). To do this, I have a HTML form in my html page with various f..
I have an AJAX app built for mobile Safari browser that needs to display different types of content.
For some content, I need user-scalable=1 and for other ones, I need user-scalable=0.
Is there a w..
How do I find (and kill) processes that listen to/use my tcp ports? I'm on mac os x.
Sometimes, after a crash or some bug, my rails app is locking port 3000. I can't find it using ps -ef...
When doi..
About a month ago Mitt’s question went unanswered. Sadly, I’m running into the same situation now.
http://api.jquery.com/change/#comment-133939395
Here’s the situation: I’m using jQuery to c..
Is it possible to setup SVN repo/server on google drive or dropbox etc?
I want to put my PhD project under version control.
The data has to stay private and only accessible to me and my supervisors...
Is there a way to use the Now() function in SQL to select values with today's date?
I was under the impression Now() would contain the time as well as date, but today's date would have the time set ..
I'm trying to display the list I made in my view but keep getting : "The model item passed into the dictionary is of type 'System.Collections.Generic.List1[System.String]', but this dictionary require..
Is there a TIMESTAMPDIFF() equivalent for PostgreSQL?
I know I can subtract two timestamps to get a postgresql INTERVAL. I just want the difference between the two timestamps in in hours represent..
I have problem when trying to close current scene and open up another scene when menuItem is selected. My main stage is coded as below:
public void start(Stage primaryStage) throws Exception {
pr..
what I am trying to find out is the proper syntax to apply some style to each individual td in my table below:
<section id="shows">
<!-- HTML5 section tag for the shows 'section' --..
I'm trying read JSON data from web, but that code returns empty result. I'm not sure what I'm doing wrong here.
package main
import "os"
import "fmt"
import "net/http"
import "io/ioutil"
import "enc..
Occasionally my MS Access reports:
The search key was not found in any record
After this happens the solution is to close Access, compact and
repair the backend and then delete the record.
Wha..
I am trying to start a Redux application I just cloned from a GitHub repository.
I tried to run it with the following command
npm start
I am getting this error
> [email protected] start ..
Client wants two color borders for an embossed look. Can I do this on one element? I was hoping to avoid stacking two DOM elements with individual borders...
I'm using spring mvc. And I can't get param from url when method = post. But when I change method to GET, so I can get all param.
This is my form:
<form method="POST" action="http://localhost:808..
For some reason, I can't seem to figure this out.
I have some radio buttons in my html which toggles categories:
<input type="radio" name="main-categories" id="_1234" value="1234" /> // All
&l..
I'm trying to convert a list to a tuple.
Most solutions on Google offer the following code:
l = [4,5,6]
tuple(l)
However, the code results in an error message when I run it:
TypeError: 'tuple' objec..
I have simple goal of copying range and pasting it into another spreadsheet. The following code below gives copies, but does not paste.
Sub Normalize()
Dim Ticker As Range
Sheets("Sheet1")...
I, for some reason, can't change the zIndex of an element using jQuery. I've searched all of this website and Google but couldn't find the right answer.
I am trying to put my element in front of ano..
Currently there is a plethora of websocket libraries for node.js, the most popular seem to be:
https://github.com/Worlize/WebSocket-Node
https://github.com/einaros/ws
https://github.com/LearnBoost/e..
I'm using Twitter-Bootstrap and I need to be able to print the page the way it looks on the browser. I'm able to print other pages made with Twitter-Bootstrap just fine but I can't seem to print my pa..
I want to trim a string if the length exceeds 10 characters.
Suppose if the string length is 12 (String s="abcdafghijkl"), then the new trimmed string will contain "abcdefgh..".
How can I achieve th..
I use the pylons and sqlalchemy. I constantly update the schema files and delete and recreate the database so that new schema can be made.
Every time I do this by opening the MySql Query Browser and..
Is it really a good practice to avoid using NOT operator in IF conditions in order to make your code better readable? I heard the if (doSomething()) is better then if (!doSomething())...
On Windows, clock() returns the time in milliseconds, but on this Linux box I'm working on, it rounds it to the nearest 1000 so the precision is only to the "second" level and not to the milliseconds ..
Given is a simple CSV file:
A,B,C
Hello,Hi,0
Hola,Bueno,1
Obviously the real dataset is far more complex than this, but this one reproduces the error. I'm attempting to build a random forest classi..
I am Learning React.js and i am using windows 8 OS.i have navigate to my root folder
1.Created the package.json file by npm init
2. install webpack by npm install -S webpack.now webpack has been down..
I'm new to the gradle build system and IntelliJ.
So how do I create an Android Library Project (e.g. com.myapp.lib1) and the application project (e.g. com.myapp.app) and make the build system include..
I want to position a paragraph to the right of an <iframe> of a Google map.
I do not know how to show my code, so here is a screenshot of what I want:
..
I have created a form-based program that needs some input validation. I need to make sure the user can only enter numeric values within the distance Textbox.
So far, I've checked that the Textbox ha..
Reasons for java.sql.SQLException: Closed Connection from Oracle??
java.sql.SQLException: Closed Connection
at oracle.jdbc.driver.DatabaseError.throwSqlException(DatabaseError.java:112)
..
I would like to return a string with all of the contents of a CSS rule, like the format you'd see in an inline style. I'd like to be able to do this without knowing what is contained in a particular r..
I have a css class defined so I can make a div to use all the browser's viewport, the rule is the following:
.fullscreenDiv {
background-color: #e8e8e8;
width: 100%;
height: auto;
bot..
The new version 1.2.0 include a terminal, but when I try to install any pack with node I get the npm ERR! code EPERM that I usually solve right clicking and running it as administrator. So how I do th..
I need a page with checkboxes and visible div if at minimum 1 is checked.
Here I got page that if i check checkbox, the div will show. It's okay and works correctly.
When I check 3 checkboxes and ..
I have 4 buttons in a header div. I have placed them all using margins top and left in css so they are all next to each other in one line. Nothing fancy.
Now I'm trying to do an action when the butto..
How do I force a css grid container take the full width and height of the device screen for a single page app? Modified example is from Mozilla: Firefox documentation
_x000D_
_x000D_
.wrapper {_x000D..
I am new to JDBC and I am trying to make a connection to a MySQL database.
I am using Connector/J driver, but I cant find the JDBC connection string for my Class.forName() method...
I'm just wondering why we usually use logical OR || between two booleans not bitwise OR |, though they are both working well.
I mean, look at the following:
if(true | true) // pass
if(true | fals..
I have a pandas dataframe "df". In this dataframe I have multiple columns, one of which I have to substring.
Lets say the column name is "col".
I can run a "for" loop like below and substring the colu..
I am doing a https post and I'm getting an exception of ssl exception Not trusted server certificate. If i do normal http it is working perfectly fine. Do I have to accept the server certificate someh..
How do I write a PHP ternary operator with the elseif portion?
I see basic examples with the if and else portions of the PHP ternary operator like this:
echo (true) ? "yes" : "no"; //prints yes
..
I want to save my canvas to a img. I have this function:
function save() {
document.getElementById("canvasimg").style.border = "2px solid";
var dataURL = canvas.toDataURL();
document.getE..
Say you have a form that has values loaded from database. How do you initialize ng-model?
Example:
<input name="card[description]" ng-model="card.description" value="Visa-4242">
In my contr..
Heres the entire page
* wrappable is defined in a main.css file
/* Wrappable cell
* Add this class to make sure the text in a cell will wrap.
* By default, data_table tds do not wrap.
*/
td.wrappable..
How do i get the html on '#container' including '#container' and not just what's inside it.
<div id="container">
<div id="one">test 1 </div>
<div id="two">test 2 </div&g..
With DataTable I can order, list, do pagination but I want to detect when the pagination changes, I've seen the API but the only one I can do is change the page but no detect this change...
I have successfully sent email in my web application using JMS, but the result only displays in plain text. I want the content to be able to display html. How do I do it? Here is roughly what I have:
..
Trying to understand what Sql Profiler means by emitting "sp_reset_connection".
I have the following, "exec sp_reset_connection" line followed by BatchStarting and Completed,
RPC:Completed exe..
I got a table-cell with fixed width and height and if text is too large, cell size should remain the same and text should be hidden by overflow:hidden.
div {
display: table-cell
height: 100px;
..
How can I delete all rows of an HTML table except the <th>'s using Javascript, and without looping through all the rows in the table? I have a very huge table and I don't want to freeze the UI w..
Here are two statements that I'd like to work, but which return error messages:
IF EXISTS (SELECT * FROM gdata_calendars WHERE `group` = ? AND id = ?) SELECT 1 ELSE SELECT 0
and
IF ((SELECT COUNT..
With ui-router, it's possible to inject either $state or $stateParams into a controller to get access to parameters in the URL. However, accessing parameters through $stateParams only exposes paramete..
I'm aware of the reason that git push --tags is a separate operation to plain old git push. Pushing tags should be a conscious choice since you don't want accidentally push one. That's fine. But is th..
I am storing a class object into a string using toString() method. Now, I want to convert the string into that class object.
How to do that? Please help me with source code...
My issue is that I have two (or more) divs of the same class, that need to be spaced from each other. I cannot directly use margins however, as the last or first element would also have the margin app..
I have this error message:
Msg 8134, Level 16, State 1, Line 1 Divide by zero error encountered.
What is the best way to write SQL code so that I will never see this error message again?
I coul..
I'm learning CSS. How to style input and submit button with CSS?
I'm trying create something like this but I have no idea how to do
<form action="#" method="post">
Name <input type="tex..
I am displaying some data in a ScrollView. On activity startup (method onCreate) I fill the ScrollView with data and want to scroll to the bottom.
I tried to use getScrollView().fullScroll(ScrollView..
I want to know how to change the color of the links when you hover over them in the nav bar, as currently they are an ugly color.
Thanks for any suggestions?
HTML:
<div class="container">
..
I have an image that is a link. I want to show a different image when the user hovers over the link.
Currently I'm using this code:
<a href="http://twitter.com/me" title="Twitter link">
<d..
I have a Facebook desktop application and am using the Graph API.
I am able to get the access token, but after that is done - I don't know how to get the user's ID.
My flow is like this:
I send t..
I'm using a flex box to display 8 items that will dynamically resize with my page. How do I force it to split the items into two rows? (4 per row)?
Here is a relevant snip:
(Or if you prefer jsfiddl..
What programming languages can one use to develop iPhone, iPod Touch and iPad (iOS) applications?
Also are there plans in the future to expand the amount of programming languages that iOS will suppor..
I need to iterate over std::queue.
www.cplusplus.com says:
By default, if no container class is specified for a particular queue class, the standard container class template deque is used.
So ca..
I have a list of dictionaries that looks something like this:
toCSV = [{'name':'bob','age':25,'weight':200},{'name':'jim','age':31,'weight':180}]
What should I do to convert this to a csv file that..
I am trying to rename a column in MySQL community server 5.5.27 using this SQL expression:
ALTER TABLE table_name RENAME COLUMN old_col_name TO new_col_name;
I also tried
ALTER TABLE table_name ..
In Python, how can I remove an object from array of objects? Like this:
x = object()
y = object()
array = [x,y]
# Remove x
I've tried array.remove() but it only works with a value, not a specific l..
I want to preface this with the fact that I am very very new to JavaScript. I appreciate your patience with me.
I'm trying to create a script that allows a user to input a name into a text-area, pres..
In C, if I wanted to create a matrix struct, I would use:
struct matrix {
int col, row;
double data[1]; // I want the matrix entries stored
// right after this struct
}
Then I..
Is there a way to embed/mashup the OpenStreetMap in your page (like the way Google Maps API works)?
I need to show a map inside my page with some markers and allow dragging/zooming around, maybe rout..
I am using this data frame:
Fruit Date Name Number
Apples 10/6/2016 Bob 7
Apples 10/6/2016 Bob 8
Apples 10/6/2016 Mike 9
Apples 10/7/2016 Steve 10
Apples 10/7/2016 Bob 1
Orang..
I have a program in C++ (compiled using g++). I'm trying to apply two doubles as operands to the modulus function, but I get the following error:
error: invalid operands of types 'double' and 'dou..
NB This is not a question about how to use inline functions or how they work, more why they are done the way they are.
The declaration of a class member function does not need to define a function as..
We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly.
Is there any plugin that's compatible with Pipeline that I..
When we call getMonth() and getDate() on date object, we will get the single digit number.
For example :
For january, it displays 1, but I need to display it as 01. How to do that?..
I want to be able to run a command from my machine using ssh and pass through the environment variable $BUILD_NUMBER
Here's what I'm trying:
ssh [email protected] '~/tools/myScript.pl $BUILD_NUMBER'..
I've created SQL command that uses INNER JOIN on 9 tables, anyway this command takes a very long time (more than five minutes). So my folk suggested me to change INNER JOIN to LEFT JOIN because the pe..
Not obvious from the flask documention on how to get the query string. I am new, looked at the docs, could not find!
So
@app.route('/')
@app.route('/data')
def data():
query_string=??????
..
I am using d3 to draw a line from a relative svg position and hence want to access the coordinates of the element itself. I tried something like this (where "this" refers to the element)
.attr("x1",..
I have been having trouble while attempting to use the nextLine() method from java.util.Scanner.
Here is what I tried:
import java.util.Scanner;
class TestRevised {
public void menu() {
..
I have seen lots of similar pages on the web, but most of them use a new project instead of an existing one, or don't have the necessary features. So, I have an existing MVC 5 project and want to inte..
How to create maven pom, which will make project buildable, can I include propriatery jars with my project directly without having to take them from repository? anyone did this before ?
EDIT :
I do..
I am trying to include the path to extra libraries in my makefile, but I can't figure out how to get the compiler to use that path. so far I have:
g++ -g -Wall testing.cpp fileparameters.cpp main.cp..
I am writing an iframe based facebook app. Now I want to use the same html page to render the normal website as well as the canvas page within facebook. I want to know if I can determine whether the p..
I am currently new to robot framework.I am currently using latest window version of chrome and chromedriver which is 80 but when i try to run the test it gives the message "SessionNotCreatedException:..
How can I add text from a DIV to a textarea?
I have this now:
$('.oquote').click(function() {
$('#replyBox').slideDown('slow', function() {
var quote = $('.container').text();
..
I am using dig installed on my machine to search for SPF records for a particular domain. Is there a way to search a particular DNS server for the SPF records?
For example, will the following work?
..
I have two files in the same folder that I'd like to run. One is a .txt file, and the other is the program shortcut to an .exe. I'd like to make a batch file in the same location to open the text file..
Given the following matrix lets assume I want to find the maximum value in column two:
mat <- matrix(c(1:3,7:9,4:6), byrow = T, nc = 3)
mat
[,1] [,2] [,3]
[1,] 1 2 3
[2,] 7 8 ..
I'm trying to use the below code to calculate the average of a set of values that a user enters and display it in a jTextArea but it does not work properly. Say, a user enters 7, 4, and 5, the program..
I have a Python pandas DataFrame rpt:
rpt
<class 'pandas.core.frame.DataFrame'>
MultiIndex: 47518 entries, ('000002', '20120331') to ('603366', '20091231')
Data columns:
STK_ID ..
I'm completely new to Kotlin. I want to do a login validation using POST method and to get some information using GET method. I've URL, server Username and Password already of my previous project. I d..
Using a rich-text editor, our users can drag and drop a saved image from their desktop to the editor. The image appears and displays properly in the web page after they submit.
Since the image is not..
How do emulators work? When I see NES/SNES or C64 emulators, it astounds me.
Do you have to emulate the processor of those machines by interpreting its particular assembly instructions? What else..
What's the exact difference between Unicode and ASCII?
ASCII has a total of 128 characters (256 in the extended set).
Is there any size specification for Unicode characters?..
I understand that an id must be unique within an HTML/XHTML page.
My question is, for a given element, can I assign multiple ids to it?
<div id="nested_element_123 task_123"></div>
I r..
I would like to know a simple algorithm to check if the given instance of datetime lies between another two instances in C#.
Note:
I skimmed though this How do I check if a given datetime object is &q..
First, here is the code:
<form action="FirstServlet" method="Post">
Last Name: <input type="text" name="lastName" size="20">
<br><br>
<input type="submit" value..
I have a class X containing method myMethod(). I would like to find locations in all projects in my current workspace where this myMethod() is being called. I cannot use any search functions as there ..
I am using matplotlib to create the plots. I have to identify each plot with a different color which should be automatically generated by Python.
Can you please give me a method to put different colo..
I know this will work:
function Foo() {};
Foo.prototype.talk = function () {
alert('hello~\n');
};
var a = new Foo;
a.talk(); // 'hello~\n'
But if I want to call
Foo.talk() // this will not w..
I have an image called myImage.jpg. This is my CSS:
body {
background-image:url("../images/myImage.jpg");
background-repeat: no-repeat;
background-size: 100% 100%;
}
For some reason, wh..
When i use the command
C:\>keytool -list -alias androiddebugkey
-keystore .android\debug.keystore
-storepass android -keypass android
I get this error:
'keytool' i..
I am fairly new to C++ and have been avoiding pointers. From what I've read online I cannot return an array but I can return a pointer to it. I made a small code to test it and was wondering if this w..
I want to create custom compare function for std::sort(), to sort some key-value pairs std::pair
Here is my function
template <typename K, typename V>
int comparePairs(const void* left, cons..
I'm using node v0.10.26 and express v4.2.0 and I'm pretty new to node. I've been beating my head against my desk for the past three or so hours trying to get a file upload form working with node. At..
I am trying to make Sphinx from source on a 32-bit CentOS 6 VPS.
When I run this command:
./configure --prefix=/usr/local/sphinx
I get this error output:
checking build environment
--------------..
I have a library (jar) on build path of my project. The project accesses the MainActivity in the jar, using the following intent:
final Intent it = new Intent();
it.setClassName("com.example.lib", "c..
I want to use generic way to manage 5xx error codes, let's say specifically the case when the db is down across my whole spring application. I want a pretty error json instead of a stack trace.
For ..
I have a list of Person objects. I want to convert to a Dictionary where the key is the first and last name (concatenated) and the value is the Person object.
The issue is that I have some duplicated..
I have the following table but unsure of whether it is possible to pivot this and retain all the labels.
RATIO RESULT SCORE GRADE
Current Ratio 1.294 60 Good
Gearing R..
I can print with printf as a hex or octal number. Is there a format tag to print as binary, or arbitrary base?
I am running gcc.
printf("%d %x %o\n", 10, 10, 10); //prints "10 A 12\n"
print("%b\n..
Another developer and I disagree about whether PYTHONPATH or sys.path should be used to allow Python to find a Python package in a user (e.g., development) directory.
We have a Python project with a ..
I'm having a problem with my PHP file that takes more than 30 seconds to execute.
After searching, I added set_time_limit(0); at the start of the code,cbut the file still times out with a 500 error a..
I want to detect if the request came from the localhost:5000 or foo.herokuapp.com host and what path was requested. How do I get this information about a Flask request?..
Here is my GitHub repository on the gh-pages branch.
Everything looks good, I have my index.html, my CSS, JS and pictures folders.
But when I access http://roine.github.com/p1 I get HTTP 404 not foun..