Questions Tagged with #Typography

Typography — in digital development — includes the creation, formatting, organization, arrangement, rendering, legibility, and readability of visual type on a device. This often extends beyond letterforms, numerals, and punctuation to include iconography, text layout, and more.

What is class="mb-0" in Bootstrap 4?

The latest documention has: _x000D_ _x000D_ <p class="mb-0">Lorem ipsum</p>_x000D_ _x000D_ _x000D_ Q: What is mb-0?..

How to get just the responsive grid from Bootstrap 3?

I need to add responsive design features to my web application using Twitter Bootstrap. I just want the responsive behavior, I'm not interested in the typography, components or any other stuff include..

Responsive font size in CSS

I've created a site using the Zurb Foundation 3 grid. Each page has a large h1: _x000D_ _x000D_ body {_x000D_ font-size: 100%_x000D_ }_x000D_ _x000D_ /* Headers */_x000D_ _x000D_ h1 {_x000D_ font..

How to show a dialog to confirm that the user wishes to exit an Android Activity?

I've been trying to show a "Do you want to exit?" type of dialog when the user attempts to exit an Activity. However I can't find the appropriate API hooks. Activity.onUserLeaveHint() initially lo..

Writing a dictionary to a text file?

I have a dictionary and am trying to write it to a file. exDict = {1:1, 2:2, 3:3} with open('file.txt', 'r') as file: file.write(exDict) I then have the error file.write(exDict) TypeError: mus..

Input size vs width

<input name="txtId" type="text" size="20" /> or <input name="txtId" type="text" style="width: 150px;" /> Which one is optimal cross-browser code? Of course it depends on requirements..

How do I determine file encoding in OS X?

I'm trying to enter some UTF-8 characters into a LaTeX file in TextMate (which says its default encoding is UTF-8), but LaTeX doesn't seem to understand them. Running cat my_file.tex shows the charac..

Convert int (number) to string with leading zeros? (4 digits)

Possible Duplicate: Number formatting: how to convert 1 to "01", 2 to "02", etc.? How can I convert int to string using the following scheme? 1 converts to 0001 123 converts to 0123 Of ..

Error converting data types when importing from Excel to SQL Server 2008

Every time that I try to import an Excel file into SQL Server I'm getting a particular error. When I try to edit the mappings the default value for all numerical fields is float. None of the fields ..

Detecting when user scrolls to bottom of div with jQuery

I have a div box (called flux) with a variable amount of content inside. This divbox has overflow set to auto. Now, what I am trying to do, is, when the use scroll to the bottom of this DIV-box, load..

What type of hash does WordPress use?

What type of hash does WordPress use? Here is an example of a WordPress hash: $P$Bp.ZDNMM98mGNxCtHSkc1DqdRPXeoR. ..

How to build a Horizontal ListView with RecyclerView?

I need to implement a horizontal listview in my Android application. I did a bit of research and came across How can I make a horizontal ListView in Android? and Horizontal ListView in Android? howeve..

How can I multiply all items in a list together with Python?

I need to write a function that takes a list of numbers and multiplies them together. Example: [1,2,3,4,5,6] will give me 1*2*3*4*5*6. I could really use your help...

How can I get the data type of a variable in C#?

How can I find out what data type some variable is holding? (e.g. int, string, char, etc.) I have something like this now: using System; using System.Collections.Generic; using System.Linq; using Sy..

jquery get all form elements: input, textarea & select

Is there an easy way (without listing them all separately) in jquery to select all form elements and only form elements. I can't use children() etc because the form contains other HTML. E.g: $("fo..

push() a two-dimensional array

I'm trying to push to a two-dimensional array without it messing up, currently My array is: var myArray = [ [1,1,1,1,1], [1,1,1,1,1], [1,1,1,1,1] ] And my code I'm trying is: var r = 3; //start fr..

JavaScript DOM remove element

I'm trying to test if a DOM element exists, and if it does exist delete it, and if it doesn't exist create it. var duskdawnkey = localStorage["duskdawnkey"]; var iframe = document.createElement("ifra..

Django 1.7 throws django.core.exceptions.AppRegistryNotReady: Models aren't loaded yet

This is the traceback on my windows system. Traceback (most recent call last): File "D:\AMD\workspace\steelrumors\manage.py", line 9, in <module> django.setup() File "D:\AMD\Django\dja..

Laravel 5 PDOException Could Not Find Driver

I have a problem using Laravel 5. When I run "php aritsan migrate", I got this error ************************************** * Application In Production! * ************************************..

How to print a float with 2 decimal places in Java?

Can I do it with System.out.print?..

Android: Difference between Parcelable and Serializable?

Why does Android provide 2 interfaces for serializing objects? Do Serializable objects interopt with Android Binder and AIDL files?..

Asp.net Validation of viewstate MAC failed

I am receiving the following error at certain times on asp.net website. Sys.WebForms.PageRequestManagerServerErrorException: Validation of viewstate MAC failed. If this application is hosted by ..

Count number of columns in a table row

I have a table similar to: <table id="table1"> <tr> <td><input type="text" value="" /></td> <td><input type="text" value="" /></td> <td><..

Popup window in PHP?

here's a quick question: How do you make a window pop up for your error handling in php? Is javascript the only way to do this or is there a way to do this in PHP? i have a PHP-file, and one of the ..

How can one create an overlay in css?

I'd like to create a div with an arbitrary size, then display something on top of that div. What is the best way to position and size the overlay exactly as the div below in css?..

Change output format for MySQL command line results to CSV

I want to get headerless CSV data from the output of a query to MySQL on the command line. I'm running this query on a different machine from the MySQL server, so all those Google answers with "INTO O..

Environment variables in Eclipse

I am able to run a sample hadoop program from the command prompt and am trying to run the same program from Eclipse, so that I can debug it and understand it better. For the command line program, som..

How to commit to remote git repository

I am new to git. I have done a clone of remote repo as follows git clone https://[email protected]/repo.git then I did git checkout master made some changes and committed these changes t..

NSURLErrorDomain error codes description

This is my first experience of developing an ios app. I am trying to Post some data using Facebook graph api. I am constantly getting the following error: The operation couldn’t be completed. (NSUR..

Tomcat 404 error: The origin server did not find a current representation for the target resource or is not willing to disclose that one exists

I was following the tutorial on o7planning and got stuck at step 6: http://o7planning.org/en/10169/java-servlet-tutorial It's just a simple project that show HelloWorld but for some reason I keep gett..

How to close a window using jQuery

How to close a window using jQuery for all browser compatibility? <input type="button" name="backButton" value="Close" style="background-color:#245f91; color:#fff;font-weig..

How do I clear inner HTML

I've been fiddling with this for a while but it won't work and I can't figure out why. Please help. Here is what I have: <html> <head> <title>lala</title> </head> &l..

How can I compile LaTeX in UTF8?

I did my document in an ISO-standard. It does not support umlaut alphabets, such as ä and ö. I need them. The document gets compiled without UTF8, but not with UTF8. More precisely, the document doe..

SVN commit command

I need to commit the folder after adding some new files to that folder. When I tried this in TortoiseSVN, it was working properly (committed successfully), but while trying this by using the svn commi..

Accessing nested JavaScript objects and arrays by string path

I have a data structure like this : var someObject = { 'part1' : { 'name': 'Part 1', 'size': '20', 'qty' : '50' }, 'part2' : { 'name': 'Part 2', 's..

How do I print to the debug output window in a Win32 app?

I've got a win32 project that I've loaded into Visual Studio 2005. I'd like to be able to print things to the Visual Studio output window, but I can't for the life of me work out how. I've tried 'prin..

General error: 1364 Field 'user_id' doesn't have a default value

I am trying to assign the user_id with the current user but it give me this error SQLSTATE[HY000]: General error: 1364 Field 'user_id' doesn't have a default value (SQL: insert into `posts` (`update..

nvarchar(max) still being truncated

So I'm writing a stored procedure in MS SQL Server 2008. It's a really long query and I have to write it dynamically, so I create a variable called @Query and make it of type NVARCHAR(MAX). Now, I hav..

How do you round to 1 decimal place in Javascript?

Can you round a number in javascript to 1 character after the decimal point (properly rounded)? I tried the *10, round, /10 but it leaves two decimals at the end of the int...

How to make HTML input tag only accept numerical values?

I need to make sure that a certain <input> field only takes numbers as value. The input is not part of a form. Hence it doesn't get submitted, so validating during submission is not an option. I..

How to JOIN three tables in Codeigniter

I'm using codeigniter framework to develop one music cms. i have 3 tables in mysql database, Currently im working in "Album" Table and "Model, Controller". i want to SELECT "Album" Table 1 and JOIN "A..

Question mark characters displaying within text, why is this?

I have a backup server that automatically backs up my live site, both files and database. On the live site, the text looks fine, but when you view the mirrored version of it, it displays '?' within s..

Count textarea characters

I am developing a character count for my textarea on this website. Right now, it says NaN because it seems to not find the length of how many characters are in the field, which at the beginning is 0, ..

System.web.mvc missing

We have an old ASP.NET MVC 3 Web Application, building in VS2010, that fails to compile, since last week's security update. The problem is that the reference to System.Web.Mvc.dll is broken. When I..

how to get the last part of a string before a certain character?

I am trying to print the last part of a string before a certain character. I'm not quite sure whether to use the string .split() method or string slicing or maybe something else. Here is some ..

Maven error: Could not find or load main class org.codehaus.plexus.classworlds.launcher.Launcher

I have installed a latest maven-3.0.4 on Windows 7: The installation details are as follows: Installation Path : C:\apache-maven-3.0.4 Environment Variables are: M2_HOME C:\apache-maven-3.0...

C++ equivalent of StringBuffer/StringBuilder?

Is there a C++ Standard Template Library class that provides efficient string concatenation functionality, similar to C#'s StringBuilder or Java's StringBuffer?..

What is the color code for transparency in CSS?

Can anyone tell me what is the color code for transparency in CSS like white = "#FFFFFF"? As I am using following code, to convert the color codes into int: Color color = ColorTranslator.FromHtml(hex..

How to get HTML 5 input type="date" working in Firefox and/or IE 10

I find it odd that input type="date" is still not supported in Firefox after all of this time. In fact, I don't think they added in much (if any) of the HTML 5 new types on an input element. Not s..

To show only file name without the entire directory path

ls /home/user/new/*.txt prints all txt files in that directory. However it prints the output as follows: [me@comp]$ ls /home/user/new/*.txt /home/user/new/file1.txt /home/user/new/file2.txt /ho..

How to convert minutes to hours/minutes and add various time values together using jQuery?

There are a couple parts to this question. I am not opposed to using a jQuery plugin if anyone knows of one that will accomplish what I want done. Q1 - How do I convert minutes into hours and vise ve..

PHP not displaying errors even though display_errors = On

I have a Ubuntu server running Apache2 with PHP 5. In the php.ini I set display_errors = On and error_reporting = E_ALL | E_STRICT, but PHP is still not displaying error messages. I'm also using Apa..

How do I create a unique ID in Java?

I'm looking for the best way to create a unique ID as a String in Java. Any guidance appreciated, thanks. I should mention I'm using Java 5...

What is reflection and why is it useful?

What is reflection, and why is it useful? I'm particularly interested in Java, but I assume the principles are the same in any language...

How can I fix "Design editor is unavailable until a successful build" error?

I started to learn Android Studio from yesterday. I try to echo out simple "Hello World": <?xml version="1.0" encoding="utf-8"?> <RelativeLayout android:id="@+id/activity_main" xmlns..

The type initializer for 'MyClass' threw an exception

The following is my Windows service code. When I am debugging the code, I am getting the error/ exception: The type initializer for 'CSMessageUtility.CSDetails' threw an exception. using System;..

Create a .txt file if doesn't exist, and if it does append a new line

I would like to create a .txt file and write to it, and if the file already exists I just want to append some more lines: string path = @"E:\AppServ\Example.txt"; if (!File.Exists(path)) { File.C..

Add carriage return to a string

I have a long string. string s1 = "'99024','99050','99070','99143','99173','99191','99201','99202','99203','99204','99211','99212','99213','99214','99215','99217','99218','99219','99221','99222','992..

Pagination using MySQL LIMIT, OFFSET

I have some code that LIMITs data to display only 4 items per page. The column I'm using has about 20-30 items, so I need to make those spread out across the pages. On the first page, I have: $..

How to plot time series in python

I have been trying to plot a time series graph from a CSV file. I have managed to read the file and converted the data from string to date using strptime and stored in a list. When I tried plotting a ..

The R %in% operator

In R, I have am running the following script: > 1:6 %in% 0:36 [1] TRUE TRUE TRUE TRUE TRUE TRUE Which is clearly producing a logical vector. I have read the documentation but can't seem to find..

Determine if 2 lists have the same elements, regardless of order?

Sorry for the simple question, but I'm having a hard time finding the answer. When I compare 2 lists, I want to know if they are "equal" in that they have the same contents, but in different order. ..

Java output formatting for Strings

I was wondering if someone can show me how to use the format method for Java Strings. For instance If I want the width of all my output to be the same For instance, Suppose I always want my output to..

Scroll back to the top of scrollable div

<div id="containerDiv"></div> #containerDiv { position: absolute; top: 0px; width: 400px; height: 100%; padding: 5px; font-size: .875em; overflow-y: scroll; } document.ge..

Comparing arrays in C#

I am trying to compare two arrays with each other. I tried this code and got the following errors. static bool ArraysEqual(Array a1, Array a2) { if (a1 == a2) return true; if (a1 == ..

Does IE9 support console.log, and is it a real function?

In which circumstances is window.console.log defined in Internet Explorer 9? Even when window.console.log is defined, window.console.log.apply and window.console.log.call are undefined. Why is this? ..

Convert Bitmap to File

I understand that using BitmapFactory can convert a File to a Bitmap, but is there any way to convert a Bitmap image to a File?..

How to convert an Image to base64 string in java?

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(..

laravel select where and where condition

I have this basic query i want to perform but an error keeps coming up. Probably due to my newness to laravel. here is the code: $userRecord = $this->where('email', $email)->where('password',..

How to fast get Hardware-ID in C#?

I need in my program to tie a license to a hardware ID. I tried use WMI, but it still slow. I need, for example, CPU, HDD, and motherboard info...

How can I insert values into a table, using a subquery with more than one result?

I really would appreciate your help. Probably it's a quite simple problem to solve - but I'm not the one .. ;-) I have two tables in SQL Server: article prices Now I want to select a certain set..

Connect to mysql in a docker container from the host

(It's probably a dumb question due to my limited knowledge with Docker or mysql administration, but since I spent a whole evening on this issue, I dare to ask it.) In a nutshell I want to run mysql ..

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..

make div's height expand with its content

I have these nested divs and I need the main container to expand (in height) to accommodate the DIVs inside <!-- head --> ... <!-- /head --> <body class="main"> ..

How to embed a SWF file in an HTML page?

How do you embed a SWF file in an HTML page?..

Converting BitmapImage to Bitmap and vice versa

I have BitmapImage in C#. I need to do operations on image. For example grayscaling, adding text on image, etc. I have found function in stackoverflow for grayscaling which accepts Bitmap and returns..

If list index exists, do X

In my program, user inputs number n, and then inputs n number of strings, which get stored in a list. I need to code such that if a certain list index exists, then run a function. This is made more ..

Load dimension value from res/values/dimension.xml from source code

I'd like to load the value as it is. I have two dimension.xml files, one in /res/values/dimension.xml and the other one in /res/values-sw360dp/dimension.xml. From source code I'd like to do somethin..

MetadataException: Unable to load the specified metadata resource

All of a sudden I keep getting a MetadataException on instantiating my generated ObjectContext class. The connection string in App.Config looks correct - hasn't changed since last it worked - and I've..

Only variable references should be returned by reference - Codeigniter

After the server PHP upgrade I am getting the following error with PHP Version 5.6.2 on Apache 2.0 A PHP Error was encountered Severity: Notice Message: Only variable references should be returned by..

How to vertically center a <span> inside a div?

The code: <div id="theMainDiv" style=" border:solid 1px gray; cursor:text; width:400px; padding:0px;" > <span id="tag1_outer" style=" background:#e2e6f..

How do I do an insert with DATETIME now inside of SQL server mgmt studioÜ

I have a website that does inserts into this table below. I need to do some manual inserts but I wasn't sure how do pass in the equivalent of DateTime.Now in C#. I am running this below from the q..

Python: Pandas Dataframe how to multiply entire column with a scalar

How do I multiply each element of a given column of my dataframe with a scalar? (I have tried looking on SO, but cannot seem to find the right solution) Doing something like: df['quantity'] *= -1 #..

ssh script returns 255 error

In my code I have the following to run a remote script. ssh [email protected] "sh /home/user/backup_mysql.sh" For some reason it keeps 255'ing on me. Any ideas? I can SSH into the box just fine..

How to upgrade docker-compose to latest version

I have installed docker-compose using the command sudo apt install docker-compose It installed docker-compose version 1.8.0 and build unknown I need the latest version of docker-compose or at least..

Parsing a CSV file using NodeJS

With nodejs I want to parse a .csv file of 10000 records and do some operation on each row. I tried using http://www.adaltas.com/projects/node-csv. I couldnt get this to pause at each row. This just r..

Using LIMIT within GROUP BY to get N results per group?

The following query: SELECT year, id, rate FROM h WHERE year BETWEEN 2000 AND 2009 AND id IN (SELECT rid FROM table2) GROUP BY id, year ORDER BY id, rate DESC yields: year id rate 2006 p01 ..

Git push: "fatal 'origin' does not appear to be a git repository - fatal Could not read from remote repository."

I know similar questions have already been asked. But, I believe my issue is due to a mistake I have previously made and therefore is different: let me explain. Everything was working smoothly, as I..

How to concatenate multiple lines of output to one line?

If I run the command cat file | grep pattern, I get many lines of output. How do you concatenate all lines into one line, effectively replacing each "\n" with "\" " (end with " followed by space)? ca..

How do I search for files in Visual Studio Code?

I am used to Resharper where I can search for files, not the content, but the filename, which makes it quick to open new files. Is this feature implemented in Visual Studio Code and is there a shortc..

Easiest way to copy a single file from host to Vagrant guest?

I have a use case where I occasionally want to copy a single file from my host machine to the Vagrant guest. I don't want to do so via traditional provisioners (Puppet / Chef) because this is often a..

Python : List of dict, if exists increment a dict value, if not append a new dict

I would like do something like that. list_of_urls = ['http://www.google.fr/', 'http://www.google.fr/', 'http://www.google.cn/', 'http://www.google.com/', 'http://www..

How to run Visual Studio post-build events for debug build only

How can I limit my post-build events to running only for one type of build? I'm using the events to copy DLL files to a local IIS virtual directory, but I don't want this happening on the build serve..

How to parse XML using shellscript?

I would like to know what would be the best way to parse an XML file using shellscript ? Should one do it by hand ? Does third tiers library exist ? If you already made it if you could let me know..

Storing Objects in HTML5 localStorage

I'd like to store a JavaScript object in HTML5 localStorage, but my object is apparently being converted to a string. I can store and retrieve primitive JavaScript types and arrays using localStorage..

How to "grep" for a filename instead of the contents of a file?

grep is used to search within a file to see if any line matches a given regular expression. However, I have this situation - I want to write a regular expression that will match the filename itself (a..

Insert value into a string at a certain position?

i'm looking to place a value from a text box lets say "12" to a certain place in a string temp variable. Then I want to place another value after that say "10" but with a : in between like a time. Bot..

Opening popup windows in HTML

I am working with web apps, and I am wondering if there is a way to open a link in an app-type window using HTML? Something like this: <a href="link" target="_app">My App</a> ..

Disable beep of Linux Bash on Windows 10

Having a Linux Bash on Windows 10 is pretty cool, but as far as I've got to struggle with the not-so-good terminal provided from Microsoft I'm gonna get stuck with Ubuntu for everything. Anyway, is t..

Using multiple parameters in URL in express

I am using Express with Node and I have a requirement in which the user can request the URL as: http://myhost/fruit/apple/red. Such a request will return a JSON response. The JSON data, before t..

Convert Pixels to Points

I have a need to convert Pixels to Points in C#. I've seen some complicated explanations about the topic, but can't seem to locate a simple formula. Let's assume a standard 96dpi, how do I calulate th..

Find files containing a given text

In bash I want to return file name (and the path to the file) for every file of type .php|.html|.js containing the case-insensitive string "document.cookie" | "setcookie" How would I do that?..

Convert XLS to CSV on command line

How could I convert an XLS file to a CSV file on the windows command line. The machine has Microsoft Office 2000 installed. I'm open to installing OpenOffice if it's not possible using Microsoft Offi..

ImportError: No module named 'Queue'

I am trying to import requests module, but I got this error my python version is 3.4 running on ubuntu 14.04 >>> import requests Traceback (most recent call last): File "/usr/local/lib/pyt..

struct.error: unpack requires a string argument of length 4

Python says I need 4 bytes for a format code of "BH": struct.error: unpack requires a string argument of length 4 Here is the code, I am putting in 3 bytes as I think is needed: major, minor = str..

Python function attributes - uses and abuses

Not many are aware of this feature, but Python's functions (and methods) can have attributes. Behold: >>> def foo(x): ... pass ... >>> foo.score = 10 >>> dir(foo) ..

How to playback MKV video in web browser?

I am trying to make a MKV video with a MPEG4 video codec and AC3 audio codec available to be played online using Mozilla or Chrome. I have tried multiple methods including native HTML5, which plays ba..

Loop code for each file in a directory

I have a directory of pictures that I want to loop through and do some file calculations on. It might just be lack of sleep, but how would I use PHP to look in a given directory, and loop through each..

Jquery change background color

I was trying out jquery with this example: $(document).ready(function(){ $("button").mouseover(function(){ $("p#44.test").css("background-color","yellow"); $("p#44.test").hide..

org.apache.poi.POIXMLException: org.apache.poi.openxml4j.exceptions.InvalidFormatException:

I'm using the following jar files: dom4j-1.6.1.jar poi-3.9-20121203.jar poi-ooxml-3.9-20121203.jar poi-ooxml-schemas-3.9-20121203.jar xmlbeans-2.3.0.jar Code: package ExcelTest; import java.io.Fi..

SQL Server CTE and recursion example

I never use CTE with recursion. I was just reading an article on it. This article shows employee info with the help of Sql server CTE and recursion. It is basically showing employees and their manager..

Clearing a text field on button click

I have two text labels: <div> <input type="text" id="textfield1" size="5"/> </div> <div> <input type="text" id="textfield2" size="5"/> ..

How to parse a JSON Input stream

I am using java to call a url that returns a JSON object: url = new URL("my URl"); urlInputStream = url.openConnection().getInputStream(); How can I convert the response into string form and parse ..

animating addClass/removeClass with jQuery

I am using jQuery and jQuery-ui and want to animate various attributes on various objects. For the sake of explaining the issue here I've simplified it to one div that changes from blue to red when ..

What is "406-Not Acceptable Response" in HTTP?

In my Ruby on Rails application I tried to upload an image through the POSTMAN REST client in Base64 format. When I POST the image I am getting a 406 Not Acceptable Response. When I checked my databas..

How to get client's IP address using JavaScript?

I need to somehow retrieve the client's IP address using JavaScript; no server side code, not even SSI. However, I'm not against using a free 3rd party script/service...

Entity Framework vs LINQ to SQL

Now that .NET v3.5 SP1 has been released (along with VS2008 SP1), we now have access to the .NET entity framework. My question is this. When trying to decide between using the Entity Framework and L..

How can I make an entire HTML form "readonly"?

I have two pages with HTML forms. The first page has a submission form, and the second page has an acknowledgement form. The first form offers a choice of many controls, while the second page displays..

How to install JDBC driver in Eclipse web project without facing java.lang.ClassNotFoundexception

There is a VERY similar question to mine but in my case I don't have any duplicate jars in my build path, so the solution does not work for me. I've searched google for a couple of hours now, but non..

How to get a barplot with several variables side by side grouped by a factor

I have a dataset which looks like this one below. I am trying to make a barplot with the grouping variable gender, with all the variables side by side on the x axis (grouped by gender as filler with d..

The performance impact of using instanceof in Java

I am working on an application and one design approach involves extremely heavy use of the instanceof operator. While I know that OO design generally tries to avoid using instanceof, that is a differe..

ReactJS lifecycle method inside a function Component

Instead of writing my components inside a class, I'd like to use the function syntax. How do I override componentDidMount, componentWillMount inside function components? Is it even possible? const gri..

How to set the locale inside a Debian/Ubuntu Docker container?

I'm running a Ubuntu Docker container. I have a Norwegian keyboard and need to use Norwegian characters (øæå). My Terminal character encoding is set to UTF-8 and I'm connected to my container usin..

How to explicitly obtain post data in Spring MVC?

Is there a way to obtain the post data itself? I know spring handles binding post data to java objects. But, given two fields that I want to process, how can I obtain that data? For example, suppose ..

XMLHttpRequest blocked by CORS Policy

I add an API with following script in let's say http://www.test.com: <script src="http://apiendpoint.com/api/v1/api.js"></script> <div id="api" data-apikey="LA59CJI9HZ-KIJK4I5-3CKJC"&..

Where is localhost folder located in Mac or Mac OS X?

I just started developing PHP projects on my mac (using PDT) and was wondering where localhost is located? How does Mac OS X serve websites, I haven't changed any settings during the installation of P..

android EditText - finished typing event

I want to catch an event when the user finishes editing EditText. How can it be done?..

How does HTTP_USER_AGENT work?

Possible Duplicate: Why navigator.appCodeName returning Mozilla? When I get the PHP server variable HTTP_USER_AGENT with this code: <?php $useragent = $_SERVER ['HTTP_USER_AGENT']; ..

Installing SQL Server 2012 - Error: Prior Visual Studio 2010 instances requiring update

I'm trying to install SQL Server 2012 Developer Edition and I can get to the point where it's doing the Installation Rule Checks but one of the rules keep failing: 'Prior Visual Studio 2010 instances..

How to hide soft keyboard on android after clicking outside EditText?

Ok everyone knows that to hide a keyboard you need to implement: InputMethodManager imm = (InputMethodManager) getSystemService(INPUT_METHOD_SERVICE); imm.hideSoftInputFromWindow(getCurrentFocus().ge..

How to use jQuery to get the current value of a file input field

From what I've ready you should be able to use the 'value' property of a file input field to get the currently set path of that field. But when I do this: $('#fileinput').value() I get 'undefined..

How to parse a JSON file in swift?

I have a JSON file, want to parse and use list of objects in table view. Can any one share the code to parse JSON file in swift. ..

How to gettext() of an element in Selenium Webdriver

I am finding a textbox by its ID. I need to get the content which is already there inside the text box. For that I am using the gettext() method, but it is returning the ID value. The content in the t..

Convert Uri to String and String to Uri

I'm developing some Application which allows select image from SD Card, save it into database and set this value for ImageView. I need to know way for converting uri to string and string to uri. Now I..

How to define relative paths in Visual Studio Project?

I have a library and a console application that uses a library. The library has a folder with source and header files. My project is in a child/inner directory but that library directory that I want ..

What is the difference between "is None" and "== None"

I recently came across this syntax, I am unaware of the difference. I would appreciate it if someone could tell me the difference...

Random color generator

Given this function, I want to replace the color with a random color generator. document.overlay = GPolyline.fromEncoded({ color: "#0000FF", weight: 10, points: encoded_points, zoomFa..

iPad/iPhone hover problem causes the user to double click a link

I have some websites I built times ago, that use jquery mouse events...I just got an ipad and i noticed that all the mouse over events are translated in clicks...so for instance i have to do two click..

Subtracting Number of Days from a Date in PL/SQL

I would like to subtract a given x number of days from sysdate, can someone assist me on how to do that, I am using the PL/SQL language. THANKS!..

Case Function Equivalent in Excel

I have an interesting challenge - I need to run a check on the following data in Excel: | A - B - C - D | |------|------|------|------| | 36 | 0 | 0 | x | | 0 | 600 | 700 ..

calculating the difference in months between two dates

In C#/.NET TimeSpan has TotalDays, TotalMinutes, etc. but I can't figure out a formula for total months difference. Variable days per month and leap years keep throwing me off. How can I get TotalMont..

How to measure elapsed time in Python?

What I want is to start counting time somewhere in my code and then get the passed time, to measure the time it took to execute few function. I think I'm using the timeit module wrong, but the docs ar..

Remove a file from the list that will be committed

I have a list of changed files in git repository. There is one file I don't wanna commit for the current moment. Can I do: git commit -a To commit all files and then somehow remove that file from c..

Logging levels - Logback - rule-of-thumb to assign log levels

I'm using logback in my current project. It offers six levels of logging: TRACE DEBUG INFO WARN ERROR OFF I'm looking for a rule of thumb to determine the log level for common activities...

How does one remove a Docker image?

I'm running Docker under Vagrant under OS X 10.8.4 (Mountain Lion), and whenever I try to delete a saved image, I get an error: $ docker rmi some-image-id 2013/07/15 hh:mm:ss unexpected JSON input ..

Summarizing count and conditional aggregate functions on the same factor

Quick and short of it is I'm having problems summarizing count and aggregate functions with conditions on the same factor. Suppose I have this dataframe: library(dplyr) df = tbl_df(data.frame( ..

Get Base64 encode file-data from Input Form

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..

ReactJS Two components communicating

I just got started with ReactJS and am a little stuck on a problem that I have. My application is essentially a list with filters and a button to change the layout. At the moment I'm using three c..

Gson and deserializing an array of objects with arrays in it

I am trying to use Gson to deserialize a json string returned from my webservice The structure would be returned as TypeDTO[]. where TypeDTO is like int id; String name; ArrayList<ItemDTO> i..

What does "The APR based Apache Tomcat Native library was not found" mean?

I am using Tomcat 7 in Eclipse on Windows. When starting Tomcat, I am getting the following info message: The APR based Apache Tomcat Native library which allows optimal performance in production ..

Live video streaming using Java?

Are there any good libraries for streaming live video using Java? Ideally both ends of the pipe should be written in Java but I am mostly concerned about the video player. What software would you reco..

How to control size of list-style-type disc in CSS?

My HTML first: <ul class="moreLinks" > <div>More from Travelandleisure.com</div> <li><a rel="nofollow" href="">xyz1</a></li> <li><a..

How to load image files with webpack file-loader

I am using webpack to manage a reactjs project. I want to load images in javascript by webpack file-loader. Below is the webpack.config.js: const webpack = require('webpack'); const path = require('pa..

How to get the name of the current Windows user in JavaScript

I was wondering how I would get the name of the current user in JavaScript as part of an HTML document. In Java, one would type System.getProperty("user.name"); to achieve this. What is the alternati..

Find and replace string values in list

I got this list: words = ['how', 'much', 'is[br]', 'the', 'fish[br]', 'no', 'really'] What I would like is to replace [br] with some fantastic value similar to &lt;br /&gt; and thus getting..

Is there a way to make text unselectable on an HTML page?

I'm building an HTML UI with some text elements, such as tab names, which look bad when selected. Unfortunately, it's very easy for a user to double-click a tab name, which selects it by default in ma..

Getting the count of unique values in a column in bash

I have tab delimited files with several columns. I want to count the frequency of occurrence of the different values in a column for all the files in a folder and sort them in decreasing order of coun..

How to unblock with mysqladmin flush hosts

I have gone through similar cases listed here but it doesn't seem to work. I was using MySQL Workbench to establish a connection with my database which is hosted on another server. Tried a few times ..

Pandas - Get first row value of a given column

This seems like a ridiculously easy question... but I'm not seeing the easy answer I was expecting. So, how do I get the value at an nth row of a given column in Pandas? (I am particularly interested..

Setting background colour of Android layout element

I am trying to, somewhat clone the design of an activity from a set of slides on Android UI design. However I am having a problem with a very simple task. I have created the layout as shown in the im..

How to convert a data frame column to numeric type?

How do you convert a data frame column to a numeric type?..

Filename timestamp in Windows CMD batch script getting truncated

I have a batch script that outputs a file, and I'm trying to ensure that each time the script is executed, no existing files are overwritten, so I'm trying to put a timestamp on it. Currently I have ..

How to open a file / browse dialog using javascript?

Is there any way to open the browse for files dialog box when a <a href> link is clicked using javascript? It should function like a normal browse for files button and give the names/list of fil..

ld cannot find an existing library

I am attempting to link an application with g++ on this Debian lenny system. ld is complaining it cannot find specified libraries. The specific example here is ImageMagick, but I am having similar pro..

Difference between sh and bash

When writing shell programs, we often use /bin/sh and /bin/bash. I usually use bash, but I don't know what's the difference between them. What's main difference between bash and sh? What do we need..

How to make the tab character 4 spaces instead of 8 spaces in nano?

When I press TAB in nano editor, the cursor will jump with 8 spaces like this: def square(x): return x * x def cube(y): return y * y * y how can I set the tab stop width to 4 spaces..

How to compare DateTime without time via LINQ?

I have var q = db.Games.Where(t => t.StartDate >= DateTime.Now).OrderBy(d => d.StartDate); But it compares including time part of DateTime. I really don't need it. How to do it without t..

How to create local notifications?

How can I setup local notifications so that at the time I set, my app generates a notification/alert with a customized message?..

Adding external library into Qt Creator project

How can I add external library into a project built by Qt Creator RC1 (version 0.9.2)? For example, the win32 function EnumProcesses() requires Psapi.lib to be added in the project to build...

Android: show soft keyboard automatically when focus is on an EditText

I'm showing an input box using AlertDialog. The EditText inside the dialog itself is automatically focused when I call AlertDialog.show(), but the soft keyboard is not automatically shown. How do I m..

Best way to create enum of strings?

What is the best way to have a enum type represent a set of strings? I tried this: enum Strings{ STRING_ONE("ONE"), STRING_TWO("TWO") } How can I then use them as Strings?..

Live-stream video from one android phone to another over WiFi

I have searched the internet for days now on how to implement a video streaming feature from an android phone to another android phone over a WiFi connection but I can't seem to find anything useful. ..

Python Timezone conversion

I am looking for a quick way to type in a time and then python convert it into other timezones ( maybe up to 10 different timezones ) Sorry. I am not familar with time in python at all, if someone co..

.crx file install in chrome

I have just created a very simple chrome extension and it works fine. But when I converted to .crx file and try to open it with chrome, nothing happens. my chrome browser version is 19.0.1081.2 dev-m...

How to get the current location latitude and longitude in android

In my application, I get the current location's latitude and longitude when application is open, but not when the application is closed. I am using Service class to get the current location latitude ..

How to run bootRun with spring profile via gradle task

I'm trying to set up gradle to launch the bootRun process with various spring profiles enabled. My current bootRun configuration looks like: bootRun { // pass command line options from gradle t..

Spark - load CSV file as DataFrame?

I would like to read a CSV in spark and convert it as DataFrame and store it in HDFS with df.registerTempTable("table_name") I have tried: scala> val df = sqlContext.load("hdfs:///csv/file/dir/f..

What's the difference between a mock & stub?

I've read various articles about mocking vs stubbing in testing, including Martin Fowler's Mocks Aren't Stubs, but still don't understand the difference...

C++11 thread-safe queue

A project I'm working on uses multiple threads to do work on a collection of files. Each thread can add files to the list of files to be processed, so I put together (what I thought was) a thread-safe..

Stopword removal with NLTK

I am trying to process a user entered text by removing stopwords using nltk toolkit, but with stopword-removal the words like 'and', 'or', 'not' gets removed. I want these words to be present after st..

Best way to alphanumeric check in JavaScript

What is the best way to perform an alphanumeric check on an INPUT field in JSP? I have attached my current code function validateCode() { var TCode = document.getElementById("TCode").val..

How to revert to origin's master branch's version of file

I'm in my local computer's master branch of a cloned master-branch of a repo from a remote server. I updated a file, and I want to revert back to the original version from the remote master branch. ..

ActiveX component can't create object

I have just installed a third party app on my Windows Server 2008 server and I get the ActiveX Component can't create object message when I try to access using a CreateObject in VBScript. It i..

Pretty-Printing JSON with PHP

I'm building a PHP script that feeds JSON data to another script. My script builds data into a large associative array, and then outputs the data using json_encode. Here is an example script: $data =..

Querying DynamoDB by date

I'm coming from a relational database background and trying to work with amazon's DynamoDB I have a table with a hash key "DataID" and a range "CreatedAt" and a bunch of items in it. I'm trying to g..

How do I detect when someone shakes an iPhone?

I want to react when somebody shakes the iPhone. I don't particularly care how they shake it, just that it was waved vigorously about for a split second. Does anyone know how to detect this?..

Git commit in terminal opens VIM, but can't get back to terminal

Trying to learn GitHub at the moment and doing this Git essentials tutorial over at nettuts. I'm on the lesson about making commits. The teacher types git commit and it opens VIM as his editor (I'd a..

Postgresql: error "must be owner of relation" when changing a owner object

What is the grant option/trick I need to give to the current user ("userA") to allow him to change a object's owner which belongs by another user ("userC")? More precisely, the contact table is owned..

Amazon S3 and Cloudfront cache, how to clear cache or synchronize their cache

I have a cron job that runs every 10 minutes and updates the content-type and x-amz-meta. But since yesterday it seems like after the cron job run, Amazon is not picking up the changes made (refreshin..

What should I set JAVA_HOME environment variable on macOS X 10.6?

Many Java applications that use shell scripts to configure their environment use the JAVA_HOME environment variable to start the correct version of Java, locate JRE JARs, and so on. In macOS X 10.6, ..

How to exclude rows that don't join with another table?

I have two tables, one has primary key other has it as a foreign key. I want to pull data from the primary table, only if the secondary table does not have an entry containing it's key. Sort of an op..

How to compare two floating point numbers in Bash?

I am trying hard to compare two floating point numbers within a bash script. I have to variables, e.g. let num1=3.17648e-22 let num2=1.5 Now, I just want do a simple comparison of these two numbers: ..

500 internal server error, how to debug

I have internal server errors on my POST requests. How can I debug them ? Is it something to set up in php.ini ? THe file is really big and the word 'error' is met there many-many times...

Getting the document object of an iframe

I'm trying to get the document object of an iframe, but none of the examples I've googled seem to help. My code looks like this: <html> <head> <script> func..

Replace first occurrence of pattern in a string

Possible Duplicate: How do I replace the first instance of a string in .NET? Let's say I have the string: string s = "Hello world."; how can I replace the first o in the word Hello for l..

sql server convert date to string MM/DD/YYYY

I am using SQL Server 2008. I have the following: select convert(varchar(20),fmdate) from Sery How do I convert the date to string such that it show as MM/DD/YYYY..

Use getElementById on HTMLElement instead of HTMLDocument

I've been playing around with scraping data from web pages using VBS/VBA. If it were Javascript I'd be away as its easy, but it doesn't seem to be quite as straight forward in VBS/VBA. This is an ex..

Html.fromHtml deprecated in Android N

I am using Html.fromHtml to view html in a TextView. Spanned result = Html.fromHtml(mNews.getTitle()); ... ... mNewsTitle.setText(result); But Html.fromHtml is now deprecated in Android N+ What/Ho..

Java web start - Unable to load resource

I've got a jar that loads great with java web start when I browse through the IP address of the server. Once I try the server name instead I get the following exception: com.sun.deploy.net.FailedDow..

jQuery Validate Plugin - Trigger validation of single field

I've got a form that can optionally be pre-populated via facebook connect. Once a user connects, their name and email are automatically filled in. The problem is that this doesn't trigger the remote..

Android: Reverse geocoding - getFromLocation

I am trying to get an address based on the long/lat. it appears that something like this should work? Geocoder myLocation = Geocoder(Locale.getDefault()); List myList = myLocation.getFromLocatio..

Read and parse a Json File in C#

I have spent the best part of two days "faffing" about with code samples and etc., trying to read a very large JSON file into an array in c# so I can later split it up into a 2d array for processing. ..

Interfaces — What's the point?

The reason for interfaces truly eludes me. From what I understand, it is kind of a work around for the non-existent multi-inheritance which doesn't exist in C# (or so I was told). All I see is, you p..