Questions Tagged with #Vaadin

Vaadin is a client-server framework, that builds on GWT (Google Web Toolkit) and uses Java to code all of the server and clientside code. Vaadin tries to improve the clientside presentation layer and the rapid application development factor over GWT.

MatPlotLib: Multiple datasets on the same scatter plot

I want to plot multiple data sets on the same scatter plot: cases = scatter(x[:4], y[:4], s=10, c='b', marker="s") controls = scatter(x[4:], y[4:], s=10, c='r', marker="o") show() The above only s..

How to create two columns on a web page?

I want to have two columns on my web page. For me the simples way to do that is to use a table: <table> <tr> <td> Content of the first column. </td> ..

How to split a string in Haskell?

Is there a standard way to split a string in Haskell? lines and words work great from splitting on a space or newline, but surely there is a standard way to split on a comma? I couldn't find it on..

how to run a command at terminal from java program?

I need to run a command at terminal in Fedora 16 from a JAVA program. I tried using Runtime.getRuntime().exec("xterm"); but this just opens the terminal, i am unable to execute any command. I als..

Dynamically Fill Jenkins Choice Parameter With Git Branches In a Specified Repo

I have a parameterized Jenkins job which requires the input of a specific Git branch in a specific Git repo. Currently this parameter is a string parameter. Is there any way to make this parameter a..

How to use ArrayList's get() method

I'm new to java (& to OOP too) and I'm trying to understand about the class ArrayList but I don't understand how to use the get(). I tried searching in net, but couldn't find anything helpful...

Calculate days between two Dates in Java 8

I know there are lots of questions on SO about how to get Dates in Java, but I want an example using new Java 8 Date API. I also know about the JodaTime library, but I want a method without relying on..

How to undo last commit

I did the following comments git add /file1/path git rm /file/path git commit -m "message" how do I undo my last commit using git? Like I don't want to have those files committed...

Convert an image (selected by path) to base64 string

How do you convert an image from a path on the user's computer to a base64 string in C#? For example, I have the path to the image (in the format C:/image/1.gif) and would like to have a data URI like..

jQuery get the rendered height of an element?

How do you get the rendered height of an element? Let's say you have a <div> element with some content inside. This content inside is going to stretch the height of the <div>. How do you ..

What does "where T : class, new()" mean?

Can you please explain to me what where T : class, new() means in the following line of code? void Add<T>(T item) where T : class, new(); ..

How can I get a value from a map?

I have a map named valueMap as follows: typedef std::map<std::string, std::string>MAP; MAP valueMap; ... // Entering data. Then I am passing this map to a function by reference: void functio..

UTF-8 encoding problem in Spring MVC

I' ve a Spring MVC bean and I would like to return turkish character by setting encoding UTF-8. but although my string is "sSgGIiçÇöÖüÜ" it returns as "??????çÇöÖüÜ". and also when I look ..

Short form for Java if statement

I know there is a way for writing a Java if statement in short form. if (city.getName() != null) { name = city.getName(); } else { name="N/A"; } Does anyone know how to write the short form..

"While .. End While" doesn't work in VBA?

The code below is VBA for Excel. I am using the Visual Basic editor that comes with Excel 2007. Dim counter As Integer counter = 1 While counter < 20 counter = counter + 1 end while '<- t..

How To Launch Git Bash from DOS Command Line?

I've got what I'm hoping is a simple question, but I haven't been able to find the answer yet. I would like to launch Git Bash from a DOS batch file. Here is what I tried so far: Launched Git Bash..

How can I read a text file from the SD card in Android?

I am new to Android development. I need to read a text file from the SD card and display that text file. Is there any way to view a text file directly in Android or else how can I read and display th..

Generate random numbers following a normal distribution in C/C++

How can I easily generate random numbers following a normal distribution in C or C++? I don't want any use of Boost. I know that Knuth talks about this at length but I don't have his books at hand r..

ERROR 2003 (HY000): Can't connect to MySQL server (111)

This question is related to the following questions: Can't connect to MySQL server error 111 Trying to connect to remote MySQL host (error 2003) I am configuring a new MySQL (5.1) server on my..

IE throws JavaScript Error: The value of the property 'googleMapsQuery' is null or undefined, not a Function object (works in other browsers)

I'm having a real problem with JavaScript scope in IE 9. This is inside the body of my document (yes, I realize script should go in the head for proper HTML, but I've never had it break a script befo..

Generate class from database table

How can I generate a class from a SQL Server table object? I'm not talking about using some ORM. I just need to create the entities (simple class). Something like: public class Person { ..

Cause of No suitable driver found for

I'm trying to unit test (JUnit) a DAO i've created. I'm using Spring as my framework, my DAO (JdbcPackageDAO) extends SimpleJdbcDaoSupport. The testing class (JdbcPackageDAOTest) extends AbstractTra..

How to start color picker on Mac OS?

I am a complete newbie at Mac. It so happened that now I'm working on it. I have an weird issue - I can't find how to start default Color Picker?..

ResourceDictionary in a separate assembly

I have resource dictionary files (MenuTemplate.xaml, ButtonTemplate.xaml, etc) that I want to use in multiple separate applications. I could add them to the applications' assemblies, but it's better i..

jQuery $.ajax(), $.post sending "OPTIONS" as REQUEST_METHOD in Firefox

Having trouble with what I thought was a relatively simple jQuery plugin... The plugin should fetch data from a php script via ajax to add options to a <select>. The ajax request is pretty gen..

Gradient text color

Is there a generator , or an easy way to generate text like this but without having to define every letter So something like this: _x000D_ _x000D_ .rainbow {_x000D_ background-image: -webkit-gradi..

Using different Web.config in development and production environment

I need to use different database connection string and SMTP server address in my ASP.NET application depending on it is run in development or production environment. The application reads settings f..

How can I style an Android Switch?

The switch widget introduced in API 14 is styled by default with holo theme. I want to style it slightly different, changing its colors and shape a bit for branding reasons. How does one go about this..

jQuery click events firing multiple times

I'm attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I've run into a problem where the jQuery click event handlers are firing multiple times. They'r..

How to count the number of columns in a table using SQL?

How to count the number of columns in a table using SQL? I am using Oracle 11g Please help. t...

Java JTable getting the data of the selected row

Are there any methods that are used to get the data of the selected row? I just want to simply click a specific row with data on it and click a button that will print the data in the Console. ..

Chrome Extension: Make it run every page load

I want to make a chrome extension that executes some scripts after one page is loaded, I am not sure whether I have to implement this logic on the background page or it can be anywhere else, any help ..

How to increase application heap size in Eclipse?

Some say I need to do that in Run Configurations for my application. When I open that window, could you please tell me how to set the right argument and the amount of memory? Say how to set 2GB or 1.5..

How to find all serial devices (ttyS, ttyUSB, ..) on Linux without opening them?

What is the proper way to get a list of all available serial ports/devices on a Linux system? In other words, when I iterate over all devices in /dev/, how do I tell which ones are serial ports in th..

Static variables in JavaScript

How can I create static variables in Javascript?..

Center a popup window on screen?

How can we center a popup window opened via javascript window.open function on the center of screen variable to the currently selected screen resolution ?..

How to ping multiple servers and return IP address and Hostnames using batch script?

So I have to use batch only for this. Basically, the server HOSTNAMES are all listed in a txt file. I used the following code to ping all the servers and display their results in a txtfile. For /f %..

How to select a value in dropdown javascript?

i have a drop down like this <select style="width: 280px" id="Mobility" name="Mobility"> <option selected="">Please Select</option> <option>K</option> <option&g..

Convert generic list to dataset in C#

I have a Generic list of Objects. Each object has 9 string properties. I want to turn that list into a dataset that i can pass to a datagridview......Whats the best way to go about doing this?..

A failure occurred while executing com.android.build.gradle.internal.tasks

I am getting this error while I am building APK. Cause 1: org.gradle.workers.internal.DefaultWorkerExecutor$WorkExecutionException: A failure occurred while executing com.android.build.gradle.interna..

How do I add the contents of an iterable to a set?

What is the "one [...] obvious way" to add all items of an iterable to an existing set?..

jQuery Datepicker with text input that doesn't allow user input

How do I use the jQuery Datepicker with a textbox input: $("#my_txtbox").datepicker({ // options }); that doesn't allow the user to input random text in the textbox. I want the Datepicker to pop ..

How to create and write to a txt file using VBA

I have a file which is manually added or modified based on the inputs. Since most of the contents are repetitive in that file, only the hex values are changing, I want to make it a tool generated file..

Loading local JSON file

I'm trying to load a local JSON file but it won't work. Here is my JavaScript code (using jQuery): var json = $.getJSON("test.json"); var data = eval("(" +json.responseText + "..

How to fix the Hibernate "object references an unsaved transient instance - save the transient instance before flushing" error

I receive following error when I save the object using Hibernate object references an unsaved transient instance - save the transient instance before flushing ..

Storing files in SQL Server

It's an old question I know, but with SQL Server 2012 is it finally ok to store files in the database, or should they really be kept in the filesystem with only references to them in the database? If..

How to call a .NET Webservice from Android using KSOAP2?

I have a problem while calling a webservice. I have a .NET web service on the server, and I am using KSOAP2 (ksoap2-j2se-full-2.1.2) in Android. While running the program I got an runtime exception li..

Swift: Testing optionals for nil

I'm using Xcode 6 Beta 4. I have this weird situation where I cannot figure out how to appropriately test for optionals. If I have an optional xyz, is the correct way to test: if (xyz) // Do somethi..

How to get the list of all installed color schemes in Vim?

Is there a way to get a list of all installed color schemes in Vim? That would make very easy to select one without looking at the .vim directory...

String or binary data would be truncated. The statement has been terminated

I have met some problem with the SQL server, this is the function I created: ALTER FUNCTION [dbo].[testing1](@price int) RETURNS @trackingItems1 TABLE ( item nvarchar NULL, warehouse n..

Custom circle button

I want to create custom button and I need it to be circle. How can I create a circle button? I do not think that be possible with draw9patch. Also I do not know how to make custom button! Do you hav..

Storing Data in MySQL as JSON

I thought this was a n00b thing to do. And, so, I've never done it. Then I saw that FriendFeed did this and actually made their DB scale better and decreased latency. I'm curious if I should do this. ..

Using request.setAttribute in a JSP page

Is it possible to use request.setAttribute on a JSP page and then on HTML Submit get the same request attribute in the Servlet?..

Use .htaccess to redirect HTTP to HTTPs

Please, don't recommend me the long and very detailed thread with more than 173 upvotes. It didn't work for me. I have also tried many others (1, 2, 3, 4). They all give me TOO_MANY_REDIRECTS or error..

Apply Calibri (Body) font to text

I have a div and in this div I want to display some text in Calibri (Body) font. How can I do this? This is the css I have been given : .an_account_join_1 { float:left; width:100%; colo..

Notification bar icon turns white in Android 5 Lollipop

I have an app showing custom notifications. The problem is that when running in Android 5 the small icon in the Notification bar is shown in white. How can I fix this?..

How to index into a dictionary?

I have a Dictionary below: colors = { "blue" : "5", "red" : "6", "yellow" : "8", } How do I index the first entry in the dictionary? colors[0] will return a KeyError for obvious reason..

What is the difference between Set and List?

What is the fundamental difference between the Set<E> and List<E> interfaces?..

Composer killed while updating

I got a problem, I tried to install a new package to my Laravel 4 project. But when I run php composer.phar update I get this: Loading composer repositories with package information Updating dependen..

"RangeError: Maximum call stack size exceeded" Why?

If I run Array.apply(null, new Array(1000000)).map(Math.random); on Chrome 33, I get RangeError: Maximum call stack size exceeded Why?..

How to sort an ArrayList?

I have a List of doubles in java and I want to sort ArrayList in descending order. Input ArrayList is as below: List<Double> testList = new ArrayList(); testList.add(0.5); testList.add(0.2); ..

How to take character input in java

In C, we are able to take input as character with the keyword char from keyboard as scanf("%c", &ch); But In Java how to do this? I have tried this: import java.util.Scanner; public class Ma..

Converting String Array to an Integer Array

so basically user enters a sequence from an scanner input. 12, 3, 4, etc. It can be of any length long and it has to be integers. I want to convert the string input to an integer array. so int[0] woul..

Python 3 Float Decimal Points/Precision

I am reading a text file with floating point numbers, all with either 1 or 2 decimal points. I am using float() to convert a line into a float, and raising a ValueError if that fails. I am storing all..

What is the default value for Guid?

The default value for int is 0 , for string is "" and for boolean it is false. Could someone please clarify what the default value for guid is? ..

How to print HTML content on click of a button, but not the page?

I want to print some HTML content, when the user clicks on a button. Once the user clicks on that button, the print dialog of the browser will open, but it will not print the webpage. Instead, it will..

Laravel 5.2 Missing required parameters for [Route: user.profile] [URI: user/{nickname}/profile]

I keep getting this error ErrorException in UrlGenerationException.php line 17: When ever any page loads and I'm logged in. Here is what my nav looks like @if(Auth::guest()) <..

Normalization in DOM parsing with java - how does it work?

I saw the line below in code for a DOM parser at this tutorial. doc.getDocumentElement().normalize(); Why do we do this normalization ? I read the docs but I could not understand a word. Puts a..

How to convert decimal to hexadecimal in JavaScript

How do you convert decimal values to their hexadecimal equivalent in JavaScript?..

PHP - Get array value with a numeric index

I have an array like: $array = array('foo' => 'bar', 33 => 'bin', 'lorem' => 'ipsum'); echo native_function($array, 0); // bar echo native_function($array, 1); // bin echo native_function($a..

How to check if all of the following items are in a list?

I found, that there is related question, about how to find if at least one item exists in a list: How to check if one of the following items is in a list? But what is the best and pythonic way to fin..

Python constructor and default value

Somehow, in the Node class below, the wordList and adjacencyList variable is shared between all instances of Node. >>> class Node: ... def __init__(self, wordList = [], adjacencyList = [..

How to apply a CSS filter to a background image

I have a JPEG file that I'm using as a background image for a search page, and I'm using CSS to set it because I'm working within Backbone.js contexts: background-image: url("whatever.jpg"); I want..

Why do I get an error instantiating an interface?

I have a class and an interface, and when I try to instantiate the interface, I get an error: Cannot create an instance of the abstract class or interface My code is below: namespace MyNamespac..

Why can't I declare static methods in an interface?

The topic says the most of it - what is the reason for the fact that static methods can't be declared in an interface? public interface ITest { public static String test(); } The code above giv..

MySQL case sensitive query

This has been asked on this site before but I couldn't find a sufficient answer. If I'm doing a query like: Select Seller from Table where Location = 'San Jose' How can I make it return only Seller..

fork: retry: Resource temporarily unavailable

I tried installing Intel MPI Benchmark on my computer and I got this error: fork: retry: Resource temporarily unavailable Then I received this error again when I ran ls and top command. What is ca..

WITH CHECK ADD CONSTRAINT followed by CHECK CONSTRAINT vs. ADD CONSTRAINT

I'm looking at the AdventureWorks sample database for SQL Server 2008, and I see in their creation scripts that they tend to use the following: ALTER TABLE [Production].[ProductCostHistory] WITH CHEC..

Java maximum memory on Windows XP

I've always been able to allocate 1400 megabytes for Java SE running on 32-bit Windows XP (Java 1.4, 1.5 and 1.6). java -Xmx1400m ... Today I tried the same option on a new Windows XP machine using..

Installing tensorflow with anaconda in windows

I have installed Anaconda on Windows 64 bit. I have downloaded PyCharm for creating a project and in the terminal of PyCharm I have installed numpy, scipy, matplotlib using the following commands: co..

How do I deserialize a complex JSON object in C# .NET?

I have a JSON string and I need some help to deserialize it. Nothing worked for me... This is the JSON: { "response": [{ "loopa": "81ED1A646S894309CA1746FD6B57E5BB46EC18D1FAff", ..

How to use registerReceiver method?

I want to use dynamically registered BroadcastReceiver that has a reference to an Activity so it can modify its UI. I am using Context.registerReceiver() method but receiver's onReceive() method is ne..

Check substring exists in a string in C

I'm trying to check whether a string contains a substring in C like: char *sent = "this is my sample example"; char *word = "sample"; if (/* sentence contains word */) { /* .. */ } What is some..

How to quit android application programmatically

I Found some codes for quit an Android application programatically. By calling any one of the following code in onDestroy() will it quit application entirely? System.runFinalizersOnExit(true) ..

JPA: how do I persist a String into a database field, type MYSQL Text

The requirement is that the user can write an article, therefore I choose type Text for the content field inside mysql database. How can I convert Java String into MySQL Text Here you go Jim Tough @..

Function is not defined - uncaught referenceerror

I have this uncaught referenceerror function is not defined error which do not understand. If I have $(document).ready(function(){ function codeAddress() { var address = document.getElementById("..

Twitter Bootstrap and ASP.NET GridView

I am having aproblem using Twitter Bootstrap from my ASP.NET application. When I use the table table-striped css class to my asp:GridView control, it treats the Header of the table as a Row. My GridV..

Format cell color based on value in another sheet and cell

I have a workbook with two sheets. I would like to format the cell background color in the first column of sheet 1 based on the values in the second column of sheet 2. For example, if the value of of..

How do I populate a JComboBox with an ArrayList?

I need to populate a JComboBox with an ArrayList. Is there any way to do this?..

Android changing Floating Action Button color

I have been trying to change Material's Floating Action Button color, but without success. <android.support.design.widget.FloatingActionButton android:id="@+id/profile_edit_fab" android:la..

Handler vs AsyncTask vs Thread

I got slightly confused about the differences between Handlers, AsyncTask and Threads in Android. I've read quite a few blogs and questions here in StackOverflow. Handler are background threads that..

Android button onClickListener

I am trying to open new Activity by clicking on a button in my OnClickListener method. How does OnClickListener method work and what should be done in it to start a new Activity? ..

Read a variable in bash with a default value

I need to read a value from the terminal in a bash script. I would like to be able to provide a default value that the user can change. # Please enter your name: Ricardo^ In this script the prompt..

Using UPDATE in stored procedure with optional parameters

I have an SP like so (using SQL Server): ALTER PROCEDURE [dbo].[sp_ClientNotes_update] @id uniqueidentifier, @ordering smallint = NULL, @title nvarchar(20) = NULL, @content text = NUL..

JAVA_HOME does not point to the JDK

I am trying to follow a tutorial about how to use ant to build and run your application. I've followed all the steps and have created the build file, but when I try to run ant it gives me this error. ..

HTML 5 video or audio playlist

Can I use a <video> or <audio> tag to play a playlist, and to control them? My goal is to know when a video/song has finished to play and take the next and change its volume...

Run php function on button click

I want to run a php function on button click. for eg : <input type="button" name="test" id="test" value="RUN" onclick="<?php echo testfun(); ?>" /><br/> <?php function testfun..

Can Selenium WebDriver open browser windows silently in the background?

I have a Selenium test suite that runs many tests and on each new test it opens a browser window on top of any other windows I have open. Very jarring while working in a local environment. Is there a ..

Change type of varchar field to integer: "cannot be cast automatically to type integer"

I have a small table and a certain field contains the type "character varying". I'm trying to change it to "Integer" but it gives an error that casting is not possible. Is there a way around this or ..

Renaming Columns in an SQL SELECT Statement

I would like to rename the columns in the results of a SELECT expression. Of course, the following doesn't work: SELECT * AS foobar_* FROM `foobar` As I'm new to SQL, I think I'm just missing a co..

How does Task<int> become an int?

We have this method: async Task<int> AccessTheWebAsync() { HttpClient client = new HttpClient(); Task<string> getStringTask = client.GetStringAsync("http://msdn.microsoft.com"); ..

How do I convert a decimal to an int in C#?

How do I convert a decimal to an int?..

How to compare two date values with jQuery

I have two String fields which represent Dates in my page and I would like to compare these two fields to know if my first date < second date. How can I do this? <tr> <td align="right..

What is the effect of encoding an image in base64?

If I convert an image (jpg or png) to base64, then will it be bigger, or will it have the same size? How much greater will it be? Is it recommended to use base64 encoded images on my website?..

Converting A String To Hexadecimal In Java

I am trying to convert a string like "testing123" into hexadecimal form in java. I am currently using BlueJ. And to convert it back, is it the same thing except backward?..

CMake unable to determine linker language with C++

I'm attempting to run a cmake hello world program on Windows 7 x64 with both Visual Studio 2010 and Cygwin, but can't seem to get either to work. My directory structure is as follows: HelloWorld -- C..

Phone validation regex

I'm using this pattern to check the validation of a phone number ^[0-9\-\+]{9,15}$ It's works for 0771234567 and +0771234567, but I want it to works for 077-1234567 and +077-1234567 and +077-1-23-..

HTTP error 403 in Python 3 Web Scraping

I was trying to scrap a website for practice, but I kept on getting the HTTP Error 403 (does it think I'm a bot)? Here is my code: #import requests import urllib.request from bs4 import BeautifulSou..

How to edit the size of the submit button on a form?

Hi I don't want an image for my submit button so I have gone with the default submit button but I want to edit its width and height. How do I do that? <input type="submit" id="search" value="Searc..

Fast and simple String encrypt/decrypt in JAVA

I need fast and simple way to encrypt/decrypt a "lot" of String data. I tried jasypt but it crashes on my Android phone. I have about 2000 records (strings). BasicTextEncryptor textEncryptor = new Ba..

how to execute a scp command with the user name and password in one line

I would like to put the password in on one line when running scp in my terminal scp [email protected]:sys_config /var/www/dev/..

Fatal error: Please read "Security" section of the manual to find out how to run mysqld as root

I am not sure how to fix this: dyn-72-33-214-45:python mona$ sudo /usr/local/mysql/bin/mysqld stop 2014-09-06 09:49:04 0 [Warning] TIMESTAMP with implicit DEFAULT value is deprecated. Please use --ex..

IF a == true OR b == true statement

I can't find a way to have TWIG interpret the following conditional statement: {% if a == true or b == true %} do stuff {% endif %} Am I missing something or it's not possible?..

How to check whether a string is a valid HTTP URL?

There are the Uri.IsWellFormedUriString and Uri.TryCreate methods, but they seem to return true for file paths etc. How do I check whether a string is a valid (not necessarily active) HTTP URL for in..

Image vs Bitmap class

I have trouble understanding the differences between the Image class and the Bitmap class. Now, I know that the Bitmap inherits from the Image but from what I understand both are very similar. Can any..

Remove characters from a string

What are the different ways I can remove characters from a string in JavaScript?..

Command-line svn for Windows?

Is there a command-line based version of svn for Windows? I know I can get TortoiseSVN, but that just doesn't work for me...

Checking Date format from a string in C#

I want to check whether a string contains dates such as 1/01/2000 and 10/01/2000 in dd/MM/yyyy format. So far I have tried this. DateTime dDate = DateTime.Parse(inputString); string.Format("{0:d/MM..

How to pass parameters to a modal?

I want to pass the userName from a list of userNames a logged in user clicks on to twitter bootstrap modal. I am using grails with angularjs, where data is rendered via angularjs. Configuration My g..

bash: Bad Substitution

#!/bin/bash jobname="job_201312161447_0003" jobname_pre=${jobname:0:16} jobname_post=${jobname:17} This bash script gives me Bad substitution error on Ubuntu. Any help will be highly app..

How to increase code font size in IntelliJ?

I tried doing it via Appearances as shown, but this seems to not affect code font or size How can this be done please?..

CSS Always On Top

I have a website with a fixed image at the top of my screen. When I scroll down my page the image stays at the top like it should. However, all content below overlaps my image and it is then covered. ..

Name [jdbc/mydb] is not bound in this Context

I see this question was raised several times already and I went through all of them. But I am still unable to fix my problem. Could anyone help me pinpoint what I am doing wrong? I get the following..

Set opacity of background image without affecting child elements

Is it possible to set the opacity of a background image without affecting the opacity of child elements? Example All links in the footer need a custom bullet (background image) and the opacity of th..

Int to Decimal Conversion - Insert decimal point at specified location

I have the following int 7122960 I need to convert it to 71229.60 Any ideas on how to convert the int into a decimal and insert the decimal point in the correct location?..

Origin http://localhost is not allowed by Access-Control-Allow-Origin

I'm trying to do a fetch from backbone.js to my node.js server. However, I get the following error in the console: Origin http://localhost is not allowed by Access-Control-Allow-Origin. I added the ..

Tips for using Vim as a Java IDE?

I'm addicted to Vim, it's now my de facto way of editing text files. Being that it's mainly a text editor and not an IDE, has anyone got tricks for me to make it easier when developing Java apps? So..

What happens if you mount to a non-empty mount point with fuse?

I am new to fuse. When I try to run a FUSE client program I get this error: fuse: mountpoint is not empty fuse: if you are sure this is safe, use the 'nonempty' mount option I understand that a mou..

Python logging: use milliseconds in time format

By default logging.Formatter('%(asctime)s') prints with the following format: 2011-06-09 10:54:40,638 where 638 is the millisecond. I need to change the comma to a dot: 2011-06-09 10:54:40.638 T..

vue.js 'document.getElementById' shorthand

Does vue.js have a shorthand for document.getElementById('#id') like JQuery's $('#id')? If so, where is the reference for this in the docs so I can locate other information?..

How do I get java logging output to appear on a single line?

At the moment a default entry looks something like this: Oct 12, 2008 9:45:18 AM myClassInfoHere INFO: MyLogMessageHere How do I get it to do this? Oct 12, 2008 9:45:18 AM myClassInfoHere - INFO: ..

Executing <script> injected by innerHTML after AJAX call

There's a div called "Content": <div id="content"></div> It should be filled with data from a PHP file, by AJAX, including a <script> tag. However, the script inside this tag is n..

How to pass in a react component into another react component to transclude the first component's content?

Is there a way to pass one component into another react component? I want to create a model react component and pass in another react component in order to transclude that content. Edit: Here is a..

How to update nested state properties in React

I'm trying to organize my state by using nested property like this: this.state = { someProperty: { flag:true } } But updating state like this, this.setState({ someProperty.flag: false ..

Forcing to download a file using PHP

I have a CSV file on my server. If a user clicks on a link it should download, but instead it opens up in my browser window. My code looks as follows <a href="files/csv/example/example.csv"> ..

Add text at the end of each line

I'm on Linux command line and I have file with 127.0.0.1 128.0.0.0 121.121.33.111 I want 127.0.0.1:80 128.0.0.0:80 121.121.33.111:80 I remember my colleagues were using sed for that, but after r..

How to compare a local git branch with its remote branch?

How can I see the diff between a local branch and a remote branch?..

Android Location Manager, Get GPS location ,if no GPS then get to Network Provider location

I am using this given below code to get locations: public Location getLocation() { try { mLocationManager = (LocationManager) context.getSystemService(LOCATION_SERVICE); ..

How to convert a currency string to a double with jQuery or Javascript?

I have a text box that will have a currency string in it that I then need to convert that string to a double to perform some operations on it. "$1,100.00" ? 1100.00 This needs to occur all client s..

Angular - How to apply [ngStyle] conditions

I have a div that I want to style based on a condition. If styleOne is true I want a background colour of red. If StyleTwo is true, I want the background colour to be blue. I've got half of it working..

Where to put a textfile I want to use in eclipse?

I need to read a text file when I start my program. I'm using eclipse and started a new java project. In my project folder I got the "src" folder and the standard "JRE System Library" + staedteliste.t..

How to check a string against null in java?

How can I check a string against null in java? I am using stringname.equalsignorecase(null) but it's not working...

python save image from url

I got a problem when I am using python to save an image from url either by urllib2 request or urllib.urlretrieve. That is the url of the image is valid. I could download it manually using the explorer..

Uploading Files in ASP.net without using the FileUpload server control

How can I get an ASP.net web form (v3.5) to post a file using a plain old <input type="file" />? I am not interested in using the ASP.net FileUpload server control...

Bootstrap combining rows (rowspan)

I am testing Twitter Bootstrap and got stuck with basic scaffolding with rows. I revisited their documentation number of times and I can see nesting columns where you can basically nest columns within..

Clear MySQL query cache without restarting server

Is there any way to clear mysql query cache without restarting mySQL server?..

MongoDB: How to update multiple documents with a single command?

I was surprised to find that the following example code only updates a single document: > db.test.save({"_id":1, "foo":"bar"}); > db.test.save({"_id":2, "foo":"bar"}); > db.test.update({"fo..

to_string not declared in scope

I am trying to make the to_string(NUMBER) function work in my Ubuntu computer for weeks but it never ever works in the QT environment or anywhere else. My code works perfectly on my Mac osx, but when ..

JavaScript for detecting browser language preference

I have been trying to detect the browser language preference using JavaScript. If I set the browser language in IE in Tools>Internet Options>General>Languages, how do I read this value using..

How to scroll page in flutter

My code for a page is like this. i need to scroll part below appbar. @override Widget build(BuildContext context) { return new Scaffold( appBar: new AppBar(... ), body: new Stack( ..

fcntl substitute on Windows

I received a Python project (which happens to be a Django project, if that matters,) that uses the fcntl module from the standard library, which seems to be available only on Linux. When I try to run ..

Android WebView not loading URL

I want to load the URL in WebView I have used the following Code: webView = (WebView) findViewById(R.id.webview1); webView.setWebViewClient(new HostsWebClient()); webView.getSettings().setPluginStat..

How to log Apache CXF Soap Request and Soap Response using Log4j?

I am using the Apache CXF Framework. Inside my client program, I need to log CXF SOAP Requests and SOAP Responses. When I used JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean(); factory.se..

Is recursion ever faster than looping?

I know that recursion is sometimes a lot cleaner than looping, and I'm not asking anything about when I should use recursion over iteration, I know there are lots of questions about that already. Wha..

Disable scrolling on `<input type=number>`

Is it possible to disable the scroll wheel changing the number in an input number field? I've messed with webkit-specific CSS to remove the spinner but I'd like to get rid of this behavior altogether...

Should I URL-encode POST data?

I'm POSTing data to an external API (using PHP, if it's relevant). Should I URL-encode the POST variables that I pass? Or do I only need to URL-encode GET data? UPDATE: This is my PHP, in case it is ..

How to get the values of a ConfigurationSection of type NameValueSectionHandler

I'm working with C#, Framework 3.5 (VS 2008). I'm using the ConfigurationManager to load a config (not the default app.config file) into a Configuration object. Using the Configuration class, I was ..

Is it possible in Java to catch two exceptions in the same catch block?

I need to catch two exceptions because they require the same handling logic. I would like to do something like: catch (Exception e, ExtendsRuntimeException re) { // common logic to handle both ex..

How to call python script on excel vba?

trying to call a python script on Vba and I am a newb. I tried converting the main script to an exe using py2exe and then calling it from VBA (shell) but the main script calls other scripts therefore ..

What is the difference between VFAT and FAT32 file systems?

I have searched the internet, but could not find any convincing answers; Are the filesystems VFAT and FAT32 the same, or are there any differences between them?..

How to configure the web.config to allow requests of any length

I am building a site in which i would like to create a file client side from the value of a textarea element. I have the code in place to do this, but i am getting this error HTTP Error 404.15 - ..

'App not Installed' Error on Android

I have a program working in the Android Emulator. Every now and again I have been creating a signed .apk and exporting it to my HTC Desire to test. It has all been fine. On my latest exported .apk I ..

Return a `struct` from a function in C

Today I was teaching a couple of friends how to use C structs. One of them asked if you could return a struct from a function, to which I replied: "No! You'd return pointers to dynamically malloc..

Round a floating-point number down to the nearest integer?

I want to take a floating-point number and round it down to the nearest integer. However, if it's not a whole, I always want to round down the variable, regardless of how close it is to the next integ..

Get output parameter value in ADO.NET

My stored procedure has an output parameter: @ID INT OUT How can I retrieve this using ado.net? using (SqlConnection conn = new SqlConnection(...)) { SqlCommand cmd = new SqlCommand("sproc", c..

Concatenating date with a string in Excel

I have two cells in Excel. one has a string and the other one has a date. in the third cell I want to put the date and the string together. For example: A1 = "This " A2 = "03/03/1982" I want A3 to..

Default background color of SVG root element

I'd like to set a default background color for the entire SVG document, to red for example. <svg viewBox="0 0 500 600" style="background: red">/* content */</svg> The solution above wor..

jQuery scroll() detect when user stops scrolling

Ok with this.. $(window).scroll(function() { $('.slides_layover').removeClass('showing_layover'); $('#slides_effect').show(); }); I can tell when someone is scrolling from what I understan..

How to convert array into comma separated string in javascript

I have an array a.value = [a,b,c,d,e,f] How can I convert to comma seperated string like a.value = "a,b,c,d,e,f" Thanks for all help. ..

The CodeDom provider type "Microsoft.CodeDom.Providers.DotNetCompilerPlatform.CSharpCodeProvider" could not be located

It's a WebApi project using VS2015. Step to reproduce: Create an empty WebApi project Change Build output path from "bin\" to "bin\Debug\" Run Everything is working perfectly until I changed B..

What's the difference between getPath(), getAbsolutePath(), and getCanonicalPath() in Java?

What's the difference between getPath(), getAbsolutePath(), and getCanonicalPath() in Java? And when do I use each one?..

Using ORDER BY and GROUP BY together

My table looks like this (and I'm using MySQL): m_id | v_id | timestamp ------------------------ 6 | 1 | 1333635317 34 | 1 | 1333635323 34 | 1 | 1333635336 6 | 1 | 1333635343 6 ..

Git On Custom SSH Port

My VPS provider recommends that I leave my SSH port to the custom port number they assign it by default (not 22). The thing is the while I know I can give the port number when create a remote config,..

ReactJS - Add custom event listener to component

In plain old javascript I have the DIV <div class="movie" id="my_movie"> and the following javascript code var myMovie = document.getElementById('my_movie'); myMovie.addEventListener('nv-en..

Is it possible to use the SELECT INTO clause with UNION [ALL]?

In SQL Server this inserts 100 records, from the Customers table into tmpFerdeen :- SELECT top(100)* INTO tmpFerdeen FROM Customers Is it possible to do a SELECT INTO across a UNION ALL SELECT :- ..

How can I make a SQL temp table with primary key and auto-incrementing field?

What am I missing here? I'm trying to get the ID field to be the primary key and auto increment so that I don't need to insert it explicitly. CREATE TABLE #tmp ( ID INT IDENTITY(1, 1) , AssignedTo NV..

'git status' shows changed files, but 'git diff' doesn't

I've had a look at all similar questions. However, I've double checked and something strange is definitely happening. On one server (Solaris with Git 1.8.1) I cloned the Git repository then copied th..

Spring Could not Resolve placeholder

I'm fairly new to spring so excuse me if this is a dumb question. When I try to launch a program I get the following error: java.lang.IllegalArgumentException: Could not resolve placeholder 'appclient..

How to set height property for SPAN

I need to make following code stretchable with predefined height <style> .title{ background: url(bg.gif) no-repeat bottom right; height: 25px; } </style> <span class="title">..

How do I point Crystal Reports at a new database

I have a Crystal Reports 2008 user that has over 100 custom developed reports. The reports all query Sql Server databases (SQL 2005). This database server is getting replaced with a new system (runnin..

Only detect click event on pseudo-element

My code is: p { position: relative; background-color: blue; } p:before { content: ''; position: absolute; left:100%; width: 10px; height: 100%; background-color: red; ..

Laravel 5 Failed opening required bootstrap/../vendor/autoload.php

I have recently installed Laravel 5 via composer. I tried creating a new controller using artisan and I get the following error: bootstrap/../vendor/autoload.php. Failed to open stream: No such fi..

Javascript seconds to minutes and seconds

This is a common problem but I'm not sure how to solve it. The code below works fine. var mind = time % (60 * 60); var minutes = Math.floor(mind / 60); var secd = mind % 60; var seconds = Math.ceil(..

How to prevent Screen Capture in Android

Is it possible to prevent the screen recording in Android Application? I would like to develop an Android Secure Application. In that I need to detect screen recording software which are running back..

How to upload image in CodeIgniter?

In view <?php echo form_open_multipart('welcome/do_upload');?> <input type="file" name="userfile" size="20" /> In controler function do_upload() { $config['upload_path'] = './upl..

How can I map True/False to 1/0 in a Pandas DataFrame?

I have a column in python pandas DataFrame that has boolean True/False values, but for further calculations I need 1/0 representation. Is there a quick pandas/numpy way to do that?..

C++ Cout & Cin & System "Ambiguous"

I was just programming in c++, when all of a sudden all the "cout"s and "cin"s were errors and "Ambiguous". Including System. I don't know why this happened. Everything was fine, I was coding the sam..

How can I read a large text file line by line using Java?

I need to read a large text file of around 5-6 GB line by line using Java. How can I do this quickly?..

What does "The code generator has deoptimised the styling of [some file] as it exceeds the max of "100KB"" mean?

I added a new npm package to my project and require it in one of my modules. Now I get this message from webpack, build modulesNote: The code generator has deoptimised the styling of "D:/path/to/pro..

Why would you use Expression<Func<T>> rather than Func<T>?

I understand lambdas and the Func and Action delegates. But expressions stump me. In what circumstances would you use an Expression<Func<T>> rather than a plain old Func<T>?..

How do I run a batch script from within a batch script?

How do I call another batch script from within a batch script? I want it to execute in an if statement...

How can I pause setInterval() functions?

How do I pause and resume the setInterval() function using Javascript? For example, maybe I have a stopwatch to tell you the number of seconds that you have been looking at the webpage. There is a 'P..

Insert array into MySQL database with PHP

I have the following array I want to store in my database... $insData = array( 'uid' => $fbme['id'], 'first_name' => $fbme['first_name'], 'last_name' => $fbme['last_name'], '..

Generating a drop down list of timezones with PHP

Most sites need some way to show the dates on the site in the users preferred timezone. Below are two lists that I found and then one method using the built in PHP DateTime class in PHP 5. I need he..

Why should I use an IDE?

In another question, Mark speaks highly of IDEs, saying "some people still just dont know "why" they should use one...". As someone who uses vim for programming, and works in an environment where mos..

How to make a website secured with https

I have to build a small webapp for a company to maintain their business data... Only those within the company will be using it, but we are planning to host it in public domain, so that the employees ..

how to set imageview src?

I have an image view and a string src. I want to set the imageview source to the string src that I have, but am unable to do so beacuse the method expects an int: imgview.setImageResource(int); Si..

How can I find the version of the Fedora I use?

sudo find /etc | xargs grep -i fedora > searchFedora gives: /etc/netplug.d/netplug: # At least on Fedora Core 1 ... But see the Fedora version in the /etc/netplug.d/netplug file. Is it serious..

Logical operators ("and", "or") in DOS batch

How would you implement logical operators in DOS Batch files?..

Error: request entity too large

I'm receiving the following error with express: Error: request entity too large at module.exports (/Users/michaeljames/Documents/Projects/Proj/mean/node_modules/express/node_modules/connect/node_..