Questions Tagged with #Html

HTML (Hyper Text Markup Language) is the standard markup language used for structuring web pages and formatting content. HTML describes the structure of a website semantically along with cues for presentation, making it a markup language, rather than a programming language. HTML works in conjunction primarily with CSS and JavaScript, adding presentation and behaviour to the pages. The most recent revision to the HTML specification is HTML5.2.

FormData.append("key", "value") is not working

Can you tell me whats wrong with this: var formdata = new FormData(); formdata.append("key", "value"); console.log(formdata); My output looks like this, I cant find my "key" - "value" pair FormDat..

How to change the style of the title attribute inside an anchor tag?

Example: <a href="" title="My site"> Link </a> How do I change the presentation of the "title" attribute in the browser?. By default, it just has yellow background and small ..

How can I let a table's body scroll but keep its head fixed in place?

I am writing a page where I need an HTML table to maintain a set size. I need the headers at the top of the table to stay there at all times but I also need the body of the table to scroll no matter h..

Links in <select> dropdown options

Is it possible for each dropdown options to link somewhere when selected without the need for an external button? <select> <option value="x">x</option> <option value="y">y..

Is it necessary to write HEAD, BODY and HTML tags?

Is it necessary to write <html>, <head> and <body> tags? For example, I can make such a page: <!DOCTYPE html> <meta http-equiv="Content-type" content="text/html; ..

XPath Query: get attribute href from a tag

I want to use XPath to get the href attribute from an a-tag, but it has two occurrences within the same file. How am I getting along? I need to check IF there is an href attribute with value $street/o..

How can I get name of element with jQuery?

How can I get name property of HTML element with jQuery?..

How to set min-height for bootstrap container

I have some issues with the container in bootstrap. My goal is to have a container which is only as high as the content. For example: <div class="container"> <img src="#.jpg" height="200px..

HTML5 input type range show range value

I am making a website where I want to use range slider(I know it only supports webkit browsers). I have integrated it fully and works fine. But I would like to use a textbox to show the current slide..

Bootstrap 3.0: How to have text and input on same line?

I'm currently switching my website over to Bootstrap 3.0. I'm having an issue with form input and text formatting. What worked in Bootstrap 2 does not work in Bootstrap 3. How can I get text on t..

Positioning <div> element at center of screen

I want to position a <div> (or a <table>) element at the center of the screen irrespective of screen size. In other words, the space left on 'top' and 'bottom' should be equal and space le..

How to set date format in HTML date input tag?

I am wondering whether it is possible to set the date format in the html <input type="date"></input> tag... Currently it is yyyy-mm-dd, while I need it in the dd-mm-yyyy format...

HTML: How to make a submit button with text + image in it?

I would like to have a submit button which contains text and an image. Is this possible? I can get the exact look I want with code that looks like: <button type="button"> <img src="save.gif..

How can I write text on a HTML5 canvas element?

Is it possible to write text on HTML5 canvas? ..

How do I install a custom font on an HTML site

I am not using flash or php - and I have been asked to add a custom font to a simple HTML layout. "KG June Bug" I have it downloaded locally - is there a simple CSS trick to accomplish this?..

How to get base64 encoded data from html image

I have a registration form where users can choose an avatar. They have 2 possibilities: Choose a default avatar Upload their own avatar In my HTML page I have this. <img id="preview" src="img/..

how to set the background color of the whole page in css

I am trying to set the background color of the page at to yellow. I have tried the following and it fails: body{ background-color: yellow;} /*only a sliver under the header turns yellow...

Cropping images in the browser BEFORE the upload

Many libraries I have found, like Jcrop, do not actually do the cropping, it only creates an image cropping UI. It then depends on the server doing the actual cropping. How can I make the image cropp..

How to set a:link height/width with css?

I just can't set the height and width of a elements of my navigation. #header div#snav div a{ width:150px; height:77px; } #header div#snav div a:link{ width:150px; height:77px; } #..

How (and why) to use display: table-cell (CSS)

I have a site with a very active background (I'm talking 6 or so different z-indexes here 2 with animations). I wanted a in the foreground that had content but wanted a "window" through to the backgr..

anchor jumping by using javascript

I have a question that will be found very often. The problem is that nowhere can be found an explicit solution. I have two problems regarding anchors. The main goal should be to get a nice clean url..

How does the "position: sticky;" property work?

I want to make the navigation bar stick to the top of the viewport once a user scrolls the page, but it's not working and I have no clue why. If you can please help, here is my HTML and CSS code: _x00..

How can I align text directly beneath an image?

I used to know how to put an image on top and then justify the text below the image so that it stays within the borders of the width of the image. However, now I have no idea how to do this. How is ..

How to align footer (div) to the bottom of the page?

Can anyone explain how to align a footer div to the bottom of the page. From the examples I've seen, they all show how to make the div stay visible at the bottom, no matter where you've scrolled the p..

What does the clearfix class do in css?

I've seen div tags use a clearfix class when it's child divs use the float property. The clearfix class looks like this: .clearfix:after { clear: both; content: "."; display: block; h..

Link a .css on another folder

I have some questions about how to link things. Imagine that I have a folder "Website" where my files for that website are stored, and another folder with fonts, and that the font folder has more fol..

Html attributes for EditorFor() in ASP.NET MVC

Why can't I pass in html attributes to EditorFor()? eg; <%= Html.EditorFor(model => model.Control.PeriodType, new { disabled = "disabled", readonly = "readonly" }) %> I don't want to..

Generating HTML email body in C#

Is there a better way to generate HTML email in C# (for sending via System.Net.Mail), than using a Stringbuilder to do the following: string userName = "John Doe"; StringBuilder mailBody = new String..

Get text of the selected option with jQuery

I have a select box with some values. How do I get the selected options text, not the value? <select name="options[2]" id="select_2"> <option value="">-- Please Select --</option&g..

How to prevent user from typing in text field without disabling the field?

I tried: $('input').keyup(function() { $(this).attr('val', ''); }); but it removes the entered text slightly after a letter is entered. Is there anyway to prevent the user from entering text c..

How to submit form on change of dropdown list?

I am creating a page in JSP where I have a dropdown list and once the user selects a value he has to click on the go button and then the value is sent to the Servlet. </select> ..

Get width in pixels from element with style set with %?

I have this element: <div style="width: 100%; height: 10px;"></div> I want to get it's width in pixels. I just tried this: document.getElementById('banner-contenedor').style.wid..

How to resize image automatically on browser width resize but keep same height?

I am trying to replicate the same effect that this website has: When the browser width is resized the image automatically gets smaller but the height of the area in..

input type="submit" Vs button tag are they interchangeable?

input type="submit" and button tag are they interchangeable? or if there is any difference then When to use input type="submit" and when button ? And if there is no difference then why we have 2 tags..

how to call a onclick function in <a> tag?

i want to open a new window on click of 1 $leadID = "<a href=', myWin, scrollbars=yes, width=400, height=650);'>1</a>"; it is not sh..

Can one AngularJS controller call another?

Is it possible to have one controller use another? For example: This HTML document simply prints a message delivered by the MessageCtrl controller in the messageCtrl.js file. <html xmlns:ng="htt..

How to format html table with inline styles to look like a rendered Excel table?

I'm currently stuck setting borders in an html table. (I use inline styles for a better rendering in e-mail-clients) I have this piece of code: <html> <body> <table style="..

How to trigger HTML button when you press Enter in textbox?

So the code that I have so far is: <fieldset id="LinkList"> <input type="text" id="addLinks" name="addLinks" value="http://"> <input type="button" id="linkadd" name="linkadd" v..

Blur the edges of an image or background image with CSS

I know there are a bunch of new CSS filters and I am wondering if there is a way to apply those to an image or background image. Everything I have read talks about softening the image with a drop sha..

How to detect DIV's dimension changed?

I've the following sample html, there is a DIV which has 100% width. It contains some elements. While performing windows re-sizing, the inner elements may be re-positioned, and the dimension of the di..

Passing parameters to a JQuery function

I'm creating HTML with a loop that has a column for Action. That column is a Hyperlink that when the user clicks calls a JavaScript function and passes the parameters... example: <a href="#" OnCl..

How to find the parent element using javascript

I want to change the background color of the table cell when radio button inside the cell is clicked. <table> <tr> <td align="center"> <input type="radio" value="fo..

Passing a variable from node.js to html

I am trying to pass a variable from node.js to my HTML file. app.get('/main', function(req, res) { var name = 'hello'; res.render(__dirname + "/views/layouts/main.html", {name:name}); }); ..

Checkboxes in web pages – how to make them bigger?

The standard checkboxes rendered in most browsers are quite small and don’t increase in size even when a larger font is used. What is the best, browser-independent way to display larger checkboxes?..

Set selected option of select box

I want to set a option that was selected previously to be displayed on page load. I tried it with the following code: $("#gate").val('Gateway 2'); with <select id="gate"> <option valu..

How to restrict user to type 10 digit numbers in input element?

I want to create a input field for phone number. I am creating input field using JavaScript dynamically. <input type="text" id="phone" name="phone"> How to restrict users to type only 10 dig..

what's the easiest way to put space between 2 side-by-side buttons in

I have 2 buttons side by side, and I would like to have some inbetween them. Following code will have 2 buttons right next to each other. I have tried margin for the div, and just couldn't get some n..

How to disable a link using only CSS?

Is there any way to disable a link using CSS? I have a class called current-page and want links with this class to be disabled so that no action occurs when they are clicked...

How to make a vertical line in HTML

How do you make a vertical line using HTML?..

How to avoid page refresh after button click event in

This is the following code the page refreshes as soon as the btninsert click event is completed i want to stop the page refresh after the btninsert is click <asp:UpdatePanel ID="UpdatePanel1" runa..

How to write :hover using inline style?

<a href="#">Alink</a> All i need is while i hover the color should change for the link, But it should be completely using only inline CSS *No Scripting or external CSS Please he..

Best HTML5 markup for sidebar

I'm setting up my WordPress sidebars for an HTML5 theme and really wanting to use before_widget and after_widget right. So my question is this: which of the two markup patterns is more appropriate? T..

How to change font size in html?

I am trying to make a website and I want to know how to change the size of text in a paragraph. I want paragraph 1 to be bigger than paragraph 2. It doesn't matter how much bigger, as long as it's big..

How do I make the text box bigger in HTML/CSS?

I am not sure where you edit the code for my question so I put both (sorry if that confuses anyone) In the top right hand corner there are two text boxes, but I'm not sure how to make them bigger in ..

Best way to track onchange as-you-type in input type="text"?

In my experience, input type="text" onchange event usually occurs only after you leave (blur) the control. Is there a way to force browser to trigger onchange every time textfield content changes? If..

Checking if a textbox is empty in Javascript

This is my code which was supposed to raise an alert message if the textbox is left empty: function a(id) { var n=document.getElementById(id).value; if (n.length < 1) { window...

textarea character limit

I would like to be able to limit the number of characters in a textarea. The method I am using works great in Google Chrome, but is slow in Firefox, and doesn't work in IE. Javascript: function len(..

How do I display ? Play (Forward) or Solid right arrow symbol in html?

How do I display this ? Play (Forward) or Solid right arrow symbol in html?..

Darken background image on hover

How would I darken a background image on hover without making a new darker image? CSS: .image { background: url(''); ..

Maximum and minimum values in a textbox

I have a textbox. Is there a way where the highest value the user can enter is 100 and the lowest is 0? So if the user types in a number more than 100 then it will automatically change the value to 1..

How to Set Focus on Input Field using JQuery

Given the following HTML structure: <div class="wrapper"> <div class="top"> <a href="" class="link">click here</a> </div> <div c..

Colspan all columns

How can I specify a td tag should span all columns (when the exact amount of columns in the table will be variable/difficult to determine when the HTML is being rendered)? w3schools mentions you can u..

Limiting the number of characters per line with CSS

I have a paragraph of text: <p>Lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ipsum lorem ..

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

HTML Table different number of columns in different rows

Like in Excel sheet can I have 2 columns in 1st row 1 long column in the 2nd row is this possible in html ?..

How can I change all input values to uppercase using Jquery?

I want to change all my form values to uppercase before the form is submitted. So far I have this but it's not working. $('#id-submit').click(function () { var allInputs = $(":input"); ..

Hide div by default and show it on click with bootstrap

I want to show and hide a div, but I want it to be hidden by default and to be able to show and hide it on click. Here is the code that I have made : <a class="button" onclick="$('#target').toggl..

Multiline TextBox multiple newline

I set a value for a Multiline Textbox like this. textBox1.Text = "Line1\r\n\r\nLine2"; But, only one line space in output. When I read the value of textbox, I read "Line1\r\nLine2"; Why does ASP...

How do I remove the horizontal scrollbar in a div?

When I set overflow: scroll, I get horizontal and vertical scrollbars. Is there a way to remove the horizontal scrollbar in a div?..

Does HTML5 <video> playback support the .avi format?

I am wondering if the HTML5 <video> tag now supports playback of .avi format video files...

Adding value to input field with jQuery

I want to add some value in an input field with jQuery. The problem is with the ID of the input field. I am using the id such as options[input2]. In that case my code does not work. If I use ID like i..

Position: absolute and parent height?

I have some containers and their children are only absolute / relatively positioned. How to set containers height so their children will be inside of them? Here's the code: HTML <section id="foo..

How to simulate a click by using x,y coordinates in JavaScript?

Is it possible to use given coordinates in order to simulate a click in JavaScript within a webpage?..

Redirecting to a new page after successful login

I'm sure this question has been asked before but I have searched thoroughly for an answer but to no avail. (The only answers I've seen involve ajax) But I'm using just javascript, PHP and HTML. I hav..

HTML input field hint

I want to provide the user with a hint on what he needs to enter into my text field. However, when I set the value, it does not disappear once a user clicks on the text field. How can you make it disa..

How to force a html5 form validation without submitting it via jQuery

I have this form in my app and I will submit it via AJAX, but I want to use HTML5 for client-side validation. So I want to be able to force the form validation, perhaps via jQuery. I want to trigger ..

Fixed header, footer with scrollable content

How can I get fixed header, footer with scrollable content? Something like this page. I can look at the source to get the CSS, but I just want to know minimum CSS and HTML I need to get this working. ..

align textbox and text/labels in html?

I cant figure it out. How do i align the textbox? I thought using float: left on the labels on the left (then doing it on the input when i notice the input was now on the left without that) but that w..

Nesting optgroups in a dropdownlist/select

I have created a customer c# DropDownList control that can render out it's contents are optgroups (Not from scratch, I edited some code found on the internet, although I do understand exactly what it'..

Forcing Internet Explorer 9 to use standards document mode

How can I force Internet Explorer 9 to use standards document mode? I built a website and I'm finding that IE9 uses quirks mode to render the website pages. But I want to use standards mode for render..

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

HTML+CSS: How to force div contents to stay in one line?

I have a long text inside a div with defined width: HTML: <div>Stack Overflow is the BEST !!!</div> CSS: div { border: 1px solid black; width: 70px; } How could I force the ..

What does "for" attribute do in HTML <label> tag?

I wonder what is the difference between the following two code snippets: <label>Input here : </label> <input type='text' name='theinput' id='theinput'/> and <label for='theinput'..

How to put two divs on the same line with CSS in simple_form in rails?

Putting two divs on the same line is an old question. But I can't find a solution when working with simple_form in rails. What I want to do is to display content and its label on the same line. The wi..

Bootstrap 3 - jumbotron background image effect

Hi I'm trying to build a site with a jumbotron with a background image, which in itself is not hard: HTML: <div class="jumbotron"> ... </div> CSS: (which lies in my custom css file and..

Hide the browse button on a input type=file

Is there a way to hide the browse button and only leave the text box that works in all browsers? I have tried setting the margins but they show up different in each browser..

How to place two forms on the same page?

I want to place both register and login form on the same page. They both starts with: if (!empty($_POST)) ... so, I need something like: if (!empty($_POST_01))... // regForm and if (!empty(..

HTML/CSS--Creating a banner/header

I've got a horizontal image as a GIF and JPG. It is something I made with Paint--a text logo with an image on a solid background. I am having a lot of trouble trying to get it to display as a banner/..

How to find elements by class

I'm having trouble parsing HTML elements with "class" attribute using Beautifulsoup. The code looks like this soup = BeautifulSoup(sdata) mydivs = soup.findAll('div') for div in mydivs: if (div[..

bootstrap 4 file input doesn't show the file name

I have a problem with the custom-file-input class in Bootstrap 4. after I chose which file I want to upload the filename do not show. I use this code: <div class="input-group mb-3"> <div ..

Using the HTML5 "required" attribute for a group of checkboxes?

When using the newer browsers that support HTML5 (FireFox 4 for example); and a form field has the attribute required='required'; and the form field is empty/blank; and the submit button is clicked; t..

jQuery select change show/hide div event

I am trying to create a form which when the select element 'parcel' is selected it will show a div but when it is not selected I would like to hide the div. Here is my markup at the moment: This is m..

How to check for empty value in Javascript?

I am working on a method of retrieving an array of hidden inputs in my form like so <input type="hidden" value="12:34:00" name="timetemp0"> <input type="hidden" value="14:45:00" name="timete..

Replace image src location using CSS

I have a website that has an image with a src attribute and I would like to change the src location of that image with an image of my own. The image lives in a div component. I can't change the HTML a..

How to remove an HTML element using Javascript?

I am a total newbie. Can somebody tell me how to remove an HTML element using the original Javascript not jQuery. index.html <html> <head> <script type="text/javascript" src="myscrip..

Node.js Generate html

I have created a JavaScript program which generates a list of data. Example output below: output one output two output three ... I would like to be able to generate a HTML file which can be save..

how to display a div triggered by onclick event

I have have two divs. I want to display a div( which has other divs inside it ) when the onclick event is triggered. Any help or suggestion would be appreciated. ..

Set a div width, align div center and text align left

I have a small problem but I can't get it solved. I have a content header of 864px width, a background image repeated-y and footer image. Now I have this <div> over the background image and I w..

Specifying content of an iframe instead of the src attribute to a page

I'm currently working on a form which includes some file inputs to upload pictures. There is an onchange() event for those inputs that submits the pictures to an iframe, then dynamically loads the upl..

How to place the "table" at the middle of the webpage?

I have a very basic Table structure to be placed in middle/center of the web page. I Have a code below, I know its incomplete to make this happen, as I am bad in structuring the HTML part, please help..

Syntax for a for loop in ruby

How do I do this type of for loop in Ruby? for(int i=0; i<array.length; i++) { } ..

How many concurrent AJAX (XmlHttpRequest) requests are allowed in popular browsers?

In Firefox 3, the answer is 6 per domain: as soon as a 7th XmlHttpRequest (on any tab) to the same domain is fired, it is queued until one of the other 6 finish. What are the numbers for the other ma..

Apache VirtualHost and localhost

I'm working with XAMPP on Mac OS X. I'm trying to run a Symfony website properly for a client, and I really don't know Symfony (yet). I just want to install and launch it. I've changed my /etc/hosts f..

Command to collapse all sections of code?

In Visual Studio is there a command to collapse/expand all the sections of code in a file?..

How to uninstall Python 2.7 on a Mac OS X 10.6.4?

I want to completely remove Python 2.7 from my Mac OS X 10.6.4. I managed to remove the entry from the PATH variable by reverting my .bash_profile. But I also want to remove all directories, files, sy..

Get everything after and before certain character in SQL Server

I got the following entry in my database: images/test.jpg I want to trim the entry so I get: test So basically, I want everything after / and before . How can I solve it?..

How do I check if a string contains another string in Objective-C?

How can I check if a string (NSString) contains another smaller string? I was hoping for something like: NSString *string = @"hello bla bla"; NSLog(@"%d",[string containsSubstring:@"hello"]); But ..

Update TextView Every Second

I've looked around and nothing seems to be working from what I've tried so far... @Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setCon..

Prefer composition over inheritance?

Why prefer composition over inheritance? What trade-offs are there for each approach? When should you choose inheritance over composition?..

How to generate unique IDs for form labels in React?

I have form elements with labels and I want to have unique IDs to link labels to elements with htmlFor attribute. Something like this: React.createClass({ render() { const id = ???; ..

How to list files inside a folder with SQL Server

How do I list files inside a folder in SQL Server without using the xp_cmdshell stored procedure?..

Laravel: Get base url

Simple question, but the answer seems quite hard to come by. In Codeigniter, I could load the url helper and then simply do echo base_url(); to get my site's URL. Is there an equivalent in Laravel?..

Hide html horizontal but not vertical scrollbar

I have an HTML textarea that is of fixed width, but variable height. I would like to set overflow:scroll and be able to show a vertical scrollbar, but not a horizontal one. I am not able to use overfl..

Stop Visual Studio from mixing line endings in files

When opening a text based file in Visual Studio 2010 it will then write my edits with CRLF instead of the line ending format of the original file. How can I stop VS from doing this? Any half decent ed..

How to repeat a char using printf?

I'd like to do something like printf("?", count, char) to repeat a character count times. What is the right format-string to accomplish this? EDIT: Yes, it is obvious that I could call printf() in a..

SSRS Field Expression to change the background color of the Cell

I'm trying to write a field expression for a Cell in my report where I have to change the background color of the cell depending on the string value in the cell. Ex: if the column has a value 'Approve..

How can I convert a character to a integer in Python, and viceversa?

I want to get, given a character, its ASCII value. For example, for the character a, I want to get 97, and vice versa...

How to upload & Save Files with Desired name

i am using this code to upload files(images to a folder) <form action='' method='POST' enctype='multipart/form-data'> <input type='file' name='userFile'><br> <input type='submit'..

how to change background image of button when clicked/focused?

I want to change the background image of a button when clicked or focused. This is my code: Button tiny = (Button)findViewById(; tiny.setOnClickListener(new OnClickListener() { @Overri..

Postgresql 9.2 pg_dump version mismatch

I am trying to dump a Postgresql database using the pg_dump tool. $ pg_dump books > books.out How ever i am getting this error. pg_dump: server version: 9.2.1; pg_dump version: 9.1.6 pg_dump:..

How to remove specific elements in a numpy array

How can I remove some specific elements from a numpy array? Say I have import numpy as np a = np.array([1,2,3,4,5,6,7,8,9]) I then want to remove 3,4,7 from a. All I know is the index of the value..


I dont understand when I echo $httpCode I always get 0, I was expecting 404 when I change $html_brand into a broken url. Is there anything that I miss or do not know of? Thanks. //check if url exist..

The activity must be exported or contain an intent-filter

when I tried to run my application its show the error below Error running Dashboard: The activity must be exported or contain an intent-filter How can I solve this error?..

__FILE__ macro shows full path

The standard predefined macro __FILE__ available in C shows the full path to the file. Is there any way to short the path? I mean instead of /full/path/to/file.c I see to/file.c or file.c ..

How to distinguish mouse "click" and "drag"

I use to handle the mouse click event on Raphael graph, meanwhile, I need to handle mouse drag event, mouse drag consists of mousedown, mouseupand mousemove in Raphael. It is difficult ..

How to get the current location in Google Maps Android API v2?

Using mMap.setMyLocationEnabled(true) can set the myLocation layer enable. But the problem is how to get the myLocation when the user clicks on the button? I want to get the longitude and latitude..

How to format a float in javascript?

In JavaScript, when converting from a float to a string, how can I get just 2 digits after the decimal point? For example, 0.34 instead of 0.3445434...

vbscript output to console

What is the command or the quickest way to output results to console using vbscript?..

setAttribute('display','none') not working

function classInfo(e){ document.getElementById('classRight').setAttribute('display','none'); alert(e); } I think this code is very straightforward bit it's not working, and is not hiding ..

Pass a PHP variable value through an HTML form

In a html form I have a variable $var = "some value";. I want to call this variable after the form posted. The form is posted on the same page. I want to call here if (isset($_POST['save_exit']))..

Using 'make' on OS X

I have a MacBook Pro that I'm trying to do some development on. I have a program I want to build, and when I went to use make to build it, I got a "command not found" error. I did some googling and S..

Writing BMP image in pure c/c++ without other libraries

In my algorithm, I need to create an information output. I need to write a boolean matrix into a bmp file. It must be a monocromic image, where pixels are white if the matrix on such element is true. ..

How do I print the elements of a C++ vector in GDB?

I want to examine the contents of a std::vector in GDB, how do I do it? Let's say it's a std::vector<int> for the sake of simplicity...

javascript set cookie with expire time

I am setting a cookie by Javascript and it is working fine but it is not taking the expire time I am giving. It keeps on taking session value regardless of what I give, below is the code which I took ..

Django set default form values

I have a Model as follows: class TankJournal(models.Model): user = models.ForeignKey(User) tank = models.ForeignKey(TankProfile) ts = models.IntegerField(max_length=15) title = models..

Java : Cannot format given Object as a Date

I have Date in this format (2012-11-17T00:00:00.000-05:00). I need to convert the date into this format mm/yyyy. I tried this way, but I am getting this Exception. Exception in thread "main" java.l..

How do I get the Date & Time (VBS)

How do I get the current date and time using VBS (for Windows. I'm not looking for VBScript for ASP/ASPX or webpages)...

Hide div by default and show it on click with bootstrap

I want to show and hide a div, but I want it to be hidden by default and to be able to show and hide it on click. Here is the code that I have made : <a class="button" onclick="$('#target').toggl..

Removing MySQL 5.7 Completely

I am trying to uninstall mysql from my ubuntu 12.04 completely. But not able to. I tried a lot of commands. But nothing is working. Can anyone help out here! sudo apt-get remove mysql-server mysql-c..

Google Gson - deserialize list<class> object? (generic type)

I want to transfer a list object via Google Gson, but I don't know how to deserialize generic types. What I tried after looking at this (BalusC's answer): MyClass mc = new Gson().fromJson(result, n..

How to install latest version of openssl Mac OS X El Capitan

I have used brew install openssl to download and install openssl v1.0.2f, however, it comes back saying: A CA file has been bootstrapped using certificates from the system keychain. To add additional..

Transitions on the CSS display property

I'm currently designing a CSS 'mega dropdown' menu - basically a regular CSS-only dropdown menu, but one that contains different types of content. At the moment, it appears that CSS 3 transition..

Origin http://localhost is not allowed by Access-Control-Allow-Origin

I'm trying to do a fetch from backbone.js to my node.js server. However, I get the following error in the console: Origin http://localhost is not allowed by Access-Control-Allow-Origin. I added the ..

How to replace a hash key with another key

I have a condition where, I get a hash hash = {"_id"=>"4de7140772f8be03da000018", .....} and I want this hash as hash = {"id"=>"4de7140772f8be03da000018", ......} P.S: I don't know wh..

Create stacked barplot where each stack is scaled to sum to 100%

I have a data.frame like this: df <- read.csv(text = "ONE,TWO,THREE 23,234,324 34,534,12 56,324,124 34,2..

How to compute precision, recall, accuracy and f1-score for the multiclass case with scikit learn?

I'm working in a sentiment analysis problem the data looks like this: label instances 5 1190 4 838 3 239 1 204 2 127 So my data is unbalanced since 1190 insta..

Default Values to Stored Procedure in Oracle


Ruby on Rails: How do I add placeholder text to a f.text_field?

How can I add placeholder text to my f.text_field fields so that the text comes pre-written by default, and when a user click inside the fields, the text goes away - allowing the user to type in the n..

caching JavaScript files

Which is the best method to make the browser use cached versions of js files (from the serverside)?..

find filenames NOT ending in specific extensions on Unix?

Is there a simple way to recursively find all files in a directory hierarchy, that do not end in a list of extensions? E.g. all files that are not *.dll or *.exe UNIX/GNU find, powerful as it is, doe..

Android Google Maps API V2 Zoom to Current Location

I'm trying to mess around with the Maps API V2 to get more familiar with it, and I'm trying to start the map centered at the user's current location. Using the map.setMyLocationEnabled(true); statemen..

How to center the content inside a linear layout?

I'm trying to center an ImageView inside a LinearLayout horizontally and vertically, but I just can't do it. The main reason why I'm not using a RelativeLayout for that is because I need the layout_we..

Refresh or force redraw the fragment

I have a fragment that inflates an xml layout. My requirement is to update the text size on all my views inside my fragment when my Activity is resumed. I tried fragment.getView().invalidate(); ..

Team Build Error: The Path ... is already mapped to workspace

When creating a new build in Team Foundation Server, I get the following error when attempting to run the new build: The path C:\Build\ProductReleases\FullBuildv5.4.2x\Sources is already mappe..

How to insert an item into a key/value pair object?'s a softball question... I just need to be able to insert a key/value pair into an object at a specific position. I'm currently working with a Hashtable which, of course, doesn't allow for ..

ASP.NET MVC Html.DropDownList SelectedValue

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

Adding up BigDecimals using Streams

I have a collection of BigDecimals (in this example, a LinkedList) that I would like to add together. Is it possible to use streams for this? I noticed the Stream class has several methods Stream::m..

No Such Element Exception?

So here is my code: public static void getArmor(String treasure) throws FileNotFoundException{ Random rand=new Random(); Scanner file=new Scanner(new File ("armor.txt")); while(!file...

Convert base-2 binary number string to int

I'd simply like to convert a base-2 binary number string into an int, something like this: >>> '11111111'.fromBinaryToInt() 255 Is there a way to do this in Python? ..

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

hexadecimal string to byte array in python

I have a long Hex string that represents a series of values of different types. I wish to convert this Hex String into a byte array so that I can shift each value out and convert it into its proper da..

Trying to add adb to PATH variable OSX

I am trying to develop for android and I want to add the adb to my PATH so that I can launch it really easily. I have added directories before by for some reason adb does not want to be found. This is..

LINQ equivalent of foreach for IEnumerable<T>

I'd like to do the equivalent of the following in LINQ, but I can't figure out how: IEnumerable<Item> items = GetItems(); items.ForEach(i => i.DoStuff()); What is the real syntax?..

SQLSTATE[42000]: Syntax error or access violation: 1064 You have an error in your SQL syntax — PHP — PDO

I've looked through all the other StackOverflow (and google) posts with the same problem, but none seemed to address my problem. I am using PDO and PHP. My code: $vals = array( ':from' => ..

MYSQL query between two timestamps

I have the following entry in my DB table eventName(varchar 100) -> myEvent date(timestamp) -> 2013-03-26 09:00:00 and I am trying to use the following query; SELECT * FROM eventList WHERE..

PostgreSQL DISTINCT ON with different ORDER BY

I want to run this query: SELECT DISTINCT ON (address_id) purchases.address_id, purchases.* FROM purchases WHERE purchases.product_id = 1 ORDER BY purchases.purchased_at DESC But I get this error: ..

What to do with commit made in a detached head

Using git I made something like this git clone git checkout {a rev number tree rev before} (here I started to be in a detached head state) //hacking git commit //hacking git commit (some commit where..

Pass an array of integers to ASP.NET Web API?

I have an ASP.NET Web API (version 4) REST service where I need to pass an array of integers. Here is my action method: public IEnumerable<Category> GetCategories(int[] categoryIds){ // code t..

Barcode scanner for mobile phone for Website in form

I have inventory maintenance website up and running. currently the back end users are manually typing the item id on the system and using to search and do their work. I would like to automate the typi..

SQL Query Where Field DOES NOT Contain $x

I want to find an SQL query to find rows where field1 does not contain $x. How can I do this?..

React.js: How to append a component on click?

I'm new to React and I'm puzzled on something kind of basic. I need to append a component to the DOM after the DOM is rendered, on a click event. My initial attempt is as follows, and it doesn't wor..

How to index into a dictionary?

I have a Dictionary below: colors = { "blue" : "5", "red" : "6", "yellow" : "8", } How do I index the first entry in the dictionary? colors[0] will return a KeyError for obvious reason..

Java verify void method calls n times with Mockito

I'm trying to verify that a (void) method is being called inside of a DAO - I'm using a commit point that sends a list of results up to that point, resets the list and continues. Say I have 4 things ..

How to convert DataTable to class Object?

I have already developed an application which returns DataTable everywhere. Now my client wants to convert (use some part using service stack), so I need to return DTO (objects) in my application. I..

Changing MongoDB data store directory

Until now I have not been specifying a MongoDB data directory and have had only one 30 GB primary partition. I just ran out of space and added a new hard disk. How can I transfer my data (that is app..

tslint / codelyzer / ng lint error: "for (... in ...) statements must be filtered with an if statement"

Lint error message: src/app/detail/edit/edit.component.ts[111, 5]: for (... in ...) statements must be filtered with an if statement Code snippet (It is a working code. It is also available a..

How Can I Bypass the X-Frame-Options: SAMEORIGIN HTTP Header?

I am developing a web page that needs to display, in an iframe, a report served by another company's SharePoint server. They are fine with this. The page we're trying to render in the iframe is givi..

Turn off enclosing <p> tags in CKEditor 3.0

Is there a possibility to turn off the automatic enclosing of all written content within <p></p> in CKEditor 3.x? I tried CKEDITOR.config.enterMode = CKEDITOR.ENTER_BR; but this jus..

Android - Launcher Icon Size

For HDPI, XHDPI, etc. what should be the ideal size of the launcher icon? Should I have to create 9-Patch images for the icon to scale automatically, or would it be better to create separate icons? ..

How to fix Error: laravel.log could not be opened?

I'm pretty new at laravel, in fact and I'm trying to create my very first project. for some reason I keep getting this error (I haven't even started coding yet) Error in exception handler: The stream..

How do I get an object's unqualified (short) class name?

How do I check the class of an object within the PHP name spaced environment without specifying the full namespaced class. For example suppose I had an object library/Entity/Contract/Name. The fo..

Numpy Resize/Rescale Image

I would like to take an image and change the scale of the image, while it is a numpy array. For example I have this image of a coca-cola bottle: bottle-1 Which translates to a numpy array of shape (..

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

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

How can one run multiple versions of PHP 5.x on a development LAMP server?

I need to test my PHP applications with multiple versions of PHP 5.x, such as PHP 5.0.0 and PHP 5.2.8. Is there a way that I can configure a development LAMP server so I can quickly test applications..

Creating a constant Dictionary in C#

What is the most efficient way to create a constant (never changes at runtime) mapping of strings to ints? I've tried using a const Dictionary, but that didn't work out. I could implement a immuta..

c# write text on bitmap

I have following problem. I want to make some graphics in c# windows form. I want to read bitmap to my program and after it write some text on this bitmap. In the end I want this picture load to pict..

How to pass form input value to php function

I want to write a php page in which there is a html form. I want to send all input (number for example) of my form to a php function (instead of a javascript function; I make this to hide my javascrip..

Custom height Bootstrap's navbar

I want a header with a height of 150px which contains a navbar. The navbar should be vertically centered in the header. HTML: <header> <div class="navbar navbar-static-top"> ..

How to check if an element exists in the xml using xpath?

Below is my element hierarchy. How to check (using xpath) that AttachedXml element is present under CreditReport of Primary Consumer <Consumers xmlns=""> ..

Setting up a git remote origin

I have the following repos. DEV REPO: in a directory on my development machine where i make changes MAIN REPO: bare repository on my development machine to which i push changes from dev repo PRODUCT..

Message Queue vs. Web Services?

Under what conditions would one favor apps talking via a message queue instead of via web services (I just mean XML or JSON or YAML or whatever over HTTP here, not any particular type)? I have to tal..

How do I check what version of Python is running my script?

How can I check what version of the Python Interpreter is interpreting my script?..

Your content must have a ListView whose id attribute is ''

I have created an xml file like this: <?xml version="1.0" encoding="utf-8"?> <ListView xmlns:android="" android:layout_width="match_parent" ..

How come I can't remove the blue textarea border in Twitter Bootstrap?

In Chrome, there is a blue border around the textarea. How come I can't remove it? textarea:hover, input:hover, textarea:active, input:active, textarea:focus, input:focus { outline:0px !impo..

How to send PUT, DELETE HTTP request in HttpURLConnection?

I want to know if it is possible to send PUT, DELETE request (practically) through to HTTP-based URL. I have read so many articles describing that how to send GET, POST, TR..

splitting a string based on tab in the file

I have file that contains values separated by tab ("\t"). I am trying to create a list and store all values of file in the list. But I get some problem. Here is my code. line = "abc def ghi" values =..

How to Remove the last char of String in C#?

I have a numeric string, which may be "124322" or "1231.232" or "132123.00". I want to remove the last char of my string (whatever it is). So I want if my string is "99234" became "9923". The length..

How do I run PHP code when a user clicks on a link?

I want to have a page run some PHP code when a user clicks on a link, without redirecting them. Is this possible with <a href=""></a> or with the javascript onclick event?..

How to extract URL parameters from a URL with Ruby or Rails?

I have some URLs, like and I would like to extract the parameters from these URLs and get them in a Hash. Obviousl..

How to access private data members outside the class without making "friend"s?

I have a class A as mentioned below:- class A{ int iData; }; I neither want to create member function nor inherit the above class A nor change the specifier of iData. My doubts:- How to acc..

javascript createElement(), style problem

today i wrote this function: function zoom(obj){ var img = (!document.getElementById(obj))?false:document.getElementById(obj); var fullImage = (img.getAttribute("image") == n..

Listing all the folders subfolders and files in a directory using php

Please give me a solution for listing all the folders,subfolders,files in a directory using php. My folder structure is like this: Main Dir Dir1 SubDir1 File1 File2 SubDir2 File3 Fil..

Python: Writing to and Reading from serial port

I've read the documentation, but can't seem to find a straight answer on this. I have a list of all COM Ports in use by Modems connected to the computer. From this list, I try to open it, send it a co..

Converting pfx to pem using openssl

How to generate a .pem CA certificate and client certificate from a PFX file using OpenSSL...

Stretch and scale a CSS image in the background - with CSS only

I want that my background image stretch and scale depending on the browser viewport size. I've seen some questions on Stack Overflow that do the job, like Stretch and scale CSS background for ex..

invalid command code ., despite escaping periods, using sed

Being forced to use CVS for a current client and the address changed for the remote repo. The only way I can find to change the remote address in my local code is a recursive search and replace. Howe..

Type definition in object literal in TypeScript

In TypeScript classes it's possible to declare types for properties, for example: class className { property: string; }; How do declare the type of a property in an object literal? I've tried th..

Convert to Datetime MM/dd/yyyy HH:mm:ss in Sql Server

How to convert given date format to MM/dd/yyyy HH:mm:ss I tried this one below but not achieved. Can anyone help me? SELECT CONVERT(VARCHAR(20), GETDATE(), 120) ..

How to set environment variable for everyone under my linux system?

Can I have certain settings that are universal for all my users?..

XAMPP - Error: MySQL shutdown unexpectedly

I have reinstalled XAMPP for some reason and MySQL is not working, giving the following error in the console: 01:56:03 [mysql] Error: MySQL shutdown unexpectedly. 01:56:03 [mysql] This may be d..

onMeasure custom view explanation

I tried to do custom component. I extended View class and do some drawing in onDraw overrided method. Why I need to override onMeasure? If I didn't, everything seen to be right. May someone explain it..

ECMAScript 6 class destructor

I know ECMAScript 6 has constructors but is there such a thing as destructors for ECMAScript 6? For example if I register some of my object's methods as event listeners in the constructor, I want to ..

lambda expression join multiple tables with select and where clause

I have three table many to many relationship I have joined the three table and select the value I want but now I need to select one row from the query result by where by specifying the id this is my ..

github markdown colspan

Is there a way to have 'colspan' on github markdown? I'm trying to create a table where one row takes up four columns. | One | Two | Three | Four | | ------------- |----------..

What does Include() do in LINQ?

I tried to do a lot of research but I'm more of a db guy - so even the explanation in the MSDN doesn't make any sense to me. Can anyone please explain, and provide some examples on what Include() stat..

Authentication issue when debugging in VS2013 - iis express

I'm trying to pick up the windows username when debugging in Visual Studio 2013. I am simply using: If I run this on my Dev Server it works fine, if I run it ..

SQL Server principal "dbo" does not exist,

I am getting the following error Cannot execute as the database principal because the principal "dbo" does not exist, this type of principal cannot be impersonated, or you do not have permission. ..

Bootstrap Navbar toggle button not working

When I shrink the window and click the button it doesn't work. Button doesn't respond. What seems to be the problem here could anyone tell me please? <button type="button" class="navbar-t..

How to fill Dataset with multiple tables?

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

sh: 0: getcwd() failed: No such file or directory on cited drive

I am trying to compile ARM code in Ubuntu 12. Everything is working fine when I put the code in the local directory. But when I put the code in cited mount directory error shows up: making testXmlF..

How to check if a variable exists in a FreeMarker template?

I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName v..

Pandas "Can only compare identically-labeled DataFrame objects" error

I'm using Pandas to compare the outputs of two files loaded into two data frames (uat, prod): ... uat = uat[['Customer Number','Product']] prod = prod[['Customer Number','Product']] print uat['Custom..

How to check existence of user-define table type in SQL Server 2008?

I have a user-defined table type. I want to check it's existence before editing in a patch using OBJECT_ID(name, type) function. What type from the enumeration should be passed for user-defined table..

Automated Python to Java translation

Is there a tool out there that can automatically convert Python to Java? Can Jython do this?..

Python integer incrementing with ++

I've always laughed to myself when I've looked back at my VB6 days and thought, "What modern language doesn't allow incrementing with double plus signs?": number++ To my surprise, I can't find anyt..

How can I count the number of children?

I have a list <ul> <li> <li> <li> ... </ul> I need jQuery to count the number of items in my list...

Installing Apple's Network Link Conditioner Tool

I have installed xcode 4.3.1 on my machine running Lion. I can't find the Network Link Conditioner tool anywhere. I have checked the utilities folder, also the xcode/contents/developer/* directorie..

Should I URL-encode POST data?

I'm POSTing data to an external API (using PHP, if it's relevant). Should I URL-encode the POST variables that I pass? Or do I only need to URL-encode GET data? UPDATE: This is my PHP, in case it is ..

jQuery check if it is clicked or not

$( element ).click( function() { }); How can I check if the element is clicked or not? I'm doing like that function element() { $( "#element" ).click( function() { return 0; } ); ..

Query an XDocument for elements by name at any depth

I have an XDocument object. I want to query for elements with a particular name at any depth using LINQ. When I use Descendants("element_name"), I only get elements that are direct children ..

How to print an unsigned char in C?

I am trying to print char as positive value: char ch = 212; printf("%u", ch); but I get: 4294967252 How I can get 212 in the output?..

How to combine GROUP BY and ROW_NUMBER?

I hope following sample code is self-explanatory: declare @t1 table (ID int,Price money, Name varchar(10)) declare @t2 table (ID int,Orders int, Name varchar(10)) declare @relation table (t1ID int,..

React Hook "useState" is called in function "app" which is neither a React function component or a custom React Hook function

I'm trying to use react hooks for a simple problem const [personState,setPersonState] = useState({ DefinedObject }); with following dependencies. "dependencies": { "react": "^16.8.6", "rea..

What are the First and Second Level caches in (N)Hibernate?

Can anyone explain in simple words what First and Second Level caching in Hibernate/NHibernate are?..

Resource u'tokenizers/punkt/english.pickle' not found

My Code: import tokenizer ='nltk:tokenizers/punkt/english.pickle') ERROR Message: [ec2-user@ip-172-31-31-31 sentiment]$ python Traceback (most recent..

Android Studio: Gradle: error: cannot find symbol variable

I was working on my app and everything was normal until I tried to display image in java. I ran the app once and it ran normally, the picture was displayed. After that it asked me to import some libr..

How to set OnClickListener on a RadioButton in Android?

I have two RadioButtons inside a RadioGroup. I want to set OnClickListener on those RadioButtons. Depending on which RadioButton is clicked, I want to change the text of an EditText. How can I achieve..

Android Device not recognized by adb

My Android device isn't recognized by eclipse nor adb anymore. My OS is Windows 7 64-bit, and I'm using a Nexus 4 with Stock Android 4.4.2. Here are some details on the problem: Yesterday I could r..

round() doesn't seem to be rounding properly

The documentation for the round() function states that you pass it a number, and the positions past the decimal to round. Thus it should do this: n = 5.59 round(n, 1) # 5.6 But, in actuality, good ..

*.h or *.hpp for your class definitions

I've always used a *.h file for my class definitions, but after reading some boost library code, I realised they all use *.hpp. I've always had an aversion to that file extension, I think mainly becau..

Lint: How to ignore "<key> is not translated in <language>" errors?

I can't compile/debug our Android app, because the localization files are not perfect yet. My IDE's validation tool Lint create errors saying: newCardsOrderVals is not translated in ar, bg, ca, c..

How to reset Django admin password?

I am using Django (version 1.3) and have forgotten both admin username and password. How to reset both? And is it possible to make a normal user into admin, and then remove admin status?..

How to set environment variables in PyCharm?

I have started to work on a Django project, and I would like to set some environment variables without setting them manually or having a bash file to source. I want to set the following variables: exp..

How to set width of mat-table column in angular?

Here in my mat-table have 6 column when any column has not more words then it looks like Image-1, but when any column has more words then UI looks like Image-2, so how to set UI like Image-1 when any ..

Array length in angularjs returns undefined

JS: function UserController($scope, User, Group){ $scope.users = User.query(); $scope.isNewUser = function(){ var len = $scope.users.lenght; console.log(len); /..

Set QLineEdit to accept only numbers

I have a QLineEdit where the user should input only numbers. So is there a numbers-only setting for QLineEdit?..

How to advance to the next form input when the current input has a value?

I am having a form with lots of entries. I would like to change my focus to the next textbox, once I entered the value in the current textbox. and want to continue this process up to the last field. M..

Converting Array to List

In order to convert an Integer array to a list of integer I have tried the following approaches: Initialize a list(Integer type), iterate over the array and insert into the list B..

How to position two elements side by side using CSS

I want to position a paragraph to the right of an <iframe> of a Google map. I do not know how to show my code, so here is a screenshot of what I want: ..

Dynamically Add C# Properties at Runtime

I know there are some questions that address this, but the answers usually follow along the lines of recommending a Dictionary or Collection of parameters, which doesn't work in my situation. I am us..

Copy directory contents into a directory with python

I have a directory /a/b/c that has files and subdirectories. I need to copy the /a/b/c/* in the /x/y/z directory. What python methods can I use? I tried shutil.copytree("a/b/c", "/x/y/z"), but python..

MySQL - force not to use cache for testing speed of query

I'm testing the speed of some queries in MySQL. The database is caching these queries making it difficult for me to get reliable results when testing how fast these queries are. Is there a way to dis..

How to avoid warning when introducing NAs by coercion

I generally prefer to code R so that I don't get warnings, but I don't know how to avoid getting a warning when using as.numeric to convert a character vector. For example: x <- as.numeric(c("1",..

What is the Python 3 equivalent of "python -m SimpleHTTPServer"

What is the Python 3 equivalent of python -m SimpleHTTPServer?..

Why are unnamed namespaces used and what are their benefits?

I just joined a new C++ software project and I'm trying to understand the design. The project makes frequent use of unnamed namespaces. For example, something like this may occur in a class definiti..

What REALLY happens when you don't free after malloc?

This has been something that has bothered me for ages now. We are all taught in school (at least, I was) that you MUST free every pointer that is allocated. I'm a bit curious, though, about the real..

jQuery click events not working in iOS

Second update: Looks like one of my functions (resetFigures) was preventing the event handler, so moving that to the end of the bind function sorted it out. Update: I realized after some basic testin..

Systrace for Windows

I'm looking for a Windows equivalent of Systrace or at least strace. I'm aware of StraceNT, but wondering if there are any more alternatives out there. Specifically, I'm looking for a specific way to..

Integer value comparison

I'm a newbie Java coder and I just read a variable of an integer class can be described three different ways in the API. I have the following code: if (count.compareTo(0)) { System.out..

Console output in a Qt GUI app?

I have a Qt GUI application running on Windows that allows command-line options to be passed and under some circumstances I want to output a message to the console and then quit, for example: int mai..

Closing Applications

What is best practice when closing a C# application? I have read that you can use: Environment.Exit(0); or Application.Exit(); But what is the difference? Furthermore, with regards to Environment..

String replacement in batch file

We can replace strings in a batch file using the following command set str="jump over the chair" set str=%str:chair=table% These lines work fine and change the string "jump over the chair" to "jump..

jQuery - adding elements into an array

I'm trying to add the ID's, which are the $hexcode values from the html span into an array. How do I do this with jQuery? Eventually, I'm going to need to grab these hexcode values and match them to a..

RegEx for validating an integer with a maximum length of 10 characters

Could you please point me the appropriate RegEx for validating an integer with a maximum length of 10 characters? Valid ones include: 1234567890..

How can I stop Chrome from going into debug mode?

If the debugging window is open, the debugger starts hitting lines by itself even though there are no set breakpoints. I have tried using the "Deactivate breakpoints" button and it doesn't m..

input() error - NameError: name '...' is not defined

I am getting an error when I try to run this simple script: input_variable = input ("Enter your name: ") print ("your name is" + input_variable) Let's say I type in "dude", the error I am getting i..

Copying text outside of Vim with set mouse=a enabled

After enabling set mouse=a, text copied inside of Vim will not paste outside of Vim. Does anybody know of a way to fix this? Here, selecting text with the mouse turns on visual mode and disables the ..

How to run Maven from another directory (without cd to project dir)?

Supposing my maven project is located in /some/location/project and my current location is /another/location/ how can I run maven build without changing to project location cd /some/location/project?..

Visual Studio loading symbols

I'm working on a ColdFusion project for a while now, and Visual Studio started to behave strange for me at least. I observed that when I started debugging, it built the project, it started the deploy..

Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

Since this question continues to attract responses that are either refuted by the question body or don't address the actual problem, please read this simple summary of what you need to know: ..

How to change users in TortoiseSVN

I was setting up another user to use our SVN repository. He didn't have a username/password, so I logged in with my credentials. We now have a username/password for him. How do I get TortoiseSVN t..

Regular expression to search multiple strings (Textpad)

I'm a bit new to regex and am looking to search for multiple lines/instaces of some wildcard strings such as *8768, *9875, *2353. I would like to pull all instances of these (within one file) rather ..

How do I force Internet Explorer to render in Standards Mode and NOT in Quirks?

I am coding a Frontend which works well in IE7 Standards Mode and IE8 Standards Mode. When I start up Internet Explorer and load the page both IE7 and IE8 go to Quirks Mode directly. How can I force ..

Converting string format to datetime in mm/dd/yyyy

I have to convert string in mm/dd/yyyy format to datetime variable but it should remain in mm/dd/yyyy format. string strDate = DateTime.Now.ToString("MM/dd/yyyy"); Please help...

How to: Add/Remove Class on mouseOver/mouseOut - JQuery .hover?

Looking to change the border color on a box.. ..when the user mouses over/out.. Here's the attempted code.. Needs Work! JQuery: <script> $("result").hover( function () { $(this).addCla..

What is the best way to check for Internet connectivity using .NET?

What is the fastest and most efficient way to check for Internet connectivity in .NET?..

Count the number of items in my array list

I want to count the number of itemids in my array, can i get an example of how i would go about adding this to my code. code below; if (value != null && !value.isEmpty()) { Set set = valu..

When should I use curly braces for ES6 import?

It seems to be obvious, but I found myself a bit confused about when to use curly braces for importing a single module in ES6. For example, in the React-Native project I am working on, I have the foll..

SQL Server - Convert varchar to another collation (code page) to fix character encoding

I'm querying a SQL Server database that uses the SQL_Latin1_General_CP850_BIN2 collation. One of the table rows has a varchar with a value that includes the +/- character (decimal code 177 in the Win..

Populate a Drop down box from a mySQL table in PHP

I am trying to populate a Drop down box from results of a mySQL Query, in Php. I've looked up examples online and I've tried them on my webpage, but for some reason they just don't populate my drop do..

How to loop through a HashMap in JSP?

How can I loop through a HashMap in JSP? <% HashMap<String, String> countries = MainUtils.getCountries(l); %> <select name="country"> <% // Here I need to loop ..

Compare a string using sh shell

I am using SH shell and I am trying to compare a string with a variable's value but the if condition is always execute to true. Why? Here is some code: Sourcesystem="ABC" if [ "$Sourcesystem" -eq '..

How to fetch all Git branches

I cloned a Git repository, which contains about five branches. However, when I do git branch I only see one of them: $ git branch * master I know that I can do git branch -a to see all the branches..

How to remove folders with a certain name

In Linux, how do I remove folders with a certain name which are nested deep in a folder hierarchy? The following paths are under a folder and I would like to remove all folders named a. 1/2/3/a 1/..

Recursively find files with a specific extension

I'm trying to find files with specific extensions. For example, I want to find all .pdf and .jpg files that's named Robert I know I can do this command $ find . -name '*.h' -o -name '*.cpp' but ..

How do I get currency exchange rates via an API such as Google Finance?

Now, I did find the Google Finance API and started looking through that but I found a lot of info about portfolios, transactions, positions & other stuff I know nothing about. Am I looking at th..

Code line wrapping - how to handle long lines

I'm facing a particular line that is 153 characters long. Now, I tend to break things after 120 characters (of course, this is heavily dependent on where I am and the local conventions.) But to be hon..

SQL like search string starts with

Learning SQL. Have a simple table games with field title. I want to search based on title. If I have a game called Age of Empires III: Dynasties, and I use LIKE with parameter Age of Empires III: Dyna..

changing the language of error message in required field in html5 contact form

I am trying to change the language of the error message in the html5 form field. I have this code: <input type="text" name="company_name" oninvalid="setCustomValidity('Lütfen isaretli yerleri d..

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

How to connect to a docker container from outside the host (same network) [Windows]

I've created my first docker container, it's running a server using Go but I can't access it from outside the host computer. I've just started with docker so I'm a little lost here. So I have a very ..

C++ [Error] no matching function for call to

I can't compile my code because of some errors. Here some of them : In function 'int main(int, char**)': [Error] no matching function for call to 'deckOfCards::shuffle(deckOfCards&)' [Note] c..

How to encode a string in JavaScript for displaying in HTML?

Possible Duplicate: How to escape HTML How can a string be converted to HTML in JavaScript? e.g. var unsafestring = "<oohlook&atme>"; var safestring = magic(unsafestring); whe..

Configure Log4Net in web application

I have this code and the config file below: ILog log = LogManager.GetLogger(typeof(MyClass)); log.Debug("Testing"); TestProj directory is not created and if I create it, no TestLog.txt file, no log..

How do you do relative time in Rails?

I'm writing a Rails application, but can't seem to find how to do relative time, i.e. if given a certain Time class, it can calculate "30 seconds ago" or "2 days ago" or if it's longer than a month "9..

Removing elements from an array in C

I just have a simple question about arrays in C What's the best way to remove elements from an array and in the process make the array smaller. i.e the array is n size, then I take elements out of..

Check if a value exists in pandas dataframe index

I am sure there is an obvious way to do this but cant think of anything slick right now. Basically instead of raising exception I would like to get True or False to see if a value exists in pandas df..

How to convert image file data in a byte array to a Bitmap?

I want to store image in SQLite DataBase. I tried to store it using BLOB and String, in both cases it store the image and can retrieve it but when i convert it to Bitmap using BitmapFactory.decode..

Stopping Excel Macro executution when pressing Esc won't work

I'm running excel 2007 on XP. Is there a way to stop a macro from running during its execution other than pressing escape? Usually if I think I created an infinate loop or otherwise messed something..

How do I access previous promise results in a .then() chain?

I have restructured my code to promises, and built a wonderful long flat promise chain, consisting of multiple .then() callbacks. In the end I want to return some composite value, and need to access m..