Combine hover and click functions (jQuery)?

Javascript
Can hover and click functions be combined into one, so for example: click: $('#target').click(function() { // common operation }); hover: $('#t...
5 months ago

How do I output the value of a checked radio button?

jQuery
How do I get the value of a checked radio button and output it inside a corresponding element? I' running into troubles since I like to load the val...
5 months ago

Fastest Method To Read Thousands of JSON Files in Python

JSON
I have a number of JSON files I need to analyze. I am using iPython (Python 3.5.2 | IPython 5.0.0), reading in the files to a dictionary and appending...
5 months ago

jQuery - get index of element, restricted to class

jQuery
Given the following html: <div class="my-container"> <div class="x"> <a href="#">Link 1</a> </div> ...
5 months ago

c - spawned a bash shell. Shell died but pipe not broken?

Linux
Problem I'm trying to pipe contents from the main routine to a execvp'd bash shell. I'm encountering a problem where when I write "exit" into the sub...
5 months ago

How to load data in second component of UIPickerView from first component selection

Objective-C
I have tried to find a solution for my problem for over a week now but no success with other similar questions on this website. I have multiple NSMut...
5 months ago

php percent calculation

PHP
how to implement calculation of percents: $x=3; $y = 100\$x; // 3.333.. $x*$y - and here I need to get 100 without Observational error Any ideas?...
5 months ago

Zend Framework 2 - Database connection

PHP
Trying to wrap my head around the new concepts of Zend Framework 2.0. I'm trying to connect to a database, and to get that connection in a controller...
5 months ago

How to number unique words on each individual line, not miss paragraph?

Perl
Before anything I am reading English language and programming, but I am beginner now. So I did a lot of methods to learn EN ( self-study ) but finally...
5 months ago

How to display html using QWebView. Python

Python
I have a question: how to display webpage in HTML format in console. import sys from PyQt4.QtGui import QApplication from PyQt4.QtCore import QUrl fr...
5 months ago

how to setup custom middleware in django

Python
I am trying to create middleware to optionally pass a kwarg to every view that meets a condition. The problem is that I cannot find an example of how...
5 months ago

Access all elements of nested lists

Python
I am trying to find a short and elegant way in order to access all individual elements in nested lists. For example: lst1 = ['1', '2', '3'] lst2 = ['...
5 months ago

Python Create Count of Letters from Text File

Python
I'm trying to do a count of the letters only from a text file. I want to exclude any punctuation and spaces. Here's what I have so far. I've been sear...
5 months ago

How to convert string date with timezone to datetime?

Python
I have date in string: Tue Oct 04 2016 12:13:00 GMT+0200 (CEST) and I use (according to https://docs.python.org/2/library/datetime.html#strftime-st...
5 months ago

Replacing different substrings without clear pattern in python

Python
I need to replace part of some queries (strings) which don't always have the same substring to replace. query = """ SELECT DATE(utimestamp) as utime...
5 months ago

How to use matplotlib quiver using an external file

Python
I am trying to write a very simple code (should be): I want to plot arrows from an external data file which gives me the vector dimensions in x and y...
5 months ago

Retaining the previous date in R

R
I got stuck at a fairly easy data munging task. I have a transactional data frame in R that resembles this one: id<-c(11,11,22,22,22) dates<-as...
5 months ago

Graphing Segments in R

R
I want to plot segmented data in R. That is, say I have data of the form | Product | Date | Origination | Rate | Num | Balance | |-...
5 months ago

Why does defineMessages from react-intl throw an error when passing in a object reference?

React JSX
I am trying to get my head around react-intl from the Yahoo! i18n project and I am running into a weird issue. My goal is to store the base string (En...
5 months ago

R ifelse changed factor value into index

R
I met a weird problem when I am using R, I'm using data.table: Here, when I tried to convert those Province has count under 500 to "Other", the outpu...
5 months ago