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.
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..
Example:
<a href="example.com" 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 ..
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..
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 <html>, <head> and <body> tags?
For example, I can make such a page:
<!DOCTYPE html>
<meta http-equiv="Content-type" content="text/html; ..
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..
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..
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..
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..
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..
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...
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..
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?..
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/..
I am trying to set the background color of the page at yumdom.com to yellow.
I have tried the following and it fails:
body{ background-color: yellow;} /*only a sliver under the header turns yellow...
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..
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;
}
#..
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..
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..
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..
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 ..
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..
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..
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..
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..
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..
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..
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..
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>
..
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..
I am trying to replicate the same effect that this website has: http://www.knockknockfactory.com/
When the browser width is resized the image automatically gets smaller but the height of the area in..
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..
i want to open a new window on click of 1
$leadID = "<a href='javascript:onclick=window.open(lead_data.php?leadid=1, myWin, scrollbars=yes, width=400, height=650);'>1</a>";
it is not sh..
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..
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="..
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..
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..
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..
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..
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..
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});
});
..
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?..
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..
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..
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..
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...
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..
<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..
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..
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..
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 ..
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..
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...
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 would I darken a background image on hover without making a new darker image?
CSS:
.image {
background: url('http://cdn1.iconfinder.com/data/icons/round-simple-social-icons/58/facebook.png');
..
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 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..
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 ..
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");
..
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..
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...
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..
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..
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..
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..
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 ..
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.
..
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..
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'..
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..
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..
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 ..
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'..
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..
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..
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..
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(..
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/..
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[..
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 ..
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..
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..
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..
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..
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..
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..
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.
..
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..
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..
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..
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..
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..
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..
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 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 ..
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..
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 = ???;
..
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?..
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..
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..
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..
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..
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'..
I want to change the background image of a button when clicked or focused.
This is my code:
Button tiny = (Button)findViewById(R.id.tiny);
tiny.setOnClickListener(new OnClickListener() {
@Overri..
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 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..
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?..
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
..
I use jQuery.click 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 ..
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..
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...
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 ..
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']))..
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..
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.
..
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 ..
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..
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..
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..
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..
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..
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..
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..
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 ..
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..
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..
I have a stored procedure as follows.
CREATE OR REPLACE PROCEDURE TEST(
X IN VARCHAR2 DEFAULT 'P',
Y IN NUMBER DEFAULT 1) AS
BEGIN
DBMS_OUTPUT.PUT_LINE('X'|| X||'--'||'Y'||Y);
END;
..
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..
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..
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..
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..
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();
..
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..
Ok...here'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 ..
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..
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..
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...
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? ..
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..
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..
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..
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?..
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' => ..
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..
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:
..
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..
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..
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..
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..
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..
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 ..
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..
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..
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..
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..
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..
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? ..
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 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..
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 (..
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 ..
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..
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..
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..
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..
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">
..
Below is my element hierarchy. How to check (using xpath) that AttachedXml element is present under CreditReport of Primary Consumer
<Consumers xmlns="http://xml.mycompany.com/XMLSchema">
..
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..
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..
I have created an xml file like this:
<?xml version="1.0" encoding="utf-8"?>
<ListView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_width="match_parent"
..
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..
I want to know if it is possible to send PUT, DELETE request (practically) through java.net.HttpURLConnection to HTTP-based URL.
I have read so many articles describing that how to send GET, POST, TR..
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 =..
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..
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?..
I have some URLs, like
http://www.example.com/something?param1=value1¶m2=value2¶m3=value3
and I would like to extract the parameters from these URLs and get them in a Hash. Obviousl..
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..
today i wrote this function:
function zoom(obj){
var img = (!document.getElementById(obj))?false:document.getElementById(obj);
var fullImage = (img.getAttribute("image") == n..
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..
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..
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..
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..
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..
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)
..
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..
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..
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 ..
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 ..
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 |
| ------------- |----------..
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..
I'm trying to pick up the windows username when debugging in Visual Studio 2013. I am simply using:
httpcontext.current.user.identity.name
If I run this on my Dev Server it works fine, if I run it ..
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.
..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
$( 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;
} );
..
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 ..
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,..
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..
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..
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..
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..
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 ..
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..
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..
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?..
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..
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 ..
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..
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..
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:
..
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..
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..
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..
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",..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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..
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 ..
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?..
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..
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:
..
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..
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 ..
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 ..
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...
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..
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..
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..
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..
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 can I loop through a HashMap in JSP?
<%
HashMap<String, String> countries = MainUtils.getCountries(l);
%>
<select name="country">
<%
// Here I need to loop ..
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 '..
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..
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/..
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 ..
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..
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..
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..
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..
I've pasted the example from php.net 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..
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 ..
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..
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..
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..
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..
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..
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..
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..
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..
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..