Questions Tagged with #Jstl

JSTL (JSP Standard Tag Library) is a JSP based standard tag library which offers tags to control the flow in the JSP page, date/number formatting and internationalization facilities and several utility EL functions.

Evaluate empty or null JSTL c tags

How can I validate if a String is null or empty using the c tags of JSTL? I have a variable of name var1 and I can display it, but I want to add a comparator to validate it. <c:out value="${var1}..

How to install JSTL? The absolute uri: http://java.sun.com/jstl/core cannot be resolved

I don't know what I've done incorrectly, but I can't include JSTL. I have jstl-1.2.jar, but unfortunately I get exception: org.apache.jasper.JasperException: The absolute uri: http://java.sun.com/js..

How to get a index value from foreach loop in jstl

I have a value set in the request object like the following, String[] categoriesList=null; categoriesList = engine.getCategoryNamesArray(); request.setAttribute("categoriesList", categoriesList ); ..

EL access a map value by Integer key

I have a Map keyed by Integer. Using EL, how can I access a value by its key? Map<Integer, String> map = new HashMap<Integer, String>(); map.put(1, "One"); map.put(2, "Two"); map.put(3, "..

Access Enum value using EL with JSTL

I have an Enum called Status defined as such: public enum Status { VALID("valid"), OLD("old"); private final String val; Status(String val) { this.val = val; } public..

How do I compare if a string is not equal to?

I'm trying to only show something based on if a string is not equal to: <c:if test="${content.getContentType().getName() != "MCE"}"> <li><a href="#publish-history" id="publishHistoryTa..

How to resolve : Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ page import="com.library.controller.*"%> <%@ page import="com.library.dao.*" %> <%@ page import="java.util.*" ..

Access Session attribute on jstl

I am trying to access a session attribute from a jsp page which is set and dispatched by a servlet, but I am getting the error message "jsp:attribute must be the subelement of a standard or custom act..

How to do if-else in Thymeleaf?

What's the best way to do a simple if-else in Thymeleaf? I want to achieve in Thymeleaf the same effect as <c:choose> <c:when test="${potentially_complex_expression}"> <h2>H..

How do you get the length of a list in the JSF expression language?

How would I get the length of an ArrayList using a JSF EL expression? #{MyBean.somelist.length} does not work...

JSTL if tag for equal strings

I've got a variable from an object on my JSP page: <%= ansokanInfo.getPSystem() %> The value of the variable is NAT which is correct and I want to apply certain page elements for this value. H..

Sun JSTL taglib declaration fails with "Can not find the tag library descriptor"

I am using a JSP page to print an array of values. I'm trying to use JSTL <c:forEach> for this. <c:forEach items="${objects}" var="object"> <td>${object.name} </td> </c..

Evaluate list.contains string in JSTL

I need to hide an element if certain values are present in the JSP The values are stored in a List so I tried: <c:if test="${ mylist.contains( myValue ) }">style='display:none;'</c:if>..

Set HTML dropdown selected option using JSTL

In the same context i have another query <select multiple="multiple" name="prodSKUs"> <c:forEach items="${productSubCategoryList}" var="productSubCategoryList"> <..

How to select the first element of a set with JSTL?

I managed to do it with the next code but there must be an easier way. <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@ taglib prefix="fn" uri="http://java.sun.com/jsp/j..

JSP : JSTL's <c:out> tag

Writing a JSP page, what exactly does the <c:out> do? I've noticed that the following both has the same result: <p>The person's name is <c:out value="${person.name}" /></p> &l..

How to set the JSTL variable value in javascript?

How to set the JSTL variable value in java script? <script> function function1() { var val1 = document.getElementById('userName').value; <c:set var="user" value=""/> // how do..

Adding external resources (CSS/JavaScript/images etc) in JSP

I added an external CSS stylesheet to my project and placed in the WEB-CONTENTS folder of my project in Eclipse. When I deployed it on the Tomcat, the stylesheet was not applied. When I debugged it in..

I can pass a variable from a JSP scriptlet to JSTL but not from JSTL to a JSP scriptlet without an error

The following code causes an error: <c:set var="test" value="test1"/> <% String resp = "abc"; resp = resp + test; pageContext.setAttribute("resp", resp); %> <c:out value="..

How to compare two object variables in EL expression language?

I am creating a drop down list of all languages. The default language selection for the list will be determined by information added by the user: <select> <c:forEach items="${languages}..

String Concatenation in EL

I would like to concatenate a string within a ternary operator in EL(Expression Language). Suppose there is a variable named value. If it's empty, I want to use some default text. Otherwise, I need t..

java.lang.ClassNotFoundException: javax.servlet.jsp.jstl.core.Config

When I am run my application after entering the URL, this exception is coming.I am using Eclipse and Tomcat7.0.35. I also added Jstl.jar and jstl1.2.jar My code is java.lang.ClassNotFoundException: ..

Loop through a Map with JSTL

I'm looking to have JSTL loop through a Map<String, String> and output the value of the key and it's value. For example I have a Map<String, String> which can have any number of entries, ..

The absolute uri: http://java.sun.com/jsp/jstl/core cannot be resolved in either web.xml or the jar files deployed with this application

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

Get value from hashmap based on key to JSTL

I want to get the value of HashMap based on key. HashMap<String, ArrayList<String>> map = new HashMap<String, ArrayList<String>>(); ArrayList<String> arrayList = ne..

How to use if-else option in JSTL

Is there an if-else tag available in JSTL?..

Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core"

I'm trying to use JSTL, but I get the following error: Can not find the tag library descriptor for "http://java.sun.com/jsp/jstl/core" How is this caused and how can I solve it? ..

Use JSTL forEach loop's varStatus as an ID

I want to use the count from the JSTL forEach loop, but my code doesnt seem to work. <c:forEach items="${loopableObject}" var="theObject" varStatus="theCount"> <div id="divIDNo${theCount..

Increment counter with loop

This question is related to my previous question : Jsp iterate trough object list I want to insert counter that starts from 0 in my for loop, I've tried several combinations so far : 1. <c:forE..

javax.el.PropertyNotFoundException: Property 'foo' not found on type com.example.Bean

I have results from Query query = session.createQuery("From Pool as p left join fetch p.poolQuestion as s"); query and I would like to display it on JSP. I have loop: <c:forEach items="${pools..

Correct syntax to compare values in JSTL <c:if test="${values.type}=='object'">

I have an if statement that I am trying to perform with JSTL. My code is below (the variables values is an ArrayList that contains a user defined object and type is a private property of that object,..

How to access at request attributes in JSP?

Currently I use: <% final String message = (String) request.getAttribute ("Error_Message"); %> and then <%= message %> However I wonder if the same can be done with EL or JSTL instea..

Iterate over elements of List and Map using JSTL <c:forEach> tag

If I have a JSF backing bean return an object of type ArrayList, I should be able to use <c:foreach> to iterate over the elements in the list. Each element contains a map and although the quest..

Check a collection size with JSTL

How can I check the size of a collection with JSTL? Something like: <c:if test="${companies.size() > 0}"> </c:if> ..

How to use if, else condition in jsf to display image

I have a condition where I have an enrollment form in which if userid is 0 it should show the dummy image and when I edit user from any update, I check for if userid which is not equal to 0 then displ..

if...else within JSP or JSTL

I want to output some HTML code based on some condition in a JSP file. if (condition 1) { Some HTML code specific for condition 1 } else if (condition 2) { Some HTML code specific for conditi..

How do I check two or more conditions in one <c:if>?

How do I check two conditions in one <c:if>? I tried this, but it raises an error: <c:if test="${ISAJAX == 0} && ${ISDATE == 0}"> ..

Evaluate if list is empty JSTL

I've been trying to evaluate if this array list is empty or not but none of these have even compiled: <c:if test="${myObject.featuresList.size == 0 }"> <c:if test="${myObj..

Where can I download JSTL jar

Does anyone know because all the places I've tried seem to timeout!..

Iterating through a List Object in JSP

I am working on a project to try and teach myself spring and struts. I am currently stuck on a JSP page. I have a pojo class with variables eid and ename with getters/setters, I also have a table in s..

test attribute in JSTL <c:if> tag

I saw some code like the following in a JSP <c:if test="<%=request.isUserInRole(RoleEnum.USER.getCode())%>"> <li>user</li> </c:if> My confusion is over the "=" tha..

Selected value for JSP drop down using JSTL

I have SortedMap in Servlet to populate drop down values in JSP and I have the following code SortedMap<String, String> dept = findDepartment(); request.setAttribute("dept ", dept); a..

Converting Decimal to Binary Java

I am trying to convert decimal to binary numbers from the user's input using Java. I'm getting errors. package reversedBinary; import java.util.Scanner; public class ReversedBinary { public stat..

Creating virtual directories in IIS express

Is there any way to create a virtual directory in IIS express? I know that Cassini can't do this and it would be nice to be able to do this without using a full version of IIS. I've got it so far tha..

HTTP 415 unsupported media type error when calling Web API 2 endpoint

I have an existing Web API 2 service and need to modify one of the methods to take a custom object as another parameter, currently the method has one parameter which is a simple string coming from the..

Age from birthdate in python

How can I find an age in python from today's date and a persons birthdate? The birthdate is a from a DateField in a Django model...

Turn off deprecated errors in PHP 5.3

My server is running PHP 5.3 and my WordPress install is spitting these errors out on me, causing my session_start() to break. Deprecated: Assigning the return value of new by reference is deprecat..

Peak signal detection in realtime timeseries data

Update: The best performing algorithm so far is this one. This question explores robust algorithms for detecting sudden peaks in real-time timeseries data. Consider the following dataset: Example o..

function is not defined error in Python

I am trying to define a basic function in python but I always get the following error when I run a simple test program; >>> pyth_test(1, 2) Traceback (most recent call last): File "<py..

Hover and Active only when not disabled

I use hover, active and disabled to style Buttons. But the problem is when the button is disabled the hover and active styles still applies. How to apply hover and active only on enabled buttons?..

Hide Command Window of .BAT file that Executes Another .EXE File

This is a batch file in Windows. Here is my .bat file @echo off copy "C:\Remoting.config-Training" "C:\Remoting.config" "C:\ThirdParty.exe" This works fine except the .bat file leaves the..

How to properly URL encode a string in PHP?

I'm making a search page, where you type a search query and the form is submitted to search.php?query=your query. What PHP function is the best and that I should use for encoding/decoding the search q..

Shortcut for echo "<pre>";print_r($myarray);echo "</pre>";

Is there a Shortcut for echo "<pre>"; print_r($myarray); echo "</pre>"; It is really annoying typing those just to get a readable format of an array...

UIView touch event in controller

How can I add UIView touchbegin action or touchend action programmatically as Xcode is not providing from Main.storyboard?..

How do I get the current username in Windows PowerShell?

How do I get the current username in Windows PowerShell?..

FIX CSS <!--[if lt IE 8]> in IE

How can I use this: <!--[if lt IE 8]> <style type='text/css'> #header ul#h-menu li a{font-weight:normal!important} </style> <![endif]--> If I remove <..

What to gitignore from the .idea folder?

Possible Duplicate: Intellij Idea 9/10, what folders to check into (or not check into) source control? I started using WebStorm for web development and am not sure what to add and what to e..

How to display a loading screen while site content loads

I'm working on a site which contains a whole bunch of mp3s and images, and I'd like to display a loading gif while all the content loads. I have no idea how to achieve this, but I do have the animat..

Multiple Buttons' OnClickListener() android

I'm currently making a simple calculator app on Android. Im trying to set up the code so that when a number button is pressed it updates the calculator screen with that number. Currently I'm doing it ..

find vs find_by vs where

I am new to rails. What I see that there are a lot of ways to find a record: find_by_<columnname>(<columnvalue>) find(:first, :conditions => { <columnname> => <columnvalue..

Ruby capitalize every word first letter

I need to make the first character of every word uppercase, and make the rest lowercase... manufacturer.MFA_BRAND.first.upcase is only setting the first letter uppercase, but I need this: ALFA ROM..

How To Check If A Key in **kwargs Exists?

Python 3.2.3. There were some ideas listed here, which work on regular var's, but it seems **kwargs play by different rules... so why doesn't this work and how can I check to see if a key in **kwargs ..

How do I configure Notepad++ to use spaces instead of tabs?

Notepad++ keeps inserting tabs which later messes up my code. This doesn't just happen when I hit the tab key, but other times as well. I want it to use 4 spaces instead of tabs. How can I make Notep..

Checking if an object is a given type in Swift

I have an array that is made up of AnyObject. I want to iterate over it, and find all elements that are array instances. How can I check if an object is of a given type in Swift?..

Pushing value of Var into an Array

I know this is probably a simple question, but I'm attempting a tweak in a plugin & js is not my expertise and I got stumped on how to do the following: I have an array that can contain a number ..

How can I show an image using the ImageView component in javafx and fxml?

I suppose it's a very simple thing but I just can't get behind it. All I want is to show an image over an ImageView linked to fxml. Here is my code: package application; import java.io.File; import..

Numpy: Get random set of rows from 2D array

I have a very large 2D array which looks something like this: a= [[a1, b1, c1], [a2, b2, c2], ..., [an, bn, cn]] Using numpy, is there an easy way to get a new 2D array with, e.g., 2 random rows..

What languages are Windows, Mac OS X and Linux written in?

I was just wondering who knows what programming languages Windows, Mac OS X and Linux are made up from and what languages are used for each part of the OS (ie: Kernel, plug-in architecture, GUI compon..

How do I make Visual Studio pause after executing a console application in debug mode?

I have a collection of Boost unit tests I want to run as a console application. When I'm working on the project and I run the tests I would like to be able to debug the tests, and I would like to hav..

Rails and PostgreSQL: Role postgres does not exist

I have installed PostgreSQL on my Mac OS Lion, and am working on a rails app. I use RVM to keep everything separate from my other Rails apps. For some reason when I try to migrate the db for the firs..

How to add extra whitespace in PHP?

I was wondering how can I add extra whitespace in php is it something like \s please help thanks. Is there a tutorial that list these kind of things thanks...

How to make a <button> in Bootstrap look like a normal link in nav-tabs?

I'm working in (formerly Twitter) Bootstrap 2 and I wanted to style buttons as though they were normal links. Not just any normal links, though; these are going in a <ul class="nav nav-tabs nav-sta..

How to get the selected radio button value using js

I am using this code to get the value of currently selected radio button, but it doesn't work. var mailcopy = document.getElementById('mailCopy').value; How to get the currently selected radio but..

How to change TIMEZONE for a java.util.Calendar/Date

I would like to change the TIMEZONE value in a Java Calendar instance at runtime. I tried below. But the output is the same in both instances: Calendar cSchedStartCal = Calendar.getInstance(TimeZ..

Obtain form input fields using jQuery?

I have a form with many input fields. When I catch the submit form event with jQuery, is it possible to get all the input fields of that form in an associative array?..

How to disable auto-play for local video in iframe

How to disable auto-play for video when src is from my local pc? <iframe width="465" height="315" src="videos/example.mp4"></iframe> I have tried the following, but it doesn't work: ..

How to lose margin/padding in UITextView?

I have a UITextView in my iOS Application, which displays a large amount of text. I am then paging this text by using the offset margin parameter of the UITextView. My problem is that the padding of..

How to screenshot website in JavaScript client-side / how Google did it? (no need to access HDD)

I'm working on web application that needs to render a page and make a screenshot on the client (browser) side. I don't need the screenshot to be saved on the local HDD though, just kept it in RAM an..

PostgreSQL Autoincrement

I'm switching from MySQL to PostgreSQL and was wondering how I can do autoincrement values. I saw in the PostgreSQL docs a datatype "serial", but I get syntax errors when using it (in v8.0)...

How do I redirect output to a variable in shell?

I have a script like that genhash --use-ssl -s $IP -p 443 --url $URL | grep MD5 | grep -c $MD5 I want to get stream generated by genhash in a variable. How do I redirect it into a variable $hash to..

How to extract one column of a csv file

If I have a csv file, is there a quick bash way to print out the contents of only any single column? It is safe to assume that each row has the same number of columns, but each column's content would..

EC2 instance types's exact network performance?

I cannot find exact network performance details for different EC2 instance types on Amazon. Instead, they are only saying: High Moderate Low What does this even mean? I especially want to know the..

Sql server - log is full due to ACTIVE_TRANSACTION

I have a very large database (50+ GB). In order to free space in my hard drive, I tried deleting old records from one of the tables . I ran the command: delete from Table1 where TheDate<'2004-01-0..

How to set space between listView Items in Android

I tried to use marginBottom on the listView to make space between listView Item, but still the items are attached together. Is it even possible? If yes, is there a specific way to do it? My code is ..

How to see local history changes in Visual Studio Code?

I'm looking for a way to see my local history changes. Kind of the equivalent way in WebStorm: ..

How do I get cURL to not show the progress bar?

I'm trying to use cURL in a script and get it to not show the progress bar. I've tried the -s, -silent, -S, and -quiet options, but none of them work. Here's a typical command I've tried: curl -s ..

How to check Spark Version

I want to check the spark version in cdh 5.7.0. I have searched on the internet but not able to understand. Please help...

How do I use arrays in C++?

C++ inherited arrays from C where they are used virtually everywhere. C++ provides abstractions that are easier to use and less error-prone (std::vector<T> since C++98 and std::array<T, n>..

Can I get div's background-image url?

I have a button of which when I click it I want to alert the background-image URL of #div1. Is it possible?..

Change SQLite database mode to read-write

How can I change an SQLite database from read-only to read-write? When I executed the update statement, I always got: SQL error: attempt to write a readonly database The SQLite file is a writea..

UITableView - change section header color

How can I change color of a section header in UITableView? EDIT: The answer provided by DJ-S should be considered for iOS 6 and above. The accepted answer is out of date...

ArrayList or List declaration in Java

What is the difference between these two declarations? Declaration 1: ArrayList<String> arrayList = new ArrayList<String>(); Declaration 2: List<String> arrayList = new ArrayLis..

Android view layout_width - how to change programmatically?

This is my view, and I wish to change layout_width to "10dip". How do I do so programmatically? Note, this is not a LinearLayout, it's a View. <View android:id="@+id/nutrition_bar_filled" ..

R plot: size and resolution

I have stacked into the question: I need to plot the image with DPI=1200 and specific print size. By default the png looks ok... png("test.png",width=3.25,height=3.25,units="in",res=1200) par(mar=c..

Get all photos from Instagram which have a specific hashtag with PHP

I need to get some pictures which have a specific hashtag using PHP ? Any help will be awesome, or hint ?..

Get device information (such as product, model) from adb command

One way to achieve this is as follows: adb devices -l example output: 123abc12 device product:<id> model:<id> device:<id> 456abc45 device product:<..

warning about too many open figures

In a script where I create many figures with fix, ax = plt.subplots(...), I get the warning RuntimeWarning: More than 20 figures have been opened. Figures created through the pyplot interface (matplot..

How to get the PYTHONPATH in shell?

debian@debian:~$ echo $PYTHONPATH /home/qiime/lib/: debian@debian:~$ python Python 2.7.3 (default, Jan 2 2013, 16:53:07) [GCC 4.7.2] on linux2 Type "help", "copyright", "credits" or "licen..

Pass entire form as data in jQuery Ajax function

I have a jQuery ajax function and would like to submit an entire form as post data. We are constantly updating the form so it becomes tedious to constantly update the form inputs that should be sent i..

Java - Find shortest path between 2 points in a distance weighted map

I need an algorithm to find shortest path between two points in a map where road distance is indicated by a number. what is given: Start City A Destination City Z List of Distances between Cities: ..

DISTINCT clause with WHERE

How can I use the DISTINCT clause with WHERE? For example: SELECT * FROM table WHERE DISTINCT email; -- email is a column name I want to select all columns from a table with distinct email addresse..

font-family is inherit. How to find out the font-family in chrome developer pane?

In the Chrome's developer pane, I can see these css settings of an element. As far as I can see, every single font-family value is inherit. How can I find what is the actual value of the font fam..

Ajax LARAVEL 419 POST error

I would really appreciate some help on this. I tried tons of solutions as posted in this forum, but I cannot get it to work. My ajax call is something like $(document).ready(function() { $("#co..

pandas groupby sort within groups

I want to group my dataframe by two columns and then sort the aggregated results within the groups. In [167]: df Out[167]: count job source 0 2 sales A 1 4 sales B 2 6 sales C 3 ..

Run Excel Macro from Outside Excel Using VBScript From Command Line

I'm trying to run an Excel macro from outside of the Excel file. I'm currently using a ".vbs" file run from the command line, but it keeps telling me the macro can't be found. Here is the script I'm t..

Format / Suppress Scientific Notation from Python Pandas Aggregation Results

How can one modify the format for the output from a groupby operation in pandas that produces scientific notation for very large numbers? I know how to do string formatting in python but I'm at a lo..

Replacing some characters in a string with another character

I have a string like AxxBCyyyDEFzzLMN and I want to replace all the occurrences of x, y, and z with _. How can I achieve this? I know that echo "$string" | tr 'x' '_' | tr 'y' '_' would work..

How do you use String.substringWithRange? (or, how do Ranges work in Swift?)

I have not yet been able to figure out how to get a substring of a String in Swift: var str = “Hello, playground” func test(str: String) -> String { return str.substringWithRange( /* What goe..

Check if a value is in an array or not with Excel VBA

I've got some code below, that is supposed to be checking if a value is in an Array or not. Sub test() vars1 = Array("Examples") vars2 = Array("Example") If IsInArray(Range("A1").Value, v..

How do I remove time part from JavaScript date?

I have a date '12/12/1955 12:00:00 AM' stored in a hidden column. I want to display the date without the time. How do I do this?..

Build the full path filename in Python

I need to pass a file path name to a module. How do I build the file path from a directory name, base filename, and a file format string? The directory may or may not exist at the time of call. For..

When to use single quotes, double quotes, and backticks in MySQL

I am trying to learn the best way to write queries. I also understand the importance of being consistent. Until now, I have randomly used single quotes, double quotes, and backticks without any real t..

Convert DataTable to IEnumerable<T>

I am trying to convert a DataTable to an IEnumerable. Where T is a custom type I created. I know I can do it by creating a List<T> but I was thinking if there is a slicker way to do it using IEn..

Python-Requests close http connection

I was wondering, how do you close a connection with Requests (python-requests.org)? With httplib it's HTTPConnection.close(), but how do I do the same with Requests? Code: r = requests.post("http..

How to extract week number in sql

I have a transdate column of varchar2 type which has the following entrees 01/02/2012 01/03/2012 etc. I converted it in to date format in another column using to_date function. This is the format..

AngularJS Folder Structure

How do you layout a folder structure for a large and scaleable AngularJS application?..

Accessing Session Using ASP.NET Web API

I realize session and REST don't exactly go hand in hand but is it not possible to access session state using the new Web API? HttpContext.Current.Session is always null...

Get key and value of object in JavaScript?

Given a JavaScript array of objects, how can I get the key and value of each object? The code below shows what I'd like to do, but obviously doesn't work: var top_brands = [ { 'Adidas' : 100 }, { 'N..

Calling a phone number in swift

I'm trying to call a number not using specific numbers but a number that is being called in a variable or at least tell it to pull up the number in your phone. This number that is being called in a va..

How to download a file via FTP with Python ftplib

I have the following code which easily connects to the FTP server and opens a zip file. I want to download that file into the local system. How to do that? # Open the file for writing in binary mode ..

Can you have if-then-else logic in SQL?

I need to do select data from a table based on some kind of priority like so: select product, price from table1 where project = 1 -- pseudo: if no price found, do this: select product, price from ta..

Assignment inside lambda expression in Python

I have a list of objects and I want to remove all objects that are empty except for one, using filter and a lambda expression. For example if the input is: [Object(name=""), Object(name="fake_name..

What is the result of % in Python?

What does the % in a calculation? I can't seem to work out what it does. Does it work out a percent of the calculation for example: 4 % 2 is apparently equal to 0. How?..

Matplotlib scatter plot legend

I created a 4D scatter plot graph to represent different temperatures in a specific area. When I create the legend, the legend shows the correct symbol and color but adds a line through it. The code I..

How to trim white space from all elements in array?

I was just wondering what the best way to remove the white space from all the elements of a list would be. For example if I had String [] array = {" String", "Tom Selleck "," Fish "} How could I ge..

convert php date to mysql format

I have a date field in php which is using this code: $date = mysql_real_escape_string($_POST['intake_date']); How do I convert this to MySql format 0000-00-00 for inclusion in db. Is it along the ..

Change header text of columns in a GridView

I have a GridView which i programmatically bind using c# code. The problem is, the columns get their header texts directly from Database, which can look odd when presented on websites. So basically, i..

Are there .NET implementation of TLS 1.2?

Since I just discovered that RFC 5425 requires TLS 1.2 to be used, and that .NET doesn't yet support it, I wonder if there are any implementation, possibly open source, of TLS 1.2 protocol, as defined..

What is the point of WORKDIR on Dockerfile?

I'm learning Docker. For many times I've seen that Dockerfile has WORKDIR command: FROM node:latest RUN mkdir -p /usr/src/app WORKDIR /usr/src/app COPY package.json /usr/src/app/ RUN npm install COPY..

Android - Adding at least one Activity with an ACTION-VIEW intent-filter after Updating SDK version 23

I am getting the following tool tip in AndroidManifest.xml: App is not indexable by Google Search; consider adding at least one Activity with an ACTION-VIEW intent-filler. See issue explanation for m..

setup android on eclipse but don't know SDK directory

According to the beginner guide, to setup the ADT Plugin, one of the procedures is http://developer.android.com/sdk/eclipse-adt.html#installing For the SDK Location in the main panel, click Bro..

Spring boot - configure EntityManager

I was using Google guice in my project and now I tried to convert the framework to SpringBoot totally. I configured the Bean for persistence.xml like below in @Autowired @Bean(name = "transactionMan..

Variable used in lambda expression should be final or effectively final

Variable used in lambda expression should be final or effectively final When I try to use calTz it is showing this error. private TimeZone extractCalendarTimeZoneComponent(Calendar cal, TimeZone..

How do I detect whether a Python variable is a function?

I have a variable, x, and I want to know whether it is pointing to a function or not. I had hoped I could do something like: >>> isinstance(x, function) But that gives me: Traceback (mos..

PHP foreach loop through multidimensional array

I have an array: $arr_nav = array( array( "id" => "apple", "url" => "apple.html", "name" => "My Apple" ), array( "id" => "orange", "url" =..

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 to add elements of a string array to a string array list?

I am trying to pass a string array as an argument to the constructor of Wetland class; I don't understand how to add the elements of string array to the string array list. import java.util.ArrayList..

How to run PowerShell in CMD

I'm trying to run a PowerShell script inside cmd command line. Someone gave me an example and it worked: powershell.exe -noexit "& 'c:\Data\ScheduledScripts\ShutdownVM.ps1'" But the problem is ..

How can I install Python's pip3 on my Mac?

I'm trying to install pip3, but I'm not having any luck. Also, I tried sudo install and it did not work. How could I install pip3 on my Mac? sudo easy_install pip3 Password: Searching for pip3 Reading..

How do I get the name of the rows from the index of a data frame?

Consider a data frame with row names that aren't a column of their own per se, such as the following: X Y Row 1 0 5 Row 2 8 1 Row 3 3 0 How would I extract the name of these rows ..

How to compare values which may both be null in T-SQL

I want to make sure I'm not inserting a duplicate row into my table (e.g. only primary key different). All my fields allow NULLS as I've decided null to mean "all values". Because of nulls, the foll..

How to add onload event to a div element

How do you add an onload event to an element? Can I use: <div onload="oQuickReply.swap();" ></div> for this?..

Dealing with timestamps in R

I have multiple lists of measurements. In each list have the timestramp formated as a string ("2009-12-24 21:00:07.0") and I know that each measurement in the list is separated by 5 seconds. I want to..

How to bind DataTable to Datagrid

I have a problem binding a DataTable to a DataGrid. I have already searched for solutions but just can't get rid of the error. The binding works fine when using WindowsForms, so the DataTable is corre..

White space showing up on right side of page when background image should extend full length of page

Our webpage background images are having problems in FireFox as well as Safari in iOS on iPads/iPhones with white space showing up on the right side of the page. The background images extend fine on..

Parse JSON String into List<string>

string json = "{\"People\":[{\"FirstName\":\"Hans\",\"LastName\":\"Olo\"} {\"FirstName\":\"Jimmy\",\"LastName\":\"Crackedcorn\"}]}"; var obj = JObject.Parse(json); List&l..

How to check if a specific key is present in a hash or not?

I want to check whether the "user" key is present or not in the session hash. How can I do this? Note that I don't want to check whether the key's value is nil or not. I just want to check whether th..

generate model using user:references vs user_id:integer

I'm confused on how to generate a model that belongs_to another model. My book uses this syntax to associate Micropost with User: rails generate model Micropost user_id:integer but http://guides.ru..

JavaScript file not updating no matter what I do

I have an external JavaScript file and whether in FireFox or Chrome, whether all browsing data is cleared, it will NOT update no matter what. I believe something happened when I made a backup of my fi..

Reloading submodules in IPython

Currently I am working on a python project that contains sub modules and uses numpy/scipy. Ipython is used as interactive console. Unfortunately I am not very happy with workflow that I am using right..

Is there a way to use SVG as content in a pseudo element :before or :after

I want to place some SVG images before some selected elements. I am using jQuery but that is irrelevant. I would like to have the :before element to be as: #mydiv:before { content: '<svg.. code h..

telnet to port 8089 correct command

I am using telnet to port 8089 on remote server. Can any tell me which of the following commands are true. telnet 74.255.12.25 8089 or telnet 74.255.12.25 89 Thanks in Advance...

Add a column to existing table and uniquely number them on MS SQL Server

I want to add a column to an existing legacy database and write a procedure by which I can assign each record a different value. Something like adding a column and autogenerate the data for it. Like,..

Appending to an object

I have an object that holds alerts and some information about them: var alerts = { 1: { app: 'helloworld', message: 'message' }, 2: { app: 'helloagain', message: 'another message' } } In a..

How to make the 'cut' command treat same sequental delimiters as one?

I'm trying to extract a certain (the fourth) field from the column-based, 'space'-adjusted text stream. I'm trying to use the cut command in the following manner: cat text.txt | cut -d " " -f 4 Unf..

Finding rows containing a value (or values) in any column

Say we have a table 'data' containing Strings in several columns. We want to find the indices of all rows that contain a certain value, or better yet, one of several values. The column, however, is un..

No numeric types to aggregate - change in groupby() behaviour?

I have a problem with some groupy code which I'm quite sure once ran (on an older pandas version). On 0.9, I get No numeric types to aggregate errors. Any ideas? In [31]: data Out[31]: <class 'pa..

Git Bash won't run my python files?

I have been trying to run my python files in Git Bash but I keep getting an error and can't figure out how to fix it. My command as follows in the git bash executable python filename.py then it says ..

J2ME/Android/BlackBerry - driving directions, route between two locations

On Android 1.0 there was a com.google.googlenav namespace for driving directions: Route - Improved Google Driving Directions But in newer SDK it was removed by some reason... Android: DrivingDirection..

What is the difference between server side cookie and client side cookie?

What is the difference between creating cookies on the server and on the client? Are these called server side cookies and client side cookies? Is there a way to create cookies that can only be read on..

Where is the Keytool application?

I need to use mapview control in android and I can't seem to understand how to run keytool. Is it installed with eclipse? I can't seem to find a download link. Thanks..

How different is Objective-C from C++?

What are the main differences between Objective-C and C++ in terms of the syntax, features, paradigms, frameworks and libraries? *Important: My goal is not to start a performance war between the two ..

Initialize a long in Java

Primitive Data Types - oracle doc says the range of long in Java is -9,223,372,036,854,775,808 to 9,223,372,036,854,775,807. But when I do something like this in my eclipse long i = 12345678910; it..

How to get the process ID to kill a nohup process?

I'm running a nohup process on the server. When I try to kill it my putty console closes instead. this is how I try to find the process ID: ps -ef |grep nohup this is the command to kill kill -..

Finding Key associated with max Value in a Java Map

What is the easiest way to get key associated with the max value in a map? I believe that Collections.max(someMap) will return the max Key, when you want the key that corresponds to the max value...

How to make my layout able to scroll down?

I can not scroll down the screen to view the data in the "Replied By:" section. How can I make my layout scrollable? ..

C# get string from textbox

I am just a noob in C#, and I've got this question to ask you. I have here a form that asks for login details. It has two textfields: Username Password What I want is to get the strings entered ..

How to get names of enum entries?

I would like to iterate a TypeScript an enum type and get each enumerated symbol name, e.g.: enum myEnum { entry1, entry2 } for (var entry in myEnum) { // use entry's name here, e.g., "entry1" ..

How do I pass a list as a parameter in a stored procedure?

Looking to pass a list of User IDs to return a list names. I have a plan to handle the outputed names (with a COALESCE something or other) but trying to find the best way to pass in the list of user I..

Please initialize the log4j system properly. While running web service

Maybe it looks silly to ask this but I am confused. I referred to Configuring Log4j property but it doesn't seem to help. I have written a simple web service HelloWorld. And while running it I am get..

How to discard local changes and pull latest from GitHub repository

I have a directory on my machine where I store all projects from GitHub. I opened one of them and made changes locally on my machine. Project got messed up and now I want to discard all the changes I ..

python encoding utf-8

I am doing some scripts in python. I create a string that I save in a file. This string got lot of data, coming from the arborescence and filenames of a directory. According to convmv, all my arboresc..

Android dependency has different version for the compile and runtime

After updating Android Studio from Canary 3 to Canary 4, the following error is thrown at the build time. Android dependency 'com.android.support:support-support-v4' has different version for the ..

How to delete the contents of a folder?

How can I delete the contents of a local folder in Python? The current project is for Windows, but I would like to see *nix also...

How can I ping a server port with PHP?

I want a PHP script which allows you to ping an IP address and a port number (ip:port). I found a similar script but it works only for websites, not ip:port. <?php function ping($host, $port, $ti..

binning data in python with scipy/numpy

is there a more efficient way to take an average of an array in prespecified bins? for example, i have an array of numbers and an array corresponding to bin start and end positions in that array, and ..

What is a simple C or C++ TCP server and client example?

I need to quickly implement a very small C or C++ TCP server/client solution. This is simply to transfer literally an array of bytes from one computer to another - doesn't need to be scalable / over-c..

Git Clone: Just the files, please?

I want to clone a GIT repo and NOT end up with a .git directory. In other words I just want the files. Is there a way to do this? git clone --no-checkout did the exact opposite of what I want (gave ..

Java - Check Not Null/Empty else assign default value

I am trying to simplify the following code. The basic steps that the code should carry out are as follows: Assign String a default value Run a method If the method returns a null/empty string lea..

Getting the screen resolution using PHP

I need to find the screen resolution of a users screen who visits my website?..

How can I remove the gloss on a select element in Safari on Mac?

On Macs and iOS devices, in Safari, a <select> element with a background color generates a gloss over itself. This does not seem to happen in other operating systems. For example, I have a sel..

Are table names in MySQL case sensitive?

Are table names in MySQL case sensitive? On my Windows development machine the code I have is able to query my tables which appear to be all lowercase. When I deploy to the test server in our datacen..

cannot import name patterns

Before I wrote in urls.py, my code... everything worked perfectly. Now I have problems - can't go to my site. "cannot import name patterns" My urls.py is: from django.conf.urls import patterns, incl..

How do I store an array in localStorage?

If I didn't need localStorage, my code would look like this: var names=new Array(); names[0]=prompt("New member name?"); This works. However, I need to store this variable in localStorage and it's..

Passing parameters to JavaScript files

Often I will have a JavaScript file that I want to use which requires certain variables be defined in my web page. So the code is something like this: <script type="text/javascript" src="file.js"..

PHP - Check if the page run on Mobile or Desktop browser

In my PHP page I should display two different text contents according to whether the page run under mobile or desktop browser. Is there a way to perform this control in PHP?..

How to change the author and committer name and e-mail of multiple commits in Git?

I was writing a simple script in the school computer, and committing the changes to Git (in a repo that was in my pendrive, cloned from my computer at home). After several commits I realized I was com..

checking memory_limit in PHP

I'm need to check if memory_limit is at least 64M in my script installer. This is just part of PHP code that should work, but probably due to this "M" it's not reading properly the value. How to fix t..

Determine .NET Framework version for dll

I have an old dll that was compiled against the .NET framework and deployed. I am not sure which version of the .NET framework it was compiled against. I am wondering how I can determine which versi..

How to make sql-mode="NO_ENGINE_SUBSTITUTION" permanent in MySQL my.cnf

UPDATE FIXED 1/18/15 After we recently updated to MySQL 5.6.27 (from the Ubuntu repo), this option now works. So this appears to have been a problem with the previous version of MySQL. ORIGINAL QUES..

How to paste yanked text into the Vim command line

I'd like to paste yanked text into Vim's command line. Is it possible?..

SAP Crystal Reports runtime for .Net 4.0 (64-bit)

I need a runtime for SAP Crystal Reports for .Net 4.0 (64-bit). I have been searching from the web but not getting any success. Can I get the URL from where can i download this..

PHP Session timeout

I am creating a session when a user logs in like so: $_SESSION['id'] = $id; How can I specify a timeout on that session of X minutes and then have it perform a function or a page redirect once it h..

Finding the direction of scrolling in a UIScrollView?

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

Force IE8 Into IE7 Compatiblity Mode

Is there a way to force IE8 into IE7 compatibility mode using .NET or Javascript?..

Is it possible to access an SQLite database from JavaScript?

I have a set of HTML files and a SQLite database, which I would like to access from the browser, using the file:// scheme. Is it possible to access the database and create queries (and tables) using J..

Using PropertyInfo to find out the property type

I want to dynamically parse an object tree to do some custom validation. The validation is not important as such, but I want to understand the PropertyInfo class better. I will be doing something like..

Pycharm/Python OpenCV and CV2 install error

I've been trying to install both OpenCV and cv2 from both Pycharm and from the terminal as suggested using: pip install --user opencv pip install --user cv2 but I'm getting the following error for ..

Is there an embeddable Webkit component for Windows / C# development?

I've seen a few COM controls which wrap the Gecko rendering engine (GeckoFX, as well as the control shipped by Mozilla - mozctlx.dll). Is there a wrapper for Webkit that can be included in a .NET Winf..

PHP DateTime __construct() Failed to parse time string (xxxxxxxx) at position x

I had this construction error when trying to creating a new DateTime object using a timestamp: Exception: DateTime::_construct(): Failed to parse time string (1372622987) at position 8 (8): Unexpe..

encrypt and decrypt md5

I am using code $enrypt=md5($pass) and inserting $encrypt to database. I want to find out a way to decrypt them. I tried using a decrypting software but it says the hash should be of exactly 16 bytes..

How do you beta test an iphone app?

How can you beta test an iPhone app? I can get it on my own device, and anyone that gives me a device, I can run it on theirs, but is there a way to do a limited release via the app store for beta te..

Regex pattern for checking if a string starts with a certain substring?

What's the regular expression to check if a string starts with "mailto" or "ftp" or "joe" or... Now I am using C# and code like this in a big if with many ors: String.StartsWith("mailto:") String.St..

Reason to Pass a Pointer by Reference in C++?

Under which circumstances would you want to use code of this nature in c++? void foo(type *&in) {...} void fii() { type *choochoo; ... foo(choochoo); } ..

Convert String to Calendar Object in Java

I am new to Java, usually work with PHP. I am trying to convert this string: Mon Mar 14 16:02:37 GMT 2011 Into a Calendar Object so that I can easily pull the Year and Month like this: String ..

Ascii/Hex convert in bash

I'm now doing it this way: [root@~]# echo Aa|hexdump -v 0000000 6141 000a 0000003 [root@~]# echo -e "\x41\x41\x41\x41" AAAA But it's not exactly behaving as I wanted, ..

Git in Visual Studio - add existing project?

I'm trying to put an existing project under Git source control, but I'm unclear on several things. I have set up a 'Team Foundation Service' Git account online. I currently have an ASP.NET MVC 4 sol..

How to export data from Spark SQL to CSV

This command works with HiveQL: insert overwrite directory '/data/home.csv' select * from testtable; But with Spark SQL I'm getting an error with an org.apache.spark.sql.hive.HiveQl stack trace: j..

Angular JS POST request not sending JSON data

I am trying to send an object as JSON to my webservice in Flask that is expecting JSON in the request data. I have tested the service manually by sending JSON data and it works fine. However, when I ..

Python's time.clock() vs. time.time() accuracy?

Which is better to use for timing in Python? time.clock() or time.time()? Which one provides more accuracy? for example: start = time.clock() ... do something elapsed = (time.clock() - start) vs. ..

Insert default value when parameter is null

I have a table that has a column with a default value: create table t ( value varchar(50) default ('something') ) I'm using a stored procedure to insert values into this table: create procedur..

Which icon sizes should my Windows application's icon include?

I have a Windows application which will run in Windows XP and newer (i.e. Vista/7). According to the Vista UI Guidelines, the standard sizes are 16x16, 32x32, 48x48, 256x256 (XP standard sizes do not ..

Limiting Python input strings to certain characters and lengths

I just started learning my first real programming language, Python. I'd like to know how to constrain user input in a raw_input to certain characters and to a certain length. For example, I'd like to ..

How to find a hash key containing a matching value

Given I have the below clients hash, is there a quick ruby way (without having to write a multi-line script) to obtain the key given I want to match the client_id? E.g. How to get the key for client_i..

How to add default value for html <textarea>?

I want to set a default value for my html <textarea>. I read from a material that to add default value you have to do something like <textarea>This is default text</textarea>. I did ..

When should I use a table variable vs temporary table in sql server?

I'm learning more details in table variable. It says that temp tables are always on disk, and table variables are in memory, that is to say, the performance of table variable is better than temp table..

Substring in VBA

I have multiple strings in different cells like CO20: 20 YR CONVENTIONAL FH30: 30 YR FHLMC FHA31 I need to get the substring from 1 to till index of ':' or if that is not available till ending..

How to redirect output of an already running process

Normally I would start a command like longcommand &; I know you can redirect it by doing something like longcommand > /dev/null; for instance to get rid of the output or longcommand 2&g..

How can I get the content of CKEditor using JQuery?

I'm using CKEditor. I am saving the form values with ajax using page methods. But the content of CKEditor value cannot be saving into the table. I dont postback the page. What can I do for that?..

get name of a variable or parameter

I would like to get the name of a variable or parameter: For example if I have: var myInput = "input"; var nameOfVar = GETNAME(myInput); // ==> nameOfVar should be = myInput void testName([Typ..

Javascript, viewing [object HTMLInputElement]

I'm just started to learn HTML. Doing an alert() on one of my variables gives me this result [object HTMLInputElement]. How to get the data, that were added in text field, where my input type is tex..

Can I style an image's ALT text with CSS?

I have a dark blue page and when the image is loading (or missing) the ALT text is black and difficult to read (in FF). Could I style it (with CSS) to be white?..

How to put sshpass command inside a bash script?

I am trying to run a sshpass command inside a bash script but it isn't working. If I run the same command from the terminal it works fine but running it in a bash script it doesn't. #! /bin/bash ss..

Validate a username and password against Active Directory?

How can I validate a username and password against Active Directory? I simply want to check if a username and password are correct...

JavaScript open in a new window, not tab

I have a select box that calls window.open(url) when an item is selected. Firefox will open the page in a new tab by default. However, I would like the page to open in a new window, not a new tab. ..

How to convert a "dd/mm/yyyy" string to datetime in SQL Server?

I tried this SELECT convert(datetime, '23/07/2009', 111) but got this error The conversion of a varchar data type to a datetime data type resulted in an out-of-range value. However SELECT convert..

"Please try running this command again as Root/Administrator" error when trying to install LESS

I'm trying to install LESS on my machine and have installed node already. However, when I enter "node install -g less" I get the following error and am not sure what to do? FPaulMAC:bin paul$ npm ins..

How to redirect a url in NGINX

I need to redirect every http://test.com request to http://www.test.com. How can this be done. In the server block I tried adding rewrite ^/(.*) http://www.test.com/$1 permanent; but in browser ..

Using SQL LIKE and IN together

Is there a way to use LIKE and IN together? I want to achieve something like this. SELECT * FROM tablename WHERE column IN ('M510%', 'M615%', 'M515%', 'M612%'); So basically I want to be able to m..

HTML5 Canvas and Anti-aliasing

How to turn on the anti-aliasing on an canvas. The following code doesn't draw a smooth line: var context = mainCanv.getContext("2d"); if (context) { context.moveTo(0,0); context.lineTo(100,75..

Access denied for root user in MySQL command-line

I've just installed xampp, and am using command line to write mySQL. I am using 'root' with no password and can connect to mysql but cannot CREATE DATABASE as I get the error 1044 access denied for us..

load external URL into modal jquery ui dialog

why doesn't this display ibm.com into a 400x500px modal? The section appears to be correct, but it doesn't cause the popup modal to appear. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN..

How to make sure you don't get WCF Faulted state exception?

I am getting this exception: The communication object, System.ServiceModel.Channels.ServiceChannel, cannot be used for communication because it is in the Faulted state. The WCF service us..

What's the best way to share data between activities?

I have one activity which is the main activity used throughout the app and it has a number of variables. I have two other activities which I would like to be able to use the data from the first activi..

Select by partial string from a pandas DataFrame

I have a DataFrame with 4 columns of which 2 contain string values. I was wondering if there was a way to select rows based on a partial string match against a particular column? In other words, a fu..

Xcode 'CodeSign error: code signing is required'

I've been working on an iPhone project with iOS 4.0. I just downloaded Xcode 3.2.4 with iOS SDK 4.1 so that I can work with the updated iOS. Upon opening the project in the udpated Xcode, I found that..

Change the icon of the exe file generated from Visual Studio 2010

I am currently creating an application in Visual Studio 2010. After building the project to generate the output of my application, I find that the .exe is built with the default icon. Is there any w..

Query EC2 tags from within instance

Amazon recently added the wonderful feature of tagging EC2 instances with key-value pairs to make management of large numbers of VMs a bit easier. Is there some way to query these tags in the same wa..

ssh: Could not resolve hostname [hostname]: nodename nor servname provided, or not known

I am trying to set up a VPN with a Raspberry Pi, and the first step is gaining the ability to ssh into the device from outside my local network. For whatever reason, this is proving to be impossible a..

Which UUID version to use?

Which version of the UUID should you use? I saw a lot of threads explaining what each version entails, but I am having trouble figuring out what's best for what applications...

How do I remove all HTML tags from a string without knowing which tags are in it?

Is there any easy way to remove all HTML tags or ANYTHING HTML related from a string? For example: string title = "<b> Hulk Hogan's Celebrity Championship Wrestling &nbsp;&nbsp;&nb..

How do I kill this tomcat process in Terminal?

Using ps -ef | grep tomcat I found a tomcat server that is running. I tried kill -9 {id} but it returns "No such process." What am I doing wrong? Here's an example: Admins-MacBook-Pro:test-parent t..