Questions Tagged with #Defaultnetworkcredentials

A property of Microsoft's .NET Framework that returns the security context of the current user or application.

How to set username and password for SmtpClient object in .NET?

I see different versions of the constructor, one uses info from web.config, one specifies the host, and one the host and port. But how do I set the username and password to something different from th..

Java ArrayList clear() function

Let's say I have a ArrayList<String> data; I'm adding some data into this Array, using data.add() function. Let's say I've added 10 Strings into this array. The size of the array is 10 now. Ho..

How to make CSS width to fill parent?

I am sure this problem has been asked before but I cannot seem to find the answer. I have the following markup: <div id="foo"> <div id="bar"> here be dragons </div>..

React-router urls don't work when refreshing or writing manually

I'm using React-router and it works fine while I'm clicking on link buttons, but when I refresh my webpage it does not load what I want. For instance, I am in localhost/joblist and everything is fine..

Eclipse comment/uncomment shortcut?

I thought this would be easy to achieve, but so far I haven't found solutions for comment/uncomment shortcut on both Java class editor and jsf faceted webapp XHTML file editor : to quickly comment/u..

How to find lines containing a string in linux

I have a file in Linux, I would like to diplay lines which contain a specific string in that file, how to do this?..

Transpose list of lists

Let's take: l = [[1, 2, 3], [4, 5, 6], [7, 8, 9]] The result I'm looking for is r = [[1, 4, 7], [2, 5, 8], [3, 6, 9]] and not r = [(1, 4, 7), (2, 5, 8), (3, 6, 9)] Much appreciated..

Notepad++ change text color?

I'm using Notepad++ to mock up ISPF screens. I've used StyleConfigurator to select an appropriate font, colored it green, and set a black background. How do I permanently change the color of selected..

How to get the scroll bar with CSS overflow on iOS

Developing an iPad website I tried to use the CSS property overflow: auto to get the scrollbars if needed in a div, but my device is refusing to show them even if the two fingers scroll is working. I..

How to change navbar/container width? Bootstrap 3

The default width for my navbar is too wide 1170px. I would like to reduce it down to 940px - but I want to keep the responsiveness. I tried to change the container width in CSS and it looks ok with ..

How can I convert string to double in C++?

How can I convert string to double in C++? I want a function that returns 0 when the string is not numerical...

How to move an entire div element up x pixels?

I want to reposition an entire div and its contents up about 10-15 pixels. How can I do this? Note: this is slider element, so when I click a button the slider slides down. Once it is finished I w..

Add up a column of numbers at the Unix shell

Given a list of files in files.txt, I can get a list of their sizes like this: cat files.txt | xargs ls -l | cut -c 23-30 which produces something like this: 151552 319488 1536000 225280 ..

Connect Android to WiFi Enterprise network EAP(PEAP)

I have been trying to connect my android device to an enterprise network programatically over the past few days without any success, I have been following multiple examples online, but most of the one..

How to call a method in another class in Java?

Currently I have two classes. a classroom class and a School class. I would like to write a method in the School class to call public void setTeacherName(String newTeacherName) from the classroom clas..

git pull from master into the development branch

I have a branch called dmgr2 (development) and I want to pull from the master branch (live site) and incorporate all the changes into my development branch. is there a better way to do this? here is ..

'System.OutOfMemoryException' was thrown when there is still plenty of memory free

This is my code: int size = 100000000; double sizeInMegabytes = (size * 8.0) / 1024.0 / 1024.0; //762 mb double[] randomNumbers = new double[size]; Exception: Exception of type 'System.OutOfMemoryE..

How do I change Bootstrap 3's glyphicons to white?

I've got the glyphicons in my page, but they are black. How do I set the glyphicons to white?..

Using an array as needles in strpos

How do you use the strpos for an array of needles when searching a string? For example: $find_letters = array('a', 'c', 'd'); $string = 'abcdefg'; if(strpos($string, $find_letters) !== false) { ..

How to send parameters with jquery $.get()

I'm trying to do a jquery GET and i want to send a parameter. here's my function: $(function() { var availableProductNames; $.get("", function(data){ avai..

How do I position a div relative to the mouse pointer using jQuery?

Suppose I have one link in my page and I want that when I place my mouse just over the link, a div will show there according to mouse x,y. How can I accomplish this using jQuery?..

How to call a .NET Webservice from Android using KSOAP2?

I have a problem while calling a webservice. I have a .NET web service on the server, and I am using KSOAP2 (ksoap2-j2se-full-2.1.2) in Android. While running the program I got an runtime exception li..

Adding VirtualHost fails: Access Forbidden Error 403 (XAMPP) (Windows 7)

I've got a XAMPP installation running on Windows 7. As soon as I add a VirtualHost to httpd-vhosts.conf, BOTH the 'regular' http://localhost AND the new dropbox.local aren't working. This is what I..

Custom "confirm" dialog in JavaScript?

I've been working on an project that uses custom 'modal dialogs'. I use scare quotes here because I understand that the 'modal dialog' is simply a div in my html document that is set to appea..

Autoresize View When SubViews are Added

I am developing an app using iOS 7 and auto layout. I am adding a simple textfield to a UIView. But the view is not getting resized. I even tried to change the frame manually but it did not work. I be..

SSL Error: CERT_UNTRUSTED while using npm command

I am trying to install express framework using npm command but getting following error. error message is E:\myFindings\nodejs_programs\node>npm install -g express npm http GET https://registry..

Pushing to Git returning Error Code 403 fatal: HTTP request failed

I was able to clone a copy of this repo over HTTPS authenticated. I've made some commits and want to push back out to the GitHub server. Using Cygwin on Windows 7 x64. C:\cygwin\home\XPherior\Code\lu..

how can the textbox width be reduced?

Can I reduce the textbox width without using classes? <input type="text" maxlength="5" style="3px"/> ..

Center div on the middle of screen

What is the best pattern to align a semantic ui grid in the middle of the screen? the css for this will ideal be this one. .div{ position: absolute; top: 50%; left: 50%; margin-top: ..

Detect if PHP session exists

Facebook now offer subscriptions to users so you can get realtime updates on changes. If my app receives an update, I plan to store it in the database. I would also like to detect if their session exi..

Multiple left-hand assignment with JavaScript

var var1 = 1, var2 = 1, var3 = 1; This is equivalent to this: var var1 = var2 = var3 = 1; I'm fairly certain this is the order the variables are defined: var3, var2, var1, which would be ..

How to send a message to a particular client with

I'm starting with + node.js, I know how to send a message locally and to broadcast socket.broadcast.emit() function:- all the connected clients receive the same message. Now, I would like t..

Find UNC path of a network drive?

I need to be able determine the path of the network Q drive at work for a WEBMethods project. The code that I have before is in my configuration file. I placed single character leters inside of the di..

How to get full width in body element

How would I be able to get a website to auto-fit in the page? It's a landscape design which needs no scrolling...

How to add buttons at top of map fragment API v2 layout

I am trying to show maps in android using API v2. I want UI some thing like this.But whenever I try to add button in layout it does not reflect in output I am able to get maps without buttons.I need b..

proper hibernate annotation for byte[]

I have an application using hibernate 3.1 and JPA annotations. It has a few objects with byte[] attributes (1k - 200k in size). It uses the JPA @Lob annotation, and hibernate 3.1 can read these just..

jQuery: more than one handler for same event

What happens if I bind two event handlers to the same event for the same element? For example: var elem = $("...");; Does the last handler "win", or will both handl..

Java 8 Stream API to find Unique Object matching a property value

Find the object matching with a Property value from a Collection using Java 8 Stream. List<Person> objects = new ArrayList<>(); Person attributes -> Name, Phone, Email. Iterate throu..

Remove last characters from a string in C#. An elegant way?

I have a numeric string like this 2223,00. I would like to transform it to 2223. This is: without the information after the ",". Assume that there will be only two decimals after the ",". I did: st..

Selenium WebDriver How to Resolve Stale Element Reference Exception?

I have the following code in a Selenium 2 Web Driver test which works when I am debugging but most of the time fails when I run it in the build. I know it must be something to do with the way the page..

How do I directly modify a Google Chrome Extension File? (.CRX)

I'm not sure in which languages those extensions are, I think the are written in Html, Javascript or JSON. As far as I know they are "compressed" in a .CRX file. It is possible to directly modify the..

Android Studio Image Asset Launcher Icon Background Color

I have a .png logo for my app which doesn't have a background, when I add it to android studio as an Image Asset I am forced to have a background. The hex field doesn't accept 8 digit color codes, 6 d..

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

jQuery: How can I show an image popup onclick of the thumbnail?

In my aspx page I have a thumbnail image <img>. When the user clicks on that image I would like a popup to show that blocks out the rest of the UI with the larger (full) version of the image. A..

HTML select form with option to enter custom value

I would like to have an input field that users can enter custom text value or choose from drop down. A regular <select> only offers drop down options. How can I make a <select> accept cus..

Cannot add a project to a Tomcat server in Eclipse

I cannot add my project to a server in Eclipse - why is that? I installed all necessary tools (Web Dev, Java EE, Server Adapters, and Tomcat itself, everything) I configured the runtime environments, ..

What is the difference between id and class in CSS, and when should I use them?

#main { background: #000; border: 1px solid #AAAAAA; padding: 10px; color: #fff; width: 100px; } <div id="main"> Welcome </div> Here I gave an id to the div ele..

PHP "pretty print" json_encode

Possible Duplicate: Pretty-Printing JSON with PHP I'm working on a script that creates a JSON file. Right now I'm just using json_encode (PHP 5.2.x) to encode an array into JSON output. The..

How to bring a window to the front?

We have a Java application that needs to be brought to the foreground when a telecontrol mechanism activates something in the application. In order to get this, we have realized in the called method ..

Invalid application of sizeof to incomplete type with a struct

I have a struct where I put all the information about the players. That's my struct: struct player{ int startingCapital; int currentCapital; int startingPosition; int currentPosition; ..

HTML text input field with currency symbol

I would like to have a text input field containing the "$" sign in the very beginning, and no matter what editing occurs to the field, for the sign to be persistent. I would be good if only numbers w..

getMinutes() 0-9 - How to display two digit numbers?

var date = "2012-01-18T16:03"; var date = new Date(date); console.log(date.getMinutes()); console.log(date.getMinutes().length) This returns 3. How do I make it return '03'? Why does .length re..

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:

How to set the size of button in HTML

I have some buttons on my pure HTML/JS page. When the page is opened in browser, the button size is normal. But on refresh/reloading page, the button size is reduced. In fact, I have not set the butto..

What's the C# equivalent to the With statement in VB?

Possible Duplicate: Equivalence of “With…End With” in c#? There was one feature of VB that I really like...the With statement. Does C# have any equivalent to it? I know you..

How do relative file paths work in Eclipse?

So my 2009 new years resolution is to learn Java. I recently acquired "Java for Dummies" and have been following along with the demo code in the book by re-writing it using Eclipse. Anyway, every ex..

How to get time in milliseconds since the unix epoch in Javascript?

Possible Duplicate: How do you get a timestamp in JavaScript? Calculating milliseconds from epoch How can I get the current epoch time in Javascript? Basically the number of milliseconds..

How to start Apache and MySQL automatically when Windows 8 comes up

I am using XAMPP, version 3.2.1. I just installed it on Windows 8. Every time I need to go to the XAMPP Control Panel to start services (MySQL, Apache,...); in Windows 7 it started automatic..

No connection could be made because the target machine actively refused it?

Sometimes I get the following error while I was doing HttpWebRequest to a WebService. I copied my code below too. System.Net.WebException: Unable to connect to the remote server ---> System.Net.So..

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

How do I read a date in Excel format in Python?

How can I convert an Excel date (in a number format) to a proper date in Python?..

Make install, but not to default directories?

I want to run 'make install' so I have everything I need, but I'd like it to install the things in their own folder as opposed to the system's /usr/bin etc. is that possible? even if it references too..

"Gradle Version 2.10 is required." Error

As I've been using classpath '' In the build.gradle file, I got the following error since gradle version 2.10 has been released. The error is : Warning:Gradle v..

Returning value from called function in a shell script

I want to return the value from a function called in a shell script. Perhaps I am missing the syntax. I tried using the global variables. But that is also not working. The code is: lockdir="somedir" ..

How to resume Fragment from BackStack if exists

I am learning how to use fragments. I have three instances of Fragment that are initialized at the top of the class. I am adding the fragment to an activity like this: Declaring and initializing: Fr..

AngularJs event to call after content is loaded

I have a function which I want to call after page content is loaded. I read about $viewContentLoaded and it doesn't work for me. I am looking for something like document.addEventListener('DOMContent..

How to make div follow scrolling smoothly with jQuery?

In my container there are sections/boxes, but the last one of these boxes should follow scrolling when none of the other boxes are visible. So, when user scrolls down, he sees a normal sidebar, but w..

Return a `struct` from a function in C

Today I was teaching a couple of friends how to use C structs. One of them asked if you could return a struct from a function, to which I replied: "No! You'd return pointers to dynamically malloc..

How to set background color of view transparent in React Native

This is the style of the view that i have used backCover: { position: 'absolute', marginTop: 20, top: 0, bottom: 0, left: 0, right: 0, } Currently it has a white background. I can chang..

static and extern global variables in C and C++

I made 2 projects, the first one in C and the second one in C++, both work with same behavior. C project: header.h int varGlobal=7; main.c #include <stdio.h> #include <stdlib.h> #inc..

How to create a pulse effect using -webkit-animation - outward rings

I have found this article: on css3 animations. I am trying to create a similar effect seen on the site above but on personal si..

MySQL: Get column name or alias from query

I'm not asking for the SHOW COLUMNS command. I want to create an application that works similarly to heidisql, where you can specify an SQL query and when executed, returns a result set with rows and..

A python class that acts like dict

I want to write a custom class that behaves like dict - so, I am inheriting from dict. My question, though, is: Do I need to create a private dict member in my __init__() method?. I don't see the poi..

Google Chrome display JSON AJAX response as tree and not as a plain text

I cannot find an answer to this one: My AJAX calls return JSON data. In Google Chrome Developer Tools > Resources > XHR when I click on the resource on the left and then on the Content tab I see the ..

Inserting a blank table row with a smaller height

I have a table consisting of a header row and a couple of data rows. What I want to do is to create a blank row in between the header and the data rows, but I want this blank row to be smaller in heig..

Java String new line

I have string like "I am a boy". I want to print like this way "I am a boy". Can anybody help me?..

What is the difference between gravity and layout_gravity in Android?

I know we can set the following values to the android:gravity and android:layout_gravity properties: center center_vertical center_horizontal, etc. But I am confused regarding both of these. Wha..

What is the purpose of global.asax in

How can we use global.asax in And what is that?..

Target class controller does not exist - Laravel 8

Here is my controller: <?php namespace App\Http\Controllers\Api; use App\Http\Controllers\Controller; use Illuminate\Http\Request; class RegisterController extends Controller { public functi..

Reading a key from the Web.Config using ConfigurationManager

I am trying to read the keys from the Web.config file in a different layer than the web layer (Same solution) Here is what I am trying: string userName = System.Configuration.ConfigurationManager.Ap..

C# Convert List<string> to Dictionary<string, string>

This may seem an odd thing to want to do but ignoring that, is there a nice concise way of converting a List to Dictionary where each Key Value Pair in the Dictionary is just each string in the List. ..

How to decode jwt token in javascript without using a library?

How can I decode the payload of JWT using JavaScript? Without a library. So the token just returns a payload object that can consumed by my front-end app. Example token: xxxxxxxxx.XXXXXXXX.xxxxxxxx ..

Wildcard string comparison in Javascript

Let's say I have an array with many Strings Called "birdBlue", "birdRed" and some other animals like "pig1", "pig2"). Now I run a for loop that goes through the array and should return all birds. Wha..

Download a file from HTTPS using download.file()

I would like to read online data to R using download.file() as shown below. URL <- "" download.file(URL, destfile = "./data/data.c..

Show hide fragment in android

I am developing application which contains 2 fragments and i want to show hide according to my need. Following code has simple example of my problem. This simple Fragmentactivity contains 1 button an..

how to convert from int to char*?

The only way I know is: #include <sstream> #include <string.h> using namespace std; int main() { int number=33; stringstream strs; strs << number; string temp_str = (Access is denied)

I am trying to read the files inside a folder, but when I run the program it throws this exception. I tried with some other folders also. It throws the same exception. Exception in thread "main" java..

What is meant by Ems? (Android TextView)

What is meant by Ems (related to a TextView)? For example in android:ems setEms(int) Makes the TextView be exactly this many ems wide...

Some projects cannot be imported because they already exist in the workspace error in Eclipse

I am trying to import a project that me and my co-worker have been working on.. and keep getting this error after I select-- "import" then "import existing project" then click archive file, and then I..

Twitter Bootstrap - full width navbar

Following the example of TB, I have a navbar that is marked up as follows: <div class="container"> <div class="navbar"> <div class="navbar-inner"> <..

Possible reason for NGINX 499 error codes

I'm getting a lot of 499 NGINX error codes. I see that this is a client side issue. It is not a problem with NGINX or my uWSGI stack. I note the correlation in uWSGI logs when a get a 499. addres.. Getting the error "Access to the path is denied." while trying to upload files to my Windows Server 2008 R2 Web server

I have an webapplication that uploads files to a specific folder on the Web server. locally everything works fine, but when I deploy the application to the Webserver, I begin getting the error..

Write string to output stream

I have several output listeners that are implementing OutputStream. It can be either a PrintStream writing to stdout or to a File, or it can be writing to memory or any other output destination; there..

Java ArrayList Index

int[] alist = new int [3]; alist.add("apple"); alist.add("banana"); alist.add("orange"); Say that I want to use the second item in the ArrayList. What is the coding in order to get the following out..

Running Python from Atom

In Sublime, we have an easy and convent way to run Python or almost any language for that matter using ? + b (or ctrl + b) Where the code will run in a small window below the source code and can easi..

Maven with Eclipse Juno

I just upgraded to Eclipse v4.2 (Juno). The Maven plugin seems to be missing. How do I get it?..

How can I set the focus (and display the keyboard) on my EditText programmatically

I have a layout which contains some views like this: <LinearLayout> <TextView...> <TextView...> <ImageView ...> <EditText...> <Button...> </linearLayout> H..

How to install all required PHP extensions for Laravel?

I need to make my Ubuntu 16.04. Is there a way using the GUI or is the simplest way to do this by using terminal? I have already installed PHP 7.1, MariaDB. I need to enable: OpenSSL PHP Extension..

What's the best visual merge tool for Git?

What's the best tool for viewing and editing a merge in Git? I'd like to get a 3-way merge view, with "mine", "theirs" and "ancestor" in separate panels, and a fourth "output" panel. Also, instructio..

Google Play Services Library update and missing symbol @integer/google_play_services_version

When upgrading my project to the latest version of Google Play Services (v4.0, released on Halloween 2013), you are now supposed to add a new tag into the AndroidManifest.xml file. <meta-data ..

Remove ListView items in Android

Can somebody please give me an example code of removing all ListView items and replacing with new items? I tried replacing the adapter items without success. My code is populateList(){ results //p..

How to convert std::string to LPCSTR?

How can I convert a std::string to LPCSTR? Also, how can I convert a std::string to LPWSTR? I am totally confused with these LPCSTR LPSTR LPWSTR and LPCWSTR. Are LPWSTR and LPCWSTR the same?..

Why do 64-bit DLLs go to System32 and 32-bit DLLs to SysWoW64 on 64-bit Windows?

I would like to know when do we need to place a file under C:\Windows\System32 or C:\Windows\SysWOW64, on a 64-bits windows system. I had two DLL's, one for 32-bit, one for 64-bit. Logically, I th..

prevent refresh of page when button inside form clicked

I have an issue while using buttons inside form. I want that button to call function. It does, but with unwanted result that it refresh the page. My simple code goes like this <form method="POST"..

The specified child already has a parent. You must call removeView() on the child's parent first

I create this post, because i am new at this, and i need a little help. I am doing a little exercise about a application you that put your name, and it returns "hello (the name you put)". But after i ..

Missing artifact

I am trying to add MS SQL driver dependency in my POM.xml file and the following is the dependency. <dependency> <groupId></groupId> <artifactId>..

SQL Server Management Studio missing

i just installed sql server 2008 r2 and SQL Server Management Studio. After installation i found that the SQL Server Management Studio has not been installed. i wanted to install SQL Server Managemen..

Check if application is installed - Android

I'm trying to install apps from Google Play. I can understand that on opening the Google Play store URL, it opens the Google Play and when I press the back button, the activity resumes. Intent market..

CSS3 transition events

Are there any events fired by an element to check whether a css3 transition has started or end?..

Is there a CSS selector for text nodes?

What I would like to do (not in IE obviously) is: p:not(.list):last-child + :text { margin-bottom: 10px; } Which would give a text node a margin. (Is that even possible?) How would I get the text..

Why doesn't file_get_contents work?

Why does file_get_contents not work for me? In the test file code below, it seems that everyone's examples that I've searched for all have this function listed, but it never gets executed. Is this a..

How to open an external file from HTML

I want a list of hyperlinks on a basic html page, which point to files on our corporate intranet. When a user clicks the link, I want the file to open. They are excel spreadsheets, and this is an int..

Javascript Regexp dynamic generation from variables?

How to construct two regex patterns into one? For example I have one long pattern and one smaller, I need to put smaller one in front of long one. var pattern1 = ':\(|:=\(|:-\('; var pattern2 = ':\(..

What is the advantage of using REST instead of non-REST HTTP?

Apparently, REST is just a set of conventions about how to use HTTP. I wonder which advantage these conventions provide. Does anyone know? ..

List files in local git repo?

I'm using Sparkleshare, which uses Git to sync files between my laptop and my backup server. Now I want to be able to browse in the files and dirs that I've uploaded to my server, but I do not know h..

change Oracle user account status from EXPIRE(GRACE) to OPEN

After getting the message Your password will be expired with in 7 days, I changed the password expire days of the default profile to UNLIMITED. But the account status of some users are still remaining..

How to pass multiple checkboxes using jQuery ajax post

How to pass multiple checkboxes using jQuery ajax post this is the ajax function function submit_form(){ $.post("ajax.php", { selectedcheckboxes:user_ids, confirm:"true" }, function(data){ $..

Python JSON serialize a Decimal object

I have a Decimal('3.9') as part of an object, and wish to encode this to a JSON string which should look like {'x': 3.9}. I don't care about precision on the client side, so a float is fine. Is there..

Get current URL path in PHP

I need to get the path from the URL of the current request. For example, if the current URL is: "" I would want this: "/example/test/hi.p..

How to sort a List of objects by their date (java collections, List<Object>)

private List<Movie> movieItems = null; public List<Movie> getMovieItems() { final int first = 0; if (movieItems == null) { getPagingInfo(); movieItems = jpaControll..

Function not defined javascript

For some reason my javascript code is messed up. When run through firebug, I get the error proceedToSecond not defined, but it is defined! JavaScript: <script type = "text/javascript"> fu..

PHP memcached Fatal error: Class 'Memcache' not found

I've pasted the example from for using memcached in php and I'm getting: Fatal error: Class 'Memcache' not found I have this in my php.ini: [memcache] memcache.hash_strategy = "consiste..

What does map(&:name) mean in Ruby?

I found this code in a RailsCast: def tag_names @tag_names ||' ') end What does the (&:name) in map(&:name) mean?..

jQuery - Uncaught RangeError: Maximum call stack size exceeded

The following code (see Fiddle here) throws the stack overflow referred to in the question title. I'm trying to get a box shadow to display around a circular image in a pulse effect. Can anyone point ..

fork() and wait() with two child processes

I need to use the fork() and wait() functions to complete an assignment. We are modelling non-deterministic behaviour and need the program to fork() if there is more than one possible transition. In ..

Create an Android GPS tracking application

Recently, I've taken up android development as a hobby and was looking to develop an application that can find and track a users position using Google Maps. Once the application has a GPS lock, it ca..

What is referencedColumnName used for in JPA?

In JPA there is an attribute called referencedColumnName that can be set on @JoinColumn, @PrimaryKeyJoinColumn what is the idea behind this setting, can someone give a good example of where this can b..

Combine [NgStyle] With Condition (if..else)

I have read NgStyle Documentation For Angular 2, and it is a little bit confusing for me. How do I use NgStyle with condition like (if...else) to set background image of any element? ..

sqlite3.OperationalError: unable to open database file

I get this error when setting up a server in Django. It is sqlite3 which means it should create the .db file but it doesn't seem to be doing so. I've stipulated SQLite as the backend and an absolute f..

Export html table data to Excel using JavaScript / JQuery is not working properly in chrome browser

I have a HTML table in velocity template. I want to export the html table data to excel using either java script or jquery, comatibale with all browser. I am using below script <script type="tex..

JQuery select2 set default value from an option in list?

I want to be able to set the default/selected value of a select element using the JQuery Select2 plugin...

Do we need type="text/css" for <link> in HTML5

Possible Duplicate: Is type=“text/css” necessary in a <link> tag? Do we need type="text/css" for <link> tag in HTML5?..

Casting an int to a string in Python

I want to be able to generate a number of text files with the names fileX.txt where X is some integer: for i in range(key): filename = "ME" + i + ".txt" //Error here! Can't concat a string and in..

String to byte array in php

How can I get the byte array from some string which can contain numbers, letters and so on? If you are familiar with Java, I am looking for the same functionality of the getBytes() method. I tried a ..

Converting Hexadecimal String to Decimal Integer

I wrote some code to convert my hexadecimal display string to decimal integer. However, when input is something like 100a or 625b( something with letter) I got an error like this: java.lang..

Handling exceptions from Java ExecutorService tasks

I'm trying to use Java's ThreadPoolExecutor class to run a large number of heavy weight tasks with a fixed number of threads. Each of the tasks has many places during which it may fail due to exceptio..

GetElementByID - Multiple IDs

doStuff(document.getElementById("myCircle1" "myCircle2" "myCircle3" "myCircle4")); This doesn't work, so do I need a comma or semi-colon to make this work?..

How to open Emacs inside Bash

I'm using Ubuntu 11.10 (Oneiric Ocelot). When I type the command "emacs" in the terminal, it opens Emacs as a separate window. How can I open it inside the terminal, like the nano editor?..

Add onclick event to newly added element in JavaScript

I have been trying to add onclick event to new elements I added with JavaScript. The problem is when I check document.body.innerHTML I can actually see the onclick=alert('blah') is added to the new e..

Jquery Ajax Call, doesn't call Success or Error

Possible Duplicate: How do I return the response from an asynchronous call? I am using Jquery Ajax to call a service to update a value. function ChangePurpose(Vid, PurId) { var Success..

How do you rename a Git tag?

Today I was looking through the logs for a project and realized that I fat fingered a tag name some time ago. Is there some way to rename the tag? Google hasn't turned up anything useful. I realize I..

Insert Data Into Tables Linked by Foreign Key

I am using PostgreSQL. Customer ================== Customer_ID | Name Order ============================== Order_ID | Customer_ID | Price To insert an order, here is what I need to do usually, Fo..

How to use a Bootstrap 3 glyphicon in an html select

I need to make a subset of the Bootstrap 3 glyphicons selectable in my ui by the user. I tried this: <select class="form-control"> <option><span class="glyphicon glyphicon-cutlery"&..

How do you set a JavaScript onclick event to a class with css

Let's say I want that every time the user click any link an alert pops up that says "hohoho". Do I need to add onclick="alert('hohoho')" to every link or can I set this with CSS so that it works with..

How do I rename a column in a SQLite database table?

I would need to rename a few columns in some tables in a SQLite database. I know that a similar question has been asked on stackoverflow previously, but it was for SQL in general, and the case of SQLi..

Convert a String In C++ To Upper Case

How could one convert a string to upper case. The examples I have found from googling only have to deal with chars...

AddRange to a Collection

A coworker asked me today how to add a range to a collection. He has a class that inherits from Collection<T>. There's a get-only property of that type that already contains some items. He wants..

How to call another components function in angular2

I have two components as follows and I want to call a function from another component. Both components are included in the third parent component using directive. Component 1: @component( sele..

How can I use delay() with show() and hide() in Jquery

How can I use delay() with show() and hide() in Jquery ?..

Create table in SQLite only if it doesn't exist already

I want to create a table in a SQLite database only if doesn't exist already. Is there any way to do this? I don't want to drop the table if it exists, only create it if it doesn't...

Specify an SSH key for git push for a given domain

I have the following use case: I would like to be able to push to [email protected]:gitolite-admin using the private key of user gitolite-admin, while I want to push to [email protected]:some_repo..

How do I define a method which takes a lambda as a parameter in Java 8?

In Java 8, methods can be created as Lambda expressions and can be passed by reference (with a little work under the hood). There are plenty of examples online with lambdas being created and used with..

How to align center the text in html table row?

I am using an HTML <table> and I want to align the text of <td> to the center in each cell. How do I center align the text horizontally and vertically?..

Creating an instance of class

What's the difference between lines 1 , 2 , 3 , 4? When do I use each? Why line 3 prints the constructor Foo and line 7 returns an error and line 8 doesn't? #include <iostream> using nam..

Check for a substring in a string in Oracle without LIKE

How can I check for a substring in a string in Oracle without using LIKE? Let's say I want to select all users from a table that have the letter "z" in their last name: SELECT * FROM users WHERE last..

javascript, for loop defines a dynamic variable name

Folks, Not sure if eval() or window() is the answer, but I am trying to loop through an array, and create variables for each item in that array dynamically. My myArray looks like: ['foo','bar','ba..

Can the Android layout folder contain subfolders?

Right now, I'm storing every XML layout file inside the 'res/layout' folder, so it is feasible and simple to manage small projects, but when there is a case of large and heavy projects, then there sho..

JQuery or JavaScript: How determine if shift key being pressed while clicking anchor tag hyperlink?

I have an anchor tag that calls a JavaScript function. With or without JQuery how do I determine if the shift key is down while the link is clicked? The following code does NOT work because keypress..

Change app language programmatically in Android

Is it possible to change the language of an app programmatically while still using Android resources? If not, is it possible to request a resource in an specific language? I would like to let the us..

What are the differences between json and simplejson Python modules?

I have seen many projects using simplejson module instead of json module from the Standard Library. Also, there are many different simplejson modules. Why would use these alternatives, instead of the ..

Str_replace for multiple items

I remember doing this before, but can't find the code. I use str_replace to replace one character like this: str_replace(':', ' ', $string); but I want to replace all the following characters \/:*?"&l..

font-weight is not working properly? Here is an example. The part where it said "PHP" (the right top corner) remained as slim as it was. here is part of the css code .wp_syntax_lang { b..

IE 8: background-size fix

I've tried to add background size to IE but it's not working at all: HTML <h2 id="news">Notícias <img src="white-marker.png" alt="" /></h2> CSS: div#content h2#news { backg..

Location of my.cnf file on macOS

I'm trying to follow along this tutorial to enable remote access to MySQL. The problem is, where should my.cnf file be located? I'm using Mac OS X Lion...

How to loop in excel without VBA or macros?

Is it possible to iterate (loop) a group of rows in Excel without VBA or macros installed? A web search didn't yield anything helpful. =IF('testsheet'!$C$1 <= 99,'testsheet'!$A$1,"") & IF('tes..

Ruby Array find_first object?

Am I missing something in the Array documentation? I have an array which contains up to one object satisfying a certain criterion. I'd like to efficiently find that object. The best idea I have fro..

How to remove the first and the last character of a string

I'm wondering how to remove the first and last character of a string in Javascript. My url is showing /installers/ and I just want installers. Sometimes it will be /installers/services/ and I just n..

jQuery: Get height of hidden element in jQuery

I need to get height of an element that is within a div that is hidden. Right now I show the div, get the height, and hide the parent div. This seems a bit silly. Is there a better way? I'm using jQu..

HTML code for an apostrophe

Seemingly simple, but I cannot find anything relevant on the web. What is the correct HTML code for an apostrophe? Is it &#8217;?..

vim - How to delete a large block of text without counting the lines?

In vim, I often find myself deleting (or copying) large blocks of text. One can count the lines of text and say (for example) 50dd to delete 50 lines. But how would one delete this large block of te..

Stop setInterval

I want to stop this interval in the error handler from running repeatedly. Is that possible, and if so, how? // example code $(document).on('ready',function(){ setInterval(updateDiv,3000); }); ..

what is the basic difference between stack and queue?

What is the basic difference between stack and queue?? Please help me i am unable to find the difference. How do you differentiate a stack and a queue? I searched for the answer in various links an..

How to test whether a service is running from the command line

I would like to be able to query whether or not a service is running from a windows batch file. I know I can use: sc query "ServiceName" but, this dumps out some text. What I really want is ..

Binding ComboBox SelectedItem using MVVM

I have a problem with the SelectedItem in my ComboBox. <ComboBox Name="cbxSalesPeriods" ItemsSource="{Binding SalesPeriods}" DisplayMemberPath="displayPeriod" SelectedItem..

How to convert string to long

how do you convert a string into a long. for int you int i = 3423; String str; str = str.valueOf(i); so how do you go the other way but with long. long lg; String Str = "1333073704000" lg =

How do I generate random integers within a specific range in Java?

How do I generate a random int value in a specific range? I have tried the following, but those do not work: Attempt 1: randomNum = minimum + (int)(Math.random() * maximum); Bug: randomNum can be big..

Running windows shell commands with python

How can we interact with OS shell using Python ? I want to run windows cmd commands via python. How can it be achieved ?.. no protocol on URL based on a string modified with URLEncoder

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

SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) symfony2

When I try to login I get an error: SQLSTATE[HY000] [1045] Access denied for user 'root'@'localhost' (using password: YES) parametrs.yml: This file is auto-generated during the composer install pa..

SQL Server: Query fast, but slow from procedure

A query runs fast: DECLARE @SessionGUID uniqueidentifier SET @SessionGUID = 'BCBA333C-B6A1-4155-9833-C495F22EA908' SELECT * FROM Report_Opener WHERE SessionGUID = @SessionGUID ORDER BY CurrencyTypeO..

Tooltip on image

I am using the tooltip. But I want that on image tag, like when I mouseover the image then the tooltip should work. I have tried but not working for me on image tag...

How to handle click event in Button Column in Datagridview?

I am developing a windows application using C#. I am using DataGridView to display data. I have added a button column in that. I want to know how can I handle click event on that button in DataGridVie..

Setting Inheritance and Propagation flags with set-acl and powershell

I am trying to mimic the action of right-clicking on a folder, setting "modify" on a folder, and having the permissions apply to the specific folder and subfolders and files. I'm mostly there using P..

Print list without brackets in a single row

I have a list in Python e.g. names = ["Sam", "Peter", "James", "Julian", "Ann"] I want to print the array in a single line without the normal " [] names = ["Sam", "Peter", "James", "Julian", "Ann"..

how to remove the bold from a headline?

I have a headline: <h1>THIS IS A HEADLINE</h1> How do i make the phrase "THIS IS..." not to be bold and the rest without a change? couldn't find any relevent tag in text-decoration...

SSL received a record that exceeded the maximum permissible length. (Error code: ssl_error_rx_record_too_long)

I followed the official docs on https setup located here: I had to remove the +CompatEnvVars from SSLOptions +FakeBas..

add an onclick event to a div

I don't know if this is allowed or even possible. Is it possible to create a div element with an onclick event so that if anywhere in the div's area is clicked, the event will run. Eg JAVASCRIPT: va..

Disable a link in Bootstrap

The first example didn't work. I need to have always a list to disable links? Or what is wrong with my first demo? <a class="disabled" href="#">Disabled link</a> <ul class="nav nav..

Master Page Weirdness - "Content controls have to be top-level controls in a content page or a nested master page that references a master page."

This is weird. I added a brand new Web Application project to my solution in Visual Studio 2008. Created a master page. Made zero modifications. Created a new webform. Set its master page to the ..

How to remove not null constraint in sql server using query

I am trying to remove not null constraint in sql server 2008 without losing data...

Converting a date string to a DateTime object using Joda Time library

I have a date as a string in the following format "04/02/2011 20:27:05". I am using Joda-Time library and would like to convert it to DateTime object. I did: DateTime dt = new DateTime("04/02/2011 20..

How to cast from List<Double> to double[] in Java?

I have a variable like that: List<Double> frameList = new ArrayList<Double>(); /* Double elements has added to frameList */ How can I have a new variable has a type of double[] from t..

Stop Powershell from exiting

I know that there is that little -noexit switch for PowerShell. Is there anyway of staying in the shell without using that switch? In other words, I want a script command(s) that executes then leave..

How can I clear the NuGet package cache using the command line?

I can clear my development computer's NuGet package cache using Visual Studio menu Tools → Options → NuGet Package Manager → General: Clear Package Cache button. I would like to d..

Android ImageView setImageResource in code

I have an imageView that I want to display a little icon of the country that you are currently in. I can get the country code, but problem is I can't dynamically change the imageView resource. My imag..

How do I create a batch file timer to execute / call another batch throughout the day

How do I create a batch file timer to execute / call another batch through out the day Maybe on given times to run but not to run on weekends ? Must run on system times can also be .cmd to run on x..

Combine Regexp?

After collecting user input for various conditions like Starts with : /(^@)/ Ends with : /(@$)/ Contains : /@/ Doesn't contains To make single regex if user enter multiple conditions, I combine th..

logger configuration to log to file and print to stdout

I'm using Python's logging module to log some debug strings to a file which works pretty well. Now in addition, I'd like to use this module to also print the strings out to stdout. How do I do this? I..

How to Delete a directory from Hadoop cluster which is having comma(,) in its name?

I have uploaded a Directory to hadoop cluster that is having "," in its name like "MyDir, Name" when I am trying to delete this Directory by using rmr hadoop shell command as following hadoop dfs -rm..

How do I create a transparent Activity on Android?

I want to create a transparent Activity on top of another activity. How can I achieve this?..

The simplest way to comma-delimit a list?

What is the clearest way to comma-delimit a list in Java? I know several ways of doing it, but I'm wondering what the best way is (where "best" means clearest and/or shortest, not the most efficient...