Questions Tagged with #Tarfile

either a tar archive file or a Python module used to handle tar archive files

How to create full compressed tar file using Python?

How can I create a .tar.gz file with compression in Python?..

How to make a variable accessible outside a function?

I am fetching data from a json file using $.getJSON to get an id of a character and then use $.getJSON to fetch it from another page using the id that I go previously. However, in the console it says..

Are there pointers in php?

What does this code mean? Is this how you declare a pointer in php? $this->entryId = $entryId; ..

React.js: How to append a component on click?

I'm new to React and I'm puzzled on something kind of basic. I need to append a component to the DOM after the DOM is rendered, on a click event. My initial attempt is as follows, and it doesn't wor..

Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target 1.6

When trying to run the Example CorDapp (GitHub CorDapp) via IntelliJ, I receive the following error: Cannot inline bytecode built with JVM target 1.8 into bytecode that is being built with JVM target..

Key error when selecting columns in pandas dataframe after read_csv

I'm trying to read in a CSV file into a pandas dataframe and select a column, but keep getting a key error. The file reads in successfully and I can view the dataframe in an iPython notebook, but whe..

Pythonic way to check if something exists?

This is pretty basic but I was coding and started wondering if there was a pythonic way to check if something does not exist. Here's how I do it if its true: var = 1 if var: print 'it exists' ..

How do I execute .js files locally in my browser?

Hello i was wondering how i can type a javascript game on textmate with my mac and have just a regular .js file but than take the .js file and open it and have it run in chrome like if i have it say "..

What does ON [PRIMARY] mean?

I'm creating an SQL setup script and I'm using someone else's script as an example. Here's an example of the script: SET ANSI_NULLS ON GO SET QUOTED_IDENTIFIER ON GO CREATE TABLE [dbo].[be_Categorie..

jQuery Show-Hide DIV based on Checkbox Value

Using AJAX I populate a DIV with a bunch of checkboxes (each with it's own unique ID). The IDs are "projectID1", "projectID2", "projectID3" and so on... I have given all checkboxes a class of "pChk". ..

UTF-8 in Windows 7 CMD

I've tried to display UTF-8 in the win7 cmd. Currently, I'm using the standard font because as I see with the mysql.exe, it works fine with the characters I'm working with (currently the german umlaut..

The ResourceConfig instance does not contain any root resource classes

What's going wrong here? The ResourceConfig instance does not contain any root resource classes. Dec 10, 2010 10:21:24 AM com.sun.jersey.spi.spring.container.servlet.SpringServlet initiate SEVERE: Ex..

How to print pthread_t

Searched, but don't come across a satisfying answer. I know there's no a portable way to print a pthread_t. How do you do it in your app? Update: Actually I don't need pthread_t, but some small..

Netbeans 8.0.2 The module has not been deployed

I just installed netbeans and I have problems deploying a new Java Web App. I simply create the project without editing anything, this is what project has by default (using apache): index.html <!..

Convert RGB to Black & White in OpenCV

I would like to know how to convert an RGB image into a black & white (binary) image. After conversion, how can I save the modified image to disk?..

Ruby array to string conversion

I have a ruby array like ['12','34','35','231']. I want to convert it to a string like '12','34','35','231'. How can I do that?..

How to connect android wifi to adhoc wifi?

I'm new on the android system. Is this correct, the android 2.2.1 WIFI only detects non-ad hoc wireless network? I was wondering if there's a way to connect my android to an ad hoc network set-up from..

How to generate xsd from wsdl

Is there any way by which I can generate xsd from wsdl. Any link or tool will also do. What is the simplest way to do this?..

How to get parameters from a URL string?

I have a HTML form field $_POST["url"] having some URL strings as the value. Example values are:[email protected]

BitBucket - download source as ZIP

I know I can get the project through git clone command, but is there any way, how to download the project through the web interface from In the best way, I am looking for a way to downl..

Jquery/Ajax call with timer

I have a php page that echos out rows from a database. I want to call it via jquery/ajax every 30 seconds. But I also want to be able to call the page at any time so that if I add a record via the for..

How to access to the parent object in c#

I have a "meter" class. One property of "meter" is another class called "production". I need to access to a property of meter class (power rating) from production class by reference. The powerRating i..

Run ssh and immediately execute command

I'm trying to find UNIX or bash command to run a command after connecting to an ssh server. For example: ssh name@ip "tmux list-sessions" The above code works, it lists the sessions, but it then i..

android - setting LayoutParams programmatically

I putting an in-game chat module into an app. I am adding text messages as they are received into a LinearLayout view. I want to set the layout params to the TextView but the following code is crashin..

How to select all columns, except one column in pandas?

I have a dataframe look like this: import pandas import numpy as np df = DataFrame(np.random.rand(4,4), columns = list('abcd')) df a b c d 0 0.418762 0.042369 0.86920..

Specify JDK for Maven to use

I am trying to build a Hudson plugin I've modified and it requires jdk1.6. This is fine, but I don't see how I can tell maven where the different jdk is. I've found few mentions on the internet but th..

File upload progress bar with jQuery

I am trying to implement an AJAX file upload feature in my project. I am using jQuery for this; my code submits the data using AJAX. I also want to implement a file upload progress bar. How can I do t..

Android SharedPreferences in Fragment

I am trying to read SharedPreferences inside Fragment. My code is what I use to get preferences in any other Activity. SharedPreferences preferences = getSharedPreferences("pref", 0); I get er..

How to start mongodb shell?

I am using MAC and I have successfully logged in to the server and started the server using the following command ./mongod then it says Thu Jul 14 01:50:41 db version v1.6.5, pdfile version 4.5 T..

Connection failed: SQLState: '01000' SQL Server Error: 10061

I'm trying to connect my access front-end to the SQL Server backend. It was working when SQL Server was on my computer but now i'm trying to connect to a server So when I create the DSN file with ac..

How do you parse and process HTML/XML in PHP?

How can one parse HTML/XML and extract information from it?..

Installing Java on OS X 10.9 (Mavericks)

I have installed the JDK on Mac OS X v10.8 (Mountain Lion). When I upgraded it to Mac OS X v10.9 (Mavericks) and ran java -version in the terminal, it showed: No Java..

How to "select distinct" across multiple data frame columns in pandas?

I'm looking for a way to do the equivalent to the SQL SELECT DISTINCT col1, col2 FROM dataframe_table The pandas sql comparison doesn't have anything about distinct. .unique() only works for a si..

IEnumerable vs List - What to Use? How do they work?

I have some doubts over how Enumerators work, and LINQ. Consider these two simple selects: List<Animal> sel = (from animal in Animals join race in Species ..

SQL set values of one column equal to values of another column in the same table

I have a table with two DATETIME columns. One of them is never NULL, but one of them is sometimes NULL. I need to write a query which will set all the NULL rows for column B equal to the values in c..

Is Secure.ANDROID_ID unique for each device?

I am using this call: Secure.getString(getApplicationContext().getContentResolver(), Secure.ANDROID_ID); To get a UID for the device. I think I am getting the same ID from multiple devices though. ..

python filter list of dictionaries based on key value

I have a list of dictionaries and each dictionary has a key of (let's say) 'type' which can have values of 'type1', 'type2', etc. My goal is to filter out these dictionaries into a list of the same di..

Get content uri from file path in android

I know the absolute path of an image (say for eg, /sdcard/cats.jpg). Is there any way to get the content uri for this file ? Actually in my code, I download an image and save it at a particular loc..

PHP Converting Integer to Date, reverse of strtotime

<?php echo strtotime("2014-01-01 00:00:01")."<hr>"; // output is 1388516401 ?> I am surprised if it can be reverse. I mean can I convert 1388516401 to 2014-01-01 00:00:01. What I actuall..

How to write a multidimensional array to a text file?

In another question, other users offered some help if I could supply the array I was having trouble with. However, I even fail at a basic I/O task, such as writing an array to a file. Can anyone expl..

Capitalize words in string

What is the best approach to capitalize words in a string?..

Clear text area

In Onselect event I have script: $("#vinanghinguyen_images_bbocde").val(''); $("#vinanghinguyen_images_bbocde").val(vinanghinguyen_final_bbcode); I want clear text area id="vinanghinguyen_images_bb..

Disabling user input for UITextfield in swift

pretty trivial question, I know. But I can not find anything online. I need to disable the user from being able to edit the text inside of a text field. So that when the click on the text, a keyboard..

Jenkins Pipeline Wipe Out Workspace

We are running Jenkins 2.x and love the new Pipeline plugin. However, with so many branches in a repository, disk space fills up quickly. Is there any plugin that's compatible with Pipeline that I..

Using margin / padding to space <span> from the rest of the <p>

Ive got a block of text, and i want to write the authors name and date bellow it in small italics, so i put it in a <span> block and styled it, but i want to space the name out a little bit so i..

What is SYSNAME data type in SQL Server?

What is the SQL Server SYSNAME data type for? BOL says: The sysname data type is used for table columns, variables, and stored procedure parameters that store object names. but I don't rea..

Java LinkedHashMap get first or last entry

I have used LinkedHashMap because it is important the order in which keys entered in the map. But now I want to get the value of key in the first place (the first entered entry) or the last. Should ..

How to serve up images in Angular2?

I am trying to put the relative path to one of my images in my assets folder in an image src tag in my Angular2 app. I set a variable in my component to 'fullImagePath' and used that in my template. I..

how to get current datetime in SQL?

Want to get current datetime to insert into lastModifiedTime column. I am using MySQL database. My questions are: is there a function available in SQL? or it is implementation depended so each data..

Apache shutdown unexpectedly

I am using XAMPPS to host PHP files from my machine. I have recently installed XAMPPs but I am unable to start Apache service as port 80 is in use by PID 4 - NT Kernel & System. I know by using a..

How to use UTF-8 in resource properties with ResourceBundle

I need to use UTF-8 in my resource properties using Java's ResourceBundle. When I enter the text directly into the properties file, it displays as mojibake. My app runs on Google App Engine. Can any..

Batch script to find and replace a string in text file without creating an extra output file for storing the modified file

I have written a batch script to find and replace a string in a text file. Following is my script. @echo off &setlocal set "search=%1" set "replace=%2" set "textfile=Input.txt" set "newfile=Outpu..

how to query child objects in mongodb

I'm new to mongodb and am trying to query child objects. I have a collection of States, and each State has child Cities. One of the Cities has a Name property that is null, which is causing errors in ..

Counting repeated characters in a string in Python

I want to count the number of times each character is repeated in a string. Is there any particular way to do it apart from comparing each character of the string from A-Z and incrementing a counter? ..

gnuplot plotting multiple line graphs

I have the following dat file, named ls.dat: # Gnuplot script file for "ls" # Version Removed Added Modified 8.1 0 0 0 8.4 0 0 4 8.5 2 5 9 8.6 ..

Find all files in a folder

I am looking to create a program that finds all files of a certain type on my desktop and places them into specific folders, for example, I would have all files with .txt into the Text folder. Any id..

How to sync with a remote Git repository?

I forked a project on github, made some changes, so far so good. In the meantime, the repository I forked from changed and I would like to get those changes into my repository. How do I do that ?..

Calculate MD5 checksum for a file

I'm using iTextSharp to read the text from a PDF file. However, there are times I cannot extract text, because the PDF file is only containing images. I download the same PDF files everyday, and I wan..

React: trigger onChange if input value is changing by state?

Edit: I don't want to call handleChange only if the button has been clicked. It has nothing to do with handleClick. I gave an example in the @shubhakhatri answer's comment. I want to change the input..

How to send POST in angularjs with multiple params?

I want to send multiple parameters using angularjs HTTP post service. Here is client side code: $"http://localhost:53263/api/Products/", [$scope.product, $scope.product2]). then(fu..

How to stop/kill a query in postgresql?

This question is while postmaster is running your query in the background, how to kill or stop it? For example, your shell or any frontend may be disconnected due to network issue, you cannot use ctr..

Send JSON data via POST (ajax) and receive json response from Controller (MVC)

I created a function in javascript like that: function addNewManufacturer() { var name = $("#id-manuf-name").val(); var address = $("#id-manuf-address").val(); var phone = $("#id..

How do I insert non breaking space character &nbsp; in a JSF page?

How do I insert a non breaking space character in JSF page like I can in HTML using &nbsp;? Is there such a tag in JSF?..

How to SHA1 hash a string in Android?

In Objective C I've been using the following code to hash a string: -(NSString *) sha1:(NSString*)stringToHash { const char *cStr = [stringToHash UTF8String]; unsigned char result[20]; ..

Normal arguments vs. keyword arguments

How are "keyword arguments" different from regular arguments? Can't all arguments be passed as name=value instead of using positional syntax?..

How to re-create database for Entity Framework?

I have got into a bad state with my ASP.Net MVC 5 project, using Code-First Entity Framework. I don't care about losing data, I just want to be able to start fresh, recreate the database and start usi..

WCF service startup error "This collection already contains an address with scheme http"

I built a web application containing a WCF service contract and a Silverlight control which makes calls to that WCF service. On my development and test servers it works great. When I deploy to our l..

What is attr_accessor in Ruby?

I am having a hard time understanding attr_accessor in Ruby. Can someone explain this to me?..

Ubuntu: Using curl to download an image

I want to download an image accessible from this link: into my local system. Now, I'm aware that the curl command can be used to ..

"CSV file does not exist" for a filename with embedded quotes

I am currently learning Pandas for data analysis and having some issues reading a csv file in Atom editor. When I am running the following code: import pandas as pd df = pd.read_csv("FBI-CRIME11...

Generate random numbers using C++11 random library

As the title suggests, I am trying to figure out a way of generating random numbers using the new C++11 <random> library. I have tried it with this code: std::default_random_engine generator; s..

Xcode doesn't see my iOS device but iTunes does

I have a strange problem. I have an iPad with iOS 5.0.1 (9A405) and iOS SDK 5.0.1 with Xcode 4.2 (Build 4C199) installed on my Mac. Xcode doesn't see my device. It says "iOS Device" not "Sauron's iP..

Send Email to multiple Recipients with MailMessage?

I have multiple email recipients stored in SQL Server. When I click send in the webpage it should send email to all recipients. I have separated emails using ;. Following is the single recipient code...

What is the regex pattern for datetime (2008-09-01 12:35:45 )?

What is the RegEx pattern for DateTime (2008-09-01 12:35:45 ) ? I get this error: No ending delimiter '^' found Using: preg_match('(?n:^(?=\d)((?<day>31(?!(.0?[2469]|11))|30(?!.0?2)|29(?..

How to reset the bootstrap modal when it gets closed and open it fresh again?

I have a list box in the bootstrap modal and a button. When the button is clicked a new button gets rendered inside a div in the modal. When I close the modal and reopen it, the last operation perform..

How to cache data in a MVC application

I have read lots of information about page caching and partial page caching in a MVC application. However, I would like to know how you would cache data. In my scenario I will be using LINQ to Entiti..

Move view with keyboard using Swift

I have an app that has a text field on the lower half of the view. This means that when I go to type in the text field the keyboard covers the textfield. How would I go about moving the view upwards ..

How to do left join in Doctrine?

This is my function where I'm trying to show the User history. For this I need to display the user's current credits along with his credit history. This is what I am trying to do: public function g..

Catch an exception thrown by an async void method

Using the async CTP from Microsoft for .NET, is it possible to catch an exception thrown by an async method in the calling method? public async void Foo() { var x = await DoSomethingAsync(); ..

Case insensitive 'Contains(string)'

Is there a way to make the following return true? string title = "ASTRINGTOTEST"; title.Contains("string"); There doesn't seem to be an overload that allows me to set the case sensitivity.. Current..

CSS transition with visibility not working

In the fiddle below, I've a transition on visibility and opacity separately. The latter works but the former doesn't. Moreover, in case of visibility, the transition time is interpreted as delay on ho..

Remove special symbols and extra spaces and replace with underscore using the replace method

I want to remove all special characters and spaces from a string and replace with an underscore. The string is var str = "hello world & hello universe"; I have this now which replaces only ..

Rails: Adding an index after adding column

Suppose I created a table table in a Rails app. Some time later, I add a column running: rails generate migration AddUser_idColumnToTable user_id:string. Then I realize I need to add user_id as an..

How to write an ArrayList of Strings into a text file?

I want to write an ArrayList<String> into a text file. The ArrayList is created with the code: ArrayList arr = new ArrayList(); StringTokenizer st = new StringTokenizer( line, ":Mode set..

How to check if one DateTime is greater than the other in C#

I have two DateTime objects: StartDate and EndDate. I want to make sure StartDate is before EndDate. How is this done in C#?..

How to define static constant in a class in swift

I have these definition in my function which work class MyClass { func myFunc() { let testStr = "test" let testStrLen = countElements(testStr) } } But if I move 'testStr' an..

Convert a JSON String to a HashMap

I'm using Java, and I have a String which is JSON: { "name" : "abc" , "email id " : ["[email protected]","[email protected]","[email protected]"] } Then my Map in Java: Map<String, Object> retMap = new ..

Linq : select value in a datatable column

How do you use LINQ (C#) to select the value in a particular column for a particular row in a datatable. The equivalent SQL would be: select NAME from TABLE where ID = 0 Thanks in advance...

How to draw a line in android

Can anybody tell how to draw a line in Android, perhaps with an example?..

Javascript: How to check if a string is empty?

I know this is really basic, but I am new to javascript and can't find an answer anywhere. How can I check if a string is empty?..

Can you remove elements from a std::list while iterating through it?

I've got code that looks like this: for (std::list<item*>::iterator i=items.begin();i!=items.end();i++) { bool isActive = (*i)->update(); //if (!isActive) // items.remove(*i); ..

Android Gradle 5.0 Update:Cause: org.jetbrains.plugins.gradle.tooling.util

On Updating version my project gradle to 5.0 release I am getting error in android studio it was working fine with gradle 5.0 rc 3 and 4 release. following is the error detail: Cause: org.jetbra..

Fit cell width to content

Given the following markup, how could I use CSS to force one cell (all cells in column) to fit to the width of the content within it rather than stretch (which is the default behaviour)? <style ty..

Java Date cut off time information

I have a Java Date object containing date and time information. I want to write a method that cuts off the time information, truncates the hours-minutes-seconds, so I only have the date left. Example..

CodeIgniter Select Query

I have a simple CodeIgniter Active record query to select an ID: $q = $this -> db -> select('id') -> where('email', $email) -> limit(1) -> g..

Can you get the column names from a SqlDataReader?

After connecting to the database, can I get the name of all the columns that were returned in my SqlDataReader?..

Why would an Enum implement an Interface?

I just found out that Java allows enums to implement an interface. What would be a good use case for that?..

How do I create a SQL table under a different schema?

This is from SQL Server 2008, ssms When I create a table, it creates under dbo. I would like to create it under a different schema, but when I use the 'New Table' dialog, I can never find the field ..

First Heroku deploy failed `error code=H10`

I deployed my app to Heroku. It's a node.js + express + app and this is the package.json file { "name": "game_test", "author": "Ilya", "description": "A test app for our board game", ..

Update Item to Revision vs Revert to Revision

I've started to use Subversion with TortoiseSVN. If I open up the log and right click on an old revision I see two options that sound like they roll back to an older version: "Update item to revision"..

How can I express that two values are not equal to eachother?

Is there a method similar to equals() that expresses "not equal to"? An example of what I am trying to accomplish is below: if (secondaryPassword.equals(initialPassword)) { JOptionPane.showMess..

Split a List into smaller lists of N size

I am attempting to split a list into a series of smaller lists. My Problem: My function to split lists doesn't split them into lists of the correct size. It should split them into lists of size 30 bu..

What is the use of the @ symbol in PHP?

I have seen uses of @ in front of certain functions, like the following: $fileHandle = @fopen($fileName, $writeAttributes); What is the use of this symbol?..

Spring MVC @PathVariable with dot (.) is getting truncated

This is continuation of question Spring MVC @PathVariable getting truncated Spring forum states that it has fixed(3.2 version) as part of ContentNegotiationManager. see the below link. https://jira.s..

Make <body> fill entire screen?

I'm using a radial gradient as the background on my webpage, like so: background-image: -webkit-gradient(radial, 100% 100%, 10, 90% 90%, 600, from(#ccc), to(#000)); It works, but when the content d..

Disable spell-checking on HTML textfields

Can I somehow disable spell-checking on HTML textfields (as seen in e.g. Safari)?..

Unable to execute dex: method ID not in [0, 0xffff]: 65536

I have seen various versions of the dex erros before, but this one is new. clean/restart etc won't help. Library projects seems intact and dependency seems to be linked correctly. Unable to execute ..

How do I make a new line in swift

Is there a way to have a way to make a new line in swift like "\n" for java? var example: String = "Hello World \n This is a new line" ..

Set Windows process (or user) memory limit

Is there any way to set a system wide memory limit a process can use in Windows XP? I have a couple of unstable apps which do work ok for most of the time but can hit a bug which results in eating who..

How To Get Selected Value From UIPickerView

I know that with a UIDatePicker, you can use something like: NSDate *myDate =; But I am using a UIPickerView in my view. How can i similarly get the value selected? Or do I have ..

Spring Boot - Cannot determine embedded database driver class for database type NONE

This is the error that is thrown when trying to run my web app: [INFO] WARNING: Nested in org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'org.springframework.b..

How to detect page zoom level in all modern browsers?

How can I detect the page zoom level in all modern browsers? While this thread tells how to do it in IE7 and IE8, I can't find a good cross-browser solution. Firefox stores the page zoom level for fu..

Adding data attribute to DOM

$('div').data('info', 1); alert($('div').data('info')); //this works $('div[data-info="1"]').text('222'); //but this don't work I'm creating element within jquery. After that, I want to add at..

How to compare type of an object in Python?

Basically I want to do this: obj = 'str' type ( obj ) == string I tried: type ( obj ) == type ( string ) and it didn't work. Also, what about the other types? For example, I couldn't replicate ..

How to use FormData in react-native?

Hi just learn to use js and react-native. I cant use FormData it always shows unsupported bodyinit type. I want to send text rather then JSON.stringify. Can anyone help me? Thanks! var data = new For..

Python import csv to list

I have a CSV file with about 2000 records. Each record has a string, and a category to it: This is the first line,Line1 This is the second line,Line2 This is the third line,Line3 I need to read t..

The server committed a protocol violation. Section=ResponseStatusLine ERROR

I have created a program, tried to post a string on a site and I get this error: "The server committed a protocol violation. Section=ResponseStatusLine" after this line of code: gResponse = (..

How to automatically reload a page after a given period of inactivity

How can I automatically reload a webpage, if there have been no activity on the page for a given period of time?..

Convenient way to parse incoming multipart/form-data parameters in a Servlet

Is there any convenient way to read and parse data from incoming request. E.g client initiate post request URLConnection connection = new URL(url).openConnection(); connection.setDoOutput(true); con..

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="

CSS background opacity with rgba not working in IE 8

I am using this CSS for background opacity of a <div>: background: rgba(255, 255, 255, 0.3); It’s working fine in Firefox, but not in IE 8. How do I make it work?..

How to add line breaks to an HTML textarea?

I’m editing a <textarea> with JavaScript. The problem is that when I make line breaks in it, they won’t display. How can I do this? I’m getting the value to write a function, but it won�..

$http get parameters does not work

Does anyone know why this does not work? $http .get('accept.php', { source: link, category_id: category }) .success(function (data, status) { $scope.info_show = da..

Should functions return null or an empty object?

What is the best practice when returning data from functions. Is it better to return a Null or an empty object? And why should one do one over the other? Consider this: public UserEntity GetUserBy..

Making HTML page zoom by default

I've designed a page, where buttons look good when the browser zoom is at 90%, but by default other users view it at 100/125%+ in their browser which is resulting an overlap in buttons and input forms..

Converting .NET DateTime to JSON

Possible Duplicate: How to format a JSON date? My webs service is returning a DateTime to a jQuery call. The service returns the data in this format: /Date(1245398693390)/ How can I conv..

How to use QueryPerformanceCounter?

I recently decided that I needed to change from using milliseconds to microseconds for my Timer class, and after some research I've decided that QueryPerformanceCounter is probably my safest bet. (The..

HTML/CSS Making a textbox with text that is grayed out, and disappears when I click to enter info, how?

How do I make a textbox that has a grayed out content, and when I click on it to enter text, the grayed out portion, it disappears and allows me to enter the desired text? Example: A "First Name" te..

Changing Java Date one hour back

I have a Java date object: Date currentDate = new Date(); This will give the current date and time. Example: Thu Jan 12 10:17:47 GMT 2012 Instead, I want to get the date, changing it to one hour..

How do you test a public/private DSA keypair?

Is there an easy way to verify that a given private key matches a given public key? I have a few *.puband a few *.key files, and I need to check which go with which. Again, these are pub/key files, D..

Get first row of dataframe in Python Pandas based on criteria

Let's say that I have a dataframe like this one import pandas as pd df = pd.DataFrame([[1, 2, 1], [1, 3, 2], [4, 6, 3], [4, 3, 4], [5, 4, 5]], columns=['A', 'B', 'C']) >> df A B C 0 1 2..

how to add jquery in laravel project

I am new to laravel framework. I want to use jQuery in web application built using laravel framework. But don't know how to link to jQuery library in laravel project...

Can Mockito stub a method without regard to the argument?

I'm trying to test some legacy code, using Mockito. I want to stub a FooDao that is used in production as follows: foo = fooDao.getBar(new Bazoo()); I can write: when(fooDao.getBar(new Bazoo()))...

Including a .js file within a .js file

I'd like to know if it is possible to include a .js file within another .js file? The reason for me wanting to do this is to keep client includes to a minimum. I have several .js files already writte..

How can I do an asc and desc sort using underscore.js?

I am currently using underscorejs for sort my json sorting. Now I have asked to do an ascending and descending sorting using underscore.js. I do not see anything regarding the same in the documentatio..

Python datetime - setting fixed hour and minute after using strptime to get day,month,year

I've successfully converted something of 26 Sep 2012 format to 26-09-2012 using: datetime.strptime(request.POST['sample_date'],'%d %b %Y') However, I don't know how to set the hour and minute of som..

Disable Required validation attribute under certain circumstances

I was wondering if it is possible to disable the Required validation attribute in certain controller actions. I am wondering this because on one of my edit forms I do not require the user to enter val..

How to use MapView in android using google map V2?

I want to show a map in on of my activity. In google map V1 we use - < android:id="@+id/mapview" android:layout_width="match_parent" androi..

Programmatically Add CenterX/CenterY Constraints

I have a UITableViewController that doesn't display any sections if there is nothing to show. I've added a label to indicate to the user that there is nothing to display with this code: label = UILa..

writing a batch file that opens a chrome URL

looking for some help writing a batch file to use as a joke on my friend. essentially i want it to open a certain URL in chrome. then i was going to disguise it as something like svchost.exe and have ..

Count Vowels in String Python

I'm trying to count how many occurrences there are of specific characters in a string, but the output is wrong. Here is my code: inputString = str(input("Please type a sentence: ")) a = "a" A = "A" ..

Is there a real solution to debug cordova apps

I spent the last two days trying to figure out how to debug an HTML5 app I created using Cordova 3.2 and deployed to an Android 2.3 device. All the articles/posts I've seen provide hacks rather than r..

Automatically start a Windows Service on install

I have a Windows Service which I install using the InstallUtil.exe. Even though I have set the Startup Method to Automatic, the service does not start when installed, I have to manually open the servi..

"Could not find or load main class" Error while running java program using cmd prompt

I am running a simple "HelloWorld" Program. I get this error in the command prompt: Could not find or load main class HelloWorld. I have set the CLASSPATH and PATH variable in the system. In the..

Error in : figure margins too large in R

I'm new to R but I've made numerous correlation plots with smaller data sets. However, when I try to plot a large dataset (2gb+), I can produce the plot just fine, but the legend doesn't show up. Any ..

How to force child div to be 100% of parent div's height without specifying parent's height?

I have a site with the following structure: <div id="header"></div> <div id="main"> <div id="navigation"></div> <div id="content"></div> </div> &..

Why don’t my SVG images scale using the CSS "width" property?

I'm building a portfolio website. HTML Code <div id = "hero"> <div id = "social"> <img src = "facebook.svg"> <img src = "linkedin.svg"> <img src = "..

How can I reconcile detached HEAD with master/origin?

I'm new at the branching complexities of Git. I always work on a single branch and commit changes and then periodically push to my remote origin. Somewhere recently, I did a reset of some files to ge..

Making a drop down list using swift?

What is the library to make drop down menu in swift? I am new to Xcode and the Swift language, so can anyone please direct me on how to implement the drop down list in swift?..

Url.Action parameters?

In listing controller I have, public ActionResult GetByList(string name, string contact) { var NameCollection = Service.GetByName(name); var ContactCollection = Service.GetByC..

ERROR: Cannot open source file " "

I am running visual studio C++ and I have a header file "GameEngine.h" that I am trying to have another file see. When I #include "GameEngine.h" it gives me the error that it cannot open the sour..

Nested rows with bootstrap grid system?

I want 1 larger image with 4 smaller images in a 2x2 format like this: My initial thought was to house everything in one row. Then create two columns, and, in the second column, create two rows an..

XAMPP Apache won't start

I am using Windows 8 Pro. I have just installed XAMPP Windows 1.8.1. I tried to start Apache from the XAMPP control panel but it wont start. It gives the following error. Also I have no IIS Servic..

How to convert nanoseconds to seconds using the TimeUnit enum?

How to convert a value from nanoseconds to seconds? Here's the code segment: import*; import java.util.concurrent.*; .. class Stamper { public static void main (String[] args) { lon..

What is the best java image processing library/approach?

I am using both the JAI media apis and ImageMagick? ImageMagick has some scalability issues and the JNI based JMagick isn't attractive either. JAI has poor quality results when doing resizing operati..

Java Project: Failed to load ApplicationContext

I have a Java Project in which I am writing a simple JUNIT test case. I have copied the applicatinoContext.xml file into the root java source directory. I've tried it with some of the recommended se..

Bundle ID Suffix? What is it?

I'm new to the iPhone submission process. Apple asks for the Bundle ID Suffix. What is this? Not sure what to put here and what the significance of it is...

How to prevent Google Colab from disconnecting?

Q: Is there any way to programmatically prevent Google Colab from disconnecting on a timeout? The following describes the conditions causing a notebook to automatically disconnect: Google Colab..

How to run html file using node js

I have a simple html page with angular js as follows: //Application name var app = angular.module("myTmoApppdl", []); app.controller("myCtrl", function ($scope) { //Sample login ..

Display images in mvc

I am trying to create a website to upload/display images (using MVC4). I have written the below code to fetch the images which are locally stored on the server under a folder App_Data\Images. The path..

How do you set EditText to only accept numeric values in Android?

I have an EditText in which I want only integer values to be inserted. Can somebody tell me which property I have to use?..

Multiple actions were found that match the request in Web Api

I keep getting this error when I try to have 2 "Get" methods Multiple actions were found that match the request: webapi I been looking around at the other similar questions about this on stack ..

Classes residing in App_Code is not accessible

I have created a website in ASP.NET and have created a class and put it inside of the App_Code folder. However I cannot access this from my other pages. Does something need to be configured to allow t..

Returning a boolean from a Bash function

I want to write a bash function that check if a file has certain properties and returns true or false. Then I can use it in my scripts in the "if". But what should I return? function myfun(){ ... ret..

Split string to equal length substrings in Java

How to split the string "Thequickbrownfoxjumps" to substrings of equal size in Java. Eg. "Thequickbrownfoxjumps" of 4 equal size should give the output. ["Theq","uick","brow","nfox","jump","s"] Sim..

Build error: "The process cannot access the file because it is being used by another process"

I've got a C# webforms app, that until today had been working just swimmingly. Now today, all of a sudden, every time I try run the app, I get a file locking error: Unable to copy file "obj\Debu..

How to validate an email address using a regular expression?

Over the years I have slowly developed a regular expression that validates MOST email addresses correctly, assuming they don't use an IP address as the server part. I use it in several PHP programs, ..

How to use a keypress event in AngularJS?

I want to catch the enter key press event on the textbox below. To make it more clear I am using a ng-repeat to populate the tbody. Here is the HTML: <td><input type="number" id="closeqty{{..

Maven: How do I activate a profile from command line?

This is a snippet from my pom.xml. I tried the following, but the profile was not activated. mvn clean install -Pdev1 mvn clean install -P dev1 When I tried mvn help:active-profiles no profiles wer..

How can I sort a dictionary by key?

What would be a nice way to go from {2:3, 1:89, 4:5, 3:0} to {1:89, 2:3, 3:0, 4:5}? I checked some posts but they all use the "sorted" operator that returns tuples. ..

What does the Java assert keyword do, and when should it be used?

What are some real life examples to understand the key role of assertions?..

Xml Parsing in C# on this site, I wrote the following code to retrieve the data. protected void Button1_Click(object sender, EventArgs e) {..

How do I set the figure title and axes labels font size in Matplotlib?

I am creating a figure in Matplotlib like this: from matplotlib import pyplot as plt fig = plt.figure() plt.plot(data) fig.suptitle('test title') plt.xlabel('xlabel') plt.ylabel('ylabel') fig.savefi..

Invalid syntax when using "print"?

I'm learning Python and can't even write the first example: print 2 ** 100 this gives SyntaxError: invalid syntax pointing at the 2. Why is this? I'm using version 3.1..

I do not want to inherit the child opacity from the parent in CSS

I do not want to inherit the child opacity from the parent in CSS. I have one div which is the parent, and I have another div inside the first div which is the child. I want to set the opacity prope..

return string with first match Regex

I want to get the first match of a regex. In this case, I got a list: text = 'aa33bbb44' re.findall('\d+',text) ['33', '44'] I could extract the first element of the list: text = 'aa33bbb44'..

Expected block end YAML error

When pasting this YAML file into an online yaml parser, I got an expected block end error: ADDATTEMPTING: 'Tentative d ajout ' ATTEMPTINGTOGIVE: 'Tenter de donner ' ATTEMPTINGTOSET1: 'Tentative de d�..

javascript - pass selected value from popup window to parent window input box

I am building an order form with PHP and MySQL. The PHP Form has an input box where the user types in a product code. In the event that the user does not know the product code, I want them to click o..

FATAL ERROR: CALL_AND_RETRY_LAST Allocation failed - process out of memory

Node version is v0.11.13 Memory usage during crash according to sudo top not raises over 3% Code that reproduces this error: var request = require('request') var nodedump = require('nodedump') req..

Change directory in PowerShell

My PowerShell prompt's currently pointed to my C drive (PS C:\>). How do I change directory to a folder on my Q (PS Q:\>) drive? The folder name on my Q drive is "My Test Folder"...

How to test if parameters exist in rails

I'm using an IF statement in Ruby on Rails to try and test if request parameters are set. Regardless of whether or not both parameters are set, the first part of the following if block gets triggered..

Update .NET web service to use TLS 1.2

I need to use TLS 1.2 to connect from my .NET web service to another that is going to force TLS 1.2. I found a resource that said .NET 4.6 uses TLS 1.2 by default so that sounded like the easiest sol..

The real difference between "int" and "unsigned int"

int: The 32-bit int data type can hold integer values in the range of -2,147,483,648 to 2,147,483,647. You may also refer to this data type as signed int or signed. unsigned int : The 32-bit uns..

PHP regular expression - filter number only

I know this might sound as really dummy question, but I'm trying to ensure that the provided string is of a number / decimal format to use it later on with PHP's number_format() function. How would I..

Check if int is between two numbers

Why can't do you this if you try to find out whether an int is between to numbers: if(10 < x < 20) Instead of it, you'll have to do if(10<x && x<20) which seems like a bit of..

use regular expression in if-condition in bash

I wonder the general rule to use regular expression in if clause in bash? Here is an example $ gg=svm-grid-ch $ if [[ $gg == *grid* ]] ; then echo $gg; fi svm-grid-ch $ if [[ $gg == ^....grid..

if statements matching multiple values

Any easier way to write this if statement? if (value==1 || value==2) For example... in SQL you can say where value in (1,2) instead of where value=1 or value=2. I'm looking for something that would..

Add objects to an array of objects in Powershell

I have this script where I want to add an object to an array called $Target in every foreach. foreach ($Machine in $Machines) { $TargetProperties = @{Name=$Machine} $TargetObject = New-Object P..

SSL: error:0B080074:x509 certificate routines:X509_check_private_key:key values mismatch

I'm not able to setup SSL. I've Googled and I found a few solutions but none of them worked for me. I need some help please... Here's the error I get when I attempt to restart nginx: root@s17925268:..

How can I "reset" an Arduino board?

I've uploaded a sketch to an Arduino Uno whose loop is something like this: void loop(){ Serial.println("Hello, World!"); } So, now, I can't upload anything anymore, because the IDE says "port ..

php: catch exception and continue execution, is it possible?

Is it possible to catch exception and continue execution of script?..

How to catch and print the full exception traceback without halting/exiting the program?

I want to catch and log exceptions without exiting, e.g., try: do_stuff() except Exception, err: print(Exception, err) # I want to print the entire traceback here, # not just the excep..

How to get a specific output iterating a hash in Ruby?

I want to get a specific output iterating a Ruby Hash. This is the Hash I want to iterate over: hash = { 1 => ['a', 'b'], 2 => ['c'], 3 => ['d', 'e', 'f', 'g'], 4 => ['h'] } ..

How to write UTF-8 in a CSV file

I am trying to create a text file in csv format out of a PyQt4 QTableWidget. I want to write the text with a UTF-8 encoding because it contains special characters. I use following code: import codecs..

How can I determine if a variable is 'undefined' or 'null'?

How do I determine if variable is undefined or null? My code is as follows: var EmpName = $("div#esd-names div#name").attr('class'); if(EmpName == 'undefined'){ // DO SOMETHING }; <div id="es..

Open Bootstrap Modal from code-behind

Anyone knows how to open a twitter bootstrap modal, from code behind? I want to open the modal based on some requeriment at the moment of the save. Something like "Hey there's no stock, pick up one o..

BigDecimal setScale and round

What is the difference between this two call? (Is there any?) // 1. new BigDecimal("3.53456").round(new MathContext(4, RoundingMode.HALF_UP)); // 2. new BigDecimal("3.53456").setScale(4, RoundingMode..

Does not contain a definition for and no extension method accepting a first argument of type could be found

I've looked around at some of the solutions to this problem but they don't seem to be the same as what I'm experiencing. Method that I'm trying to call: namespace BetfairAPI { public class CBetf..

What is the difference between #include <filename> and #include "filename"?

In the C and C++ programming languages, what is the difference between using angle brackets and using quotes in an include statement, as follows? #include <filename> #include "filename" ..

UICollectionView Set number of columns

I just started learning about UICollectionViews. I'm wondering if anyone knows how to specify the number of columns in a collectionview. The default is set to 3 (iPhone/portrait). I've looked at the d..

Converting HTML element to string in JavaScript / JQuery

I would like to convert a html element created from a string back to the string after some modifications. But I get an empty string instead. $('<iframe width="854" height="480" src="