Questions Tagged with #Mp4

MP4 is a multimedia container format standard with the file extension .mp4. It can be used to store digital audio/video streams, in addition to other multimedia.

Can I have a video with transparent background using HTML5 video tag?

We filmed a spokesperson on a green screen and have the video files ready in multiple formats. With Flash we could use the wmode transparent within the param and embed tags, but is there something s..

How to play .mp4 video in videoview in android?

I am working on video player application, I want to play .mp4 video in native videoview. I am not able to play video using url. I am getting error Sorry this video cannot be played and also I am not a..

How do I embed a mp4 movie into my html?

I have a blog section on my site that has the TinyMce editor. I want to embed a video when I post a blog and it's just spitting out the code. I have added the <embed> tag on my output script. ..

Bootstrap 3 - Responsive mp4-video

I tried to find a good solution on the bootstrap site but I didn't get an answer to this yet. I think I can't be the only one struggling with this, but I couldn't find anything that helped me. I'm tr..

How to concatenate two MP4 files using FFmpeg?

I'm trying to concatenate two mp4 files using ffmpeg. I need this to be an automatic process hence why I chose ffmpeg. I'm converting the two files into .ts files and then concatenating them and the..

Playing MP4 files in Firefox using HTML5 video

I have searched around quite a bit but have not solved my problem. I have a video tag running as follows: <video class="ne" src="{{ page | video_url }}" muted="true" volume="0" c..

Use ffmpeg to add text subtitles

I am trying to add text subtitles to an .mp4 container using ffmpeg: ffmpeg -i input.mp4 -i input.srt -map 0.0 -map 0.1 -map 1.0 output.mp4 When I am trying to run this line, it gives me an error :..

Eclipse cannot load SWT libraries

Every time I try to open Eclipse in Ubuntu 12.04 I get an Unsatisfied Link Error and it will not open. I have recently installed the java JDK and Android SDK, could this be the problem? I followed thi..

Xcode Objective-C | iOS: delay function / NSTimer help?

So I'm developing my first iOS application and I need help.. Simple program for now, I have about 9 buttons and when I press the first button, or any button, I just want the first button to highlight..

FFmpeg on Android

I have got FFmpeg compiled (libffmpeg.so) on Android. Now I have to build either an application like RockPlayer or use existing Android multimedia framework to invoke FFmpeg. Do you have steps / pro..

How do I catch a PHP fatal (`E_ERROR`) error?

I can use set_error_handler() to catch most PHP errors, but it doesn't work for fatal (E_ERROR) errors, such as calling a function that doesn't exist. Is there another way to catch these errors? I am..

How to get value by class name in JavaScript or jquery?

i wan to retrive all the value of this code using class name ..is it possible in jquery . i want to retrive only the text within a div or number of div may be change the next form <span class="..

MAX function in where clause mysql

How can I use max() function in where clause of a mysql query, I am trying: select firstName,Lastname,MAX(id) as max where id=max; this is giving me an error: Unknown column 'max' in 'where claus..

<select> HTML element with height

Does anyone know of a way to style an HTML select element so that it has a certain height and looks good across browsers? I've tried simply setting height in CSS but the text inside the box is vertic..

Stop and Start a service via batch or cmd file?

How can I script a bat or cmd to stop and start a service reliably with error checking (or let me know that it wasn't successful for whatever reason)?..

Echoing the last command run in Bash?

I am trying to echo the last command run inside a bash script. I found a way to do it with some history,tail,head,sed which works fine when commands represent a specific line in my script from a parse..

ASP.NET MVC Html.DropDownList SelectedValue

I have tried this is RC1 and then upgraded to RC2 which did not resolve the issue. // in my controller ViewData["UserId"] = new SelectList( users, "UserId", "DisplayName", selected..

Add text to textarea - Jquery

How can I add text from a DIV to a textarea? I have this now: $('.oquote').click(function() { $('#replyBox').slideDown('slow', function() { var quote = $('.container').text(); ..

Using File.listFiles with FileNameExtensionFilter

I would like to get a list of files with a specific extension in a directory. In the API (Java 6), I see a method File.listFiles(FileFilter) which would do this. Since I need a specific extension, I ..

How to find text in a column and saving the row number where it is first found - Excel VBA

I have the following column (column A) named project (rows column is just displaying the row number): rows project 1 14 2 15 3 16 4 17 5 18 6 19 7 ProjTem..

Count the items from a IEnumerable<T> without iterating?

private IEnumerable<string> Tables { get { yield return "Foo"; yield return "Bar"; } } Let's say I want iterate on those and write something like processing #n of #..

Unable to locate tools.jar

Possible Duplicate: Unable to locate tools.jar I'm trying to use ant to compile using this command : ant compile I don't know if the problem comes from my windows 64bit, or by something..

Installing TensorFlow on Windows (Python 3.6.x)

I'm trying to install TensorFlow on Windows. I tried to install it with pip, but I always get the same error message: ... is not a supported wheel on this platform. I first tried it with Python 3...

Concatenate String in String Objective-c

I want to place a string within a string. Basically in pseudo code: "first part of string" + "(varying string)" + "third part of string" How can I do this in objective-c? Is there a way to easily c..

XCOPY switch to create specified directory if it doesn't exist?

I am using XCOPY in a post-build event to copy compiled DLLs from their output folders to the main app's output folder. The DLLs are being copied to a "Modules" subfolder in the main app output folder..

Get clicked element using jQuery on event?

I'm using the following code to detect when a dynamically generated button is clicked. $(document).on("click",".appDetails", function () { alert("test"); }); Normally, if you just did $('.appDe..

SQL "IF", "BEGIN", "END", "END IF"?

Not a SQL person at all. Have the following code a consultant wrote. First, it makes sure only an elementary school has been chosen - then, after the BEGIN, if the variable @Term equals a 3 we wa..

Proper way to catch exception from JSON.parse

I’m using JSON.parse on a response that sometimes contains a 404 response. In the cases where it returns 404, is there a way to catch an exception and then execute some other code? data = JSON.pars..

enable/disable zoom in Android WebView

There are some methods in WebSettings related to zoom: WebSettings.setSupportZoom WebSettings.setBuiltInZoomControls I noticed they work differently on some devices. For example, on my Galaxy S pi..

Generating a PNG with matplotlib when DISPLAY is undefined

I am trying to use networkx with Python. When I run this program it get this error. Is there anything missing? #!/usr/bin/env python import networkx as nx import matplotlib import matplotlib.pyplot ..

XPath to select Element by attribute value

I have following XML. <?xml version="1.0" encoding="UTF-8"?> <Employees> <Employee id="3"> <age>40</age> <name>Tom</name> <gen..

React img tag issue with url and class

I have the following simple react code in my JSX file: /** @jsx React.DOM */ var Hello = React.createClass({ render: function() { return <div><img src='http://placehold.it/400x2..

Reading JSON POST using PHP

I looked around a lot before posting this question so my apologies if it is on another post and this is only my second quesiton on here so apologies if I don't format this question correctly. I have ..

jQuery select by attribute using AND and OR operators

I'm thinking about, if it is possible in jQuery to select elements by named attributes using AND and OR. Example: <div myid="1" myc="blue">1</div> <div myid="2" myc="blue">2</di..

htmlentities() vs. htmlspecialchars()

What are the differences between htmlspecialchars() and htmlentities(). When should I use one or the other?..

Making view resize to its parent when added with addSubview

I'm having a problem when using addSubview. Example code: ParentView *myParentView = [[ParentView alloc] initWithNibName:@"ParentView " bundle:nil]; ChildeView *myChildeView = [[ChildeView alloc] in..

How to set Apache Spark Executor memory

How can I increase the memory available for Apache spark executor nodes? I have a 2 GB file that is suitable to loading in to Apache Spark. I am running apache spark for the moment on 1 machine, so t..

Nginx serves .php files as downloads, instead of executing them

I am installing a website in a droplet (Digital Ocean). I have a issue for install NGINX with PHP properly. I did a tutorial https://www.digitalocean.com/community/tutorials/how-to-install-linux-nginx..

Trying to include a library, but keep getting 'undefined reference to' messages

I am attempting to use the libtommath library. I'm using the NetBeans IDE for my project on Ubuntu linux. I have downloaded and built the library, I have done a 'make install' to put the resulting .a ..

Any difference between await Promise.all() and multiple await?

Is there any difference between: const [result1, result2] = await Promise.all([task1(), task2()]); and const t1 = task1(); const t2 = task2(); const result1 = await t1; const result2 = await t2; ..

Change color when hover a font awesome icon?

Base in the Font Awesome documentation I create this icon: <span class="fa-stack fa-5x"> <i class="fa fa-circle fa-stack-2x"></i> <i class="fa fa-flag fa-stack-1x fa-inverse"..

What is a faster alternative to Python's http.server (or SimpleHTTPServer)?

Python's http.server (or SimpleHTTPServer for Python 2) is a great way of serve the contents of the current directory from the command line: python -m http.server However, as far as web servers go, i..

Checking whether a String contains a number value in Java

How can I write a method to find whether a given string contains a number? The method should return true if the string contains a number and false otherwise...

Eclipse error "ADB server didn't ACK, failed to start daemon"

After updating the SDK, Eclipse shows this error: ADB server didn't ACK, failed to start daemon. When I run an Android application, it gives me the following: Please ensure that adb is corre..

Javascript one line If...else...else if statement

I know you can set variables with one line if/else statements by doing var variable = (condition) ? (true block) : (else block), but I was wondering if there was a way to put an else if statement in t..

Enter export password to generate a P12 certificate

I would like to generate a P12 certificate from a .key and .pem. I'm running this command and get prompted to enter a export password: pkcs12 -export -inkey private-key.key -in developer_identity.pem ..

Possible to change where Android Virtual Devices are saved?

I've set up the Android SDK and Eclipse on my machine running Windows XP and AVDs (Android Virtual Devices) are saved to "Documents and Settings\user\.android" by default. Is there any way to change ..

function to remove duplicate characters in a string

The following code is trying to remove any duplicate characters in a string. I'm not sure if the code is right. Can anybody help me work with the code (i.e whats actually happening when there is a mat..

How to find which version of TensorFlow is installed in my system?

I need to find which version of TensorFlow I have installed. I'm using Ubuntu 16.04 Long Term Support. ..

Show/hide 'div' using JavaScript

For a website I'm doing, I want to load one div, and hide another, then have two buttons that will toggle views between the div using JavaScript. This is my current code _x000D_ _x000D_ function rep..

Python foreach equivalent

I am diving into Python and I have a question about foreach iteration. I am new to Python and I have some experience in C#. So I am wondering, if there is some equivalent function in Python for iterat..

How to disable button in React.js

I have this component: import React from 'react'; export default class AddItem extends React.Component { add() { this.props.onButtonClick(this.input.value); this.input.value = ''; } rende..

Convert UTF-8 to base64 string

I'm trying to convert UTF-8 to base64 string. Example: I have "abcdef==" in UTF-8. It's in fact a "representation" of a base64 string. How can I retrieve a "abcdef==" base64 string (note that I don..

Remove all items from RecyclerView

I am trying to remove all the elements from my RecyclerView in my onRestart method so the items don't get loaded twice: @Override protected void onRestart() { super.onRestart(); // first cle..

SQL Server PRINT SELECT (Print a select query result)?

I am trying to print a selected value, is this possible? Example: PRINT SELECT SUM(Amount) FROM Expense ..

How to recover Git objects damaged by hard disk failure?

I have had a hard disk failure which resulted in some files of a Git repository getting damaged. When running git fsck --full I get the following output: error: .git/objects/pack/pack-6863e0a0e4b4ded..

Printing with sed or awk a line following a matching pattern

Question: I'd like to print a single line directly following a line that contains a matching pattern. My version of sed will not take the following syntax (it bombs out on +1p) which would seem like a..

jquery: how to get the value of id attribute?

Basic jquery question. I have an option element as below. <option class='select_continent' value='7'>Antarctica</option> jquery $(".select_continent").click(function () { alert(th..

Run automatically program on startup under linux ubuntu

I'd need a program to be run every time I startup my ubuntu linux. So I'd need to add it to my startup programs list. Just one problem: I'd need to do it via terminal...

Adding div element to body or document in JavaScript

I am creating a light box in pure JavaScript. For that I am making an overlay. I want to add this overlay to body but I also want to keep the content on the page. My current code adds the overlay div ..

Use superscripts in R axis labels

Using base graphics in R, how can I add superscripts to axis labels, as one might want to when plotting latitude and longitude axes on a map. Consider this example: plot(-100:-50, 50:100, type="n", ..

How to insert an item at the beginning of an array in PHP?

I know how to insert it to the end by: $arr[] = $item; But how to insert it to the beginning?..

Calling multiple JavaScript functions on a button click

How to call multiple functions on button click event? Here is my button, <asp:LinkButton ID="LbSearch" runat="server" CssClass="regular" onclick="LbSearch_Click" OnClientClick..

Calculate the number of business days between two dates?

In C#, how can I calculate the number of business (or weekdays) days between two dates?..

Linking a qtDesigner .ui file to python/pyqt?

So if I go into QtDesigner and build a UI, it'll be saved as a .ui file. How can I make this as a python file or use this in python?..

Rank function in MySQL

I need to find out rank of customers. Here I am adding the corresponding ANSI standard SQL query for my requirement. Please help me to convert it to MySQL . SELECT RANK() OVER (PARTITION BY Gender OR..

"Could not run curl-config: [Errno 2] No such file or directory" when installing pycurl

I'm trying to install pycurl via: sudo pip install pycurl It downloaded fine, but when when it runs setup.py I get the following traceback: Downloading/unpacking pycurl Running setup.py egg_info..

Is there a "not equal" operator in Python?

How would you say does not equal? Like if hi == hi: print "hi" elif hi (does not equal) bye: print "no hi" Is there something equivalent to == that means "not equal"?..

Why doesn't TFS get latest get the latest?

Why Why WHY doesn't TFS's get latest work consistently? You would have thought that feature would have been tested thoroughly. What I have to do is, get specific version, then check both overwrite w..

In PHP with PDO, how to check the final SQL parametrized query?

In PHP, when accessing MySQL database with PDO with parametrized query, how can you check the final query (after having replaced all tokens)? Is there a way to check what gets really executed by the ..

Converting Numpy Array to OpenCV Array

I'm trying to convert a 2D Numpy array, representing a black-and-white image, into a 3-channel OpenCV array (i.e. an RGB image). Based on code samples and the docs I'm attempting to do this via Pytho..

Extract XML Value in bash script

I'm trying to extract a value from an xml document that has been read into my script as a variable. The original variable, $data, is: <item> <title>15:54:57 - George:</title> &..

What is the difference between varchar and nvarchar?

Is it just that nvarchar supports multibyte characters? If that is the case, is there really any point, other than storage concerns, to using varchars?..

ORA-30926: unable to get a stable set of rows in the source tables

I am getting ORA-30926: unable to get a stable set of rows in the source tables in the following query: MERGE INTO table_1 a USING (SELECT a.ROWID row_id, 'Y' FROM..

How to get the current time in Python

What is the module/method used to get the current time?..

How to empty a list?

It seems so "dirty" emptying a list in this way: while len(alist) > 0 : alist.pop() Does a clear way exist to do that?..

How do I prevent DIV tag starting a new line?

I want to output a single line of text to the browser that contains a tag. When this is rendered it appears that the DIV causes a new line. How can I include the content in the div tag on the same li..

how to implement a pop up dialog box in iOS

After a calculation, I want to display a pop up or alert box conveying a message to the user. Does anyone know where I can find more information about this?..

When to use RSpec let()?

I tend to use before blocks to set instance variables. I then use those variables across my examples. I recently came upon let(). According to RSpec docs, it is used to ... to define a memoized h..

SQL Current month/ year question

So I have a table that has the month and year broken down, for example field called Month has the number 7 in it (this month) and the Year field has 2011. Theres also additional months years, etc. How..

Scikit-learn train_test_split with indices

How do I get the original indices of the data when using train_test_split()? What I have is the following from sklearn.cross_validation import train_test_split import numpy as np data = np.reshape(n..

ASP.NET Web API session or something?

I need to store some information in session(or in whatever in ASP.NET Web API) that I need to retrieve in every API request. We will have one api IIS web site and multiple web site binding will be ad..

Create a file if it doesn't exist

I'm trying to open a file, and if the file doesn't exist, I need to create it and open it for writing. I have this so far: #open file for reading fn = input("Enter file to open: ") fh = open(fn,'r') ..

How to get a variable from a file to another file in Node.js

Here is my first file: var self = this; var config = { 'confvar': 'configval' }; I want this configuration variable in another file, so I have done this in another file: conf = require('./conf');..

How do I force files to open in the browser instead of downloading (PDF)?

Is there a way to force PDF files to open in the browser when the option "Display PDF in browser" is unchecked? I tried using the embed tag and an iframe, but it only works when that option is checke..

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 can I clear the input text after clicking

Using jQuery, how can I clear the input text after I made a click? By default, the value remains in the input field. For example, I have an input text and the value is TEXT. When I perform a click, I..

Eclipse Intellisense?

How do I tell Eclipse to automatically make suggestions as I type? I'm looking for a Visual Studio Intellisense-like feature with Resharper. Currently I have to press CTRL+Space each time...

Node.js check if path is file or directory

I can't seem to get any search results that explain how to do this. All I want to do is be able to know if a given path is a file or a directory (folder)...

what is the use of fflush(stdin) in c programming

I have the following program #include <stdio.h> #include <stdlib.h> int main() { char ans[8]; int i; for(i=1;i<=3;i++) { printf("\n What is the unit of traffic ..

Setting onClickListener for the Drawable right of an EditText

In my app I have a EditText with a search Icon on the right side. I used the code given below. <EditText android:id="@+id/search" android:layout_width="0dp" android:layout..

How do I specify "not equals to" when comparing strings in an XSLT <xsl:if>?

Currently i have a xsl with following code where I'm trying print out "count" only if it is not equal to N/A. but seems like "!=" is not working. <xsl:for-each select="Directory/Match"> &l..

How to check whether mod_rewrite is enable on server?

Currently I am using the hosting with lightspeed server. Hosting says mod_rewrite is enabled but I can't get my script working there. Whenever I try to access the URL, it returns 404 - not found page...

Iterate a certain number of times without storing the iteration number anywhere

I was wondering if it is possible to perform a certain number of operations without storing the loop iteration number anywhere. For instance, let's say I want to print two "hello" messages to the con..

Is it possible to find out the users who have checked out my project on GitHub?

I'm wondering if there is any way to know who has checked out my project hosted on GitHub? This would include people who have forked the project directly on GitHub, as well as people who may have clon..

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

How can I detect if a selector returns null?

What is the best way to detect if a jQuery-selector returns an empty object. If you do: alert($('#notAnElement')); you get [object Object], so the way I do it now is: alert($('#notAnElement').get(..

How to make a transparent HTML button?

I am using dreamweaver to create a website and I thought of just using Photoshop to create backgrounds. I decided to do so only because in case I'd choose to change the button name easily by just edit..

In Perl, how can I read an entire file into a string?

I'm trying to open an .html file as one big long string. This is what I've got: open(FILE, 'index.html') or die "Can't read file 'filename' [$!]\n"; $document = <FILE>; close (FILE); prin..

How to write a PHP ternary operator

How do I write a PHP ternary operator with the elseif portion? I see basic examples with the if and else portions of the PHP ternary operator like this: echo (true) ? "yes" : "no"; //prints yes ..

How can I use "." as the delimiter with String.split() in java

What I am trying to do is read a .java file, and pick out all of the identifiers and store them in a list. My problem is with the .split() method. If you run this code the way it is, you will get Ar..

Create a global variable in TypeScript

In JavaScript I can just do this: something = 'testing'; And then in another file: if (something === 'testing') and it will have something be defined (as long as they were called in the correc..

Google Maps: how to get country, state/province/region, city given a lat/long value?

I need a list of countries, states & cities based on a collection of lat/long values I have. I need to store this information in a manner that hierarchy is preserve and without duplicates (e.g. "U..

Using css transform property in jQuery

How can you specify cross-browser transform controls using jQuery since each browser seems to use its own methodology? Here is the code I am using for Firefox but I can't even get it to work. I think..

Access Control Request Headers, is added to header in AJAX request with jQuery

I would like to add a custom header to an AJAX POST request from jQuery. I have tried this: $.ajax({ type: 'POST', url: url, headers: { "My-First-Header":"first value", ..

How to add a vertical Separator?

I want to add a vertical Separator to a Grid, but i can only find the horizontal. Isn't there a Property, where you can enter if the line of the separator should be horizontal or vertical? I searched..

AngularJS $resource RESTful example

I would like to use $resource to call my RESTful web service, (which I am still working on) but I would like to find out if I got my AngularJS script correct first. The todo DTO has: {id, order, cont..

Is `shouldOverrideUrlLoading` really deprecated? What can I use instead?

Is "shouldOverrideUrlLoading" really deprecated? If so, what can I use instead? It seems like shouldOverrideUrlLoading is deprecated targeting Android N and I need to make an app work since API 19 un..

How to "pretty" format JSON output in Ruby on Rails

I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted. Right now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a proble..

In Visual Studio C++, what are the memory allocation representations?

In Visual Studio, we've all had "baadf00d", have seen seen "CC" and "CD" when inspecting variables in the debugger in C++ during run-time. From what I understand, "CC" is in DEBUG mode only to indica..

.NET Console Application Exit Event

In .NET, is there a method, such as an event, for detecting when a Console Application is exiting? I need to clean up some threads and COM objects. I am running a message loop, without a form, from t..

What's the difference between "super()" and "super(props)" in React when using es6 classes?

When is it important to pass props to super(), and why? class MyComponent extends React.Component { constructor(props) { super(); // or super(props) ? } } ..

git with IntelliJ IDEA: Could not read from remote repository

Since a few weeks, I'm not able to pull or push from or to the remote repository. I thought it happend when upgrading to IntelliJ IDEA 14, but I can reproduce the problem with IDEA 13.1.5 as well. Th..

How to write ternary operator condition in jQuery?

In this fiddle http://jsfiddle.net/mjmitche/6nar4/3/, if you drag, for example, the little blue box into the yellow box, then the big black box will turn pink. All of the 4 boxes along the left can be..

JavaScript: Passing parameters to a callback function

I'm trying to pass some parameter to a function used as callback, how can I do that? function tryMe (param1, param2) { alert (param1 + " and " + param2); } function callbackTester (callback, par..

"The system cannot find the file specified" when running C++ program

I installed Visual Studio 2010. I wrote a simple code which I'm sure is correct but unfortunately, when I run the code, I get the error below. Here is my code: #include<iostream> using namespa..

How to create custom button in Android using XML Styles

I want to make this kind of button [same background & text] colors by using XML Styles that's just for an example, i want to write some other texts, like: About Me Still i am using button crea..

Find all packages installed with easy_install/pip?

Is there a way to find all Python PyPI packages that were installed with easy_install or pip? I mean, excluding everything that was/is installed with the distributions tools (in this case apt-get on ..

Sort dataGridView columns in C# ? (Windows Form)

I have a datagridview that i bind from an sql table, in that dv i have those attributes: Id, Name and Price. When i set the SortMode of the Name Columns to Automatic and i click on the header of this ..

Simple state machine example in C#?

Update: Again thanks for the examples, they have been very helpful and with the following, I don't mean to take anything away from them. Aren't the currently given examples, as far as I understand the..

How to concatenate two layers in keras?

I have an example of a neural network with two layers. The first layer takes two arguments and has one output. The second should take one argument as result of the first layer and one additional argum..

Call Class Method From Another Class

In Python, is there a way to call a class method from another class? I am attempting to spin my own MVC framework in Python and I can not figure out how to invoke a method from one class in another cl..

Return index of highest value in an array

From an array that looks something like the following, how can I get the index of the highest value in the array. For the array below, the desired result would be '11'. Array ( [11] => 14 ..

Conversion failed when converting the nvarchar value ... to data type int

I created the procedure listed below: CREATE procedure getdata ( @ID int, @frm varchar(250), @to varchar(250) ) AS BEGIN DECLARE @SQL nvarchar(500) set @SQL = 'select' set @SQL = @SQL ..

ggplot geom_text font size control

I tried to change the font to 10 for the labels of my bar plot in ggplot2 by doing something like this: ggplot(data=file,aes(x=V1,y=V3,fill=V2)) + geom_bar(stat="identity",position="dodge",colour..

How to get Latitude and Longitude of the mobile device in android?

How do I get the current Latitude and Longitude of the mobile device in android using location tools?..

SSH to Vagrant box in Windows?

I'm using Vagrant to start a VirtualBox VM in windows. In other platforms, I can just $ vagrant ssh to connect to the VM. How do i connect to this Vagrant box in windows? The way suggested in Vag..

No visible cause for "Unexpected token ILLEGAL"

I'm getting this JavaScript error on my console: Uncaught SyntaxError: Unexpected token ILLEGAL This is my code: _x000D_ _x000D_ var foo = 'bar';?_x000D_ _x000D_ _x000D_ It's super simple, as..

Load HTML page dynamically into div with jQuery

I'm trying to make it so when I click on a link in a HTML page, it dynamically loads the requested page into a div with jQuery. How can I do that? <html> <head> <script type="text/jav..

How to split a string by spaces in a Windows batch file?

Suppose I have a string "AAA BBB CCC DDD EEE FFF". How can I split the string and retrieve the nth substring, in a batch file? The equivalent in C# would be "AAA BBB CCC DDD EEE FFF".Split()[n] ..

Playing HTML5 video on fullscreen in android webview

Well, I've been searching few days already, how to display HTML5 video in full-screen mode on android WebView. I managed to play HTML5 videos on my webview. Problems are arising when displaying video..

What is the maximum number of characters that nvarchar(MAX) will hold?

I'm new to the concept nvarchar(MAX). How many characters will it hold?..

From milliseconds to hour, minutes, seconds and milliseconds

I need to go from milliseconds to a tuple of (hour, minutes, seconds, milliseconds) representing the same amount of time. E.g.: 10799999ms = 2h 59m 59s 999ms The following pseudo-code is the only th..

When should I create a destructor?

For example: public class Person { public Person() { } ~Person() { } } When should I manually create a destructor? When have you needed to create a destructor? ..

Angular 2: import external js file into component

I'm going to import this d3gauge.js file into one of my angular2 component, memmon.component.ts file. import '../../../../js/d3gauge.js'; export class MemMonComponent { createMemGauge() { ..

SQLAlchemy default DateTime

This is my declarative model: import datetime from sqlalchemy import Column, Integer, DateTime from sqlalchemy.ext.declarative import declarative_base Base = declarative_base() class Test(Base): ..

The executable was signed with invalid entitlements

I am having a problem with ad-hoc distribution on my iPhone. I have developed an application with SDK 3.0. I have a developer's license. I have added certificates and provisioning profiles in my proje..

How do you add an image?

Situation: I have a simple XML document that contains image information. I need to transform it into HTML. However, I can't see where the open tag is and when I use the XSL code below, it shows the f..

Download single files from GitHub

I guess most of you, developers, use any VCS, and I hope some of you use Git. Do you have any tip or trick how to get a download URL for a single file in a repository? I don't want the URL for displa..

How do I to insert data into an SQL table using C# as well as implement an upload function?

Below is the code I am working with to try to insert data into my 'ArticlesTBL' table. I also want to upload an image file to my computer. I am getting an error reading: Incorrect syntax near 'Uploa..

Converting XML to JSON using Python?

I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results..

parsing a tab-separated file in Python

I'm trying to parse a tab-separated file in Python where a number placed k tabs apart from the beginning of a row, should be placed into the k-th array. Is there a built-in function to do this, or ..

How to add a where clause in a MySQL Insert statement?

This doesn't work: INSERT INTO users (username, password) VALUES ("Jack","123") WHERE id='1'; Any ideas how to narrow insertion to a particular row by id?..

Singleton in Android

I have followed this link and successfully made singleton class in Android. http://www.devahead.com/blog/2011/06/extending-the-android-application-class-and-dealing-with-singleton/ Problem is that i ..

Best way to overlay an ESRI shapefile on google maps?

What is the best way to overlay a shapefile in Google Maps? After some reading suggests that, converting shapefile into KML and overlaying KML in Google map is an option. If that is the case, how do..

RecyclerView vs. ListView

From android developer (Creating Lists and Cards): The RecyclerView widget is a more advanced and flexible version of ListView. Okay, it sounds cool, but when I saw this example picture, I got..

How to run 'sudo' command in windows

How would I run the following command in windows: $ sudo django-admin.py startproject NEW ?..

How do I abort/cancel TPL Tasks?

In a thread, I create some System.Threading.Task and start each task. When I do a .Abort() to kill the thread, the tasks are not aborted. How can I transmit the .Abort() to my tasks ?..

Is there an API to get bank transaction and bank balance?

I'm using CHASE bank. (Also Bank of America) and I want to get my bank transactions and my balance if I can. Is there an API for that? in PHP or JAVA? If so, please let me know how to get them...

Web scraping with Python

I'd like to grab daily sunrise/sunset times from a web site. Is it possible to scrape web content with Python? what are the modules used? Is there any tutorial available?..

java: use StringBuilder to insert at the beginning

I could only do this with String, for example: String str=""; for(int i=0;i<100;i++){ str=i+str; } Is there a way to achieve this with StringBuilder? Thanks...

How to convert TimeStamp to Date in Java?

How do I convert 'timeStamp' to date after I get the count in java? My current code is as follows: public class GetCurrentDateTime { public int data() { int count = 0; java.sql...

SPAN vs DIV (inline-block)

Is there any reason to use a <div style="display:inline-block"> instead of a <span> to layout a webpage? Can I put content nested inside the span? What is valid and what isn't? It's ok t..

How do I print bold text in Python?

How do I print bold text in Python? For example: print "hello" What should I do so that the text “hello” is displayed in bold?..

Efficiently getting all divisors of a given number

According to this post, we can get all divisors of a number through the following codes. for (int i = 1; i <= num; ++i){ if (num % i == 0) cout << i << endl; } For exampl..

Change the background color of a pop-up dialog

I wrote android code that shows a pop-up dialog but I want to change the background color from black to white , and then the color of the writing. This is the dialog's code: mPrefs = PreferenceMana..

selenium - chromedriver executable needs to be in PATH

Error message: 'chromedriver' executable needs to be in PATH I was trying to code a script using selenium in pycharm, however the error above occured. I have already linked my selenium to pycha..

How to set the max value and min value of <input> in html5 by javascript or jquery?

I am trying to find out how to set the max value and min value of html5 type input by javascript or jquery. <input type="number" max="???" min="???" step="0.5"/> Would someone please guide..

Converting binary to decimal integer output

I need to convert a binary input into a decimal integer. I know how to go from a decimal to a binary: n = int(raw_input('enter a number: ')) print '{0:b}'.format(n) I need to go in the reverse dire..

How to make a DIV visible and invisible with JavaScript

Can you do something like function showDiv() { [DIV].visible = true; //or something } ..

Writing to output window of Visual Studio

I am trying to write a message to the output window for debugging purposes. I searched for a function like Java's system.out.println(""). I tried Debug.Write, Console.Write, and Trace.Write. It does n..

SQLite DateTime comparison

I can't seem to get reliable results from the query against a sqlite database using a datetime string as a comparison as so: select * from table_1 where mydate >= '1/1/2009' and mydate <= ..

Find unused code

I have to refactor a large C# application, and I found a lot of functions that are never used. How can I check for unused code, so I can remove all the unused functions?..

How to make jQuery UI nav menu horizontal?

I love the jQuery UI stuff! I like the navigation menu, but I can't seem to get it horizontal. I've got to be missing something that's a cinch. Anyone know how to change the CSS? I tried this but it..

How do I sort a two-dimensional (rectangular) array in C#?

I have a two-dimensional array (of Strings) which make up my data table (of rows and columns). I want to sort this array by any column. I tried to find an algorithm for doing this in C#, but have no..

Android Studio: Default project directory

Whenever I create a new project in Android Studio it wants to put it in a generic default folder at a location something similar to (dependent on OS - Ubuntu here): /home/USER/AndroidStudioProjects/ ..

How do I set the value property in AngularJS' ng-options?

Here is what seems to be bothering a lot of people (including me). When using the ng-options directive in AngularJS to fill in the options for a <select> tag, I cannot figure out how to set the..

Simple PHP Pagination script

I have rows of data coming from database, I would like to have a table with a simple pagination, what is the easiest way of doing it? I'd be glad if anyone could provide...

RSA: Get exponent and modulus given a public key

I need to encrypt some data using RSA in JavaScript. All of the libraries around ask for an exponent and a modulus, yet I get a single public.key file from my opponent. How do you retrieve the publi..

Hibernate Group by Criteria Object

I would like to implement the following SQL query with Hibernate Criteria: SELECT column_name, aggregate_function(column_name) FROM table_name WHERE column_name <operator> value GROUP BY column..

Options for embedding Chromium instead of IE WebBrowser control with WPF/C#

Updated for 2020, I've linked my article where I compare the memory footprints of different approaches to hosting HTML WebView in a basic Windows Desktop application: MSEdge WebView2 WPF Chromely/Cef..

What does mysql error 1025 (HY000): Error on rename of './foo' (errorno: 150) mean?

I tried this in mysql: mysql> alter table region drop column country_id; And got this: ERROR 1025 (HY000): Error on rename of './product/#sql-14ae_81' to './product/region' (errno: 150) Any i..

Adding an image to a PDF using iTextSharp and scale it properly

here's my code. It correctly adds the pictures I want and everything works except that the images are using their native resolution, so if the image is big it's being cropped to fit the page. Is ther..

Most efficient way to check for DBNull and then assign to a variable?

This question comes up occasionally, but I haven't seen a satisfactory answer. A typical pattern is (row is a DataRow): if (row["value"] != DBNull.Value) { someObject.Member = row["value"]; ..

Warning about SSL connection when connecting to MySQL database

With the two classes below, I've tried connect to a MySQL database. However, I always get this error: Wed Dec 09 22:46:52 CET 2015 WARN: Establishing SSL connection without server's identity verific..

How to execute multiple commands in a single line

I know Unix has the following command which can execute multiple commands in a single line, how can I do this in DOS? command1 ; command2 ; command3 ... ..

Child element click event trigger the parent click event

Say you have some code like this: <html> <head> </head> <body> <div id="parentDiv" onclick="alert('parentDiv');"> <div id="childDiv" onclick="alert('childDi..

std::unique_lock<std::mutex> or std::lock_guard<std::mutex>?

I have two use cases. A. I want to synchronise access to a queue for two threads. B. I want to synchronise access to a queue for two threads and use a condition variable because one of the threads wil..

vi/vim editor, copy a block (not usual action)

In vi/vim editor, I need to copy a block. There are many ways, but one way is very quick. label the first line by some way, then label the end line by some way, then put some command to copy the lab..

How do I grep for all non-ASCII characters?

I have several very large XML files and I'm trying to find the lines that contain non-ASCII characters. I've tried the following: grep -e "[\x{00FF}-\x{FFFF}]" file.xml But this returns every line ..

ImportError: No Module Named bs4 (BeautifulSoup)

I'm working in Python and using Flask. When I run my main Python file on my computer, it works perfectly, but when I activate venv and run the Flask Python file in the terminal, it says that my main P..

Python pip install fails: invalid command egg_info

I find that recently often when I try to install a Python package using pip, I get the error(s) below. I found a reference online that one has to use "python2 setup.py install" from the download dire..

Visual Studio: How to show Overloads in IntelliSense?

Once code has been written, the only way I know of to view the overloads for a method is to actually edit the method by deleting the Parenthesis () and reopening them. Is there a shortcut key that I ..

mongo - couldn't connect to server 127.0.0.1:27017

I am coming from riak and redis where I never had an issue with this services starting, or to interact. This is a pervasive problem with mongo and am rather clueless. Restarting does not help.I am n..

How to remove constraints from my MySQL table?

I want to remove constraints from my table. My query is: ALTER TABLE `tbl_magazine_issue` DROP CONSTRAINT `FK_tbl_magazine_issue_mst_users` But I got an error: #1064 - You have an error in you..

SQL Error: ORA-00942 table or view does not exist

I use SQL developer and i made a connection to my database with the system user, after I created a user and made a another connection with that user with all needed privileges. But when I try to proc..

jQuery selectors on custom data attributes using HTML5

I would like to know what selectors are available for these data attributes that come with HTML5. Taking this piece of HTML as an example: <ul data-group="Companies"> <li data-company="Mi..

Why does instanceof return false for some literals?

"foo" instanceof String //=> false "foo" instanceof Object //=> false true instanceof Boolean //=> false true instanceof Object //=> false false instanceof Boolean //=..

How do I center text vertically and horizontally in Flutter?

I'd like to know how to center the contents of a Text widget vertically and horizontally in Flutter. I only know how to center the widget itself using Center(child: Text("test")) but not the..

What is meaning of negative dbm in signal strength?

When we try to get nearby cells and their LAC, MNC, signal (and while using other android apps) we are getting signal as negative value (like -85dbm). How should I take this? Should I ignore -ve sign..

How do I encode URI parameter values?

I want to send a URI as the value of a query/matrix parameter. Before I can append it to an existing URI, I need to encode it according to RFC 2396. For example, given the input: http://google.com/re..

How to take the first N items from a generator or list?

With linq I would var top5 = array.Take(5); How to do this with Python?..

ActiveSheet.UsedRange.Columns.Count - 8 what does it mean?

what does ActiveSheet.UsedRange.Columns.Count - 8 mean in vba? How does vba know the usedRange?..

Angular expression if array contains

I'm trying to add a class to an element if a jobSet has not been selected for approval using expressions. <li class="approvalUnit" ng-repeat="jobSet in dashboard.currentWork" ng-class="{-1:'approv..

Making a button invisible by clicking another button in HTML

How can I make a button invisible by clicking another button in HTML? I have written like below, but it doesn't work. <input type="button" onclick="demoShow();" value="edit" /> <script type=..

How to change progress bar's progress color in Android

I'm using an horizontal progress bar in my Android application, and I want to change its progress color (which is Yellow by default). How can I do it using code (not XML)?..

Creating the checkbox dynamically using JavaScript?

I am trying to create a checkbox dynamically using following HTML/JavaScript. Any ideas why it doesn't work? <div id="cb"></div> <script type="text/javascript"> var cbh = docume..

Error: unable to verify the first certificate in nodejs

I'm trying to download a file from jira server using an url but I'm getting an error. how to include certificate in the code to verify Error: Error: unable to verify the first certificate in nodejs ..

click() event is calling twice in jquery

I setup a link element and called its click event in jquery but the click event is calling twice, please see below the code of jquery. $("#link_button") .button() .click(function () { $("#attachme..

How to reference a method in javadoc?

How can I use the @link tag to link to a method? I want to change: /** * Returns the Baz object owned by the Bar object owned by Foo owned by this. * A convenience method, equivalent to getFoo().g..

Updates were rejected because the tip of your current branch is behind its remote counterpart

Our workflow is such. We have a branch called dev which I can reach at origin/dev. When we do changes, we create a branch off dev: git checkout -b FixForBug origin/dev Now I have a branch called F..

How to convert char to integer in C?

Possible Duplicates: How to convert a single char into an int Character to integer in C Can any body tell me how to convert a char to int? char c[]={'1',':','3'}; int i=int(c[0]); printf("..

int value under 10 convert to string two digit number

string strI; for (int i = 1; i < 100; i++) strI = i.ToString(); in here, if i = 1 then ToString yields "1" But I want to get "01" or "001" It looks quite easy, but there's only articl..

Spaces cause split in path with PowerShell

I'm having an issue with powershell when invoking an exe at a path containing spaces. PS C:\Windows Services> invoke-expression "C:\Windows Services\MyService.exe" The term 'C:\Windows' is not..

Convert generic list to dataset in C#

I have a Generic list of Objects. Each object has 9 string properties. I want to turn that list into a dataset that i can pass to a datagridview......Whats the best way to go about doing this?..

ALTER TABLE on dependent column

I am trying to alter column datatype of a primary key to tinyint from int.This column is a foreign key in other tables.So,I get the following error: Msg 5074, Level 16, State 1, Line 1 The objec..

what is the difference between OLE DB and ODBC data sources?

I was reading a MS Excel help article about pivotcache and wonder what they mean by OLE DB and ODBC sources ...You should use the CommandText property instead of the SQL property, which now ex..