Questions Tagged with #Innerhtml

innerHTML is a DOM node's property that gets or sets the inner HTML code of an HTML element. It is commonly used in Javascript to dynamically change or read from a page.

Can scripts be inserted with innerHTML?

I tried to load some scripts into a page using innerHTML on a <div>. It appears that the script loads into the DOM, but it is never executed (at least in Firefox and Chrome). Is there a way to h..

Cannot set property 'innerHTML' of null

Why do I get an error or Uncaught TypeError: Cannot set property 'innerHTML' of null? I thought I understood innerHTML and had it working before. <!DOCTYPE HTML> <html> <head> <m..

Javascript Iframe innerHTML

Does anyone know how to get the HTML out of an IFRAME I have tried several different ways: document.getElementById('iframe01').contentDocument.body.innerHTML document.frames['iframe01'].document.body..

Remove innerHTML from div

I'm trying to clear the div's innerHTML before repopulating it. I tried removeData() but once that's called, when I try to add the data, I get nothing from the next line after remove whereas if I rem..

It says that TypeError: document.getElementById(...) is null

Althought I pushed a parameter to getElementById I wonder from where is this 'is null' error coming from? TypeError: document.getElementById(...) is null [Break On This Error] document.getElemen..

Javascript - Replace html using innerHTML

I'm trying to replace html using innerHTML javascript. From: aaaaaa/cat/bbbbbb To: <a href="">Helloworld</a> This's my code <html> <head>..

Change label text using JavaScript

Why doesn't the following work for me? <script> document.getElementById('lbltipAddedComment').innerHTML = 'Your tip has been submitted!'; </script> <label id="lbltipAddedComment"&g..

How do I clear inner HTML

I've been fiddling with this for a while but it won't work and I can't figure out why. Please help. Here is what I have: <html> <head> <title>lala</title> </head> &l..

Show/hide 'div' using JavaScript

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

Is it possible to append to innerHTML without destroying descendants' event listeners?

In the following example code, I attach an onclick event handler to the span containing the text "foo". The handler is an anonymous function that pops up an alert(). However, if I assign to the paren..

JQuery html() vs. innerHTML

Can I completely rely upon jQuery's html() method behaving identical to innerHTML? Is there any difference between innerHTML and jQuery's html() method? If these methods both do the same, can I use jQ..

Uncaught Typeerror: cannot read property 'innerHTML' of null

Can anyone explain what is theses errors? Uncaught TypeError: cannot read property 'innerHTML' of null View on my website This is the line which is causing the error: var idPost=document.getEle..

How to replace innerHTML of a div using jQuery?

How could I achieve the following: document.all.regTitle.innerHTML = 'Hello World'; Using jQuery where regTitle is my div id?..

Add inline style using Javascript

I'm attempting to add this code to a dynamically created div element style = "width:330px;float:left;" The code in which creates the dynamic div is var nFilter = document.createElement('div'); n..

React.js: Set innerHTML vs dangerouslySetInnerHTML

Is there any "behind the scenes" difference from setting an element's innerHTML vs setting the dangerouslySetInnerHTML property on an element? Assume I'm properly sanitizing things for the sake of sim..

Add/remove HTML inside div using JavaScript

I want to be able to add multiple rows to a div and also removing them. I have a '+' button at the top of the page which is for adding content. Then to the right of every row there is a '-' button tha..

Executing <script> elements inserted with .innerHTML

I've got a script that inserts some content into an element using innerHTML. The content could for example be: <script type="text/javascript">alert('test');</script> <strong>test&l..

Javascript - Append HTML to container element without innerHTML

I need a way to append HTML to a container element without using innerHTML. The reason why I do not want to use innerHTML is because when it is use like this: element.innerHTML += htmldata It works ..

How to get the innerHTML of selectable jquery element?

I have a php generated list whose list items are selectable using jquery selectable widget. The list for all intents and purposes is: <ul id="#select-image"> <li class="ui-widget-content..

Angular 2 - innerHTML styling

I am getting chunks of HTML codes from HTTP calls. I put the HTML blocks in a variable and insert it on my page with[innerHTML] but i can not style the inserted HTML block. Does anyone have any sugges..

Does document.body.innerHTML = "" clear the web page?

When I refresh the page below in FF 3.0, I expected the web page to clear but it didn't. Why doesn't document.body.innerHTML = "" clear the page? UPDATE: I am trying to clear the previous screen dur..

Rails 4 image-path, image-url and asset-url no longer work in SCSS files

Are we supposed to use something else aside from image-url and others in Rails 4? They return different values that don't seem to make sense. If I have logo.png in /app/assets/images/logo.png and I do..

How to get .app file of a xcode application

I have created an xcode project. Now I want to give .app file to my friend to use that application. From where do I get this file? How to install this .app file in his Applications folder using an ins..

Java: object to byte[] and byte[] to object converter (for Tokyo Cabinet)

I need to convert objects to a byte[] to be stored in the Tokyo Cabinet key-value store. I also need to unbyte the byte[] to an Object when reading from the key-value store. Are there any packages ou..

What's the difference between `raw_input()` and `input()` in Python 3?

What is the difference between raw_input() and input() in Python 3?..

Rails: Address already in use - bind(2) (Errno::EADDRINUSE)

I am trying to deploy Rails app with the Puma web server. When trying to start Puma server with a config file bundle exec puma -C config/puma.rb I get an error that the address is already in use. Doe..

json_encode(): Invalid UTF-8 sequence in argument

I'm calling json_encode() on data that comes from a MySQL database with utf8_general_ci collation. The problem is that some rows have weird data which I can't clean. For example symbol ?, so once it r..

How do I find out if first character of a string is a number?

In Java is there a way to find out if first character of a string is a number? One way is string.startsWith("1") and do the above all the way till 9, but that seems very inefficient. ..

How to create file execute mode permissions in Git on Windows?

I use Git in Windows, and want to push the executable shell script into git repo by one commit. Usually I need to do two steps (git commit). $ vi $ git add $ git commit -am "..

How do I vertically align text in a paragraph?

I would like to know to align the text in a p element to be vertically centered. Here are my styles: _x000D_ _x000D_ p.event_desc { font: bold 12px "Helvetica Neue", Helvetica, Arial, sans-serif;..

I can't install pyaudio on Windows? How to solve "error: Microsoft Visual C++ 14.0 is required."?

I have a Windows 10 PC and I want to install pyaudio to use it with my chatbot, powered by chatterbot. I tried 2 different ways to install pyaudio. The first way is doing this on the command prompt:..

Matplotlib scatter plot with different text at each data point

I am trying to make a scatter plot and annotate data points with different numbers from a list. So, for example, I want to plot y vs x and annotate with corresponding numbers from n. y = [2.56422, 3...

How to make Python speak

How could I make Python say some text? I could use Festival with subprocess but I won't be able to control it (or maybe in interactive mode, but it won't be clean). Is there a Python TTS library? Li..

How can I take a screenshot with Selenium WebDriver?

Is it possible to take a screenshot using Selenium WebDriver? (Note: Not Selenium Remote Control)..

How to export a CSV to Excel using Powershell

I'm trying to export a complete CSV to Excel by using Powershell. I stuck at a point where static column names are used. But this doesn't work if my CSV has generic unknown header names. Steps to rep..

How can I concatenate two arrays in Java?

I need to concatenate two String arrays in Java. void f(String[] first, String[] second) { String[] both = ??? } What is the easiest way to do this?..

How to do a less than or equal to filter in Django queryset?

I am attempting to filter users by a custom field in each users profile called profile. This field is called level and is an integer between 0-3. If I filter using equals, I get a list of users with ..

Real differences between "java -server" and "java -client"?

Is there any real practical difference between "java -server" and "java -client"? All I can find on Sun's site is a vague "-server starts slower but should run faster". What are the real d..

How to read the value of a private field from a different class in Java?

I have a poorly designed class in a 3rd-party JAR and I need to access one of its private fields. For example, why should I need to choose private field is it necessary? class IWasDesignedPoorly { ..

Java: How to get input from System.console()

I am trying to use Console class to get input from user but a null object is returned when I call System.console(). Do I have to change anything before using System.console? Console co=System.console..

Can I safely delete contents of Xcode Derived data folder?

I am running low on disk space and checked through a third party utility that among other things that ~/Library/Developer/Xcode/DerivedData directory is taking about 22GB of disk space. I searched st..

error C2220: warning treated as error - no 'object' file generated

I have below class class Cdata12Mnt { public: char IOBname[ID1_IOB_PIOTSUP-ID1_IOB_TOP][BOADNAM_MAX + 4]; char ExIOBname[ID1_MAX_INF-ID1_EXIOB_U1TOP][BOADNAM_MAX + 4]; char cflpath[256]; ..

Need a query that returns every field that contains a specified letter

I have an SQL table with 11000 keywords in it. I want a query that can find fields which contain a certain letter. So, if I include "a" and "b" the query will select all fields which contain the let..

UICollectionView auto scroll to cell at IndexPath

Before loading the collection view user sets the number of image in the array of collection view. All of the cells don't fit on the screen. I have 30 cells and only 6 on the screen. The question: How..

How to disable margin-collapsing?

Is there a way to disable margin-collapsing altogether? The only solutions I've found (by the name of "uncollapsing") entail using a 1px border or 1px padding. I find this unacceptable: the extraneo..

Change the fill color of a cell based on a selection from a Drop Down List in an adjacent cell

This is my first time here so I hope I'm doing things right. First of all, I have been investigating this for quite a while, and have found many useful tips for manipulating cell colors in Excel, but..

How to connect access database in c#

I have access database file with 7 tables in it but I don't know how to connect and show all tables, If some one can help me? this is my code but it doesn't show anything private void button1_Click..

Global variables in AngularJS

I have a problem where i'm initialising a variable on the scope in a controller. Then it gets changed in another controller when a user logs in. This variable is used to control things such as the nav..

SVN Repository Search

Is there any good software that will allow me to search through my SVN respository for code snippets? I found 'FishEye' but the cost is 1,200 and well outside my budget...

trying to animate a constraint in swift

I have a UITextField that I want to enlarge its width when tapped on. I set up the constraints and made sure the constraint on the left has the lower priority then the one that I am trying to animate ..

How do I initialize a TypeScript Object with a JSON-Object?

I receive a JSON object from an AJAX call to a REST server. This object has property names that match my TypeScript class (this is a follow-on to this question). What is the best way to initialize it..

When is " reset by peer" thrown?

ERROR GServerHandler - Connection reset by peer Connection reset by peer at Method) at

Reading integers from binary file in Python

I'm trying to read a BMP file in Python. I know the first two bytes indicate the BMP firm. The next 4 bytes are the file size. When I execute: fin = open("hi.bmp", "rb") firm = file_si..

Python equivalent of a given wget command

I'm trying to create a Python function that does the same thing as this wget command: wget -c --read-timeout=5 --tries=0 "$URL" -c - Continue from where you left off if the download is interrupted...

Shrinking navigation bar when scrolling down (bootstrap3)

I would like to build a navigation-bar effect like it is on on my page (after scrolling down the bar getting smaller and the logo changes). Im using bootstrap 3 for my page. Is the..

create a trusted self-signed SSL cert for localhost (for use with Express/Node)

Trying to follow various instructions on creating a self-signed cert for use with localhost, Most of the instructions seem to be for IIS, but I'm trying to use Nodejs/Express. None of them work pro..

How to get the list of all printers in computer

I need to get the list of all printers that connect to computer? How I can do it in C#, WinForms?..

Parse XML using JavaScript

I need to be able to parse XML using JavaScript. The XML will be in a variable. I would prefer not to use jQuery or other frameworks. I have looked at this, XML > jQuery reading...

SQL update statement in C#

I have table "Student" P_ID LastName FirstName Address City 1 Hansen Ola 2 Svendson Tove 3 Petterson Kari 4 Nilsen Johan..

Toggle button using two image on different state

I need to make a toggle button using two image instead of ON/OFF state. At off state i set a background image.But the OFF text can not removed while i use background image. And i can not set another..

How to set the height and the width of a textfield in Java?

I was trying to make my JTextField fill the width and set a height for it but still failed. I tried adding the code setPreferredSize(new Dimension(320,200)); but still failed. Is there any way I can m..

Java regex to extract text between tags

I have a file with some custom tags and I'd like to write a regular expression to extract the string between the tags. For example if my tag is: [customtag]String I want to extract[/customtag] How..

Detecting a redirect in ajax request?

I want to use jQuery to GET a URL and explicitly check if it responded with a 302 redirect, but not follow the redirect. jQuery's $.ajax appears to always follow redirects. How can I prevent this, a..

How to install bcmath module?

How do I install the bcmath module on a server? I tried yum update php-bcmath but it said it found nothing...

How to access Spring MVC model object in javascript file?

I am using spring 3 MVC and i have below classes. External system would call my application using below URL: http://somehost/root/param1/param2/param3 I have a spring MVC controller method as belo..

Rebuild Docker container on file changes

For running an ASP.NET Core application, I generated a dockerfile which build the application and copys the source code in the container, which is fetched by Git using Jenkins. So in my workspace, I d..

any tool for java object to object mapping?

I am trying to convert DO to DTO using java and looking for automated tool before start writing my own. I just wanted to know if there any free tool available for the same...

How to make an empty div take space

This is my 960 grid system case: <div class="kundregister_grid_full"> <div class="kundregister_grid_1">ID</div> <div class="kundregister_grid_1">Namn</div> &..

Test iOS app on device without apple developer program or jailbreak

How can I test an iOS application on my iPod Touch without registering for the Apple Developer Program or jailbreaking my iPod? Neither is a viable option at the moment. I'd like to test on the devi..

postgres, ubuntu how to restart service on startup? get stuck on clustering after instance reboot

I have a Postgres db 9.1 running on AWS EC2, with ubuntu 12.04. I messed a lot with the instance (i.e installed all kinds of postgres X.X before i settled on 9.1). Now after a month working on that ..

How can I override the OnBeforeUnload dialog and replace it with my own?

I need to warn users about unsaved changes before they leave a page (a pretty common problem). window.onbeforeunload = handler This works but it raises a default dialog with an irritating standard me..

How do I trigger a macro to run after a new mail is received in Outlook?

I'm writing a macro that creates tickets on a database based on alerts received from a Nagios server as an email. However, I cannot let the macro run in an infinite loop while checking for mails becau..

What's the difference between a mock & stub?

I've read various articles about mocking vs stubbing in testing, including Martin Fowler's Mocks Aren't Stubs, but still don't understand the difference...

how to change onclick event with jquery?

I have create a js file in which i am creating the dynamic table and dynamically changing the click event for the calendar but onclicking the calender image for dynamic generated table, calendar popup..

How to alter SQL in "Edit Top 200 Rows" in SSMS 2008

In SQL Server 2008 Management Studio, when I right click on a database table and choose "Select Top 100 Rows", I can then e.g. easily add a "ORDER BY " statement to the SQL. That works fine. But when..

MySQL ORDER BY rand(), name ASC

I would like to take a database of say, 1000 users and select 20 random ones (ORDER BY rand(),LIMIT 20) then order the resulting set by the names. I came up with the following query which is not worki..

The absolute uri: cannot be resolved in either web.xml or the jar files deployed with this application

I am using JDK 1.7, Apache Tomcat 7.0.23 and I have placed JSTL core library(1.2) and STANDARD jar in WEB_INF lib folder it is not giving me any warning but when I will try to run the code <%@ ta..

How can getContentResolver() be called in Android?

I want to know the context in which getContentResolver() is called? I have a scenario like this: I have an activity A that calls a method myFunc() of class B which is not an activity. So, in class B ..

Where is the Android SDK folder located?

I created with Adobe Flash an .apk app through Air for Android. Now I would like to make it ready for the Blackberry App World with this Blackberry online packager:

Select DISTINCT individual columns in django?

I'm curious if there's any way to do a query in Django that's not a "SELECT * FROM..." underneath. I'm trying to do a "SELECT DISTINCT columnName FROM ..." instead. Specifically I have a model that l..

Run automatically program on startup under linux ubuntu

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

align text center with android

I know it sounds easy. I need to put a text in center, but when the text is too long it needs to go below, but still align in the center of my xml. Here's my code : <LinearLayout android:la..

Build query string for System.Net.HttpClient get

If I wish to submit a http get request using System.Net.HttpClient there seems to be no api to add parameters, is this correct? Is there any simple api available to build the query string that doesn..

When is it acceptable to call GC.Collect?

The general advise is that you should not call GC.Collect from your code, but what are the exceptions to this rule? I can only think of a few very specific cases where it may make sense to force a ga..

Sorting rows in a data table

We have two columns in a DataTable, like so: COL1 COL2 Abc 5 Def 8 Ghi 3 We're trying to sort this datatable based on COL2 in decreasing order. COL1 COL2 ghi 8 a..

Updating a local repository with changes from a GitHub repository

I've got a project checked locally from GitHub, and that remote repository has since had changes made to it. What's the correct command to update my local copy with the latest changes?..

Memory address of variables in Java

Please take a look at the picture below. When we create an object in java with the new keyword, we are getting a memory address from the OS. When we write out.println(objName) we can see a "special" ..

How to work offline with TFS

Our TFS server has some temporary connectivity issues right now, and as such VS has gone unresponsive, leaving 50+ developers unable to work! Is it possible to switch TFS into an offline mode in the ..

How to reset sequence in postgres and fill id column with new data?

I have a table with over million rows. I need to reset sequence and reassign id column with new values (1, 2, 3, 4... etc...). Is any easy way to do that?..

How do I make an HTTP request in Swift?

I read The Programming Language Swift by Apple in iBooks, but cannot figure out how to make an HTTP request (something like cURL) in Swift. Do I need to import Obj-C classes or do I just need to impor..

Understanding generators in Python

I am reading the Python cookbook at the moment and am currently looking at generators. I'm finding it hard to get my head round. As I come from a Java background, is there a Java equivalent? The book..

Centering a div block without the width

I have a problem when I try to center the div block "products" because I don't know in advance the div width. Anybody have a solution? Update: The problem I have is I don't know how many products I'..

Auto increment primary key in SQL Server Management Studio 2012

How do I auto increment the primary key in a SQL Server database table, I've had a look through the forum but can't see how. I've looked the the properties but can't see an option, I have seen an ans..

Target WSGI script cannot be loaded as Python module

I am trying to deploy mod_wsgi with apache to run a django application but I am getting an error 500 internal server error The apache logs shows: [Thu Jun 23 14:01:47 2011] [error] [client 152.78.95...

How to verify a method is called two times with mockito verify()

I want to verify if a method is called at least once through mockito verify. I used verify and it complains like this: org.mockito.exceptions.verification.TooManyActualInvocations: Wanted 1 time: Bu..

How to write a simple Java program that finds the greatest common divisor between two numbers?

Here is the question: "Write a method named gcd that accepts two integers as parameters and returns the greatest common divisor of the two numbers. The greatest common divisor (GCD) of two integers a..

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

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

Move column by name to front of table in pandas

Here is my df: Net Upper Lower Mid Zsore Answer option More than once a day 0% 0.22% -0.12% 2 65 O..

Regular Expression Match to test for a valid year

Given a value I want to validate it to check if it is a valid year. My criteria is simple where the value should be an integer with 4 characters. I know this is not the best solution as it will not al..

How do I get my solution in Visual Studio back online in TFS?

I had my solution in Visual Studio 2012 (which is under TFS source control) open and the TFS server (2010) was down. When I then made a change to one of the files and attempted to save it I got a prom..

Default string initialization: NULL or Empty?

I have always initialized my strings to NULL, with the thinking that NULL means the absence of a value and "" or String.Empty is a valid value. I have seen more examples lately of code wher..

Parse JSON response using jQuery

I'm dealing with a JSON Response in one of my applications. I have established a connection using jsonp successfully. But I'm not able to parse my response. Code: <script type='text/javascript'&g..

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

How might I find the largest number contained in a JavaScript array?

I have a simple JavaScript Array object containing a few numbers. [267, 306, 108] Is there a function that would find the largest number in this array?..

How to decrypt the password generated by wordpress

I am using a wordpress site. I just want to know , How to get a plain text from encrypted password(stored in wordpress database). I used the $wp_hasher->CheckPassword($plain_password, $password_has..

How Can I Truncate A String In jQuery?

I have long titles and want truncate them but in a way that no words break, I mean the cutting happen between words not cutting a word. How can I do it using jquery?..

Given two directory trees, how can I find out which files differ by content?

If I want find the differences between two directory trees, I usually just execute: diff -r dir1/ dir2/ This outputs exactly what the differences are between corresponding files. I'm interested in..

insert echo into the specific html element like div which has an id or class

I have this code. <html> <head> <style type="text/css"> body{background:#666666;} div{border:1px solid red;} </style> </head> <body> <?php $con = mysql_connect..

What is the right way to write my script 'src' url for a local development environment?

I'm working on a local environment and I'm not sure if I've written my src URl correctly because my functions aren't working. The bold script tag has the src in question. <!DOCTYPE html> <h..

iOS: Multi-line UILabel in Auto Layout

I'm having trouble trying to achieve some very basic layout behavior with Auto Layout. My view controller looks like this in IB: The top label is the title label, I don't know how many lines it wil..

Remove x-axis label/text in chart.js

How do I hide the x-axis label/text that is displayed in chart.js ? Setting scaleShowLabels:false only removes the y-axis labels. <script> var options = { scaleFontColor: "#fa0", ..

Show only two digit after decimal

How to get the double value that is only two digit after decimal point. for example if i=348842. double i2=i/60000; tv.setText(String.valueOf(i2)); this code generating 5.81403333. But I want ..

Multi-key dictionary in c#?

I know there isn't one in the BCL but can anyone point me to a good opensource one? By Multi I mean 2 keys. ;-)..

Makefile to compile multiple C programs?

This is an incredibly simple question, but I'm new to makefiles. I am trying to make a makefile that will compile two independent programs: program1: gcc -o prog1 program1.c program2: gcc -o..

Test if a vector contains a given element

How to check if a vector contains a given value?..

How to use ConcurrentLinkedQueue?

How do I use a ConcurrentLinkedQueue in Java? Using this LinkedQueue, do I need to be worried about concurrency in the queue? Or do I just have to define two methods (one to retrive elements from the ..


I would like to include an "AND" condition for one of the conditions I have in my COUNTIFS clause. Something like this: =COUNTIFS(A1:A196;{"Yes"or "NO"};J1:J196;"Agree") So, it should return the n..

Get max and min value from array in JavaScript

I am creating the following array from data attributes and I need to be able to grab the highest and lowest value from it so I can pass it to another function later on. var allProducts = $(products)...

How do I POST JSON data with cURL?

I use Ubuntu and installed cURL on it. I want to test my Spring REST application with cURL. I wrote my POST code at the Java side. However, I want to test it with cURL. I am trying to post a JSON data..

How to open every file in a folder

I have a python script, which in the script open a file, say file1, and then do something maybe print out the total number of characters. filename = 'file1' f = open(filename, 'r') content ..

What is an unsigned char?

In C/C++, what an unsigned char is used for? How is it different from a regular char?..

Can you use Microsoft Entity Framework with Oracle?

Is it possible to use Microsoft Entity Framework with Oracle database?..

Maven version with a property

I have big Maven (Tycho) project witch about 400 plug-ins. We have specified version of application in each POM file. Is there a way how to specify the version for all POM:s only on one place? I wo..

Best way to change the background color for an NSView

I'm looking for the best way to change the backgroundColor of an NSView. I'd also like to be able to set the appropriate alpha mask for the NSView. Something like: myView.backgroundColor = [NSColor..

Summarizing count and conditional aggregate functions on the same factor

Quick and short of it is I'm having problems summarizing count and aggregate functions with conditions on the same factor. Suppose I have this dataframe: library(dplyr) df = tbl_df(data.frame( ..

How to test if a string contains one of the substrings in a list, in pandas?

Is there any function that would be the equivalent of a combination of df.isin() and df[col].str.contains()? For example, say I have the series s = pd.Series(['cat','hat','dog','fog','pet']), and I ..

Whitespace Matching Regex - Java

The Java API for regular expressions states that \s will match whitespace. So the regex \\s\\s should match two spaces. Pattern whitespace = Pattern.compile("\\s\\s"); matcher = whitespace.matcher(mo..

Where is the IIS Express configuration / metabase file found?

Where can the IIS Express configuration / metabase file be found?..

How to make a div with no content have a width?

I am trying to add a width to a div, but I seem to be running into a problem because it has no content. Here is the CSS and HTML I have so far, but it is not working: CSS body{ margin:0 auto; width:10..

Spring default behavior for lazy-init

I am beginner to spring, ESP Inversion of control. I was puzzled understanding the difference between the following <bean id="demo" class="Demo" lazy-init="false"/> <bean id="demo" class=..

Access: Move to next record until EOF

I need to loop through a form by moving to the next record in the recordset. I am using the Form_Current event to loop thru. I have used a couple of statements and have different outcomes. This one ..

What's the difference between a single precision and double precision floating point operation?

What is the difference between a single precision floating point operation and double precision floating operation? I'm especially interested in practical terms in relation to video game consoles. Fo..

How to return a value from pthread threads in C?

I'am new to C and would like to play with threads a bit. I would like to return some value from a thread using pthread_exit() My code is as follows: #include <pthread.h> #include <stdio.h&g..

How do I check out a specific version of a submodule using 'git submodule'?

How would I go about adding a Git submodule for a specific tag or commit?..

How to top, left justify text in a <td> cell that spans multiple rows

I have the following html code: <table border="1"> <tr> <th>Month</th> <th>Savings</th> </tr> <tr> <td>January</td> &..

How to display HTML in TextView?

I have simple HTML: <h2>Title</h2><br> <p>description here</p> I want to display HTML styled text it in TextView. How to do this?..

How to convert the following json string to java object?

I want to convert the following JSON string to a java object: String jsonString = "{ "libraryname":"My Library", "mymusic":[{"Artist Name":"Aaron","Song Name":"Beautiful"}, {"Artist Name":"Britney","..

MySql Error: 1364 Field 'display_name' doesn't have default value

I have just switched from a MAMP installation to a native Apache, MySql and PHP installation. I have got everything working, but I have started using my web app in the new environment and suddenly any..

Print in one line dynamically

I would like to make several statements that give standard output without seeing newlines in between statements. Specifically, suppose I have: for item in range(1,100): print item The result i..

Python "SyntaxError: Non-ASCII character '\xe2' in file"

I am writing some python code and I am receiving the error message as in the title, from searching this has to do with the character set. Here is the line that causes the error hc = HealthCheck("in..

What does "Could not find or load main class" mean?

A common problem that new Java developers experience is that their programs fail to run with the error message: Could not find or load main class ... What does this mean, what causes it, and how sho..

How to add multiple files to Git at the same time

This will be my first git use. I have added new files ( a lot ) to the folder/project ( git local repository). I went through online tutorials and forums and see i can do git commit -a So I go to the..

How To Run PHP From Windows Command Line in WAMPServer

I'm new to php and wanted to run php from command line. I have installed WAMP and set the "System Variables" to my php folder ( which is C:\wamp\bin\php\php5.4.3). When i go to Run -> CMD -> Type php..

npm install hangs

This is my package.json: { "name": "my-example-app", "version": "0.1.0", "dependencies": { "request": "*", "nano": "3.3.x", "async": "~0.2" } } Now, when I open the cmd and run npm install..

How to get SQL from Hibernate Criteria API (*not* for logging)

Is there a way to get the (to-be-generated) SQL from a Hibernate Criteria? Ideally, I would have something like: Criteria criteria = session.createCriteria(Operator.class); ... build up the criteri..

REACT - toggle class onclick

I am trying to figure out how to toggle an active class onClick to change CSS properties. I have taken many approaches, and read many SO answers. Using jquery it would be relatively simple , however,..

How is using OnClickListener interface different via XML and Java code?

Possible Duplicate: Difference between OnClick() event and OnClickListener? I'm semi-new to Android development and when I first started I tried to avoid using the xml layout by any means n..

Find the unique values in a column and then sort them

I have a pandas dataframe. I want to print the unique values of one of its columns in ascending order. This is how I am doing it: import pandas as pd df = pd.DataFrame({'A':[1,1,3,2,6,2,8]}) a = df['..

How do I navigate to another page when PHP script is done?

I have a simple POST script that I need to return to the page that was doing the Posting. Is there any way to do it like this? if($done) { //go to page } ..

How should strace be used?

A colleague once told me that the last option when everything has failed to debug on Linux was to use strace. I tried to learn the science behind this strange tool, but I am not a system admin guru a..

How can I force a long string without any blank to be wrapped?


nodejs vs node on ubuntu 12.04

I installed nodejs on ubuntu from instructions given here When I write node --version in the terminal I see this : -bash: /usr/sbin/node: No such file or directory I can see node in the /usr/sbin/ ..

Check if a string is a date value

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

Test if a variable is a list or tuple

In python, what's the best way to test if a variable contains a list or a tuple? (ie. a collection) Is isinstance() as evil as suggested here? Update: th..

How to give a pandas/matplotlib bar graph custom colors

I just started using pandas/matplotlib as a replacement for Excel to generate stacked bar charts. I am running into an issue (1) there are only 5 colors in the default colormap, so if I have more ..

How to take complete backup of mysql database using mysqldump command line utility

How can I make a complete backup of mysql database using mysqldump? When I am making a backup, my tables from specified database are only getting backed up. The procedures and functions are not. Here..

React eslint error missing in props validation

I have the next code, eslint throw: react/prop-types onClickOut; is missing in props validation react/prop-types children; is missing in props validation propTypes was defined but eslint does not re..

How do you validate a URL with a regular expression in Python?

I'm building an app on Google App Engine. I'm incredibly new to Python and have been beating my head against the following problem for the past 3 days. I have a class to represent an RSS Feed and in ..

How to access the correct `this` inside a callback?

I have a constructor function which registers an event handler: _x000D_ _x000D_ function MyConstructor(data, transport) {_x000D_ = data;_x000D_ transport.on('data', function () {_x0..

How to tell if a string is not defined in a Bash shell script

If I want to check for the null string I would do [ -z $mystr ] but what if I want to check whether the variable has been defined at all? Or is there no distinction in Bash scripting?..

converting epoch time with milliseconds to datetime

I have used a ruby script to convert iso time stamp to epoch, the files that I am parsing has following time stamp structure: 2009-03-08T00:27:31.807 Since I want to keep milliseconds I used follo..

How to embed an autoplaying YouTube video in an iframe?

I am trying to embed the new iframe version of a YouTube video and get it to auto play. As far as I can tell, there is no way of doing this by amending flags to the URL. Is there a way to do it by u..

Split a string into array in Perl

my $line = "file1.gz file2.gz file3.gz"; my @abc = split('', $line); print "@abc\n"; Expected output: file1.gz file2.gz file3.gz I want the output to be file1.gz in $abc[0], file2.gz in $abc[1], ..

Use querystring variables in MVC controller

I am new to MVC and am trying to add FullCalendar to an MVC application. The FullCalendar script automatically adds ?start={}&end={} to the URL...which is fine, but I have no idea how to..

Splitting a dataframe string column into multiple different columns

What I am trying to accomplish is splitting a column into multiple columns. I would prefer the first column to contain "F", second column "US", third "CA6" or "DL", and the fourth to be "Z13" or "U13..

Load view from an external xib file in storyboard

I want to use a view throughout multiple viewcontrollers in a storyboard. Thus, I thought about designing the view in an external xib so changes are reflected in every viewcontroller. But how can one ..

How do I run a program with a different working directory from current, from Linux shell?

Using a Linux shell, how do I start a program with a different working directory from the current working directory? For example, I have a binary file helloworld that creates the file hello-world.txt..

Create list or arrays in Windows Batch

Can I declare a list or array in a batch file like this: set list = "A B C D" And then I need to write these to a file, with the spaces between: A B C D ..

Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse (<anonymous>)

I need some help with this error : Uncaught SyntaxError: Unexpected end of JSON input at JSON.parse () at Object.success (dashboard.js:22) at fire (jquery-3.3.1.js:3268) at..

Int to byte array

I thought .net had some kind of easy conversion method to use for converting an int into a byte array? I did a quick search and all solutions are bit masking/shifting one byte at a time, like "the goo..

Loading scripts after page load?

I work with an advertising company, where we tag certain pages to track activity. A client of mine wants to fire off a javascript tag to track activity AFTER the page has finished loading entirely (to..

download and install visual studio 2008

Ok, this may be the dumbest question ever, but I swear I searched for the answer and don't know what to do. I need to install Visual Studio 2008. The free version. I need it in order to compile somet..

Button button = findViewById( always resolves to null in Android Studio

I'm new to Android development and Android Studio, so pardon my ignorance. findViewById of a button I added always resolves to null. Hence if I try to setonClickListener it fails the whole Activity...

Boolean.parseBoolean("1") = false...?

sorry to be a pain... I have: HashMap<String, String> o o.get('uses_votes'); // "1" Yet... Boolean.parseBoolean(o.get('uses_votes')); // "false" I'm guessing that ....parseBoolean doesn't ..

What is the best project structure for a Python application?

Imagine that you want to develop a non-trivial end-user desktop (not web) application in Python. What is the best way to structure the project's folder hierarchy? Desirable features are ease of maint..

Java web start - Unable to load resource

I've got a jar that loads great with java web start when I browse through the IP address of the server. Once I try the server name instead I get the following exception:

Sass and combined child selector

I've just discovered Sass, and I've been so excited about it. In my website I implement a tree-like navigation menu, styled using the child combinator (E > F). Is there any way to rewrite this ..

Error in : figure margins too large in R

I'm new to R but I've made numerous correlation plots with smaller data sets. However, when I try to plot a large dataset (2gb+), I can produce the plot just fine, but the legend doesn't show up. Any ..

jQuery - simple input validation - "empty" and "not empty"

I have an input that I want to validate: <input type="text" id="input" /> And here's the JS: jQuery("#input").live('change', function() { if("#input:not(:empty)") { ..

Mips how to store user input string

I used to think I knew how to do this. But then I actually tried to do it. Here's the program I wrote but the Berkeley S*** simulator for mac said there was a syntax error on the last line. What did I..

Creating a "Hello World" WebSocket example

I don't understand why I cannot make the following code work. I want to connect with JavaScript to my server console application. And then send data to the server. Here is the server code: stati..

What is the difference between children and childNodes in JavaScript?

I have found myself using JavaScript and I ran across childNodes and children properties. I am wondering what the difference between them is. Also is one preferred to the other?..

NPM Install Error:Unexpected end of JSON input while parsing near '...nt-webpack-plugin":"0'

When Creating a new Angular 5 project: node version: 8.9.2 npm version: 5.5.1 My Command is npm install -g @angular/cli the Error is npm ERR! **Unexpected end of JSON input while parsing near..

JQuery - Storing ajax response into global variable

Im still somewhat of a newbie on jQuery and the ajax scene, but I have an $.ajax request performing a GET to retrieve some XML files (~6KB or less), however for the duration the user spends on that pa..

Java to Jackson JSON serialization: Money fields

Currently, I'm using Jackson to send out JSON results from my Spring-based web application. The problem I'm having is trying to get all money fields to output with 2 decimal places. I wasn't able to ..

Is there a simple JavaScript slider?

I need to create a custom volume slider for a WMP object. The current slider is complicated to modify, and use, is there a simple way to generate a slider on an HTML page that can have it's value pas..

What is the difference between display: inline and display: inline-block?

What exactly is the difference between the inline and inline-block values of CSS display?..

JWT refresh token flow

I'm building a mobile app and am using JWT for authentication. It seems like the best way to do this is to pair the JWT access token with a refresh token so that I can expire the access token as freq..

What is the first character in the sort order used by Windows Explorer?

For example, in a Windows folder, if we create some files and name them 1.html, 2.txt, 3.txt, photo.jpg, zen.png the order will be as is. But if we create another file with the name _file.doc it will ..

Android activity life cycle - what are all these methods for?

What is the life cycle of an Android activity? Why are so many similar sounding methods (onCreate(), onStart(), onResume()) called during initialization, and so many others (onPause(), onStop(), onDes..

Correct way of using log4net (logger naming)

There are two ways of configuring and using log4net. First one is when I can configure my own appender and associated logger: <!-- language: xml --> <appender name="myLogAppender" type="log..

Changing cursor to waiting in javascript/jquery

How would i get my cursor to change to this loading icon when a function is called and how would i change it back to a normal cursor in javascript/jquery..

Perl regular expression (using a variable as a search string with Perl operator characters included)

$text_to_search = "example text with [foo] and more"; $search_string = "[foo]"; if ($text_to_search =~ m/$search_string/) print "wee"; Please observe the above code. For some reason I would lik..

How do I iterate through table rows and cells in JavaScript?

If I have an HTML table...say <div id="myTabDiv"> <table name="mytab" id="mytab1"> <tr> <td>col1 Val1</td> <td>col2 Val2</td> </tr> <..

Cut Corners using CSS

I'm looking to "cut" the top left corner of a div, like if you had folded the corner of a page down. I'd like to do it in pure CSS, are there any methods?..

Is it possible to create a File object from InputStream

Is there any way to create a object from an ? My requirement is reading the File from a RAR . I am not trying to write a temporary File, I have a file inside RAR arch..

Git Push ERROR: Repository not found

I am having a very strange problem with git and github. When I try and push, I am getting: git push -u origin master ERROR: Repository not found. fatal: The remote end hung up unexpectedly I added ..

Recommended date format for REST GET API

What's the recommended timestamp format for a REST GET API like this:{timestamp} I think the actual date format should be ISO 8601 format, such as YYYY-MM-DDThh:m..

Random Number Between 2 Double Numbers

Is it possible to generate a random number between 2 doubles? Example: public double GetRandomeNumber(double minimum, double maximum) { return Random.NextDouble(minimum, maximum) } Then I cal..

Iterating through map in template

I am trying to display a list gym classes (Yoga, Pilates etc). For each class type there are several classes, so I want to group all the Yoga classes, and all the Pilates classes and so on. I made th..

Check if Key Exists in NameValueCollection

Is there a quick and simple way to check if a key exists in a NameValueCollection without looping through it? Looking for something like Dictionary.ContainsKey() or similar. There are many ways to s..

Reading HTML content from a UIWebView

Is it possible to read the raw HTML content of a web page that has been loaded into a UIWebView? If not, is there another way to pull raw HTML content from a web page in the iPhone SDK (such as an eq..

How to change plot background color?

I am making a scatter plot in matplotlib and need to change the background of the actual plot to black. I know how to change the face color of the plot using: fig = plt.figure() fig.patch.set_faceco..

Hibernate error: ids for this class must be manually assigned before calling save():

Caused by: org.springframework.orm.hibernate3.HibernateSystemException: ids for this class must be manually assigned before calling save(): com.rfid.model.Role; nested exception is

"The transaction log for database is full due to 'LOG_BACKUP'" in a shared host

I have an Asp.Net MVC 5 website with EntityFramework codefirst approach in a shared hosting plan. It uses the open source WebbsitePanel for control panel and its SQL Server panel is somewhat limited. ..

How do I debug Windows services in Visual Studio?

Is it possible to debug the Windows services in Visual Studio? I used code like System.Diagnostics.Debugger.Break(); but it is giving some code error like: I got two event error: eventID 4096 ..

How to encrypt a large file in openssl using public key

How can I encrypt a large file with a public key so that no one other than who has the private key be able to decrypt it? I can make RSA public and private keys but when it comes to encrypting a lar..

How to change MySQL data directory?

Is it possible to change my default MySQL data directory to another path? Will I be able to access the databases from the old location?..

How to adjust the size of y axis labels only in R?

How can I adjust only the size of Y-axis labels in R? I know that cex.axis alters the size of the axis labels but it only affects the x-axis. Why, and how can I adjust the y axis?.. Connection reset

I am getting the following error trying to read from a socket. I'm doing a readInt() on that InputStream, and I am getting this error. Perusing the documentation this suggests that the client part of ..

Reset all changes after last commit in git

How can I undo every change made to my directory after the last commit, including deleting added files, resetting modified files, and adding back deleted files?..

Regular expression for URL validation (in JavaScript)

Does someone have a regex for validating urls (NOT for finding them inside a text passage)? JavaScript snippet would be preferred...

Restore the mysql database from .frm files

I have dumped all my tables everyweek to got the backup. But later I understand that it is only storing the .frm file of the table. It is not showing .MYD and .MYI files of a table. So I have only my ..

Oracle's default date format is YYYY-MM-DD, WHY?

Oracle's default date format is YYYY-MM-DD. Which means if I do: select some_date from some_table ...I lose the time portion of my date. Yes, I know you can "fix" this with: alter session set ..

Mercurial: how to amend the last commit?

I'm looking for a counter-part of git commit --amend in Mercurial, i.e. a way to modify the commit which my working copy is linked to. I'm only interested in the last commit, not an arbitrary earlier ..

Static link of shared library function in gcc

How can I link a shared library function statically in gcc?..

Writing to an Excel spreadsheet

I am new to Python. I need to write some data from my program to a spreadsheet. I've searched online and there seem to be many packages available (xlwt, XlsXcessive, openpyxl). Others suggest to write..

Is it necessary to use # for creating temp tables in SQL server?

Is it necessary to use # before creating a temporary table in SQL server? Example: SELECT column1, column2, someInt, someVarChar INTO ItemBack1 FROM table2 WHERE table2.ID = 7 For ItemBack1 is i..

How do I run Python code from Sublime Text 2?

I want to set up a complete Python IDE in Sublime Text 2. I want to know how to run the Python code from within the editor. Is it done using build system? How do I do it ?..

Adding Python Path on Windows 7

I've been trying to add the Python path to the command line on Windows 7, yet no matter the method I try, nothing seems to work. I've used the set command, I've tried adding it through the Edit Enviro..

How to inspect Javascript Objects

How can I inspect an Object in an alert box? Normally alerting an Object just throws the nodename: alert(document); But I want to get the properties and methods of the object in the alert box. How ..