Questions Tagged with #Mpmediaquery

A media query specifies a set of media items (instances of MPMediaItem) from the iPod library by way of a filter and a grouping type. Filter and grouping type are both optional; an unqualified query matches the entire library.

How to list all files in a directory and its subdirectories in hadoop hdfs

I have a folder in hdfs which has two subfolders each one has about 30 subfolders which,finally,each one contains xml files. I want to list all xml files giving only the main folder's path. Locally I ..

Mutex example / tutorial?

I'm new to multithreading, and was trying to understand how mutexes work. Did a lot of Googling but it still left some doubts of how it works because I created my own program in which locking didn't w..

How to convert UTF-8 byte[] to string?

I have a byte[] array that is loaded from a file that I happen to known contains UTF-8. In some debugging code, I need to convert it to a string. Is there a one liner that will do this? Under th..

How to get time (hour, minute, second) in Swift 3 using NSDate?

How can you determine the hour, minute and second from NSDate class in Swift 3? In Swift 2: let date = NSDate() let calendar = NSCalendar.currentCalendar() let components = calendar.components(.Hour..

How to install pip with Python 3?

I want to install pip. It should support Python 3, but it requires setuptools, which is available only for Python 2. How can I install pip with Python 3?..

How to sign in kubernetes dashboard?

I just upgraded kubeadm and kubelet to v1.8.0. And install the dashboard following the official document. $ kubectl apply -f https://raw.githubusercontent.com/kubernetes/dashboard/master/src/deploy/r..

Assign multiple values to array in C

Is there any way to do this in a condensed form? GLfloat coordinates[8]; ... coordinates[0] = 1.0f; coordinates[1] = 0.0f; coordinates[2] = 1.0f; coordinates[3] = 1.0f; coordinates[4] = 0.0f; coordin..

Could not load file or assembly ... An attempt was made to load a program with an incorrect format (System.BadImageFormatException)

I have two projects, ProjectA and ProjectB. ProjectB is a console application, which depends on ProjectA. Yesterday, everything was working fine, but suddenly today when I run ProjectB I get this: ..

ASP.NET Identity's default Password Hasher - How does it work and is it secure?

I am wondering wether the Password Hasher that is default implemented in the UserManager that comes with MVC 5 and ASP.NET Identity Framework, is secure enough? And if so, if you could explain to me h..

Error message: (provider: Shared Memory Provider, error: 0 - No process is on the other end of the pipe.)

I am trying to deploy my website on windows server 2003. Am i missing something or what is wrong from the following error message, how can I correct it? Thank I am having the error message: A co..

Difference between const reference and normal parameter

void DoWork(int n); void DoWork(const int &n); What's the difference?..

How to run shell script file using nodejs?

I need to run a shell script file using nodeJS that executes a set of Cassandra DB commands. Can anybody please help me on this. inside db.sh file: create keyspace dummy with replication = {'clas..

How do I resize an image using PIL and maintain its aspect ratio?

Is there an obvious way to do this that I'm missing? I'm just trying to make thumbnails...

Vim and Ctags tips and tricks

I have just installed Ctags (to help with C++ development) with my Vim (or rather gVim), and would like to find out your favorite commands, macros, shortcuts, tips that go along with it... Share your..

How to change a TextView's style at runtime

I have an android app on which, when the user taps a TextView, I would like to apply a defined style. I thought to find a textview.setStyle() but it doesn't exists. I tried textview.setTextAppearan..

Handling very large numbers in Python

I've been considering fast poker hand evaluation in Python. It occurred to me that one way to speed the process up would be to represent all the card faces and suits as prime numbers and multiply them..

Error: Unfortunately you can't have non-Gradle Java modules and > Android-Gradle modules in one project

I have an IntelliJ 14.1.2 Project consisting of two modules - one is an Android Gradle based module and the other is a Spring Java-based module with Maven. gps-trackman.v1 is my root project and I've..

How to change the default port of mysql from 3306 to 3360

I want to change the default port number of MySQL server presently it is 3306. I want to change it to 3360. I have tried: -- port=3360 But things are not working for me. Please provide query to ..

How do I remove a file from the FileList

I'm building a drag-and-drop-to-upload web application using HTML5, and I'm dropping the files onto a div and of course fetching the dataTransfer object, which gives me the FileList. Now I want to re..

Where can I find a NuGet package for upgrading to System.Web.Http v5.0.0.0?

Just upgraded an ASP.NET MVC4 project to use Unity.WebApi version 5.0.0.0 and it requires System.Web.Http v 5.0.0.0 as per the following error: Assembly 'Unity.WebApi, Version=5.1.0.0, Culture=neutral..

HTML5 : Iframe No scrolling?

When it comes to HTML5, scrolling attribute is no longer supported - but I still need to remove the scroll bars - how to do that?..

How to convert a Scikit-learn dataset to a Pandas dataset?

How do I convert data from a Scikit-learn Bunch object to a Pandas DataFrame? from sklearn.datasets import load_iris import pandas as pd data = load_iris() print(type(data)) data1 = pd. # Is there a ..

Use of "instanceof" in Java

What is the 'instanceof' operator used for? I learned that Java has the instanceof operator. Can you elaborate where it is used and what are its advantages?..

Case insensitive searching in Oracle

The default behaviour of LIKE and the other comparison operators, = etc is case-sensitive. Is it possible make them case-insensitive?..

link button property to open in new tab?

In my application I have some link buttons there but when I right click on them I cannot (they are in disable mode) find the menu items Open in new tab or Open in new window. How do I show those men..

Regex to match alphanumeric and spaces

What am I doing wrong here? string q = "john s!"; string clean = Regex.Replace(q, @"([^a-zA-Z0-9]|^\s)", string.Empty); // clean == "johns". I want "john s"; ..

Reading and writing value from a textfile by using vbscript code

i have a variable named 'data' i need to write in to a textfile named "listfile.txt".Can you tell me the vbscript code to do that..And i need vbscript code for reading value from textfile "listfile.tx..

Making a <button> that's a link in HTML

Basically, I like the way that <input type="submit"> is styled, with the clickable button when you add a little CSS. However, regular buttons are not styled as such, they have no such clickabili..

How do you calculate the variance, median, and standard deviation in C++ or Java?

Possible Duplicate: Simple statistics - Java packages for calculating mean, standard deviation, etc I have a vector of some doubles (1.1,2,3,5). How can I calculate the variance, median, an..

Error type 3 Error: Activity class {} does not exist

I have an IntelliJ Android project, that I successfully imported to Android Studio 0.4.0. It works perfectly if I don't change anything in manifest. However, when I want to change the launcher activit..

Angular2 - Input Field To Accept Only Numbers

In Angular 2, how can I mask an input field (textbox) such that it accepts only numbers and not alphabetical characters? I have the following HTML input: <input type="text" *ngSwitchDefault..

How can I produce an effect similar to the iOS 7 blur view?

I'm trying to replicate this blurred background from Apple's publicly released iOS 7 example screen: This question suggests applying a CI filter to the contents below, but that's a whole different ..

How get value from URL

I want to get the value from the URL to choose data from the database by ID. I want the value for the id. For example, if I were to open `www.example.com/index.php?id=12'. I want to get a value whose ..

How do the likely/unlikely macros in the Linux kernel work and what is their benefit?

I've been digging through some parts of the Linux kernel, and found calls like this: if (unlikely(fd < 0)) { /* Do something */ } or if (likely(!err)) { /* Do something */ } I've foun..

How to suppress Update Links warning?

I'm trying to write a script that opens many Excel files. I keep getting the prompt: This workbook contains links to other data sources. I want to keep this message from appearing, so that my scri..

Convert comma separated string of ints to int array

I only found a way to do it the opposite way round: create a comma separated string from an int list or array, but not on how to convert input like string str = "1,2,3,4,5"; to an array or list of int..

RegExp matching string not starting with my

For PMD I'd like to have a rule which warns me of those ugly variables which start with my. This means I have to accept all variables which do NOT start with my. So, I need a RegEx (re) which behaves ..

Difference between Parameters.Add(string, object) and Parameters.AddWithValue

I read the MSDN documentation and examples here and I know that the correct syntax for a Paramters.Add call is : command.Parameters.Add("@ID", SqlDbType.Int); command.Parameters["@ID"].Value = ..

Add newline to VBA or Visual Basic 6

I want to concatenate two strings with a linebreak between them. st = "Line 1" + newline + "Line2" How do I add a newline to VBA or Visual Basic 6?..

Difference between malloc and calloc?

What is the difference between doing: ptr = (char **) malloc (MAXELEMS * sizeof(char *)); or: ptr = (char **) calloc (MAXELEMS, sizeof(char*)); When is it a good idea to use calloc over malloc o..

How can I make a thumbnail <img> show a full size image when clicked?

Normally you have an image tage with the src as the source of the image and the alt as the alternative text: <img src="image1.gif" alt="Image 1" /> Can you have something like is?: <im..

How to use moment.js library in angular 2 typescript app?

I tried to use it with typescript bindings: npm install moment --save typings install moment --ambient -- save test.ts: import {moment} from 'moment/moment'; And without: npm install moment --s..

The Eclipse executable launcher was unable to locate its companion launcher jar windows

I am facing a small issue and need help on it. I had to re-install Windows on my laptop. After that I installed Java, extracted Eclipse and set the environment variables, namely Path to the Java bin ..

Java Object Null Check for method

I need to create a null check in this formula for the books[i] and I am not entirely sure how to go about this as I am not greatly familiar with null checks and very new at programming. Any and all he..

Trigger event when user scroll to specific element - with jQuery

I have an h1 that is far down a page.. <h1 id="scroll-to">TRIGGER EVENT WHEN SCROLLED TO.</h1> and I want to trigger an alert when the user scrolls to the h1, or has it in it's browser'..

Link a photo with the cell in excel

Is there anyone who knows how to connect a picture with the cell that it is in at microsoft excel? For example in the first column I put some brands of mobile phones and in the second one some pictur..

IllegalStateException: Can not perform this action after onSaveInstanceState with ViewPager

I'm getting user reports from my app in the market, delivering the following exception: java.lang.IllegalStateException: Can not perform this action after onSaveInstanceState at android.app.FragmentM..

Add 'x' number of hours to date

I currently have php returning the current date/time like so: $now = date("Y-m-d H:m:s"); What I'd like to do is have a new variable $new_time equal $now + $hours, where $hours is a number of hour..

How to pass an event object to a function in Javascript?

<button type="button" value="click me" onclick="check_me();" /> function check_me() { //event.preventDefault(); var hello = document.myForm.username.value; var err = ''; if(hello == ''..

How to get distinct results in hibernate with joins and row-based limiting (paging)?

I'm trying to implement paging using row-based limiting (for example: setFirstResult(5) and setMaxResults(10)) on a Hibernate Criteria query that has joins to other tables. Understandably, data is ge..

CSS image resize percentage of itself?

I am trying to resize an img with a percentage of itself. For example, I just want to shrink the image by half by resizing it to 50%. But applying width: 50%; will resize the image to be 50% of the co..

How do I get the domain originating the request in express.js?

I'm using express.js and i need to know the domain which is originating the call. This is the simple code app.get( '/verify_license_key.json', function( req, res ) { // do something ..

HTML Drag And Drop On Mobile Devices

When you add drag and drop to a web page using JavaScript, such as jQuery UI draggable and droppable, how do you get this to work when viewed via a browser on a mobile device - where the touch-screen ..

What encoding/code page is cmd.exe using?

When I open cmd.exe in Windows, what encoding is it using? How can I check which encoding it is currently using? Does it depend on my regional setting or are there any environment variables to check?..

How to check if spark dataframe is empty?

Right now, I have to use df.count > 0 to check if the DataFrame is empty or not. But it is kind of inefficient. Is there any better way to do that? Thanks. PS: I want to check if it's empty so th..

Substring with reverse index

How can I extract "456" from "xxx_456" where xxx is of indefinite length?..

How to get first and last day of week in Oracle?

I need to get the first day and the last day of the week from some strings that have the format like this: '201118' where 2011 is the year and 18 is the number of the week. Knowing the number of th..

get one item from an array of name,value JSON

I have this array: var arr = []; arr.push({name:"k1", value:"abc"}); arr.push({name:"k2", value:"hi"}); arr.push({name:"k3", value:"oa"}); is it possible to do get the value or a specific element b..

Best way to increase heap size in catalina.bat file

I have tomcat 6 server on windows xp ,And I start tomcat through console i.e. using startup.bat. AFAIK catalina.bat file is for windows so I am changing bat file for memory management.I don't have to..

Setting up Eclipse with JRE Path

I have downloaded and extracted Eclipse. I have Eclipse in the following directory: C:\Applications\eclipse. When I try and run the executable , I get the following message : I currently have the f..

How do you force a CIFS connection to unmount

I have a CIFS share mounted on a Linux machine. The CIFS server is down, or the internet connection is down, and anything that touches the CIFS mount now takes several minutes to timeout, and is unk..

SOAP request to WebService with java

I'm a bit confused about how to make a request to a webservice via java. For now the only thing that I've understand is that webservices uses xml structured messages, but still I didn't quite underst..

How to hide a <option> in a <select> menu with CSS?

I've realized that Chrome, it seems, will not allow me to hide <option> in a <select>. Firefox will. I need to hide the <option>s that match a search criteria. In the Chrome web too..

How to add a border to a widget in Flutter?

I'm using Flutter and I'd like to add a border to a widget (in this case, a Text widget). I tried TextStyle and Text, but I didn't see how to add a border...

JPA: difference between @JoinColumn and @PrimaryKeyJoinColumn?

What's the exact difference between @JoinColumn and @PrimaryKeyJoinColumn? You use @JoinColumn for columns that are part of a foreign key. A typical column could look like (e.g. in a join table with ..

Javascript seconds to minutes and seconds

This is a common problem but I'm not sure how to solve it. The code below works fine. var mind = time % (60 * 60); var minutes = Math.floor(mind / 60); var secd = mind % 60; var seconds = Math.ceil(..

Searching multiple files for multiple words

I have to search trough a huge amount of .txt files. I know I can do multiple words search, but here's my problem. I want my results to only be the .txt files that contain all of the words of the sear..

hadoop copy a local file system folder to HDFS

I need to copy a folder from local file system to HDFS. I could not find any example of moving a folder(including its all subfolders) to HDFS $ hadoop fs -copyFromLocal /home/ubuntu/Source-Folder-To-..

.Net System.Mail.Message adding multiple "To" addresses

EDIT: This question is pointless, except as an exercise in red herrings. The issue turned out to be a combination of my idiocy (NO ONE was being emailed as the host was not being specified and was i..

Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing, return null

I have a component in React which I am importing in index.js, but it is giving this error: Nothing was returned from render. This usually means a return statement is missing. Or, to render nothing..

Kill detached screen session

I learned from somewhere a detached screen can be killed by screen -X -S [session # you want to kill] kill where [session # you want to kill] can be gotten from screen -ls But this doesn't work...

Benefits of EBS vs. instance-store (and vice-versa)

I'm unclear as to what benefits I get from EBS vs. instance-store for my instances on Amazon EC2. If anything, it seems that EBS is way more useful (stop, start, persist + better speed) at relatively ..

PHP check if date between two dates

I got this code from Stackoverflow and changed it slightly to work with today's date. I want to check if today fits between two dates. But this is not working. What am I missing? $paymentDate = date..

How to upgrade docker container after its image changed

Let's say I have pulled the official mysql:5.6.21 image. I have deployed this image by creating several docker containers. These containers have been running for some time until MySQL 5.6.22 is rel..

How to set the font style to bold, italic and underlined in an Android TextView?

I want to make a TextView's content bold, italic and underlined. I tried the following code and it works, but doesn't underline. <Textview android:textStyle="bold|italic" .. How do I do it? Any ..

Removing the textarea border in HTML

I'm working with the textarea element in HTML and want to remove the border of the box. I also want to align the text in the bottom of my textarea...

What is the purpose of XSD files?

Since we can query on the XML file from C# (.NET), why do we need an XSD file? I know it is metadata file of particular XML file. We can specify the relationships in XSD, but what is its functioning ..

How can I display a tooltip message on hover using jQuery?

As the title states, how can I display a tooltip message on hover using jQuery?..

Prevent linebreak after </div>

Is there a way to prevent a line break after a div with css? For example I have <div class="label">My Label:</div> <div class="text">My text</div> and want it to display li..

Error # 1045 - Cannot Log in to MySQL server -> phpmyadmin

We have installed PHPMyAdmin on a windows machine running IIS 7.0. We are able to connect to MySQL using command-line, But we are not able to connect using PHPMyAdmin. The error displayed is: Error #1..

How to escape % in String.Format?

I am storing a SQL query in my strings.xml file and I want to use String.Format to build the final string in code. The SELECT statement uses a like, something like this: SELECT Field1, Field2 FROM m..

Spring JUnit: How to Mock autowired component in autowired component

I've got a Spring component I'd like to test and this component has an autowired attribute which I need to change for the purpose of unit testing. The problem is, that the class uses the autowired com..

Android LinearLayout Gradient Background

I am having trouble applying a gradient background to a LinearLayout. This should be relatively simple from what I have read but it just doesn't seem to work. For reference sakes I am developing on 2..

How can I change the default width of a Twitter Bootstrap modal box?

I tried the following: <div class="modal hide fade modal-admin" id="testModal" style="display: none;"> <div class="modal-header"> <a data-dismiss="modal" class="cl..

Putting a password to a user in PhpMyAdmin in Wamp

How do you change the password for the root user in phpMyAdmin on WAMP server? because I'm locked out of phpMyAdmin, after changing the password incorrectly...

Passing an array as parameter in JavaScript

I have an array, and I want to pass it as a parameter in a function such as: function something(arrayP){ for(var i = 0; i < arrayP.length; i++){ alert(arrayP[i].value); } } I'..

Cast Int to enum in Java

What is the correct way to cast an Int to an enum in Java given the following enum? public enum MyEnum { EnumValue1, EnumValue2 } MyEnum enumValue = (MyEnum) x; //Doesn't work??? ..

How do I toggle an element's class in pure JavaScript?

I'm looking for a way to convert this jQuery code (which is used in responsive menu section) to pure JavaScript. If it's hard to implement it's OK to use other JavaScript frameworks. $('.btn-navbar..

'MOD' is not a recognized built-in function name

I wanted to use MOD function in SQL Server 2008R2 and followed this link but still got the message: 'MOD' is not a recognized built-in function name. DECLARE @m INT SET @m = MOD(321,11) SELECT..

ScriptManager.RegisterStartupScript code not working - why?

I have used code like this in the past to successfully pop up an alert message on my asp.net webpage. Now it is not working. I can't figure out why. ScriptManager.RegisterStartupScript(this, typeof(P..

How to fix git error: RPC failed; curl 56 GnuTLS

I use Ubuntu 16.04. When I want to git push origin master I get: error: RPC failed; curl 56 GnuTLS recv error (-12): A TLS fatal alert has been received. fatal: The remote end hung up unexpectedly fat..

How do I check the operating system in Python?

I want to check the operating system (on the computer where the script runs). I know I can use os.system('uname -o') in Linux, but it gives me a message in the console, and I want to write to a varia..

How do I properly set the permgen size?

I have this VM with tomcat, java, and grails in it. I've been getting permgen errors so I looked around and found the solution: set JAVA_OPTS="-Xms256m -Xmx1024m -XX:PermSize=512m -XX:MaxPermSize=512..

Rails Active Record find(:all, :order => ) issue

I seem to be unable to use the ActiveRecord::Base.find option :order for more than one column at a time. For example, I have a "Show" model with date and attending columns. If I run the following c..

Node.js ES6 classes with require

So up until now, i have created classes and modules in node.js the following way: var fs = require('fs'); var animalModule = (function () { /** * Constructor initialize object * @c..

Can Powershell Run Commands in Parallel?

I have a powershell script to do some batch processing on a bunch of images and I'd like to do some parallel processing. Powershell seems to have some background processing options such as start-job,..

AngularJS 1.2 $injector:modulerr

When using angular 1.2 instead of 1.07 the following piece of code is not valid anymore, why? 'use strict'; var app = angular.module('myapp', []); app.config(['$routeProvider', '$locationProvider',..

how to get value of selected item in autocomplete

i have here a code from http://jqueryui.com/autocomplete/ it works really good but i cant find a way to get the value of selected item in the text view i tried something like this but its not working ..

Web colors in an Android color xml resource file

What do all of the X11/w3c color codes look like in the format of an Android XML resource file? I know this looks a tad ridiculous as a question, but given the votes apparently it's useful and sin..

What is the easiest way to push an element to the beginning of the array?

I can't think of a one line way to do this. Is there a way?..

How to style SVG with external CSS?

I have several SVG graphics I'd like to modify the colors of via my external style sheets - not directly within each SVG file. I'm not putting the graphics in-line, but storing them in my images folde..

Html.Raw() in ASP.NET MVC Razor view

@{int count = 0;} @foreach (var item in Model.Resources) { @(count <= 3 ? Html.Raw("<div class=\"resource-row\">").ToString() : Html.Raw("")) // some co..

Differences between unique_ptr and shared_ptr

Possible Duplicates: pimpl: shared_ptr or unique_ptr smart pointers (boost) explained Could someone explain differences between shared_ptr and unique_ptr?..

jQuery append and remove dynamic table row

I can add many rows for a table, but I can't remove many rows. I only can remove 1 row per sequential add. <script src="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script&g..

Wait on the Database Engine recovery handle failed. Check the SQL server error log for potential causes

I m using SQL Server 2012 Developer Edition. Even I tried 2012 express and enterprise edition but all gave same error. I browsed msdn blog as well as few post on stackoverflow. But nothing help me ou..

MySQL: Curdate() vs Now()

What is difference between MySQL Curdate() and Now()?..

Using "like" wildcard in prepared statement

I am using prepared statements to execute mysql database queries. And I want to implement a search functionality based on a keyword of sorts. For that I need to use LIKE keyword, that much I know. A..

Check if table exists

I have a desktop application with a database embedded in it. When I execute my program I need to check that specific table exists, or create it if not. Given a Connection object named conn for my dat..

Does MS Access support "CASE WHEN" clause if connect with ODBC?

Does ODBC support CASE WHEN clause for MS Access? Is there any other database which does not support the CASE WHEN clause? I tried the following query while connecting to MS Access with ODBC but get a..

"A namespace cannot directly contain members such as fields or methods"

I am trying to use this code for NET.reflector using Reflexil. I am trying to replace code with this: if(Input.GetKeyDown(KeyCode.Keypad5)) { int i = 0; Character localPlayer = PlayerClient.GetLocal..

Is there a way to get a collection of all the Models in your Rails app?

Is there a way that you can get a collection of all of the Models in your Rails app? Basically, can I do the likes of: - Models.each do |model| puts model.class.name end ..

How do I merge my local uncommitted changes into another Git branch?

How can I do the following in Git? My current branch is branch1 and I have made some local changes. However, I now realize that I actually meant to be applying these changes to branch2. Is there a wa..

Add characters to a string in Javascript

I need to add in a For Loop characters to an empty string. I know that you can use the function concat in Javascript to do concats with strings var first_name = "peter"; var last_name = "jones"; v..

Java Immutable Collections

From Java 1.6 Collection Framework documentation: Collections that do not support any modification operations (such as add, remove and clear) are referred to as unmodifiable. [...] Collections tha..

How to see the changes between two commits without commits in-between?

How do you make git diff only show the difference between two commits, excluding the other commits in-between?..

How to replace NaNs by preceding values in pandas DataFrame?

Suppose I have a DataFrame with some NaNs: >>> import pandas as pd >>> df = pd.DataFrame([[1, 2, 3], [4, None, None], [None, None, 9]]) >>> df 0 1 2 0 1 2 3 1..

When and why to 'return false' in JavaScript?

When and why to return false in JavaScript?..

How to edit data in result grid in SQL Server Management Studio

I want to edit some row values once I get a query output in the result grid. Its true that we can right click the table and say open table to get an editable table output, but what I want is editable ..

How to set timeout on python's socket recv method?

I need to set timeout on python's socket recv method. How to do it?..

How can I fix the form size in a C# Windows Forms application and not to let user change its size?

How can I fix the form size in a C# Windows Forms application and not to let user change its size?..

Plotting with ggplot2: "Error: Discrete value supplied to continuous scale" on categorical y-axis

The plotting code below gives Error: Discrete value supplied to continuous scale What's wrong with this code? It works fine until I try to change the scale so the error is there... I tried to figure ..

How to use JavaScript to change the form action

My current code is as follows: <div class="fr_search"> <form action="/" accept-charset="UTF-8" method="post" id="search-theme-form"> ....... </form> </div> Now I w..

JavaScript file not updating no matter what I do

I have an external JavaScript file and whether in FireFox or Chrome, whether all browsing data is cleared, it will NOT update no matter what. I believe something happened when I made a backup of my fi..

How to update ruby on linux (ubuntu)?

I'm newbie on both ruby and linux, so I'm sure this is trivial but I don't know yet. I currently have ruby 1.8.7 installed and I want to update it to ruby 1.9. How can I do that?..

How can you test if an object has a specific property?

How can you test if an object has a specific property? Appreciate I can do ... $members = Get-Member -InputObject $myobject and then foreach through the $members, but is there a function to test ..

Detect Close windows event by jQuery

Could you please give me the best way to detect only window close event for all browsers by jQuery? I mean clicking X button on the browser or window.close(), not meaning F5, form submission, window...

How to add/subtract time (hours, minutes, etc.) from a Pandas DataFrame.Index whos objects are of type datetime.time?

I've got a DataFrame who's index is just datetime.time and there's no method in DataFrame.Index and datetime.time to shift the time. datetime.time has replace but that'll only work on individual item..

jasmine: Async callback was not invoked within timeout specified by jasmine.DEFAULT_TIMEOUT_INTERVAL

I have an angular service called requestNotificationChannel: app.factory("requestNotificationChannel", function($rootScope) { var _DELETE_MESSAGE_ = "_DELETE_MESSAGE_"; function deleteMessa..

How do I create a ListView with rounded corners in Android?

How do I create a ListView with rounded corners in Android?..

how to convert an RGB image to numpy array?

I have an RGB image. I want to convert it to numpy array. I did the following im = cv.LoadImage("abc.tiff") a = numpy.asarray(im) It creates an array with no shape. I assume it is a iplimage object..

What is the difference between exit and return?

What is difference between return and exit statement in C programming when called from anywhere in a C program?..

<DIV> inside link (<a href="">) tag

I want to make a div click-able and but inside this <div> i have another <div> which also should be click-able or linked. HTML <a href="#"> <div class="box"> <d..

Resource from src/main/resources not found after building with maven

Hello I'm using a configuration file from src/main/resources in my java application. I'm reading it in my Class like this : new BufferedReader(new FileReader(new File("src/main/resources/config.txt")..

Angular2 - Http POST request parameters

I'm trying to make a POST request but i can't get it working: testRequest() { var body = 'username=myusername?password=mypassword'; var headers = new Headers(); headers.append('Cont..

Meaning of ${project.basedir} in pom.xml

What is the meaning of <directory>${project.basedir}</directory> and ${project.build.directory} in pom.xml..

Curl setting Content-Type incorrectly

I am running a curl operation on the command line and am having trouble forcing the header to set as XML. I use the -H option to force the Content-Type to be xml, however, once I run the command I can..

Why use argparse rather than optparse?

I noticed that the Python 2.7 documentation includes yet another command-line parsing module. In addition to getopt and optparse we now have argparse. Why has yet another command-line parsing module..

adb not finding my device / phone (MacOS X)

Doing Android development on a Mac and this very new phone I have doesn't show up in the devices list in adb. Lots of other phones and devices work fine for me so I know my setup is good. I have debu..

PL/pgSQL checking if a row exists

I'm writing a function in PL/pgSQL, and I'm looking for the simplest way to check if a row exists. Right now I'm SELECTing an integer into a boolean, which doesn't really work. I'm not experienced wit..

Git: cannot checkout branch - error: pathspec '...' did not match any file(s) known to git

I'm not sure why I'm unable to checkout a branch that I had worked on earlier. See the commands below (note: co is an alias for checkout): ramon@ramon-desktop:~/source/unstilted$ git branch -a * deve..

Make Vim show ALL white spaces as a character

I can't find a way to make Vim show all white spaces as a character. All I found was about tabs, trailing spaces etc...

How to extract table as text from the PDF using Python?

I have a PDF which contains Tables, text and some images. I want to extract the table wherever tables are there in the PDF. Right now am doing manually to find the Table from the page. From there I a..

Removing the password from a VBA project

How can I programmatically remove a (known) password from an Excel VBA project? To be clear: I want to remove the password from the VBA Project, not the workbook or any worksheets...

Difference between static and shared libraries?

What is the difference between static and shared libraries? I use Eclipse and there are several project types including Static Libraries and Shared Libraries? Does one have an advantage over the othe..

How to auto-remove trailing whitespace in Eclipse?

The question has two parts, one of which I already have the answer for. How to auto-remove trailing whitespace from the entire file being edited? -> Answer: use the AnyEdit plugin, which can be set ..

maven error: package org.junit does not exist

I'm trying to create the javadoc with maven and it fails. It also fails when doing the verify. mvn verify I get the following error: (...) [INFO] ----------------------------------------------..

How do I change a TCP socket to be non-blocking?

How do you make a socket non-blocking? I am aware of the fcntl() function, but I've heard it's not always reliable...

Why is my toFixed() function not working?

Here's the relevant code. I've confirmed with the alert that the correct number is saved, it's just not being changed to 2 decimal places. if ($(this).attr('name') == 'time') { var value = $(th..

Changing the highlight color when selecting text in an HTML text input

I've been looking for this throughout the web and can't even find anyone else even asking this, let alone a solution... Is there a way to change the color of the highlight area within a text input wh..

Setting the classpath in java using Eclipse IDE

I have an Eclipse project with an external folder containing a lot of JAR files (legacy libraries) . instead of adding all the jars in Eclipse ("add external Jar"), I would prefer to add a ref to this..

jackson deserialization json to java-objects

Here is my Java code which is used for the de-serialization, i am trying to convert json string into java object. In doing so i have used the following code: package ex1jackson; import com.fasterxml..

Visual Studio Code compile on save

How can I configure Visual Studio Code to compile typescript files on save? I see it is possible to configure a task to build the file in focus using the ${file} as an argument. But I would like th..

Calling a user defined function in jQuery

I am trying to call a user defined function in jQuery: _x000D_ _x000D_ $(document).ready(function() {_x000D_ $('#btnSun').click(function() {_x000D_ myFunction();_x000D_ });_x000D_ $.fn.myF..

Angular2, what is the correct way to disable an anchor element?

I'm working on an Angular2 application, and I need to display -- but disable an <a> HTML element. What is the correct way to do this? Updated Please note the *ngFor, this would prevent the opt..

How to convert all tables from MyISAM into InnoDB?

I know I can issue an alter table individually to change the table storage from MyISAM to InnoDB. I am wondering if there is a way to quickly change all of them to InnoDB?..

An unhandled exception occurred during the execution of the current web request. ASP.NET

I just ran my program and I got this error message An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the..

php artisan migrate throwing [PDO Exception] Could not find driver - Using Laravel

I have a bad experience while installing laravel. However, I was able to do so and move to the next level. I used generators and created my migrations. But when I type the last command php artisan ..

How can I align YouTube embedded video in the center in bootstrap

I am trying to align YouTube embedded video in the center of the page in my bootstrap page. The size of the video is always the same. My html looks really simple: <div class="video"> <i..

TCPDF output without saving file

How to use TCPDF to output pdf file in browser without saving like in ezpdf? ..

Difference Between Select and SelectMany

I've been searching the difference between Select and SelectMany but I haven't been able to find a suitable answer. I need to learn the difference when using LINQ To SQL but all I've found are standar..

Input text dialog Android

When a user clicks a Button in my App (which is printed in a SurfaceView), I'd like a text Dialog to appear and I would like to store the result in a String. I'd like the text Dialog to overlay the cu..

How do you test your Request.QueryString[] variables?

I frequently make use of Request.QueryString[] variables. In my Page_load I often do things like: int id = -1; if (Request.QueryString["id"] != null) { try { ..

How to convert an address to a latitude/longitude?

How would I go about converting an address or city to a latitude/longitude? Are there commercial outfits I can "rent" this service from? This would be used in a commercial desktop application on a Win..

LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1

LDAP: error code 49 - 80090308: LdapErr: DSID-0C0903A9, comment: AcceptSecurityContext error, data 52e, v1db1 I know "52e" code is when username is valid, but password is invalid. I am using the ..

right align an image using CSS HTML

How can I right-align an image using CSS. I do not want the text to wrap-around the image. I want the right aligned image to be on a line by itself...

Python convert tuple to string

I have a tuple of characters like such: ('a', 'b', 'c', 'd', 'g', 'x', 'r', 'e') How do I convert it to a string so that it is like: 'abcdgxre' ..

Apply function to each element of a list

How do I apply a function to the list of variable inputs? For e.g. the filter function returns true values but not the actual output of the function. from string import upper mylis=['this is test', '..

CREATE TABLE LIKE A1 as A2

I want to create a new table with properties of an old table and without duplicates. I want to do something like this: CREATE TABLE New_Users LIKE Old_Users, AS (SELECT * FROM Old_Users GROUP BY ID..

Counting null and non-null values in a single query

I have a table create table us ( a number ); Now I have data like: a 1 2 3 4 null null null 8 9 Now I need a single query to count null and not null values in column a ..

How can I quantify difference between two images?

Here's what I would like to do: I'm taking pictures with a webcam at regular intervals. Sort of like a time lapse thing. However, if nothing has really changed, that is, the picture pretty much loo..

SQL Server IF NOT EXISTS Usage?

Ok, so my schema is this: Table: Timesheet_Hours Columns: Timesheet_Id (PK, int) Staff_Id (int) BookedHours (int) Posted_Flag (boolean) This is an extremely simplified version of the table, but it w..

How to use a link to call JavaScript?

How to use a link to call JavaScript code?..

How to convert string to integer in C#

How do I convert a string to an integer in C#?..

How to access property of anonymous type in C#?

I have this: List<object> nodes = new List<object>(); nodes.Add( new { Checked = false, depth = 1, id = "div_" + d.Id }); ... and I'm wondering if I can..

Where are include files stored - Ubuntu Linux, GCC

So, when we do the following: #include <stdio.h> versus #include "myFile.h" the compiler, GCC in my case, knows where that stdio.h (and even the object file) are located on my hard drive...

Setting default value in select drop-down using Angularjs

I have an object as below. I have to display this as a drop-down: var list = [{id:4,name:"abc"},{id:600,name:"def"},{id:200,name:"xyz"}] In my controller I have a variable that carries a value. Thi..

How to do a for loop in windows command line?

I was wondering if this was possible? I'm not familiar with using windows command line, but I have to use it for a project I'm working on. I have a a number of files, for which I need to perform a fun..

Build fails with "Command failed with a nonzero exit code"

When I try to build my app with Xcode, an error interrupts the build process: Command CompileStoryboard failed with a nonzero exit code Sometimes, it shows this error instead: Command Compil..

SQL How to replace values of select return?

In my database (MySQL) table, has a column with 1 and 0 for represent true and false respectively. But in SELECT, I need it replace for true or false for printing in a GridView. How to I make my SEL..

Cannot read property 'addEventListener' of null

I have to use vanilla JavaScript for a project. I have a few functions, one of which is a button that opens a menu. It works on pages where the target id exists, but causes an error on pages where t..

Simple int to char[] conversion

I have a simple question How to simply convert integer (getting values 0-8) to char, e.g. char[2] in C? Thanks..

ie8 var w= window.open() - "Message: Invalid argument."

I have a site that has an IE8-only problem: The code is: var w = window.open(urlstring, wname, wfeatures, 'false'); The error is: Message: Invalid argument. Line: 419 Char: 5 Code: 0 ..

Multiple WHERE clause in Linq

I'm new to LINQ and want to know how to execute multiple where clause. This is what I want to achieve: return records by filtering out certain user names. I tried the code below but not working as exp..

Logging POST data from $request_body

I have my config setup to handle a bunch of GET requests which render pixels that work fine to handle analytics and parse query strings for logging. With an additional third party data stream, I need ..

How to convert SQL Server's timestamp column to datetime format

As SQL Server returns timestamp like 'Nov 14 2011 03:12:12:947PM', is there some easy way to convert string to date format like 'Y-m-d H:i:s'. So far I use date('Y-m-d H:i:s',strtotime('Nov 14 2011..

How to cast DATETIME as a DATE in mysql?

My query is this. I have a bunch of entries and i want to group them by date. But instead of having date in my database, I have a datetime field. What do I do? select * from follow_queue group by fol..

Efficient way to determine number of digits in an integer

What is a very efficient way of determining how many digits there are in an integer in C++?..

How to set gradle home while importing existing project in Android studio

How to set gradle home while importing existing project in Android studio. While trying to import I need to set up this path. ..

Enter key press behaves like a Tab in Javascript

I'm looking to create a form where pressing the enter key causes focus to go to the "next" form element on the page. The solution I keep finding on the web is... <body onkeydown="if(event.keyCode..

Copy Files from Windows to the Ubuntu Subsystem

I have enabled developer mode and installed Bash on Ubuntu on Windows. My home directory can be found under %localappdata%\Lxss\home\<ubuntu.username>\, i have created a sub-directory called Pi..

How to detect if URL has changed after hash in JavaScript

How can I check if a URL has changed in JavaScript? For example, websites like GitHub, which use AJAX, will append page information after a # symbol to create a unique URL without reloading the page. ..

How to get index in Handlebars each helper?

I'm using Handlebars for templating in my project. Is there a way to get the index of the current iteration of an "each" helper in Handlebars? <tbody> {{#each item}} <tr> ..

How to show a running progress bar while page is loading

I want to show a running progress bar while my page is loading like here, in my page. I used a simple loading image in my example, but I want to convert it in a running progress bar. Here is my code:..

How to select distinct query using symfony2 doctrine query builder?

I have this symfony code where it retrieves all the categories related to a blog section on my project: $category = $catrep->createQueryBuilder('cc') ->Where('cc.contenttype = :type') -..

What are the Android SDK build-tools, platform-tools and tools? And which version should be used?

I know this is a very rudimentary question, but to my surprise, I could not find any document about Android SDK Build-tools. Besides Android SDK Tools and Android SDK Platform-tools, there are a bunch..

How to use the PRINT statement to track execution as stored procedure is running?

Reference: SQL Server I have a stored procedure with a while loop in it and I want some messages to be printed after every 500 loops. So, I've written - CREATE spxxx AS BEGIN BEGIN TRAN ..

EXC_BAD_ACCESS signal received

When deploying the application to the device, the program will quit after a few cycles with the following error: Program received signal: "EXC_BAD_ACCESS". The program runs without any issue on the..

How to draw checkbox or tick mark in GitHub Markdown table?

I am able to draw checkbox in Github README.md lists using - [ ] (for unchecked checkbox) - [x] (for checked checkbox) But this is not working in table. Does anybody know how to implement checkbox ..

change PATH permanently on Ubuntu

I'd like to add to PATH the value ":/home/me/play/" for the installation of Play! framework. so I ran this command: PATH=$PATH:/home/me/play it worked. but in the next time I checked, the value c..

SQL UPDATE all values in a field with appended string CONCAT not working

Here is what I want to do: current table: +----+-------------+ | id | data | +----+-------------+ | 1 | max | | 2 | linda | | 3 | sam | | 4 | henry ..