Questions Tagged with #Mute

How to mute an html5 video player using jQuery

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

SecurityException during executing jnlp file (Missing required Permissions manifest attribute in main jar)

OS: Windows 7 64 bit Java: jdk1.7.0_51 I have a jnlp file. When I double click on this, exception is occurred as below: Application Error: Unable to launch the application Exception: java.lang.Secu..

How do I view cookies in Internet Explorer 11 using Developer Tools

I'm looking for how to view the cookies set using developer tools in IE11. I see an option in network profiling to view cookies being sent back and forth, but this is not really the same thing. It is ..

How to include Authorization header in cURL POST HTTP Request in PHP?

I'm trying to access mails of a user through Gmails OAuth 2.0, and I'm figuring this out through Google's OAuth 2.0 Playground Here, they've specified I need to send this as a HTTP REQUEST: POST /ma..

Command to list all files in a folder as well as sub-folders in windows

I tried searching for a command that could list all the file in a directory as well as subfolders using a command prompt command. I have read the help for "dir" command but coudn't find what I was loo..

Force an Android activity to always use landscape mode

I am using the Android VNC viewer on my HTC G1. But for some reason, that application is always in landscape mode despite my G1 is in portrait mode. Since the Android VNC viewer is open source, I woul..

How do I push amended commit to the remote Git repository?

When I've worked a bit with my source code, I did my usual thing commit and then I pushed to a remote repository. But then I noticed I forgot to organize my imports in the source code. So I do the ame..

How to check if a table is locked in sql server

I have a large report I am running on sql server. It takes several minutes to run. I don't want users clicking run twice. Since i wrap the whole procedure in a transaction, how do I check to see if th..

Simplest way to restart service on a remote computer

What's the easiest programmatic way to restart a service on a remote Windows system? Language or method doesn't matter as long as it doesn't require human interaction...

Difference between Static and final?

I'm always confused between static and final keywords in java. How are they different ?..

Difference between numeric, float and decimal in SQL Server

What are the differences between numeric, float and decimal datatypes and which should be used in which situations? For any kind of financial transaction (e.g. for salary field), which one is preferr..

How can I exclude a directory from Visual Studio Code "Explore" tab?

I'm trying to exclude several folders on the "Explore" tab in Visual Studio Code. To do that I have added a following jsconfig.json to the root of my project: { "compilerOptions": { "targ..

android View not attached to window manager

I am having some of the following exceptions: java.lang.IllegalArgumentException: View not attached to window manager at android.view.WindowManagerImpl.findViewLocked(WindowManagerImpl.java:355) at a..

Firefox setting to enable cross domain Ajax request

I need to temporally allow cross domain XMLHttpRequest. Changing firefox security setting seems to be the way to go. But I've tried with this and this but they didnt work. Has anyone been able to conf..

What is the GAC in .NET?

Just looking for a short overview of GAC for a layman, not a link please...

Finding the direction of scrolling in a UIScrollView?

I have a UIScrollView with only horizontal scrolling allowed, and I would like to know which direction (left, right) the user scrolls. What I did was to subclass the UIScrollView and override the touc..

PHP 5.4 Call-time pass-by-reference - Easy fix available?

Is there any way to easily fix this issue or do I really need to rewrite all the legacy code? PHP Fatal error: Call-time pass-by-reference has been removed in ... on line 30 This happens everyw..

Execute another jar in a Java program

I had written several simple java applications named as A.jar, B.jar. Now i want to write a GUI java program so that user can press button A to execute A.jar and button B to execute B.jar. Also i wa..

What does 'stale file handle' in Linux mean?

Say I have a terminal open, and through that terminal I have cd'ed to some directory. Through another terminal, I delete that directory and restore it back from an identical backup. When I try to vim ..

How to keep indent for second line in ordered lists via CSS?

I want to have an "inside" list with list bullets or decimal numbers being all flush with superior text blocks. Second lines of list entries have to have the same indent like the first row! E.g.: Lo..

Rotate image with javascript

I need to rotate an image with javascript in 90-degree intervals. I have tried a few libraries like jQuery rotate and Raphaël, but they have the same problem - The image is rotated around its center...

Permanently hide Navigation Bar in an activity

Is it possible to permanently remove the Navigation Bar on an activity? I want to remove the bar with the buttons that appear at the button of the screen on a tablet, not the Action Bar. Here. I know..

How to properly assert that an exception gets raised in pytest?

Code: # coding=utf-8 import pytest def whatever(): return 9/0 def test_whatever(): try: whatever() except ZeroDivisionError as exc: pytest.fail(exc, pytrace=True) Out..

how to set image from url for imageView

I wanna set Image in ImageView using Url for example I have this url http://www.google.iq/imgres?hl=en&biw=1366&bih=667&tbm=isch&tbnid=HjzjsaANDXVR9M:&imgrefurl=http://www.vec..

How to place a div below another div?

I have a #slider div with an image. After that, I have a #content div which has text. I have tried position:relative so I think it should come after the previous div, I mean #slider but here it is not..

Kotlin Error : Could not find org.jetbrains.kotlin:kotlin-stdlib-jre7:1.0.7

I installed the Kotlin plugin into my app (v. v1.1.1-release-Studio2.2-1) and then selected "Configure Kotlin in Project" I selected compiler and runtime version of 1.0.7. Kotlin updated m..

Manually install Gradle and use it in Android Studio

I'm using Android Studio. How can I manually install and use Gradle within Android Studio. I've downloaded Gradle from http://www.gradle.org/downloads version gradle-2.1-all.zip. When I open the zi..

How to tell bash that the line continues on the next line

In a bash script I got from another programmer, some lines exceeded 80 columns in length. What is the character or thing to be added to the line in order to indicate that the line continues on the nex..

Execute SQL script to create tables and rows

I have a database that I created using the CREATE DATABASE statement in the terminal and I have a .sql file full of statements creating tables and rows. I just wanted to know what was the command lin..

Java 8 Filter Array Using Lambda

I have a double[] and I want to filter out (create a new array without) negative values in one line without adding for loops. Is this possible using Java 8 lambda expressions? In python it would be t..

Java Enum Methods - return opposite direction enum

I would like to declare an enum Direction, that has a method that returns the opposite direction (the following is not syntactically correct, i.e, enums cannot be instantiated, but it illustrates my p..

Android Crop Center of Bitmap

I have bitmaps which are squares or rectangles. I take the shortest side and do something like this: int value = 0; if (bitmap.getHeight() <= bitmap.getWidth()) { value = bitmap.getHeight(); }..

Start new Activity and finish current one in Android?

Currently I'm starting a new Activity and calling finish on a current one. Is there any flag that can be passed to Intent that enables finishing current Activity without a need to call finish manuall..

Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/JDBC_DBO]]

I get this Tomcat Error: Sep 09, 2012 4:16:54 PM org.apache.catalina.core.AprLifecycleListener init Information: The APR based Apache Tomcat Native library which allows optimal performance in product..

HTML: How to create a DIV with only vertical scroll-bars for long paragraphs?

I want to show terms and condition note on my website. I dont want to use text field and also dont want to use my whole page. I just want to display my text in selected area and want to use only verti..

ReactJS - Call One Component Method From Another Component

I have two components. I want to call a method of the first component from the second component. How can I do it? Here is my code. First Component class Header extends React.Component{ constru..

Get GMT Time in Java

In Java, I want to get the current time in GMT. I tried various options like this: Date date = new Date(); Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT")); date1 = calendar.get..

Regular vs Context Free Grammars

I'm studying for my computing languages test, and there's one idea I'm having problems wrapping my head around. I understood that regular grammars are simpler and cannot contain ambiguity, but can'..

How to debug Apache mod_rewrite

I have two main problems with mod_rewrite: 1) There is no meaningful error reported when I have an invalid rule 2) To reliably test each modification, I have to erase chrome's cache. This isn't ro..

How to use SqlClient in ASP.NET Core?

I am trying to use SQLClient library in the ASP.net Core but cant seem to get it working. I found this article online advising how to setup but its not working for me: http://blog.developers.ba/using..

An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module

I am developing a c# application and I get the following error at debug runtime: An unhandled exception of type 'System.IO.FileNotFoundException' occurred in Unknown Module. Additional info..

Bring element to front using CSS

I can't figure out how to bring images to front using CSS. I've already tried setting z-index to 1000 and position to relative, but it still fails. Here's example- _x000D_ _x000D_ #header {_x000D_ ..

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

MySQL "Or" Condition

Check out this MySQL Query and then I'll show you what I really want it to do... mysql_query(" SELECT * FROM Drinks WHERE email='$Email' AND date='$Date_Today' OR date='$Date_Yesterday' ..

Edit Crystal report file without Crystal Report software

I need to modify a static text (few words) in 3 rpt files. But I dont have Crystal Reports. How can I do it? Is there a free editor or software to be able to modify a simple text of the report?..

Sleep for milliseconds

I know the POSIX sleep(x) function makes the program sleep for x seconds. Is there a function to make the program sleep for x milliseconds in C++?..

How to display an IFRAME inside a jQuery UI dialog

The web application that I am upgrading uses jQuery and jQuery UI. I have replaced most instances of window.open and <a target=_blank> with jQuery UI dialog. For example, the terms and condition..

LaTeX beamer: way to change the bullet indentation?

I've checked the Beamer Class manual (PDF file). I can't figure out how to change the indentation bullet assigns to \itemize. [This is kind of important, as I'm using 2 column slides, and I don't wa..

Redirect to new Page in AngularJS using $location

I am testing with the following AngularJS $location. I don't what's the problem with this. Just want to check if the redirection is working or not: HTML <body data-ng-controller="MainCtrl"> ..

jquery change div text

'<div id="'+div_id+'" class="widget" style="height:60px;width:110px">\n\ <div class="widget-head ui-widget-header" style="cursor:move;height:20px;width:130px">'+ '<..

Android Studio and Gradle build error

I've been using the new preview of android studio and really like it. But recently my project won't build. I get the following error: Gradle: FAILURE: Build failed with an exception. * What went wr..

from list of integers, get number closest to a given value

Given a list of integers, I want to find which number is the closest to a number I give in input: >>> myList = [4, 1, 88, 44, 3] >>> myNumber = 5 >>> takeClosest(myList, my..

Check if an array item is set in JS

I've got an array var assoc_pagine = new Array(); assoc_pagine["home"]=0; assoc_pagine["about"]=1; assoc_pagine["work"]=2; I tried if (assoc_pagine[var] != "undefined") { bu..

Is there a mechanism to loop x times in ES6 (ECMAScript 6) without mutable variables?

The typical way to loop x times in JavaScript is: for (var i = 0; i < x; i++) doStuff(i); But I don't want to use the ++ operator or have any mutable variables at all. So is there a way, in ES..

Capture the close event of popup window in JavaScript

I need to perform some action before a popup window(using window.open ) closes. Something like will be good: var new_window = window.open('some url') new_window.onBeforeUnload = function(){ my code}..

C compile : collect2: error: ld returned 1 exit status

I tried to search for that bug online but all the posts are for C++. This is the message: test1.o: In function `ReadDictionary': /home/johnny/Desktop/haggai/test1.c:13: undefined reference to `CreateD..

What's the difference between OpenID and OAuth?

I'm really trying to understand the difference between OpenID and OAuth? Maybe they're two totally separate things?..

How to create dispatch queue in Swift 3

In Swift 2, I was able to create queue with the following code: let concurrentQueue = dispatch_queue_create("com.swift3.imageQueue", DISPATCH_QUEUE_CONCURRENT) But this doesn't compile in Swift 3. ..

What is the easiest way to encrypt a password when I save it to the registry?

Currently I'm writing it in clear text oops!, it's an in house program so it's not that bad but I'd like to do it right. How should I go about encrypting this when writing to the registry and how do I..

Java: Check the date format of current string is according to required format or not

I wanted to know that is there any method available in Java that can do this.Otherwise I may go for Regex solution. I have input string from user that can be any characters. And I want to check that t..

How to find the index of an element in an int array?

How can I find an index of a certain value in a Java array of type int? I tried using Arrays.binarySearch on my unsorted array, it only sometimes gives the correct answer...

Printing the value of a variable in SQL Developer

I wanted to print the value of a particular variable which is inside an anonymous block. I am using Oracle SQL Developer. I tried using dbms_output.put_line. But it is not working. The code which I am..

Excel 2013 horizontal secondary axis

I have made a scatter plot and I want to have a secondary axis for the x-axis. It used to be easy to do in 2010, but I have no idea where Microsoft put this option in the 2013 version of Excel. ..

100% width Twitter Bootstrap 3 template

I am a bootstrap newbie and I have a 100% wide template that I want to code with bootstrap. The first column begins at the left corner and I have a Google map the stretches to the rightmost. I thought..

Windows service on Local Computer started and then stopped error

Usually, I get this error: (The "service name" service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other service or programs) when there's so..

Get the filePath from Filename using Java

Is there a easy way to get the filePath provided I know the Filename?..

How to respond to clicks on a checkbox in an AngularJS directive?

I have an AngularJS directive that renders a collection of entities in the following template: <table class="table"> <thead> <tr> <th><input type="checkbox" ng-..

How do I escape ampersands in batch files?

How do I escape ampersands in a batch file (or from the Windows command line) in order to use the start command to open web pages with ampersands in the URL? Double quotes will not work with start;..

Deleting all records in a database table

How do I delete all records in one of my database tables in a Ruby on Rails app?..

python: Change the scripts working directory to the script's own directory

I run a python shell from crontab every minute: * * * * * /home/udi/foo/bar.py /home/udi/foo has some necessary subdirectories, like /home/udi/foo/log and /home/udi/foo/config, which /home/udi/foo/..

Can't push image to Amazon ECR - fails with "no basic auth credentials"

I'm trying to push a docker image to an Amazon ECR registry. I'm using docker client Docker version 1.9.1, build a34a1d5. I use aws ecr get-login --region us-east-1 to get the docker login creds. Then..

How prevent CPU usage 100% because of worker process in iis

My CPU usage is 100% most of the the time in Windows Server 2008-R2 with my own vps, vmware, quad core, and 4GB Ram. When I open windows Task Manager and go to the resource monitor I see that 100% usa..

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

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

Oracle: how to UPSERT (update or insert into a table?)

The UPSERT operation either updates or inserts a row in a table, depending if the table already has a row that matches the data: if table t has a row exists that has key X: update t set mystuff....

Using Linq to get the last N elements of a collection?

Given a collection, is there a way to get the last N elements of that collection? If there isn't a method in the framework, what would be the best way to write an extension method to do this?..

The operation couldn’t be completed. (com.facebook.sdk error 2.) ios6

Hi i am ussing ios6 for facebook login and i am getting this error as native popup The operation couldn’t be completed. (com.facebook.sdk error 2.) This is the scenario ive used. (I am running th..

$(document).on('click', '#id', function() {}) vs $('#id').on('click', function(){})

I was trying to find out what is the difference between $(document).on('click', '#id', function(){}); and $('#id').on('click', function(){}); I've not been able to find any information on if the..

Compiling LaTex bib source

I am writing my thesis in Latex, and I have the references in an own thesis.bib file which look as follows @Article{xxx, author = "D.A. Reinhard", title = "Case Study", year = ..

How to use radio buttons in ReactJS?

I am new to ReactJS, sorry if this sounds off. I have a component that creates several table rows according to the received data. Each cell within the column has a radio checkbox. Hence the user can..

Stick button to right side of div

http://jsfiddle.net/kn5sH/ What do I need to add in order to stick the button to the right side of the div on the same line as the header? HTML: <div> <h1> Ok </h1> <bu..

sum two columns in R

I feel a bit embarrassed as I am trying to add two columns in R to get the product. I have tried sum(col1,col2) but this returns Error in Summary.factor(c(49L, 48L, 47L, 46L, 46L, 45L, 45L, 44L, ..

'LIKE ('%this%' OR '%that%') and something=else' not working

I have a select query where I am trying to search strings for multiple patterns LIKE ('%this%' or '%that%' ) and something=else Returns zero results However LIKE '%this%' and something=else re..

Rotating a view in Android

I have a button that I want to put on a 45 degree angle. For some reason I can't get this to work. Can someone please provide the code to accomplish this?..

How can I reuse a navigation bar on multiple pages?

I just finished making my home/index.html page. To keep the nav bar where it is, and have it stay while users click through all my pages. Do I have to copy and paste the nav code to the top of each pa..

WPF Binding StringFormat Short Date String

I would like to use Short Date named string format in WPF. I tried something like: <TextBlock Text="{Binding Date, StringFormat='Short Date'}" /> How to do this?..

Convert Word doc, docx and Excel xls, xlsx to PDF with PHP

I am looking for a way to convert Word and Excel files to PDF using PHP. The reason for this, is I need to be able to combine files of various formats into one document. I know that if I am able to c..

Unzip All Files In A Directory

I have a directory of ZIP files (created on a Windows machine). I can manually unzip them using unzip filename, but how can I unzip all the ZIP files in the current folder via the shell? Using Ubuntu..

How to add directory to classpath in an application run profile in IntelliJ IDEA?

I'm trying to add a directory to the classpath of an application run profile If I override by using -cp x:target/classes in the VM settings, I get the following error: java.lang.NoClassDefFoundError..

What is the Sign Off feature in Git for?

What's the point of the Sign Off feature in Git? git commit --signoff When should I use it, if at all? ..

Hosting ASP.NET in IIS7 gives Access is denied?

I have setup a application in my IIS7 that uses .NET Framework 4.0 (runned by NetworkService) but when browsing the site I get this: Access is denied. Description: An error occurred while acces..

How do I do an insert with DATETIME now inside of SQL server mgmt studioÜ

I have a website that does inserts into this table below. I need to do some manual inserts but I wasn't sure how do pass in the equivalent of DateTime.Now in C#. I am running this below from the q..

How to run SQL script in MySQL?

I want to execute a text file containing SQL queries, in MySQL. I tried to run source /Desktop/test.sql and received the error: mysql> . \home\sivakumar\Desktop\test.sql ERROR: Failed to open fi..

jQuery.animate() with css class only, without explicit styles

Using JQuery animate I would like to operate with css classes, defined somewhere in .css file, not to have to give all styles params to jquery.animate() explicitly. I can create a fake (e.g. invisib..

INSERT INTO TABLE from comma separated varchar-list

Maybe i'm not seeing the wood for the trees but i'm stuck, so here's the question: How can i import/insert a list of comma separated varchar-values into a table? I don't mean something like this: ..

How do I set the selenium webdriver get timeout?

When I am using a proxy in webdriver like FirefoxDriver, if the proxy is bad then the get method will block forever. I set some timeout parameters, but this did not work out. This is my code: Firefo..

How can I get client information such as OS and browser

I'm using JSP, Servlet to develop my web application. I want to get client information such as: operation system, browser, resolution, ... whenever a client is using my website...

Proxy setting for R

I am facing problem while conecting R with internet in my office. May be this due to LAN settings. I tried the almost all possible ways I come across in the web (see below) but still in vain. Metho..

Using setTimeout to delay timing of jQuery actions

I am attempting to delay the swapping of text in a div. It should operate like a slider/carousel for text. I must have the code wrong, as the final text replacement never happens. Also, how would I ..

SaveFileDialog setting default path and file type?

I'm using SaveFileDialog.SaveFile. How can I get it to the default (operating system) drive letter and also limit the options to show only .BIN as the file extension? I tried reading the docs on MSDN..

"Warning: iPhone apps should include an armv6 architecture" even with build config set

It's been a while since I've had to adjust project build settings. After upgrading to a recent SDK I'm having trouble building my ad hoc distribution configuration. Build generates this warning and e..

How to link html pages in same or different folders?

How can I link to html pages if they are in same or different folders without writing full path?..

In Python, how to check if a string only contains certain characters?

In Python, how to check if a string only contains certain characters? I need to check a string containing only a..z, 0..9, and . (period) and no other character. I could iterate over each character ..

use "netsh wlan set hostednetwork ..." to create a wifi hotspot and the authentication can't work correctly

I run netsh wlan show drivers and get the output containing Hosted network supported : Yes: Interface name: Wireless Network Connection Driver : Broadcom 802.11n Network Adapter ..

How does one generate a random number in Apple's Swift language?

I realize the Swift book provided an implementation of a random number generator. Is the best practice to copy and paste this implementation in one's own program? Or is there a library that does thi..

how to deal with google map inside of a hidden div (Updated picture)

i have a page and a google map is inside a hidden div at first. I then show the div after i click a link but only the top left of the map shows up. i tried having this code run after the click: ..

AngularJs ReferenceError: $http is not defined

I have the following Angular function: $scope.updateStatus = function(user) { $http({ url: user.update_path, method: "POST", data: {user_id: user.id, draft: true} ..

Javascript Regex: How to put a variable inside a regular expression?

So for example: function(input){ var testVar = input; string = ... string.replace(/ReGeX + testVar + ReGeX/, "replacement") } But this is of course not working :) Is there any way to do..

Most efficient way to remove special characters from string

I want to remove all special characters from a string. Allowed characters are A-Z (uppercase or lowercase), numbers (0-9), underscore (_), or the dot sign (.). I have the following, it works but I su..

CSS Box Shadow Bottom Only

How can I do this? I want my element to look as though it has a shadow underline. I don't want the shadow for the other 3 sides...

Writing your own square root function

How do you write your own function for finding the most accurate square root of an integer? After googling it, I found this (archived from its original link), but first, I didn't get it completely, a..

How can you export the Visual Studio Code extension list?

I need to send all my installed extensions to my colleagues. How can I export them? The extension manager seems to do nothing... It won't install any extension...

CSS transition between left -> right and top -> bottom positions

Is it possible to use CSS transitions to animate something between a position set as left: 0px to right: 0px so it goes all the way across the screen? I need to accomplish the same thing with top to b..

What is the difference between Linear search and Binary search?

What is the difference between Linear search and Binary search?..

Mockito: Inject real objects into private @Autowired fields

I'm using Mockito's @Mock and @InjectMocks annotations to inject dependencies into private fields which are annotated with Spring's @Autowired: @RunWith(MockitoJUnitRunner.class) public class DemoTes..

Unity 2d jumping script

Does anyone have a good jumping script for 2d games in unity? The code I have works but still is far from jumping, it looks like it is flying. using UnityEngine; using System.Collections; public cla..

XAMPP on Windows - Apache not starting

I have installed XAMPP on my windows 7 machine but can't get Apache to work. On start I get the following errors: 13:09:21 [apache] Apache Service Detected With Wrong Path 13:09:21 [apache] Unin..

Print a list of space-separated elements in Python 3

I have a list L of elements, say natural numbers. I want to print them in one line with a single space as a separator. But I don't want a space after the last element of the list (or before the firs..

What is the use of style="clear:both"?

I happened to see a div which had the style clear:both! What is the use of clear in style? <div style="clear:both"> ..

System.BadImageFormatException: Could not load file or assembly (from installutil.exe)

I am trying to install a Windows service using InstallUtil.exe and am getting the error message System.BadImageFormatException: Could not load file or assembly '{xxx.exe}' or one of its dependenci..

Calling Javascript from a html form

I am basing my question and example on Jason's answer in this question I am trying to avoid using an eventListener, and just to call handleClick onsubmit, when the submit button is clicked. Absolute..

check for null date in CASE statement, where have I gone wrong?

My source table looks like this Id StartDate 1 (null) 2 12/12/2009 3 10/10/2009 I want to create a select statement, that selects the above, but also has an additional column to ..

Select first 10 distinct rows in mysql

Is there any way in MySQL to get the first 10 distinct rows of a table. i.e. Something like... SELECT TOP 10 distinct * FROM people WHERE names='SMITH' ORDER BY names asc However this method do..

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

What exactly does the "u" do? "git push -u origin master" vs "git push origin master"

I'm apparently terrible at using git, despite my best attempts to understand it. From kernel.org for git push: -u --set-upstream For every branch that is up to date or successfully pus..

How to get href value using jQuery?

I'm trying to get href value using jQuery: <html> <head> <title>Jquery Test</title> <script type="text/javascript" src="http://code.jquery.com/jquery-l..

Can I change the headers of the HTTP request sent by the browser?

I'm looking into a restful design and would like to use the HTTP methods (POST, GET, ...) and HTTP headers as much as possible. I already found out that the HTTP methods PUT and DELETE are not support..

How do I change the background of a Frame in Tkinter?

I have been creating an Email program using Tkinter, in Python 3.3. On various sites I have been seeing that the Frame widget can get a different background using Frame.config(background="color"). How..

SQL grouping by month and year

I'm not sure what should I write in the following SQL query to show 'date' column like this: "month-year" - "9-2011". SELECT MONTH(date) + '.' + YEAR(date) AS Mjesec, SUM(marketingExpense) AS SumaMa..

How can I get argv[] as int?

i have a piece of code like this: int main (int argc, char *argv[]) { printf("%d\t",(int)argv[1]); printf("%s\t",(int)argv[1]); } and in shell i do this: ./test 7 but the first printf res..

No suitable records were found verify your bundle identifier is correct

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

MySQL Multiple Left Joins

I am trying to create a news page for a website I am working on. I decided that I want to use correct MySQL queries (meaning COUNT(id) and joins instead of more than one query or num_rows.) I'm using ..

What's the difference between VARCHAR and CHAR?

What's the difference between VARCHAR and CHAR in MySQL? I am trying to store MD5 hashes...

hibernate: LazyInitializationException: could not initialize proxy

Here's one that has me perplexed. I'm trying to implement a basic Hibernate DAO structure, but am having a problem. Here's the essential code: int startingCount = sfdao.count(); sfdao.create( sf ); ..

How to ssh connect through python Paramiko with ppk public key

i'm using Paramiko to connect through ssh to a server. Basic authentication works well, but i can't understand how to connect with public key. When i connect with putty, the server tell me this: Us..

Importing from a relative path in Python

I have a folder for my client code, a folder for my server code, and a folder for code that is shared between them Proj/ Client/ Client.py Server/ Server.py Common/ ..

phpmyadmin "no data received to import" error, how to fix?

I am using XAMPP on a pc atwork to host a database. I exported a backup ("bintra.sql") using phpmybackuppro. I use xampp on a mac at home, and when I try to import the sql file located on my desktop..

ValueError: setting an array element with a sequence

This Python code: import numpy as p def firstfunction(): UnFilteredDuringExSummaryOfMeansArray = [] MeanOutputHeader=['TestID','ConditionName','FilterType','RRMean','HRMean', ..

Changing color of Twitter bootstrap Nav-Pills

I'm trying to change the active color (after its clicked it remains twitter's light-blue color) for each tab: <ul class="nav nav-pills"> <li class="active"><a href="#tab1" data-tog..

Remove all non-"word characters" from a String in Java, leaving accented characters?

Apparently Java's Regex flavor counts Umlauts and other special characters as non-"word characters" when I use Regex. "TESTÜTEST".replaceAll( "\\W", "" ) returns "TESTTEST" for me. What I ..

Access to the path is denied

I'm trying to save an image to a folder in .NET C# but I get this exception: Access to the path 'C:\inetpub\wwwroot\mysite\images\savehere' is denied.The error occured at mscorlib because at System..

symfony2 twig path with parameter url creation

i got the following: <a href="{{ path('_be_activatecategory', {'id': category.id, 'active': 1}) }}">Aktivieren</a> creates /backend/categories/activate/8/1 and then i got <a h..

Convert an array into an ArrayList

I'm having a lot of trouble turning an array into an ArrayList in Java. This is my array right now: Card[] hand = new Card[2]; "hand" holds an array of "Cards". How this would look like as an Array..

Foreach loop in C++ equivalent of C#

How would I convert this code to C++? string[] strarr = {"ram","mohan","sita"}; foreach(string str in strarr) { listbox.items.add(str); } ..

PostgreSQL Error: Relation already exists

I am trying to create a table that was dropped previously. But when I do the CREATE TABLE A ... I am getting below error: Relation 'A' already exists. I verified doing SELECT * FROM A, but t..

Unmarshaling nested JSON objects

There are a few questions on the topic but none of them seem to cover my case, thus I'm creating a new one. I have JSON like the following: {"foo":{ "bar": "1", "baz": "2" }, "more": "text"} Is th..

Dictionary returning a default value if the key does not exist

I find myself using the current pattern quite often in my code nowadays var dictionary = new Dictionary<type, IList<othertype>>(); // Add stuff to dictionary var somethingElse = dictiona..

Eclipse Workspaces: What for and why?

I have seen, read and thought of different ways of using workspaces (per project, per application (multi-asseted or not), per program language, per target (web-development, plugins,..), and so on) and..

How to fix the session_register() deprecated issue?

How to fix the session_register() deprecated problem in PHP 5.3..

Count the frequency that a value occurs in a dataframe column

I have a dataset category cat a cat b cat a I'd like to be able to return something like (showing unique values and frequency) category freq cat a 2 cat b 1 ..

wget can't download - 404 error

I tried to download an image using wget but got an error like the following. --2011-10-01 16:45:42-- http://www.icerts.com/images/logo.jpg Resolving www.icerts.com... 97.74.86.3 Connecting to www.ic..

How to simulate a click with JavaScript?

I'm just wondering how I can use JavaScript to simulate a click on an element. Currently I have: <script type="text/javascript"> function simulateClick(control) { if (document.all) { ..

How to calculate UILabel width based on text length?

I want to display an image next to a UILabel, however UILabel has variable text length, so I don't know where to place the image. How can I accomplish this?..

Checking for empty or null List<string>

I have a List where sometimes it is empty or null. I want to be able to check if it contains any List-item and if not then add an object to the List. // I have a list, sometimes it doesn't have any ..

How to execute a JavaScript function when I have its name as a string

I have the name of a function in JavaScript as a string. How do I convert that into a function pointer so I can call it later? Depending on the circumstances, I may need to pass various arguments int..

Regex to replace multiple spaces with a single space

Given a string like: "The dog has a long tail, and it is RED!" What kind of jQuery or JavaScript magic can be used to keep spaces to only one space max? Goal: "The dog has a long tail..

How do you fix a bad merge, and replay your good commits onto a fixed merge?

I accidentally committed an unwanted file (filename.orig while resolving a merge) to my repository several commits ago, without me noticing it until now. I want to completely delete the file from the ..

mysqldump data only

I am looking for the syntax for dumping all data in my mysql database. I don't want any table information...

Where does gcc look for C and C++ header files?

On a Unix system, where does gcc look for header files? I spent a little time this morning looking for some system header files, so I thought this would be good information to have here...

AngularJS - $http.post send data as json

I'm working on autocomplete directive with angularjs but having some issues. I have a form which have an autocomplete input. When i type something there, the term variable is sent as JSON: But, wh..

How to sort a Pandas DataFrame by index?

When there is an DataFrame like the following: import pandas as pd df = pd.DataFrame([1, 1, 1, 1, 1], index=[100, 29, 234, 1, 150], columns=['A']) How can I sort this dataframe by index with each c..

Jackson - How to process (deserialize) nested JSON?

{ vendors: [ { vendor: { id: 367, name: "Kuhn-Pollich", company_id: 1, } }, { vendor: { id: 374, name: "Sawayn-Hermann", ..

How to unmount a busy device

I've got some samba drives that are being accessed by multiple users daily. I already have code to recognize shared drives (from a SQL table) and mount them in a special directory where all users can ..

What is bootstrapping?

I keep seeing "bootstrapping" mentioned in discussions of application development. It seems both widespread and important, but I've yet to come across even a poor explanation of what bootstrapping ac..

How can I add an item to a IEnumerable<T> collection?

My question as title above. For example, IEnumerable<T> items = new T[]{new T("msg")}; items.ToList().Add(new T("msg2")); but after all it only has 1 item inside. Can we have a method like ..

DropDownList's SelectedIndexChanged event not firing

I have a DropDownList object in my web page. When I click on it and select a different value, nothing happens, even though I have a function wired up to the SelectedIndexChanged event. First, the act..

Find and replace in file and overwrite file doesn't work, it empties the file

I would like to run a find and replace on an HTML file through the command line. My command looks something like this: sed -e s/STRING_TO_REPLACE/STRING_TO_REPLACE_IT/g index.html > index.html ..

How to call a function, PostgreSQL

I'm trying to use a function with PostgreSQL to save some data. Here is the create script: -- Function: "saveUser"(integer, character varying, character varying, character varying, character..

Refresh Page C# ASP.NET

Is there a Page.Refresh type of command to refresh a page? I don't want to redirect to the page or refresh in JavaScript...

jQuery keypress() event not firing?

I am trying to fire an event on the right and left arrow key presses with jQuery. Using the following code, I can fire events on any of the alphanumeric keys, but the cursor keys (up, down, left, righ..

Reading a plain text file in Java

It seems there are different ways to read and write data of files in Java. I want to read ASCII data from a file. What are the possible ways and their differences?..

Spring Security redirect to previous page after successful login

I know this question has been asked before, however I'm facing a particular issue here. I use spring security 3.1.3. I have 3 possible login cases in my web application: Login via the login page :..

Is it possible to write data to file using only JavaScript?

I want to Write Data to existing file using JavaScript. I don't want to print it on console. I want to Actually Write data to abc.txt. I read many answered question but every where they are printing o..

Using :before and :after CSS selector to insert Html

I'm wondering if the following is possible. I know it doesnt work, but maybe I'm not writing it in the correct syntax. li.first div.se_bizImg:before{ content: "<h1>6 Businesses Found <sp..

GUI-based or Web-based JSON editor that works like property explorer

Background: This is a request for something that may not exist yet, but I've been meaning to build one for a long time. First I will ask if anyone has seen anything like it yet. Suppose you have an ar..

R: Print list to a text file

I have in R a list like this: > print(head(mylist,2)) [[1]] [1] 234984 10354 41175 932711 426928 [[2]] [1] 1693237 13462 Each element of the list has different number of its elements. I wo..

How can I save application settings in a Windows Forms application?

What I want to achieve is very simple: I have a Windows Forms (.NET 3.5) application that uses a path for reading information. This path can be modified by the user, by using the options form I provid..

Understanding ASP.NET Eval() and Bind()

Can anyone show me some absolutely minimal ASP.NET code to understand Eval() and Bind()? It is best if you provide me with two separate code-snippets or may be web-links...

Difference between JE/JNE and JZ/JNZ

In x86 assembly code, are JE and JNE exactly the same as JZ and JNZ?..

How to compare only Date without Time in DateTime types in Linq to SQL with Entity Framework?

Is there a way to compare two DateTime variables in Linq2Sql but to disregard the Time part. The app stores items in the DB and adds a published date. I want to keep the exact time but still be able ..

How should you diagnose the error SEHException - External component has thrown an exception

Whenever a user reports an error such as System.Runtime.InteropServices.SEHException - External component has thrown an exception? is there anything that I as a programmer can do to determine t..

How to strip HTML tags from a string in SQL Server?

I've got data in SQL Server 2005 that contains HTML tags and I'd like to strip all that out, leaving just the text between the tags. Ideally also replacing things like &lt; with <, etc. Is ther..

fatal error LNK1169: one or more multiply defined symbols found in game programming

I've been training to use object orientated programming in c++ but I keep getting this error: 1>main.obj : error LNK2005: "int WIDTH" (?WIDTH@@3HA) already defined in GameObject.obj 1>main.obj ..

How can I run Tensorboard on a remote server?

I'm new to Tensorflow and would greatly benefit from some visualizations of what I'm doing. I understand that Tensorboard is a useful visualization tool, but how do I run it on my remote Ubuntu machin..

How to find locked rows in Oracle

We have an Oracle database, and the customer account table has about a million rows. Over the years, we've built four different UIs (two in Oracle Forms, two in .Net), all of which remain in use. We h..

Can someone provide an example of a $destroy event for scopes in AngularJS?

Can someone please provide an example of scope's $destroy event? Here is the reference documentation from http://docs.angularjs.org/api/ng.$rootScope.Scope#$destroy $destroy() Removes the cur..

How do I center align horizontal <UL> menu?

I need to center align a horizontal menu. I've tried various solutions, including the mix of inline-block / block / center-align etc., but haven't succeeded. Here is my code: <div class="topmenu-..

How to set Angular 4 background image?

I am trying the following lines to set the background image.but it not works. what are the way set background image in constantly in my application. app.component.html <div [ngStyle]="{'backgroun..

Using import fs from 'fs'

I want to use import fs from 'fs' in JavaScript. Here is a sample: import fs from 'fs' var output = fs.readFileSync('someData.txt') console.log(output) The error I get when I run my file using node..

What does '--set-upstream' do?

What does git --set-upstream do? I tried to understand it by reading the git manual, but I didn't quite get it. ..

Core dump file analysis

What are all the things I will need to check while analyzing a core dump file? Please tell me from scratch...

How to fill Dataset with multiple tables?

I'm trying to fill DataSet which contains 2 tables with one to many relationship. I'm using DataReader to achieve this : public DataSet SelectOne(int id) { DataSet result = new DataSe..

Google Map API v3 — set bounds and center

I've recently switched to Google Maps API V3. I'm working of a simple example which plots markers from an array, however I do not know how to center and zoom automatically with respect to the markers...

Bootstrap 3: Scroll bars

I am using Bootstrap 3 and have a list of subjects inside a side nav. The sidenav is long and I would like to make it that there is a scrollbar inside of the sidenav that displays 8 elements before ha..

How do I run a node.js app as a background service?

Since this post has gotten a lot of attention over the years, I've listed the top solutions per platform at the bottom of this post. Original post: I want my node.js server to run in the backgroun..

200 PORT command successful. Consider using PASV. 425 Failed to establish connection

I have setup FTP server in Ubuntu 12.04 LTS. Now when when I try to connect to FTP server from Windows 7 through command-line ftp.exe, I get successfully connected but I cannot get the list of direct..

Android Studio emulator does not come with Play Store for API 23

I selected this emulator from the newest version of Android Studio AVD. I have selected the latest version of android API 23. Because it says "with Google APIs", I thought that it would actually in..

URL to load resources from the classpath in Java

In Java, you can load all kinds of resources using the same API but with different URL protocols: file:///tmp.txt http://127.0.0.1:8080/a.properties jar:http://www.foo.com/bar/baz.jar!/COM/foo/Quux.c..

MongoDB Data directory /data/db not found

When I try to run Mongod in terminal I got this message : 2015-05-14T17:33:04.554+0700 I STORAGE [initandlisten] exception in initAndListen: 29 Data directory /data/db not found., terminating 2015-..

What's the difference between JavaScript and Java?

What's the difference between JavaScript and Java?..

How to use the addr2line command in Linux?

I am trying to use addr2line command in Unix but everytime it is giving the same output as ??:0. I am giving command as addr2line -e a.out 0x4005BDC . I got this address while running this a.out exe..

text flowing out of div

When the text is without spaces and more than the div size 200px it's flowing out The width is defined as 200px I have put my code here http://jsfiddle.net/madhu131313/UJ6zG/ You can see the below p..