Questions Tagged with #Column sizing

Python - How do you run a .py file?

I've looked all around Google and its archives. There are several good articles, but none seem to help me out. So I thought I'd come here for a more specific answer. The Objective: I want to run this..

How can I return the sum and average of an int array?

I need to define two methods for returning the sum and average of an int array. The method defining is as follow:- public int Sum(params int[] customerssalary) { // I tried the fo..

Hook up Raspberry Pi via Ethernet to laptop without router?

I'm working on a balloon project with a Raspberry Pi. When we potentially recover the Raspberry Pi, it will most likely be in a rural location and I'd like to turn off the Pi at that point safely. Wi..

Latex - Change margins of only a few pages

I have a Latex document where I need to change the margins of only a few pages (the pages where I'm adding a lot of graphics). In particular, I'd like to change the top margins (\voffset). I've tried..

Java Enum return Int

I'm having trouble declaring an enum. What I'm trying to create is an enum for a 'DownloadType', where there are 3 download types (AUDIO, VIDEO, AUDIO_AND_VIDEO). I have implemented the code as follo..


I apologize, but this is kind of a two part question. I'm extremely new to SQL and am trying to develop a time clock application for the small office that I work in. I'm playing around with the SQL b..

Read input numbers separated by spaces

This may be a total beginner's question, but I have yet to find an answer that works for me. Currently, I'm writing a program for a class that takes in a user's input (which can be one or more number..

How to convert int[] into List<Integer> in Java?

How do I convert int[] into List<Integer> in Java? Of course, I'm interested in any other answer than doing it in a loop, item by item. But if there's no other answer, I'll pick that one as the..

What is the difference between readonly="true" & readonly="readonly"?

What is the difference between: <input name="TextBox1" type="text" id="TextBox1" readonly="true" /> and: <input name="TextBox1" type="text" id="TextBox1" readonly="readonly" /> When..

Posting array from form

I have a form on my page with a bunch of inputs and some hidden fields, I've been asked to pass this data through a "post array" only im unsure on how to do this, Heres a snippet of what im doing at..

JavaScript check if variable exists (is defined/initialized)

Which method of checking if a variable has been initialized is better/correct? (Assuming the variable could hold anything (string, int, object, function, etc.)) if (elem) { // or !elem or if (type..

How do I cancel an HTTP fetch() request?

There is a new API for making requests from JavaScript: fetch(). Is there any built in mechanism for canceling these requests in-flight?..

How to check if an NSDictionary or NSMutableDictionary contains a key?

I need to check if an dict has a key or not. How?..

Convert a String representation of a Dictionary to a dictionary?

How can I convert the str representation of a dict, such as the following string, into a dict? s = "{'muffin' : 'lolz', 'foo' : 'kitty'}" I prefer not to use eval. What else can I use? The main re..

Unsupported operation :not writeable python

Email validation #Email validator import re def is_email(): email=input("Enter your email") pattern = '[\.\w]{1,}[@]\w+[.]\w+' file = open('ValidEmails.txt','r') if re.match(pattern..

jQuery iframe load() event?

Does anyone know if there is such a thing? I have a iframe that's being inserted with $.ajax() and I want to do some stuff after the contents from the iframe are completely loaded: .... success: fu..

How to present UIAlertController when not in a view controller?

Scenario: The user taps on a button on a view controller. The view controller is the topmost (obviously) in the navigation stack. The tap invokes a utility class method called on another class. A bad ..

Http Basic Authentication in Java using HttpClient?

I am trying to mimic the functionality of this curl command in Java: curl --basic --user username:password -d "" http://ipaddress/test/login I wrote the following using Commons HttpClient 3.0 but s..

GCD to perform task in main thread

I have a callback which might come from any thread. When I get this callback, then I would like to perform a certain task on the main thread. Do I need to check whether I already am on the main threa..

Python Pandas Counting the Occurrences of a Specific value

I am trying to find the number of times a certain value appears in one column. I have made the dataframe with data = pd.DataFrame.from_csv('data/DataSet2.csv') and now I want to find the number of t..

Time calculation in php (add 10 hours)?

I get the time: $today = time(); $date = date('h:i:s A', strtotime($today)); if the current time is "1:00:00 am", how do i add 10 more hours to become 11:00:00 am??..

Access props inside quotes in React JSX

In JSX, how do you reference a value from props from inside a quoted attribute value? For example: <img className="image" src="images/{this.props.image}" /> The resulting HTML output is: &l..

What does "ulimit -s unlimited" do?

There are understandably many related questions on stack allocation What and where are the stack and heap? Why is there a limit on the stack size? Size of stack and heap memory However on various ..

What is the documents directory (NSDocumentDirectory)?

Can someone explain to me what the documents directory is on an iOS app and when to use it? Here is what I believe at present: To me, it seems to be a central folder where the user can store any fil..

add a temporary column with a value

I have a select statement like this select field1, field2 from table1 What I want is to have a newfield with only value "example". newfield does not exist in the table, but when I run this que..

Temporarily disable all foreign key constraints

I am running an SSIS package which will replace data for a few tables from FlatFiles to existing tables in a database. My package will truncate the tables and then insert the new data. When I run my ..

How can I read input from the console using the Scanner class in Java?

How could I read input from the console using the Scanner class? Something like this: System.out.println("Enter your username: "); Scanner = input(); // Or something like this, I don't know the code ..

What's the main difference between Java SE and Java EE?

What's the main difference between Java SE and Java EE?..

What's the difference between a web site and a web application?

I'm stumped trying to come up to a difference between a website and a web application for myself. As I see it, a web site points to a specific page and a web application is more of some sort of 'porta..

Error: Cannot invoke an expression whose type lacks a call signature

I am brand new to typescript, and I have two classes. In the parent class I have: abstract class Component { public deps: any = {}; public props: any = {}; public setProp(prop: string): any { ..

Checking if a variable is defined?

How can I check whether a variable is defined in Ruby? Is there an isset-type method available?..

Regex to accept alphanumeric and some special character in Javascript?

I have a Javascript regex like this: /^[\x00-\x7F]*$/ I want to modify this regex so that it accept all capital and non-capital alphabets, all the numbers and some special characters: - , _, @, ., ..

How to set the value of a hidden field from a controller in mvc

I want to set the value of a hidden field from a controller.How can i do this? In view part i have given like this.. <div> @Html.Hidden("hdnFlag", null, new { @id = "hdnFlag" }) </div>..

ImportError: No module named xlsxwriter

I recently downloaded the xlsxwriter version 0.6.4 and installed it on my computer. It correctly added it to my C:\Python27\Lib\site-packages\xlsxwriter folder, however when I try to import it I get ..

Replace image src location using CSS

I have a website that has an image with a src attribute and I would like to change the src location of that image with an image of my own. The image lives in a div component. I can't change the HTML a..

jQuery get the location of an element relative to window

Given an HTML DOM ID, how to get an element's position relative to the window in JavaScript/JQuery? This is not the same as relative to the document nor offset parent since the element may be inside ..

jquery simple image slideshow tutorial

Where can I find a simple jquery image slideshow tutorial for beginners from scratch (without plugins) without left and right navigation button? thank you...

Error occurred during initialization of VM (java/lang/NoClassDefFoundError: java/lang/Object)

I'm trying to install Java to use Eclipse (I followed all instructions to install Java and Eclipse) but my Eclipse is not starting due to some bad configuration I guess. I can't figure out why it's no..

R plot: size and resolution

I have stacked into the question: I need to plot the image with DPI=1200 and specific print size. By default the png looks ok... png("test.png",width=3.25,height=3.25,units="in",res=1200) par(mar=c..

Python Remove last char from string and return it

While I know that there is the possibility: >>> a = "abc" >>> result = a[-1] >>> a = a[:-1] Now I also know that strings are immutable and therefore something like this: ..

how to add lines to existing file using python

I already created a txt file using python with a few lines of text that will be read by a simple program. However, I am having some trouble reopening the file and writing additional lines in the file ..

Eclipse - "Workspace in use or cannot be created, chose a different one."

I'm trying to create a workspace in the /Users/Shared/ directory with the thought that I can share that workspace between users. The problem is that after I create the workspace and change the permiss..

Mocking a function to raise an Exception to test an except block

I have a function (foo) which calls another function (bar). If invoking bar() raises an HttpError, I want to handle it specially if the status code is 404, otherwise re-raise. I am trying to write so..

How can I get a JavaScript stack trace when I throw an exception?

If I throw a JavaScript exception myself (eg, throw "AArrggg"), how can I get the stack trace (in Firebug or otherwise)? Right now I just get the message. edit: As many people below have posted, it ..

How to loop through a collection that supports IEnumerable?

How to loop through a collection that supports IEnumerable?..

xsd:boolean element type accept "true" but not "True". How can I make it accept it?

I am using xmllint --schema option to validate my XML that looks like this <XML> <Active>True</Active> </XML> In my schema file, I have following line that describes Active ..

How to use string.replace() in python 3.x

The string.replace() is deprecated on python 3.x. What is the new way of doing this?..

check null,empty or undefined angularjs

I am creating a project using angularjs.I have variable like $scope.test = null $scope.test = undefined $scope.test = "" I want to check all null,undefined and empty value in one condition..

How can I start InternetExplorerDriver using Selenium WebDriver

I downloaded the driver and I gave the exact path in my code but when I ran the code it shows me error my code with java is as below: System.out.println("Internet Explorer is selected"); System.setP..

How to safely open/close files in python 2.4

I'm currently writing a small script for use on one of our servers using Python. The server only has Python 2.4.4 installed. I didn't start using Python until 2.5 was out, so I'm used to the form: ..

django - get() returned more than one topic

When I tried to relate an attribute with another one which has an M to M relation I received this error: get() returned more than one topic -- it returned 2! Can you guys tell me what that means..

Count(*) vs Count(1) - SQL Server

Just wondering if any of you people use Count(1) over Count(*) and if there is a noticeable difference in performance or if this is just a legacy habit that has been brought forward from days gone pas..

How can I convert a character to a integer in Python, and viceversa?

I want to get, given a character, its ASCII value. For example, for the character a, I want to get 97, and vice versa...

How to set the height of an input (text) field in CSS?

Sorry for this question but I can't seem to find an answer anywhere. I have CSS code that should set the height of my text box. I am using VS2010 Express for Windows phone, coding in HTML/CSS/Javascri..

How to store custom objects in NSUserDefaults

Alright, so I've been doing some poking around, and I realize my problem, but I don't know how to fix it. I have made a custom class to hold some data. I make objects for this class, and I need to t..

Addition for BigDecimal

I want to do some simple sums with some currency values expressed in BigDecimal type. BigDecimal test = new BigDecimal(0); System.out.println(test); test.add(new BigDecimal(30)); System.out.println(..

How do I specify "close existing connections" in sql script

I'm doing active development on my schema in SQL Server 2008 and frequently want to rerun my drop/create database script. When I run USE [master] GO IF EXISTS (SELECT name FROM sys.databases WHERE..

How to compute the similarity between two text documents?

I am looking at working on an NLP project, in any programming language (though Python will be my preference). I want to take two documents and determine how similar they are...

ASP.NET MVC 5 - Identity. How to get current ApplicationUser

I have an Article entity in my project which has the ApplicationUser property named Author. How can I get the full object of currently logged ApplicationUser? While creating a new article, I have to s..

Strings in C, how to get subString

I have a string: char * someString; If I want the first five letters of this string and want to set it to otherString, how would I do it?..

How do I hide an element when printing a web page?

I have a link on my webpage to print the webpage. However, the link is also visible in the printout itself. Is there javascript or HTML code which would hide the link button when I click the print li..

MySQL Workbench Dark Theme

I am new here on Stackoverflow and have full of excitement bringing up my first question. My first question is all about changing the color appearance of MySQL Workbench from the default of white back..

Start thread with member function

I am trying to construct a std::thread with a member function that takes no arguments and returns void. I can't figure out any syntax that works - the compiler complains no matter what. What is the co..

Create JPA EntityManager without persistence.xml configuration file

Is there a way to initialize the EntityManager without a persistence unit defined? Can you give all the required properties to create an entity manager? I need to create the EntityManager from the use..

How can I use break or continue within for loop in Twig template?

I try to use a simple loop, in my real code this loop is more complex, and I need to break this iteration like: {% for post in posts %} {% if == 10 %} {# break #} {% endif %} ..

Ansible: get current target host's IP address

How do you get the current host's IP address in a role? I know you can get the list of groups the host is a member of and the hostname of the host but I am unable to find a solution to getting the IP..

How to add icons to React Native app

I am making a React Native app. I would like to customize the app icon (meaning the icon that you click on to start the app). I have Googled this, but I keep finding different types of icons that refe..

Changing the sign of a number in PHP?

I have a few floats: -4.50 +6.25 -8.00 -1.75 How can I change all these to negative floats so they become: -4.50 -6.25 -8.00 -1.75 Also I need a way to do the reverse If the float is a negative..

How to find a min/max with Ruby

I want to use min(5,10), or Math.max(4,7). Are there functions to this effect in Ruby?..

Rounding up to next power of 2

I want to write a function that returns the nearest next power of 2 number. For example if my input is 789, the output should be 1024. Is there any way of achieving this without using any loops but ju..

What is the function __construct used for?

I have been noticing __construct a lot with classes. I did a little reading and surfing the web, but I couldn't find an explanation I could understand. I am just beginning with OOP. I was wondering i..

How to add custom method to Spring Data JPA

I am looking into Spring Data JPA. Consider the below example where I will get all the crud and finder functionality working by default and if I want to customize a finder then that can be also done e..

Import CSV to SQLite

I'm trying to import a csv file to an SQLite table. Example csv: 1,2 5,6 2,7 Example command: sqlite> create table foo(a, b); sqlite> .separator , sqlite> .import test.csv foo Error: tes..

Git command to checkout any branch and overwrite local changes

Is there a Git command (or a short sequence of commands) that will safely and surely do the following? Get rid of any local changes. Fetch the given branch from origin if necessary Checkout the give..

How to use ternary operator in razor (specifically on HTML attributes)?

With the WebForms view engine, I'll commonly use the ternary operator for very simple conditionals, especially within HTML attributes. For example: <a class="<%=User.Identity.IsAuthenticated ? ..

HTML Button : Navigate to Other Page - Different Approaches

There are multiple ways to create a HTML button to navigate to other page. Method 1 <button id="btn_click">Click Me</button> <script> $('#btn_click').on('click', function() { windo..

How to use PowerShell select-string to find more than one pattern in a file?

I would like to search for more than one string in the files in a directory, however using "select-string -pattern" didn't help. Could anyone show me how to do it? Example: Search all files in C:\Log..

Bootstrap 3: how to make head of dropdown link clickable in navbar

I'm using the default navbar and a couple of the list items are dropdowns. I'm not able to click the link that triggers the dropdown. I know that I could just add a duplicate link into the dropdown bu..

Java regular expression OR operator

This may be a dumb question, but I couldn't find it anywhere: How can I use the java OR regular expression operator (|) without parentheses? e.g: Tel|Phone|Fax..

What is the correct way to check for string equality in JavaScript?

What is the correct way to check for equality between Strings in JavaScript?..

Logical operators for boolean indexing in Pandas

I'm working with boolean index in Pandas. The question is why the statement: a[(a['some_column']==some_number) & (a['some_other_column']==some_other_number)] works fine whereas a[(a['some_colu..

How do I get the SharedPreferences from a PreferenceActivity in Android?

I am using a PreferenceActivity to show some settings for my application. I am inflating the settings via a xml file so that my onCreate (and complete class methods) looks like this: public class Fo..

Detect end of ScrollView

I have an app, that has an Activity that uses a ScrollView. I need to detect when user gets to the bottom of the ScrollView. I did some googleing and I found this page where is explained. But, in the ..

How to print Unicode character in Python?

I want to make a dictionary where English words point to Russian and French translations. How do I print out unicode characters in Python? Also, how do you store unicode chars in a variable?..

How to use shared memory with Linux in C

I have a bit of an issue with one of my projects. I have been trying to find a well documented example of using shared memory with fork() but to no success. Basically the scenario is that when the ..

Angularjs autocomplete from $http

I'm trying to write an autocomplete directive that fetches data from the server using an $http request (without using any external plugins or scripts). Currently it works only with static data. Now, I..

Where should my npm modules be installed on Mac OS X?

I was attempting to upgrade phonegap via npm when I started running into trouble. Long story short, there are two node_modules directories on my computer. /usr/local/lib/node_modules /usr/local/share..

commands not found on zsh

I am using the z Shell (zsh) instead of the default bash, and something wrong happen so that all commands who used to work are no longer recognized: ls zsh: command not found: ls open -e .zshrc zsh:..

What is makeinfo, and how do I get it?

I'm trying to build GNU grep, and when I run make, I get: [snip] /bin/bash: line 9: makeinfo: command not found What is makeinfo, and how do I get it? (This is Ubuntu, if it makes a difference)..

How do I make a batch file terminate upon encountering an error?

I have a batch file that's calling the same executable over and over with different parameters. How do I make it terminate immediately if one of the calls returns an error code of any level? Basical..

Return date as ddmmyyyy in SQL Server

I need the date as ddmmyyyy without any spacers. How can I do this? I can get yyyymmdd using CONVERT(VARCHAR, [MyDateTime], 112) But I need the reverse of this. SQL Server 2008..

How to configure port for a Spring Boot application

How do I configure the TCP/IP port listened on by a Spring Boot application, so it does not use the default port of 8080...

How long to brute force a salted SHA-512 hash? (salt provided)

Here is an algorithm in Java: public String getHash(String password, String salt) throws Exception { String input = password + salt; MessageDigest md = MessageDigest.getInstance(SHA-512); ..

How to download a file via FTP with Python ftplib

I have the following code which easily connects to the FTP server and opens a zip file. I want to download that file into the local system. How to do that? # Open the file for writing in binary mode ..

Java math function to convert positive int to negative and negative to positive?

Is there a Java function to convert a positive int to a negative one and a negative int to a positive one? I'm looking for a reverse function to perform this conversion: -5 -> 5 5 -> -5 ..

Java equivalent of unsigned long long?

In C++, I enjoyed having access to a 64 bit unsigned integer, via unsigned long long int, or via uint64_t. Now, in Java longs are 64 bits, I know. However, they are signed. Is there an unsigned long ..

SQL Server Jobs with SSIS packages - Failed to decrypt protected XML node "DTS:Password" with error 0x8009000B

i have a SQL server job that runs a SSIS package. This job has 9 steps and in each step it extracts data from a different database. the connections strings are defined as parameters in each step. im..

docker entrypoint running bash script gets "permission denied"

I'm trying to dockerize my node.js app. When the container is built I want it to run a git clone and then start the node server. Therefore I put these operations in a .sh script. And run the script as..

Writelines writes lines without newline, Just fills the file

I have a program that writes a list to a file. The list is a list of pipe delimited lines and the lines should be written to the file like this: 123|GSV|Weather_Mean|hello|joe|43.45 122|GEV|temp_Mea..

Adding a stylesheet to (using Visual Studio 2010)

I am trying to add a stylesheet to a master page in an web form. Basically trying to create an inline nav menu for the top of the page. I'm having issues with it. I've created the stylesheet (..

How to set viewport meta for iPhone that handles rotation properly?

So I've been using: <meta name="viewport" content="width=device-width; initial-scale=1.0; maximum-scale=1.0;"/> to get my HTML content to display nicely on the iPhone. It works great until t..

Replace multiple characters in one replace call

Very simple little question, but I don't quite understand how to do it. I need to replace every instance of '_' with a space, and every instance of '#' with nothing/empty. var string = '#Please se..

Hidden property of a button in HTML

I am trying to show three buttons on one button click. Before a button click all three buttons are hidden. I set the hidden property and I am also calling a function on a button click. The problem is ..

gcc error: wrong ELF class: ELFCLASS64

I was trying to compile a program using an external compiled object coreset.o. I wrote the public01.c test file and my functions are in computation.c, both of which compiles. However its failing on ..

How to create a file in Android?

How to create a file, write data into it and read data from it on Android? If possible provide a code snippet...

what is Promotional and Feature graphic in Android Market/Play Store?

What does it mean and need whether we are uploading our app into the market? Please Explain or give me a related links...

Change cursor to hand when mouse goes over a row in table

How do I change the cursor pointer to hand when my mouse goes over a <tr> in a <table> <table class="sortable" border-style:> <tr> <th class="tname">Name</th>..

How to resume Fragment from BackStack if exists

I am learning how to use fragments. I have three instances of Fragment that are initialized at the top of the class. I am adding the fragment to an activity like this: Declaring and initializing: Fr..

Troubleshooting BadImageFormatException

I have a Windows service written in C# using Visual Studio 2010 and targeting the full .NET Framework 4. When I run from a Debug build the service runs as expected. However, when I run it from a Rel..

How to mute an html5 video player using jQuery

I've found how to pause and play the video using jquery $("video").get(0).play(); $("video").get(0).pause(); But I can't find the mute button, if there isn't a jquery solution, I'm fine with just a..

java get file size efficiently

While googling, I see that using can be slow. FileChannel has a size() method that is available as well. Is there an efficient way in java to get the file size?..

Java SimpleDateFormat for time zone with a colon separator?

I have a date in the following format: 2010-03-01T00:00:00-08:00 I have thrown the following SimpleDateFormats at it to parse it: private static final SimpleDateFormat[] FORMATS = { new Simp..

Possible heap pollution via varargs parameter

I understand this occurs with Java 7 when using varargs with a generic type; But my question is.. What exactly does Eclipse mean when it says "its use could potentially pollute the heap?" And How..

Match linebreaks - \n or \r\n?

While writing this answer, I had to match exclusively on linebreaks instead of using the s-flag (dotall - dot matches linebreaks). The sites usually used to test regular expressions behave differen..

How to find the default JMX port number?

I am running a Java application on Java 6 VM on a remote Windows XP, on which I can run jvisualvm.exe to connect to the running application automatically. Now I need to connect that application from ..

View JSON file in Browser

It is not a programming question, but need your views in few words. When we hit the JSON url in Broswer, it asks us to save the file. Why this happens ? Is there any way to view it on the page its..

How do I get the Session Object in Spring?

I am relatively new to Spring and Spring security. I was attempting to write a program where I needed to authenticate a user at the server end using Spring security, I came up with the following: p..

phpmyadmin logs out after 1440 secs

In my local development Ubuntu box I use MySQL and phpmyadmin to work with the database. Whenever phpmyadmin is idle for 1440 secs (24min) the session expires. I lose my place and have to login and ..

How to empty ("truncate") a file on linux that already exists and is protected in someway?

I have a file called error.log on my server that I need to frequently truncate. I have rw permissions for the file. Opening the file in vi > deleting all content > saving works (obviously). But when I..

Uncaught SyntaxError: Unexpected token < On Chrome

I know this question has been asked many times but I can't find similarity with my issue. I'm getting this error only in Chrome, in every other browser everything is ok. I return data with JSON in sev..

Transparent background in JPEG image

How can I set a transparent background on JPEG image? This is a doubt of many colleagues of mine. What would be the solution using Paint on Windows? What are the other simple alternatives?..

Javascript Confirm popup Yes, No button instead of OK and Cancel

Javascript Confirm popup, I want to show Yes, No button instead of OK and Cancel. I have used this vbscript code: <script language="javascript"> function window.confirm(str) { exec..

How can I store JavaScript variable output into a PHP variable?

I have the following code in JavaScript: <script> var a="Hello"; </script> PHP Code:- <?php $variable = // I want the above JavaScript variable 'a' value to be stored here ?> ..

Adding/removing items from a JavaScript object with jQuery

I have a JavaScript object as follows: var data = {items: [ {id: "1", name: "Snatch", type: "crime"}, {id: "2", name: "Witches of Eastwick", type: "comedy"}, {id: "3", name: "X-Men", type..

Select columns from result set of stored procedure

I have a stored procedure that returns 80 columns, and 300 rows. I want to write a select that gets 2 of those columns. Something like SELECT col1, col2 FROM EXEC MyStoredProc 'param1', 'param2' ..

What is the difference between And and AndAlso in VB.NET?

In VB.NET, what is the difference between And and AndAlso? Which should I use?..

Omitting the second expression when using the if-else shorthand

Can I write the if else shorthand without the else? var x=1; x==2 ? dosomething() : doNothingButContinueCode(); I've noticed putting null for the else works (but I have no idea why or if that'..

An attempt was made to access a socket in a way forbidden by its access permissions

I have a website on HostGator and a dedicated server of my own running SQL Server 2008R2. The connection string I use is X.X.X.X,1433 which points to the IP address of my dedicated server. I have mad..

How can I calculate the difference between two dates?

How can I calculate the days between 1 Jan 2010 and (for example) 3 Feb 2010?..

How to view or edit localStorage

I created a Chrome extension and am using localStorage for storing data. I am accessing localStorage through "background_page". It works fine but how can I manually view its values? In Firefox you c..

Count number of rows matching a criteria

I am looking for a command in R which is equivalent of this SQL statement. I want this to be a very simple basic solution without using complex functions OR dplyr type of packages. Select count(*) as..

What is the difference between java and core java?

When looking at job openings on-line, I noticed that some openings required knowledge of "core Java". What is core java and how is different from java?..

How to drop a list of rows from Pandas dataframe?

I have a dataframe df : >>> df sales discount net_sales cogs STK_ID RPT_Date 600141 20060331 2.709 NaN 2.709 2.245 ..

HTML5 record audio to file

What I ultimately want to do is record from the user's microphone, and upload the file to the server when they're done. So far, I've managed to make a stream to an element with the following code: v..

How to hide only the Close (x) button?

I have a modal dialog, and need to hide the Close (X) button, but I cannot use ControlBox = false, because I need to keep the Minimize and Maximize buttons. I need to hide just Close button, is ther..

How to change facet labels?

I have used the following ggplot command: ggplot(survey, aes(x = age)) + stat_bin(aes(n = nrow(h3), y = ..count.. / n), binwidth = 10) + scale_y_continuous(formatter = "percent", breaks = c(0, 0.1,..

Easiest way to loop through a filtered list with VBA?

If I have an auto filter set up in Excel and I want to loop through all the visible data in one column with VBA code, what's the easiest way to do this? All the hidden rows that have been filtered a..

Grep only the first match and stop

I'm searching a directory recursively using grep with the following arguments hoping to only return the first match. Unfortunately, it returns more than one -- in-fact two the last time I looked. It s..

How do I POST a x-www-form-urlencoded request using Fetch?

I have some parameters that I want to POST form-encoded to my server: { 'userName': '[email protected]', 'password': 'Password!', 'grant_type': 'password' } I'm sending my request (current..

How can I directly view blobs in MySQL Workbench

I'm using MySQL Workbench CE 5.2.30 CE / Rev 6790 . When execute the following statement: SELECT OLD_PASSWORD("test") I only get back a nice BLOB icon, I need to left-click to select the cell, righ..

Insert an element at a specific index in a list and return the updated list

I have this: >>> a = [1, 2, 4] >>> print a [1, 2, 4] >>> print a.insert(2, 3) None >>> print a [1, 2, 3, 4] >>> b = a.insert(3, 6) >>> print b ..

How can I use modulo operator (%) in JavaScript?

How can I use modulo operator (%) in calculation of numbers for JavaScript projects?..

How to add anything in <head> through jquery/javascript?

I'm working with a CMS, which prevents editing HTML source for <head> element. For example I want to add the following above the <title> tag: <meta http-equiv="X-UA-Compatible" conten..

How do I change the figure size with subplots?

I came across this example in the Matplotlib website. I was wondering if it was possible to increase the figure size. I tried with f.figsize(15,15) but it does nothing...

Running MSBuild fails to read SDKToolsPath

Howdy, I'm having a bit of an issue runnning a NAnt script that used to properly build my .Net 2.0 based website, when compiling with VS2008 and it's associated tools. I've recently upgraded all the ..

Is not required for packages in Python 3.3+

I am using Python 3.5.1. I read the document and the package section here: Now, I have the following structure: /home/wujek/Playground/a/b/mo..

How can I check if a string represents an int, without using try/except?

Is there any way to tell whether a string represents an integer (e.g., '3', '-17' but not '3.14' or 'asfasfas') Without using a try/except mechanism? is_int('3.14') == False is_int('-7') == True ..

Change WPF controls from a non-main thread using Dispatcher.Invoke

I have recently started programming in WPF and bumped into the following problem. I don't understand how to use the Dispatcher.Invoke() method. I have experience in threading and I have made a few sim..

Google Apps Script to open a URL

Is there a way to write a google apps script so when ran, a second browser window opens to (or another site of my choice)? I am trying to come up with a work-around to my previous ques..

Resize image in the wiki of GitHub using Markdown

I'm writing a wiki page on GitHub, and I'm using Markdown. My problem is that I'm putting a large image (this image is in its own repository) and I need resize it. I have tried different solutions,..

$(document).ready not Working

I am trying to run jQuery and WebMethods with ASP.NET; I have added a ScriptManager to the master page, and a content on the content page <asp:Content ID="ch" ContentPlaceHolderID="cHead" runat="s..

box-shadow on bootstrap 3 container

I'm building a little website using bootstrap. The base structure looks like this: <!DOCTYPE html> <html> <head> <link href="

Change value in a cell based on value in another cell

Searched for this but could not find a way to do it. I would like to be able to transform a value in one cell to another value in a different cell like this: When cells in Column A contain Y set s..

Error: More than one module matches. Use skip-import option to skip importing the component into the closest module

When I try to create a component in the angular cli, it's showing me this error. How do I get rid of it ? Error: More than one module matches. Use skip-import option to skip importing the componen..

Changing element style attribute dynamically using JavaScript

I hav a certain style sheet for a div. Now i want to modify one attribute of div dynamically using js. How can i do it? document.getElementById("xyz").style.padding-top = "10px"; Is this correct?..

Convert ASCII number to ASCII Character in C

In C is there a way to convert an ASCII value typed as an int into the the corresponding ASCII character as a char?..

Add SUM of values of two LISTS into new LIST

I have the following two lists: first = [1,2,3,4,5] second = [6,7,8,9,10] Now I want to add the items from both of these lists into a new list. output should be third = [7,9,11,13,15] ..

How do I use a 32-bit ODBC driver on 64-bit Server 2008 when the installer doesn't create a standard DSN?

I ran into an issue with some third party software that we use to track software license usage in our computer labs. We recently migrated the app to 64-bit Server 2008 after receiving assurances from..

How do I set cell value to Date and apply default Excel date format?

I've been using Apache POI for some time to read existing Excel 2003 files programmatically. Now I have a new requirement to create entire .xls files in-memory (still using Apache POI) and then write ..

counting number of directories in a specific directory

How to count the number of folders in a specific directory. I am using the following command, but it always provides an extra one. find /directory/ -maxdepth 1 -type d -print| wc -l For example, i..

Set margins in a LinearLayout programmatically

I'm trying to use Java (not XML) to create a LinearLayout with buttons that fill the screen, and have margins. Here is code that works without margins: LinearLayout buttonsView = new LinearLayout(thi..

MySQL: ignore errors when importing?

I am importing a fairly large database. The .sql file has almost 1,000,000 lines in it. Problem is that I am getting a syntax error when trying to import the database. It says: ERROR 1064 (42000)..

Using ffmpeg to encode a high quality video

I have a set of video frames saved as images in a directory, and I'm trying to encode these to a good quality video, however every setting and every format I try produces very noticeable artifacts. T..

Cannot push to GitHub - keeps saying need merge

I'm new to GitHub. Today I met some issue when I was trying to push my code to GitHub. Pushing to [email protected]:519ebayproject/519ebayproject.git To g[email protected]:519ebayproject/519ebayproject.git ..

Spring Hibernate - Could not obtain transaction-synchronized Session for current thread

I created an application with spring + hibernate, but I always get this error. This is my first application with hibernate, I read some guides but I can not solve this problem. Where am I doing wrong?..

Getting XML Node text value with Java DOM

I can't fetch text value with Node.getNodeValue(), Node.getFirstChild().getNodeValue() or with Node.getTextContent(). My XML is like <add job="351"> <tag>foobar</tag> <..

How to use sed to replace only the first occurrence in a file?

I would like to update a large number of C++ source files with an extra include directive before any existing #includes. For this sort of task, I normally use a small bash script with sed to re-write ..

Index was outside the bounds of the Array. (Microsoft.SqlServer.smo)

I am using SQL Server 2008 R2. It is working fine. But recently, I have changed my hosting server and I came to know that they have installed SQL Server 2012 on Server. Now, Issue is that after connec..

How to write a confusion matrix in Python?

I wrote a confusion matrix calculation code in Python: def conf_mat(prob_arr, input_arr): # confusion matrix conf_arr = [[0, 0], [0, 0]] for i in range(len(prob_arr)): ..

Starting a shell in the Docker Alpine container

To start an interactive shell for the Ubuntu image we can run: ole@T:~$ docker run -it --rm ubuntu root@1a6721e1fb64:/# ls bin boot dev etc home lib lib64 media mnt opt proc root run sbi..

Understanding the grid classes ( col-sm-# and col-lg-# ) in Bootstrap 3

I'm getting started on Bootstrap 3 and I'm having some trouble understanding how the grid classes are meant to be used. Here's what I've figured out so far: It appears that the classes col-sm-# and..

Stop setInterval call in JavaScript

I am using setInterval(fname, 10000); to call a function every 10 seconds in JavaScript. Is it possible to stop calling it on some event? I want the user to be able to stop the repeated refresh of d..

file_put_contents(meta/services.json): failed to open stream: Permission denied

I am new to Laravel. I was trying to open http://localhost/test/public/ and I got Error in exception handler. I googled around and changed the permission of storage directory using chmod -R 77..

What is "Linting"?

PHPLint, JSLint, and I recently came across "you can lint your JS code on the fly" while reading something about some IDE. So, what is "linting"?..

DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging is enabled

While importing the database in mysql, I have got following error: 1418 (HY000) at line 10185: This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declaration and binary logging..

Selecting data frame rows based on partial string match in a column

I want to select rows from a data frame based on partial match of a string in a column, e.g. column 'x' contains the string "hsa". Using sqldf - if it had a like syntax - I would do somethin..

Setting up SSL on a local xampp/apache server

I'm trying to access a Active Directory from my local webserver. To do this I'm using the latest version of xampp and a PHP script called adLDAP. If I understand things right, I need to enable SSL to ..

Use jQuery to change value of a label

I have a label, costLabel. What I want to be able to do is change the value of this label depending on the selected value of a dropdownlist. This is my HTML: <table> <tr> <td ..

android asynctask sending callbacks to ui

I have the following asynctask class which is not inside the activity. In the activity I'm initializing the asynctask, and I want the asynctask to report callbacks back to my activity. Is it possible?..

What's the difference between [ and [[ in Bash?

I looked at bash man page and the [[ says it uses Conditional Expressions. Then I looked at Conditional Expressions section and it lists the same operators as test (and [). So I wonder, what is the d..

How to verify CuDNN installation?

I have searched many places but ALL I get is HOW to install it, not how to verify that it is installed. I can verify my NVIDIA driver is installed, and that CUDA is installed, but I don't know how to ..

How to stop C++ console application from exiting immediately?

Lately, I've been trying to learn C++ from this website. Unfortunately whenever I try to run one of the code samples, I see that program open for about a half second and then immediately close. Is the..

LIKE operator in LINQ

Is there any way to compare strings in a C# LINQ expression similar to SQL's LIKE operator? Suppose I have a string list. On this list I want to search a string. In SQL, I could write: SELECT * FROM..

What is a serialVersionUID and why should I use it?

Eclipse issues warnings when a serialVersionUID is missing. The serializable class Foo does not declare a static final serialVersionUID field of type long What is serialVersionUID and why is..

What is ROWS UNBOUNDED PRECEDING used for in Teradata?

I am just starting on Teradata and I have come across an Ordered Analytical Function called "Rows unbounded preceding" in Teradata. I tried several sites to learn about the function but all of them us..

Cross compile Go on OSX?

I am trying to cross-compile a go app on OSX to build binaries for windows and linux. I have read everything what I could find on the net. Closest example that I have found has been published on (apar..

Improve subplot size/spacing with many subplots in matplotlib

Very similar to this question but with the difference that my figure can be as large as it needs to be. I need to generate a whole bunch of vertically-stacked plots in matplotlib. The result will be ..

How to convert integers to characters in C?

For example, if the integer was 97, the character would be 'a', or 98 to 'b'...

current/duration time of html5 video?

I need a way of getting the total time length of the video and the current time with jquery and displaying it in a couple of <div> tags. <div id="current">0:00</div> <div id="dur..

How to get files in a relative path in C#

If I have an executable called app.exe which is what I am coding in C#, how would I get files from a folder loaded in the same directory as the app.exe, using relative paths? This throws an illegal c..

Where is Java Installed on Mac OS X?

I just downloaded Java 7u17 on Mac OS 10.7.5 from here and then successfully installed it. In order to do some JNI programming, I need to know where Java installed on my Mac. I thought that inside t..

How do I get an animated gif to work in WPF?

What control type should I use - Image, MediaElement, etc.?..

Objective C - Assign, Copy, Retain

I'm new to Objective C. I have basic knowledge in C, including the concept of pointers. I have two basic questions: Can someone explain the difference between assign,copy, and retain with some analo..

HttpClient - A task was cancelled?

It works fine when have one or two tasks however throws an error "A task was cancelled" when we have more than one task listed. List<Task> allTasks = new List<Task>(); allTasks.Add(......

What's the "Content-Length" field in HTTP header?

What does it mean? Byte count of encoded content string with encoding specified in header. Character count of content string. Especially in case of Content-Type: application/x-www-form-urlencoded...

Check if AJAX response data is empty/blank/null/undefined/0

What I have: I have jQuery AJAX function that returns HTML after querying a database. Depending on the result of the query, the function will either return HTML code or nothing (i.e. blank) as desire..

Count the number of items in my array list

I want to count the number of itemids in my array, can i get an example of how i would go about adding this to my code. code below; if (value != null && !value.isEmpty()) { Set set = valu..

On Selenium WebDriver how to get Text from Span Tag

On Selenium Webdriver, how I can retrieve text from a span tag & print? I need to extract the text UPS Overnight - Free HTML code are as follow: div id="customSelect_3" class="select_wrapp..

open link in iframe

I have a page with a frame in it, and some links below the frame. I want the links, when clicked, to open the page in the frame. I tried <a href="" target="nameofframe">link1</a> but it ..

Apache Spark: map vs mapPartitions?

What's the difference between an RDD's map and mapPartitions method? And does flatMap behave like map or like mapPartitions? Thanks. (edit) i.e. what is the difference (either semantically or in term..