Questions Tagged with #Po file

Intel X86 emulator accelerator (HAXM installer) VT/NX not enabled

I`m asking how to enable my VT/NX for my MacBook, when I try to use X86 emulator, it appears to me that VT/NX NOT ENABLED, it had never seem this when I used 10.9 system, after I update my MacBook to ..

When is a timestamp (auto) updated?

If I have a column in a table of type TIMESTAMP and has as default: CURRENT_TIMESTAMP does this column get updated to the current timestamp if I update the value of any other column in the the same ro..

Count number of columns in a table row

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

Using multiple parameters in URL in express

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

Easy way to pull latest of all git submodules

We're using git submodules to manage a couple of large projects that have dependencies on many other libraries we've developed. Each library is a separate repo brought into the dependent project as a ..

what does Error "Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0)" mean?

I got this error: Thread 1:EXC_BAD_INSTRUCTION (code=EXC_I386_INVOP, subcode=0x0) How can I solve this? The code works normally, but in the calculator when I click the only equal button, it give..

Git commit -a "untracked files"?

When I do a git commit -a, I am seeing the following: # Please enter the commit message for your changes. Lines starting # with '#' will be ignored, and an empty message aborts the commit. # O..

PHP - syntax error, unexpected T_CONSTANT_ENCAPSED_STRING

I am very new to PHP and have no idea why this is happening, I have looked at other online items, however I just cannot seem to see why I am getting this error. <?php include_once('assets/libs/pos..

iOS 7: UITableView shows under status bar

The first screen of my application is a UITableViewController without a navigation bar, which means that the content flows under the status bar so there's a lot of text collisions. I've adjusted both ..

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

HTML5 - mp4 video does not play in IE9

I have an mp4 video that I want to play in IE9 using HTML5 <video> tag. I added the MIME type to IIS 7 so if I browse http://localhost/video.mp4 it plays in both Chrome and IE9 but not in HTML5,..

Nginx: stat() failed (13: permission denied)

I am using the default config while adding the specific directory with nginx installed on my ubuntu 12.04 machine. server { #listen 80; ## listen for ipv4; this line is default and implied..

How do I delete rows in a data frame?

I have a data frame named "mydata" that looks like this this: A B C D 1. 5 4 4 4 2. 5 4 4 4 3. 5 4 4 4 4. 5 4 4 4 5. 5 4 4 4 6. 5 4 4 4 7. 5 4 4 4 I'd li..

What is declarative programming?

I keep hearing this term tossed around in several different contexts. What is it?..

How to run a cron job on every Monday, Wednesday and Friday?

How can one run a cron job for every Monday, Wednesday and Friday at 7:00 pm?..

How to randomize Excel rows

How can I randomize lots of rows in Excel? For example I have an excel sheet with data in 3 rows. 1 A dataA 2 B dataB 3 C dataC I want to randomize the row order. For example 2 B dataB 1 A dataA ..

How to make an HTTP get request with parameters

Is it possible to pass parameters with an HTTP get request? If so, how should I then do it? I have found an HTTP post requst (link). In that example the string postData is sent to a webserver. I would..

npm install error from the terminal

I am trying to install node in my mac.. i am getting the following error... i downloaded the node from node site and ran that package... can you guys tell me why i am facing that errror..when i do npm..

How can I get a value from a map?

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

Case statement in MySQL

I have a database table called 'tbl_transaction' with the following definition: id INT(11) Primary Key action_type ENUM('Expense', 'Income') action_heading VARCHAR (255) action_amount FLOAT I would..

Where is `%p` useful with printf?

After all, both these statements do the same thing... int a = 10; int *b = &a; printf("%p\n",b); printf("%08X\n",b); For example (with different addresses): 0012FEE0 0012FEE0 It is trivial t..

Is it possible to do a sparse checkout without checking out the whole repository first?

I'm working with a repository with a very large number of files that takes hours to checkout. I'm looking into the possibility of whether Git would work well with this kind of repository now that it s..

Getting Current time to display in Label.

I'm trying to build a Break tracker for work and I would like to get a button to display the Current Time in a label. I have tried multiple solutions and this is how far I have gotten. Sub AddButtonC..

How to use 'cp' command to exclude a specific directory?

I want to copy all files in a directory except some files in a specific sub-directory. I have noticed that cp command didn't have the --exclude option. So, how can I achieve this?..

Matplotlib: Specify format of floats for tick labels

I am trying to set the format to two decimal numbers in a matplotlib subplot environment. Unfortunately, I do not have any idea how to solve this task. To prevent using scientific notation on the y-a..

SQL (MySQL) vs NoSQL (CouchDB)

I am in the middle of designing a highly-scalable application which must store a lot of data. Just for example it will store lots about users and then things like a lot of their messages, comments etc..

How do HashTables deal with collisions?

I've heard in my degree classes that a HashTable will place a new entry into the 'next available' bucket if the new Key entry collides with another. How would the HashTable still return the correct V..

printf a variable in C

#include <stdio.h> #include <stdlib.h> int main() { int x = 1; printf("please make a selection with your keyboard\n"); sleep(1); printf("1.\n"); char input; scan..

Check if a string is a date value

What is an easy way to check if a value is a valid date, any known date format allowed. For example I have the values 10-11-2009, 10/11/2009, 2009-11-10T07:00:00+0000 which should all be recognized ..

"Could not load type [Namespace].Global" causing me grief

In my .Net 2.0 WebForms app, I have my Global.asax containing the following code: <%@ Application CodeBehind="Global.asax.cs" Inherits="MyNamespace.Global" Language="C#" %> However wh..

How do I get the HTML code of a web page in PHP?

I want to retrieve the HTML code of a link (web page) in PHP. For example, if the link is then I want the HTML code of the page which is served. I want to re..

Angular 4 - get input value

I would like to know how to get the value from an input on angular 4. I looked over the documentation on angular and the example with the key event doesn't work very well for me and I can't find a pro..

Can I append an array to 'formdata' in javascript?

I'm using FormData to upload files. I also want to send an array of other data. When I send just the image, it works fine. When I append some text to the formdata, it works fine. When I try to attac..

MongoDB "root" user

Is there a super UNIX like "root" user for MongoDB? I've been looking at and have tried many combinations, but they all seem to lack in an are..

Powershell: convert string to number

Ok, I am beginner - and lost with this: I have an Array where some drive data from WMI are captured: $drivedata = $Drives | select @{Name="Kapazität(GB)";Expression={$_.Kapazität}} The Array ha..

How do I check if a SQL Server text column is empty?

I am using SQL Server 2005. I have a table with a text column and I have many rows in the table where the value of this column is not null, but it is empty. Trying to compare against '' yields this ..

Select top 2 rows in Hive

I'm trying to retrieve top 2 tables from my employee list based on salary in hive (version 0.11). Since it doesn't support TOP function, is there any alternatives? Or do we have define a UDF?..

Configuring diff tool with .gitconfig

How do I configure Git to use a different tool for diffing with the .gitconfig file? I have this in my .gitconfig: [diff] tool = git-chdiff #also tried /bin/git-chdiff It does not work; it jus..

Is it possible to "decompile" a Windows .exe? Or at least view the Assembly?

A friend of mine downloaded some malware from Facebook, and I'm curious to see what it does without infecting myself. I know that you can't really decompile an .exe, but can I at least view it in Asse..

Git: How to find a deleted file in the project commit history?

Once upon a time, there was a file in my project that I would now like to be able to get. The problem is: I have no idea of when have I deleted it and on which path it was. How can I locate the comm..

Difference between "or" and || in Ruby?

What's the difference between the or and || operators in Ruby? Or is it just preference?..

How to find the most recent file in a directory using .NET, and without looping?

I need to find the most recently modified file in a directory. I know I can loop through every file in a folder and compare File.GetLastWriteTime, but is there a better way to do this without loopin..

Cannot resolve the collation conflict between "SQL_Latin1_General_CP1_CI_AS" and "Latin1_General_CI_AS" in the equal to operation

I have the following code SELECT tA.FieldName As [Field Name], COALESCE(tO_A.[desc], tO_B.[desc], tO_C.Name, tA.OldVAlue) AS [Old Value], COALESCE(tN_A.[desc], tN_B.[desc], tN_C.Name, t..

Truncate a string straight JavaScript

I'd like to truncate a dynamically loaded string using straight JavaScript. It's a url, so there are no spaces, and I obviously don't care about word boundaries, just characters. Here's what I got..

How do I push a new local branch to a remote Git repository and track it too?

I want to be able to do the following: Create a local branch based on some other (remote or local) branch (via git branch or git checkout -b) Push the local branch to the remote repository (publish).. no protocol on URL based on a string modified with URLEncoder

So I was attempting to use this String in a URL :-

Getting one value from a tuple

Is there a way to get one value from a tuple in Python using expressions? def tup(): return (3, "hello") i = 5 + tup() # I want to add just the three I know I can do this: (j, _) = tup() i = 5..

Get Root Directory Path of a PHP project

I have this folder structure in my PHP project. (this is as shown in eclips) -MySystem +Code +Data_Access -Public_HTML +css +js +Templates -resources When I..

Android Studio rendering problems

I'm using Android Studio 0.2.3 and when opened an activity layout normally, the preview should appear on the right side, so that I can switch between Text and Design mode, which should again show the ..

Jmeter - get current date and time

I want to get the current date and time as example date: 11/10/2014 and time 8:30 am or 6:00 pm and pass it as parameters to my Jmeter test. Can some help me do this...

How do you move a file?

I'm using TortoiseSVN against the SourceForge SVN repository. I'd like to move a file from one folder to another in order to maintain its revision history. Is this possible? If so, how do you do it? ..

Lightbox to show videos from Youtube and Vimeo?

I'm looking for a lightbox to show videos from Youtube and Vimeo. Any suggestions? ..

What is tail call optimization?

Very simply, what is tail-call optimization? More specifically, what are some small code snippets where it could be applied, and where not, with an explanation of why?..

Solving "The ObjectContext instance has been disposed and can no longer be used for operations that require a connection" InvalidOperationException

I am trying to populate a GridView using Entity Frameworkm but every time I am getting the following error: "Property accessor 'LoanProduct' on object 'COSIS_DAL.MemberLoan' threw the following ..

How to add "active" class to wp_nav_menu() current menu item (simple way)

I am creating custom Wordpress theme using a starter theme _Underscores. I am also using Bootstrap as a front-end framework. I would like to modify wp_nav_menu so that it assigns current menu item cl..

Create an ArrayList of unique values

I have an ArrayList with values taken from a file (many lines, this is just an extract): 20/03/2013 23:31:46 6870 6810 6800 6720 6860 6670 6700 6650 6750 6830 34864 34..

How can I switch views programmatically in a view controller? (Xcode, iPhone)

Have been struggling with this for a while, and can never seem to get a direct answer. Any help is appreciated!..

What is the JavaScript equivalent of var_dump or print_r in PHP?

I would like to see the structure of object in JavaScript (for debugging). Is there anything similar to var_dump in PHP?..

How do I sort strings alphabetically while accounting for value when a string is numeric?

I'm trying to sort an array of numbers that are strings and I'd like them to sort numerically. The catch is that I cannot convert the numbers into int. Here is the code: string[] things= new string..

How do I detect IE 8 with jQuery?

I need to detect not only the browser type but version as well using jQuery. Mostly I need to find out if it is IE 8 or not. I am not sure if I am doing it correctly. If I do : if (jQuery.browser.v..

How to host material icons offline?

My apologies if this is a very simple question, but how do you use google material icons without a <link href="" rel="stylesheet"> ? ..

Java: How to convert a File object to a String object in java?

Possible Duplicate: How to create a Java String from the contents of a file I have a html file which I want to use to extract information. For that I am using Jsoup. Now for using Jsoup, I ..

Python Script execute commands in Terminal

I read this somewhere a while ago but cant seem to find it. I am trying to find a command that will execute commands in the terminal and then output the result. For example: the script will be: com..

Using Sockets to send and receive data

I am using sockets to connect my Android application (client) and a Java backend Server. From the client I would like to send two variables of data each time I communicate with the server. 1) Some ki..

How to activate virtualenv?

I have been through search and tried various alternatives without success and spent several days on it now - driving me mad. Running on Red Hat Linux with Python 2.5.2 Began using most recent Virtual..

Is there a way to make AngularJS load partials in the beginning and not at when needed?

I have a route setup like this: var myApp = angular.module('myApp', []). config(['$routeProvider', function ($routeProvider) { $routeProvider. when('/landing', { templateU..

How to trim white spaces of array values in php

I have an array as follows $fruit = array(' apple ','banana ', ' , ', ' cranberry '); I want an array which contains the values without the white spaces on either sides but it can..

How can I combine hashes in Perl?

What is the best way to combine both hashes into %hash1? I always know that %hash2 and %hash1 always have unique keys. I would also prefer a single line of code if possible. $hash1{'1'} = 'red'; ..

How to get build time stamp from Jenkins build variables?

How can I get build time stamp of the latest build from Jenkins? I want to insert this value in the Email subject in post build actions...

Reverting to a specific commit based on commit id with Git?

With git log, I get a list of commits that I have made so far. commit f5c5cac0033439c17ebf905d4391dc0705dbd5f1 Author: prosseek Date: Fri Sep 3 14:36:59 2010 -0500 Added and modified the fil..

Photoshop text tool adds punctuation to the beginning of text

I have this weird issue with Photoshop - when I use the type tool, I can type letters normally, but when I type any punctuation character, it gets added to the beginning of the text. As far as I reme..

how to countdown to a date

I am wondering if anyone can help me. After hours of searching tirelessly on here and the web I can't seem to find a simple countdown using jquery. I don't want to use any sort of plugin just a simple..

Setting Margin Properties in code

MyControl.Margin.Left = 10; Error: Cannot modify the return value of 'System.Windows.FrameworkElement.Margin' because it is not a variable ..

How to search contents of multiple pdf files?

How could I search the contents of PDF files in a directory/subdirectory? I am looking for some command line tools. It seems that grep can't search PDF files...

Insert Data Into Temp Table with Query

I have an existing query that outputs current data, and I would like to insert it into a Temp table, but am having some issues doing so. Would anybody have some insight on how to do this? Here is an ..

How can I convert string date to NSDate?

I want to convert "2014-07-15 06:55:14.198000+00:00" this string date to NSDate in Swift...

How to insert data to MySQL having auto incremented primary key?

I've created a table with a primary key and enabled AUTO_INCREMENT, how do I get MYSQL use AUTO_INCREMENT? CREATE TABLE IF NOT EXISTS test.authors ( hostcheck_id INT PRIMARY KEY AUTO_INCREMENT, ..

How to check if input date is equal to today's date?

I have a form input with an id of 'date_trans'. The format for that date input (which is validated server side) can be any of: dd/mm/yyyy dd-mm-yyyy yyyy-mm-dd yyyy/mm/dd However, before posting t..

IE8 css selector

To target elements only in IE browsers i'll use IE6: * html #nav li ul { left: -39px !important; border: 1px solid red; } IE7: *+html #nav li ul { left: -39px! important; } Does an..

Click event on select option element in chrome

I'm having a problem in Chrome with the following: var items = $("option", obj); items.each(function(){ $(this).click(function(){ // alert("test"); process($(this).html()); ..

What should I do when 'svn cleanup' fails?

I have a lot of changes in a working folder, and something screwed up trying to do an update. Now when I issue an 'svn cleanup' I get: >svn cleanup . svn: In directory '.' svn: Error processing c..

Deleting multiple elements from a list

Is it possible to delete multiple elements from a list at the same time? If I want to delete elements at index 0 and 2, and try something like del somelist[0], followed by del somelist[2], the second ..

Easy way to make a confirmation dialog in Angular?

Is there any not-so-complicated way to make a confirm dialog in angular 2, the idea is to click on an item and then show a popup or modal to confirm its deletion, I tried angular 2 modals from here an..

How to convert string to Date in Angular2 \ Typescript?

I want to create a new Date object, with a specific date. I thought of converting it from a specific string, for example: let dateString = '1968-11-16T00:00:00' How can I convert it to a date obje..

Count all duplicates of each value

I would like a SQL query for MS Jet 4.0 (MSSql?) to get a count of all the duplicates of each number in a database. The fields are: id (autonum), number (text) I have a database with a lot of numb..

How do I unset an element in an array in javascript?

How do I remove the key 'bar' from an array foo so that 'bar' won't show up in for(key in foo){alert(key);} ..

Python For loop get index

I am writing a simple Python for loop to prnt the current character in a string. However, I could not get the index of the character. Here is what I have, does anyone know a good way to get the curren..

MetadataException: Unable to load the specified metadata resource

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

7-Zip command to create and extract a password-protected ZIP file on Windows?

On Mac/Linux to zip/unzip password protected zip files, I use: Zip: zip -P password -r folderIWantToZip Unzip: unzip -P password What are the equivalent command on Wi..

How to get host name with port from a http or https request

I have two applications deployed in jboss container(same unix box). If i get a request from app1, i need to frame a corresponding request for app2. eg: if app1 request is:

How can I split a text file using PowerShell?

I need to split a large (500 MB) text file (a log4net exception file) into manageable chunks like 100 5 MB files would be fine. I would think this should be a walk in the park for PowerShel..

Is the Javascript date object always one day off?

In my Java Script app I have the date stored in a format like so: 2011-09-24 Now when I try using the above value to create a new Date object (so I can retrieve the date in a different format), the..

syntax error, unexpected T_VARIABLE

I can't seem to find where my code has went wrong. Here is my full error: Parse error: syntax error, unexpected T_VARIABLE in C:\xampp\htdocs\\register.php on line 102 But I've bee..

SQL DATEPART(dw,date) need monday = 1 and sunday = 7

I have a Query where I get the WeekDay of a date but by default: Sunday = 1 Moday = 2 etc. The function is: DATEPART(dw, as weekday I need the result so: Sunday = 7 Monday = 1 etc. ..

New og:image size for Facebook share?

Facebook recently changed image sizes for ads, and link posts. This affects also to meta property="og:image". What is new optimal size for og:image at Facebook? The old version was square, now it does..

Go to next item in ForEach-Object

I have a PowerShell script that does some checks on all Domain Admins in a number of domains. For each user account a number of checks are preformed. When one of them fails the script should go to the..

Change window location Jquery

I am using ajax to load my website content and want to update the window location when ajax is successful. How can I update the window location to "/newpage"?? I need users to be able to go back and ..

How to stop console from closing on exit?

I'm using Visual Studio 2010 and Windows 7 x64 The command prompt closes after exit, even though I used "Start without debug". Is there a setting somewhere that I can use?..

Laravel Checking If a Record Exists

I am new to Laravel. Please excuse the newbie question but how do I find if a record exists? $user = User::where('email', '=', Input::get('email')); What can I do here to see if $user has a record?..

JavaFX - create custom button with image

I would like to create a custom button, that has two states pressed or not, like a toggle button. I have got two images to do this (pressed and not pressed), so how can i create the button and displa..

Getting the current date in visual Basic 2008

I dont know how to get the current date in visual basic 2008. Here is a sample code regDate = Format(Date.Now(), "ddMMMyyyy") The output is like 7/02/1900 Need help..

Can curl make a connection to any TCP ports, not just HTTP/HTTPS?

Can curl make a connection to any TCP ports not just HTTP/HTTPS I need to check for an open port, for example: 11740. Is this possible?..

Unable to create/open lock file: /data/mongod.lock errno:13 Permission denied

How to I get mongo to use a mounted drive on ec2? I really do not understand. I attached a volume on ec2 formatted the drive as root and start as root and yet as root I cant access? I am running on..

Python: Select subset from list based on index set

I have several lists having all the same number of entries (each specifying an object property): property_a = [545., 656., 5.4, 33.] property_b = [ 1.2, 1.3, 2.3, 0.3] ... and list with flags of t..

Locating child nodes of WebElements in selenium

I am using selenium to test my web application and I can successfully find tags using By.xpath. However now and then I need to find child nodes within that node. Example: <div id="a"> <..

Set multiple system properties Java command line

Is there an easier way to specify multiple System Properties on the command line to a Java program rather than having multiple -D statements? Trying to avoid this: java -jar -DNAME="myName" -DVERSI..

Excel VBA Run-time error '13' Type mismatch

I created a macro for a file and first it was working fine, but today I've been opening and restarting the file and macro hundreds of times and I'm always getting the following error: Excel VBA Run-ti..

Java: Get month Integer from Date

How do I get the month as an integer from a Date object (java.util.Date)?..

Adding timestamp to a filename with mv in BASH

Well, I'm a linux newbie, and I'm having an issue with a simple bash script. I've got a program that adds to a log file while it's running. Over time that log file gets huge. I'd like to create a sta..

How to upgrade docker-compose to latest version

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

How to write and save html file in python?

This is what I know about writing to an HTML file and saving it: html_file = open("filename","w") html_file.write() html_file.close() But how do I save to the file if I want to wr..

How to configure a HTTP proxy for svn

I want to check code from the repository . I can only access the the repository url by setting a proxy. I guess if I want to get the code from the same URL by svn..

What does "Changes not staged for commit" mean

I thought if you want to track the files you should git add [files you want to track] I don't know why I got the messages Changes not staged for commit. If those files were not staged, shouldn't gi..

Python: Differentiating between row and column vectors

Is there a good way of differentiating between row and column vectors in python? So far I'm using numpy and scipy and what I see so far is that If I was to give one a vector, say from numpy import * ..

Table with fixed header and fixed column on pure css

I need to create a html table (or something similar looking) with a fixed header and a fixed first column. Every solution I've seen so far uses Javascript or jQuery to set scrollTop/scrollLeft, but ..

How to pass data in the ajax DELETE request other than headers

Below is my Ajax request for a DELETE request: deleteRequest: function (url, Id, bolDeleteReq, callback, errorCallback) { $.ajax({ url: urlCall, type: 'DELETE', headers: {..

Convert IQueryable<> type object to List<T> type?

I have IQueryable<> object. I want to Convert it into List<> with selected columns like new { ID = s.ID, Name = s.Name }. Edited Marc you are absolutely right! but I have only access t..

C# Get a control's position on a form

Is there any way to retrieve a control's position in a form, when the control may be inside other controls (like Panels)? The control's Left and Top properties gives me only it's position within it's..

Quick easy way to migrate SQLite3 to MySQL?

Anyone know a quick easy way to migrate a SQLite3 database to MySQL?..

How to make Google Fonts work in IE?

I've been developing a site that uses the Google Fonts API. It's great, and supposedly has been tested in IE, but when testing in IE 8 the fonts simply don't get styled. I included the font, as Googl..

How do I check whether input string contains any spaces?

I have a input dialog that asks for XML element name, and I want to check it to see if it has any spaces. can I do something like name.matches()?..

How to destroy Fragment?

I have one Activity. The Activity has two Fragments. Fragment A is Menu. Fragment B is Detail. I try to Make other Fragment C in Fragment B, so, There are 3 Fragment in the Activity. And I try to Rep..

How to run java application by .bat file

I need to run my Java Application through .bat file. Can anybody help please...

Why is the use of alloca() not considered good practice?

alloca() allocates memory on the stack rather than on the heap, as in the case of malloc(). So, when I return from the routine the memory is freed. So, actually this solves my problem of freeing up dy..

Remove elements from collection while iterating

AFAIK, there are two approaches: Iterate over a copy of the collection Use the iterator of the actual collection For instance, List<Foo> fooListCopy = new ArrayList<Foo>(fooList); for..

Calling variable defined inside one function from another function

if I have this: def oneFunction(lists): category=random.choice(list(lists.keys())) word=random.choice(lists[category]) def anotherFunction(): for letter in word: #problem i..

Setting background images in JFrame

Are any methods available to set an image as background in a JFrame?..

JavaScript - document.getElementByID with onClick

I'm trying to code a simple game in an HTML document just for fun. In it, there is an image which adds to your score when clicked. I created a simple if statement within the score-adding function whic..

How to declare an array in Python?

How do I declare an array in Python? I can't find any reference to arrays in the documentation. ..

Expand a div to fill the remaining width

I want a two-column div layout, where each one can have variable width e.g. _x000D_ _x000D_ div {_x000D_ float: left;_x000D_ }_x000D_ _x000D_ .second {_x000D_ background: #ccc;_x000D_ }_x000D_ &l..

rails simple_form - hidden field - create?

How can you have a hidden field with simple form? The following code: = simple_form_for @movie do |f| = f.hidden :title, "some value" = f.button :submit results in this error: undefined metho..

ModelState.AddModelError - How can I add an error that isn't for a property?

I am checking my database in Create(FooViewModel fvm){...} to see if the fvm.prop1 and fvm.prop2 already exist in that combination; if so, I want to add an error to the modelstate, then return the who..

Creating a comma separated list from IList<string> or IEnumerable<string>

What is the cleanest way to create a comma-separated list of string values from an IList<string> or IEnumerable<string>? String.Join(...) operates on a string[] so can be cumbersome to wo..

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

Convert a CERT/PEM certificate to a PFX certificate

I've seen a couple questions about how to convert a PFX to a cert file, but I need to go the other way. I have two files: bob_cert.cert bob_key.pem I'd like to convert them to a single .pfx file. I..

How to truncate a foreign key constrained table?

Why doesn't a TRUNCATE on mygroup work? Even though I have ON DELETE CASCADE SET I get: ERROR 1701 (42000): Cannot truncate a table referenced in a foreign key constraint (mytest.instance, CONSTRA..

Multiple WHERE Clauses with LINQ extension methods

I have a LINQ query that looks like the following: DateTime today = DateTime.UtcNow; var results = from order in context.Orders where ((order.OrderDate <= today) && (today &l..

SVG support for Internet Explorer 8 and below

I created animation in flash and converted it into HTML5 using Swiffy. I think it's using SVG to render all of it; is there some JavaScript or a trick to make IE8 and below support it? My animation i..

What is the difference between .*? and .* regular expressions?

I'm trying to split up a string into two parts using regex. The string is formatted as follows: text to extract<number> I've been using (.*?)< and <(.*?)> which work fine but after r..

How to reference a .css file on a razor view?

I know how to set .css files on the _Layout.cshtml file, but what about applying a stylesheet on a per-view basis? My thinking here is that, in _Layout.cshtml, you have <head> tags to work with..

How do I add an active class to a Link from React Router?

I've created a bootstrap-style sidebar using Link. Here is a snippet of my code: <ul className="sidebar-menu"> <li className="header">MAIN NAVIGATION</li> <li><Link to=..


What are the differences, advantages and disadvantages of these different data-types both from a performance standpoint as well as a usability standpoint?..

Wait till a Function with animations is finished until running another Function

I'm having an issue with normal (non-ajax) functions that involve lots of animations within each of them. Currently I simply have a setTimeout between functions, but this isn't perfect since no browse..

How can I do string interpolation in JavaScript?

Consider this code: var age = 3; console.log("I'm " + age + " years old!"); Are there any other ways to insert the value of a variable in to a string, apart from string concatenation?..

If Browser is Internet Explorer: run an alternative script instead

I'm using an image carousel script that is quite heavy on the browser. It works great in Opera and Chrome, half decent in FF and absolutely breaks my balls in IE. So i'd like to give IE users an alter..

What is a race condition?

When writing multithreaded applications, one of the most common problems experienced is race conditions. My questions to the community are: What is the race condition? How do you detect them? How ..

Stretch and scale CSS background

Is there a way to get a background in CSS to stretch or scale to fill its container?..

System.IO.FileNotFoundException: Could not load file or assembly 'X' or one of its dependencies when deploying the application

I'm having a strange problem with deploying an application, which references an assembly, written in managed c++. I've created an assembly X, compiled it and referenced it in an exe file, called Star..

Node.js: how to consume SOAP XML web service

I wonder what is the best way to consume SOAP XML web service with node.js Thanks!..

How to set Google Chrome in WebDriver

I am trying to set Chrome as my browser for testing with Web-Driver and set the chromedriver.exe file properly but I am still getting the following error: org.openqa.selenium.WebDriverException: The..

Can't drop table: A foreign key constraint fails

In MySQL I want to drop a table. I tried a lot things but I keep getting the error that the table named bericht can't be dropped. This is the error I'm getting: #1217 - Cannot delete or update a p..

How to implement a SQL like 'LIKE' operator in java?

I need a comparator in java which has the same semantics as the sql 'like' operator. For example:"digital","%ital%");"digital","%gi?a%");"digi..

How to install libusb in Ubuntu

I have a C program that have #include part in the header. I have download libusb-1.0.0 to my computer. If I simply copy libusb-1.0.0 folder to the folder where my C program is, it will not work. The..

Python convert csv to xlsx

In this post there is a Python example to convert from csv to xls. However, my file has more than 65536 rows so xls does not work. If I name the file xlsx it doesnt make a difference. Is there a Pyth..

How to format a numeric column as phone number in SQL

I have table in the database with a phone number column. The numbers look like this: 123456789 I want to format that to look like this: 123-456-789 ..

JavaScript Array Push key value

Ok, I'm going a little wrong here and I've already wasted an hour with this so hopefully one of you guys can help me. var a = ['left','top'], x = []; for(i=0;i<a.length;i++) { x.push({ ..

What does character set and collation mean exactly?

I can read the MySQL documentation and it's pretty clear. But, how does one decide which character set to use? On what data does collation have an effect? I'm asking for an explanation of the two and..

"&" meaning after variable type

Possible Duplicate: What are the differences between pointer variable and reference variable in C++? What's the meaning of * and & when applied to variable names? Trying to unders..

Adding parameter to ng-click function inside ng-repeat doesn't seem to work

I have a simple loop with ng-repeat like this: <li ng-repeat='task in tasks'> <p> {{}} <button ng-click="removeTask({{}})">remove</button> </li> Th..

How to use regex in file find

I was trying to find all files dated and all files 3 days or more ago. find /home/test -name 'test.log.\d{4}-d{2}-d{2}.zip' -mtime 3 It is not listing anything. What is wrong with it?..

Using other keys for the waitKey() function of opencv

I'm working on a program (python ,opencv) in which I use the spacebar to go to the next frame, and Esc to exit the program. These are the only two keys i've got working. I tried to find out about more..

Changing java platform on which netbeans runs

I am using Netbeans 6.7. I had first installed Java 1.5 before installing Netbeans. When i installed Netbeans it took Java 1.5 as the default version. Then i installed Java 1.6 on my machine. I need t..

Howto: Clean a mysql InnoDB storage engine?

Is it possible to clean a mysql innodb storage engine so it is not storing data from deleted tables? Or do I have to rebuild a fresh database every time?..

How do you Hover in ReactJS? - onMouseLeave not registered during fast hover over

How can you achieve either a hover event or active event in ReactJS when you do inline styling? I've found that the onMouseEnter, onMouseLeave approach is buggy, so hoping there is another way to do ..

How to disable HTML links

I have a link button inside a <td> which I have to disable. This works on IE but not working in Firefox and Chrome. Structure is - Link inside a <td>. I cannot add any container in the <..

How do you concatenate Lists in C#?

If I have: List<string> myList1; List<string> myList2; myList1 = getMeAList(); // Checked myList1, it contains 4 strings myList2 = getMeAnotherList(); // Checked myList2, it contains 6 ..

C# HttpWebRequest The underlying connection was closed: An unexpected error occurred on a send

I've been Googling and trying all the solutions I could find or think of myself. The site I'm trying to load is running TLS1.2 as is a few other sites I tried to test with to make sure it wasn't a TLS..

How to create a date object from string in javascript

Having this string 30/11/2011. I want to convert it to date object. Do I need to use : Date d = new Date(2011,11,30); /* months 1..12? */ or Date d = new Date(2011,10,30); /* months 0..11..

ldapsearch over ssl/tls doesn't work

I am trying to use ldapsearch over ssl/tls connection, but it doesn't work: ldapsearch -ZZ -d 5 -b "cn=Users,dc=my,dc=server,dc=com" -s sub -D "cn=mydevice,cn=Users,dc=my,dc=server,dc=com" -h my.serv..

Java: How to check if object is null?

I am creating an application which retrieves images from the web. In case the image cannot be retrieved another local image should be used. While trying to execute the following lines: Drawable draw..

How can I get color-int from color resource?

Is there any way to get a color-int from a color resource? I am trying to get the individual red, blue and green components of a color defined in the resource (R.color.myColor) so that I can set the v..

How to get phpmyadmin username and password

I have intalled phpmyadmin recently in my system. Now I lost its username and password. I tried the below methods for login. in etc/phpmyadmin/ I activated the AllowNoPassword $cfg[..

Remove Top Line of Text File with PowerShell

I am trying to just remove the first line of about 5000 text files before importing them. I am still very new to PowerShell so not sure what to search for or how to approach this. My current concept ..

How to create a directory if it doesn't exist using Node.js?

Is this the right way to create a directory if it doesn't exist. It should have full permission for the script and readable by others. var dir = __dirname + '/upload'; if (!path.existsSync(dir)) { ..

How do I query for all dates greater than a certain date in SQL Server?

I'm trying: SELECT * FROM dbo.March2010 A WHERE A.Date >= 2010-04-01; A.Date looks like: 2010-03-04 00:00:00.000 However, this is not working. Can anyone provide a reference for why?..

How can I list the contents of a directory in Python?

Can’t be hard, but I’m having a mental block...

Can VS Code run on Android?

Does anybody know about plans of MS to support running VS Code so it can run on Android OS?..

What exactly does += do in python?

I need to know what += does in Python. It's that simple. I also would appreciate links to definitions of other shorthand tools in Python...

Delete the first three rows of a dataframe in pandas

I need to delete the first three rows of a dataframe in pandas. I know df.ix[:-1] would remove the last row, but I can't figure out how to remove first n rows...

command/usr/bin/codesign failed with exit code 1- code sign error

I'm currently in the process of submitting my first app to the Apple store. I've completed the following processes Obtained a developer account Logged into the Member Center to Create an App ID Used..

How to use PrimeFaces p:fileUpload? Listener method is never invoked or UploadedFile is null / throws an error / not usable

I'm trying to upload a file using PrimeFaces, but the fileUploadListener method isn't being invoked after the upload finishes. Here is the view: <h:form> <p:fileUpload fileUploadListene..

Solving "DLL load failed: %1 is not a valid Win32 application." for Pygame

I recently installed Python 3.1 and the Pygame module for Python 3.1 When I type import python in the console I get the following error: Traceback (most recent call last): File "<pyshell#2>"..

Find all files in a directory with extension .txt in Python

How can I find all the files in a directory having the extension .txt in python?..

Windows 10 SSH keys

I am having a really hard time getting my SSH keys up and running after installing Windows 10. Normal method is create it and throw it in the user's account under .ssh. This folder does not appear t..

How to read/write files in .Net Core?

What are the options to read/write files in .Net Core? I am working on my first .Net Core app and looking for File.Read*/File.Write* functions (System.IO from .Net) alternatives...

how to remove only one style property with jquery

I have a div with this property style="-moz-user-select:none; position:static !important;". I need to remove the -moz-user-select Tried with $(selector).css() but I don't know what value to set becaus..

How do I manually configure a DataSource in Java?

I'm trying to follow Sun's JDBC tutorial at It gives the following example code: DataSource ds = (DataSource) org.apache.derby.jdb..

Sending Email in Android using JavaMail API without using the default/built-in app

I am trying to create a mail sending application in Android. If I use: Intent emailIntent = new Intent(android.content.Intent.ACTION_SEND); This will launch the built-in Android application; I'm..

How to round float numbers in javascript?

I need to round for example 6.688689 to 6.7, but it always shows me 7. My method: Math.round(6.688689); //or Math.round(6.688689, 1); //or Math.round(6.688689, 2); But result always is the same 7..

How to remove duplicate white spaces in string using Java?

How to remove duplicate white spaces (including tabs, newlines, spaces, etc...) in a string using Java?..

How to resolve git status "Unmerged paths:"?

I merged branch dog into animal. When I go to commit, I get the following: Unmerged paths: (use "git reset HEAD <file>..." to unstage) (use "git add <file>..." to mark..

Highlight Anchor Links when user manually scrolls?

I apologize for the long post. I wanted to include everything that might be helpful. I have a single page website that consists of several divs stacked vertically. I'm using a floating nav bar and so..

How should I log while using multiprocessing in Python?

Right now I have a central module in a framework that spawns multiple processes using the Python 2.6 multiprocessing module. Because it uses multiprocessing, there is module-level multiprocessing-awar..

How do I export an Android Studio project?

I just started using the Android Studio IDE and I already released and published a simple APK to Google Play store. The problem is that I did this at work. Now I downloaded the Android Studio at my ho..

Select multiple records based on list of Id's with linq

I have a list containing Id's of my UserProfile table. How can i select all UserProfiles based on the list of Id's i got in a var using LINQ? var idList = new int[1, 2, 3, 4, 5]; var userProfiles = _..

How can I check if two segments intersect?

How can I check if 2 segments intersect? I've the following data: Segment1 [ {x1,y1}, {x2,y2} ] Segment2 [ {x1,y1}, {x2,y2} ] I need to write a small algorithm in Python to detect if the 2 lines ..

How to add a second x-axis in matplotlib

I have a very simple question. I need to have a second x-axis on my plot and I want that this axis has a certain number of tics that correspond to certain position of the first axis. Let's try with a..

Python `if x is not None` or `if not x is None`?

I've always thought of the if not x is None version to be more clear, but Google's style guide and PEP-8 both use if x is not None. Is there any minor performance difference (I'm assuming not), and is..

How to format numbers?

I want to format numbers using JavaScript. For example: 10 => 10.00 100 => 100.00 1000 => 1,000.00 10000 => 10,000.00 100000 => 100,000.00 ..

No suitable records were found verify your bundle identifier is correct

I have created an app in App Store Connect and it has been in the "prepare for submission" state for more than 3 days. When I try to archive my app, and submit it to the app store it, displays this me..