Questions Tagged with #Dataitem

Using '<%# Eval("item") %>'; Handling Null Value and showing 0 against

If dataitem is Null I want to show 0 <asp:Label ID="Label18" Text='<%# Eval("item") %>' runat="server"></asp:Label> How can I accomplish this?..

Creating your own header file in C

Can anyone explain how to create a header file in C with a simple example from beginning to end...

How to center horizontal table-cell

I want the Content A, Content B, and Content C columns to be horizontally centered. I have this code been trying to add HTML:margin: 0 auto to .columns-container and i..

What is NODE_ENV and how to use it in Express?

This is my the app, I'm currently running on production. var app = express(); app.set('views',settings.c.WEB_PATH + '/public/templates'); app.set('view engine','ejs'); app.configure(function(){ a..

Manipulate a url string by adding GET parameters

I want to add GET parameters to URLs that may and may not contain GET parameters without repeating ? or &. Example: If I want to add category=action $url=""; // will add ?ca..

Attempted to read or write protected memory. This is often an indication that other memory is corrupt

I'm hoping someone can enlighten me as to what could possibly be causing this error: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I cann..

Writing a dict to txt file and reading it back?

I am trying to write a dictionary to a txt file. Then read the dict values by typing the keys with raw_input. I feel like I am just missing one step but I have been looking for a while now. I get thi..

How to change an input button image using CSS?

So, I can create an input button with an image using <INPUT type="image" src="/images/Btn.PNG" value=""> But, I can't get the same behavior using CSS. For instance, I've tried <INPUT type..

Encoding conversion in java

Is there any free java library which I can use to convert string in one encoding to other encoding, something like iconv? I'm using Java version 1.3...

check if array is empty (vba excel)

These if ... then statements are getting the wrong results in my opinion. The first is returning the value 'false' when it should be 'true'. The fourth returns the right value. The second and third re..

Concatenating bits in VHDL

How do you concatenate bits in VHDL? I'm trying to use the following code: Case b0 & b1 & b2 & b3 is ... and it throws an error Thanks..

How to get rid of blank pages in PDF exported from SSRS

I have a two-page SSRS report. When I exported it to PDF it was taking 4 pages due to its width, where the 2nd and 4th pages were displaying one of my fields from the table. I tried to set the layout ..

How do you stylize a font in Swift?

I'm trying out developing for Swift, it's going pretty well. One of the issues I'm having is finding out how to stylize fonts programmatically in the language. For example in this label I wrote the ..

Get string between two strings in a string

I have a string like: "super exemple of string key : text I want to keep - end of my string" I want to just keep the string which is between "key : " and " - ". How can I do that? Must I use a Re..

Get method arguments using Spring AOP?

I am using Spring AOP and have below aspect: @Aspect public class LoggingAspect { @Before("execution(*") public void logBefore(JoinPoint jo..

Adding an HTTP Header to the request in a servlet filter

I'm integrating with an existing servlet that pulls some properties out of the HTTP header. Basically, I'm implementing an interface that doesn't have access to the actual request, it just has access..

Why doesn't the Scanner class have a nextChar method?

This is really a curiosity more than a problem... Why doesn't the Scanner class have a nextChar() method? It seems like it should when you consider the fact that it has next, nextInt, nextLine etc me..

Prevent double submission of forms in jQuery

I have a form that takes a little while for the server to process. I need to ensure that the user waits and does not attempt to resubmit the form by clicking the button again. I tried using the follow..

"date(): It is not safe to rely on the system's timezone settings..."

I got this error when I requested to update the PHP version from 5.2.17 to PHP 5.3.21 on the server. <div style="border:1px solid #990000;padding-left:20px;margin:0 0 10px 0;"> <h4>A PHP..

Converting XML to JSON using Python?

I've seen a fair share of ungainly XML->JSON code on the web, and having interacted with Stack's users for a bit, I'm convinced that this crowd can help more than the first few pages of Google results..

How to enable curl in Wamp server

I try 30 combination of answer and forum topic but did not find the right answer. I do all but how I can enable the curl int wamp server becouse I need that? is there any solution? I try to uncomme..

How do I disable and re-enable a button in with javascript?

I can easily disable a javascript button, and it works properly. My issue is that when I try to re-enable that button, it does not re-enable. Here's what I'm doing: <script type="text/javascript..

Using strtok with a std::string

I have a string that I would like to tokenize. But the C strtok() function requires my string to be a char*. How can I do this simply? I tried: token = strtok(str.c_str(), " "); which fails becau..

No ConcurrentList<T> in .Net 4.0?

I was thrilled to see the new System.Collections.Concurrent namespace in .Net 4.0, quite nice! I've seen ConcurrentDictionary, ConcurrentQueue, ConcurrentStack, ConcurrentBag and BlockingCollection. ..

Why can't I duplicate a slice with `copy()`?

I need to make a copy of a slice in Go and reading the docs there is a copy function at my disposal. The copy built-in function copies elements from a source slice into a destination slice. (As..

Convert Dictionary<string,string> to semicolon separated string in c#

Simple one to start the day, given a Dictionary<string, string> as follows: var myDict = new Dictionary<string, string>(); myDict["A"] = "1"; myDict["B"] = "2"; myDict["C"] = "3"; myDict[..

How do I get a PHP class constructor to call its parent's parent's constructor?

I need to have a class constructor in PHP call its parent's parent's (grandparent?) constructor without calling the parent constructor. // main class that everything inherits class Grandpa { pub..

How to convert HTML to PDF using iText

import; import; import; import com.itextpdf.text.Document; import com.itextpdf.text.Paragraph; import com.itextpdf.text.pdf.PdfWriter; publi..

excel formula to subtract number of days from a date

is there a way in Excel to have a formula that does something like this: = 12/20/2010 - 180 which would take a certain date (12/20/2010 in this case) and subtract 180 days . ...

Differences between INDEX, PRIMARY, UNIQUE, FULLTEXT in MySQL?

What are the differences between PRIMARY, UNIQUE, INDEX and FULLTEXT when creating MySQL tables? How would I use them?..

Fitting a histogram with python

I have a histogram H=hist(my_data,bins=my_bin,histtype='step',color='r') I can see that the shape is almost gaussian but I would like to fit this histogram with a gaussian function and print the va..

How to build PDF file from binary string returned from a web-service using javascript

I am trying to build a PDF file out of a binary stream which I receive as a response from an Ajax request. Via XmlHttpRequest I receive the following data: %PDF-1.4.... ..... ....hole data represent..

ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean

I have written a spring batch application using Spring boot. When I am trying to run that application using command line and classpath on my local system it is running fine. However, when I tried to r..

Git merge error "commit is not possible because you have unmerged files"

I forgot to git pull my code before editing it; when I committed the new code and tried to push, I got the error "push is not possible". At that point I did a git pull which made some files ..

TypeError: ufunc 'add' did not contain a loop with signature matching types

I am creating bag of words representation of the sentence. Then taking the words that exist in the sentence to compare to the file "vectors.txt", in order to get their embedding vectors. After getting..

Java: How to Indent XML Generated by Transformer

I'm using Java's built in XML transformer to take a DOM document and print out the resulting XML. The problem is that it isn't indenting the text at all despite having set the parameter "indent" expli..

Could not install packages due to an EnvironmentError: [Errno 13]

In my MacOS Mojave terminal I wanted to install a python package with pip. At the end it says: You are using pip version 10.0.1, however version 18.1 is available. You should consider upgrading via t..

Insert Update trigger how to determine if insert or update

I need to write an Insert, Update Trigger on table A which will delete all rows from table B whose one column (say Desc) has values like the value inserted/updated in the table A's column (say Col1). ..

Better way to sort array in descending order

I have a array of int which I have to sort by descending. Since I did not find any method to sort the array in descending order.Currently I am sorting the array in descending order as below int[] a..

How do I add a custom script to my package.json file that runs a javascript file?

I want to be able to execute the command script1 in a project directory that will run node script1.js. script1.js is a file in the same directory. The command needs to be specific to the project dir..

Matplotlib plots: removing axis, legends and white spaces

I'm new to Python and Matplotlib, I would like to simply apply colormap to an image and write the resulting image, without using axes, labels, titles or anything usually automatically added by matplot..

Checking if float is an integer

How can I check if a float variable contains an integer value? So far, I've been using: float f = 4.5886; if (f-(int)f == 0) printf("yes\n"); else printf("no\n"); But I wonder if there is a be..

Waiting on a list of Future

I have a method which returns a List of futures List<Future<O>> futures = getFutures(); Now I want to wait until either all futures are done processing successfully or any of the tasks ..

Call JavaScript function from C#

Javascript.js function functionname1(arg1, arg2){content} C# file public string functionname(arg) { if (condition) { functionname1(arg1,arg2); // How do I call the JavaScript funct..

Crystal Reports - Adding a parameter to a 'Command' query

Crystal Version - Crystal Reports 2008 Business Objects - XI I have written a query to populate a subreport and want to pull in a parameter to that query based on input from a user. My question is, ..

How to quickly and conveniently disable all console.log statements in my code?

Is there any way to turn off all console.log statements in my JavaScript code, for testing purposes?..

How can I convert string to datetime with format specification in JavaScript?

How can I convert a string to a date time object in javascript by specifying a format string? I am looking for something like: var dateTime = convertToDateTime("23.11.2009 12:34:56", "dd.MM.yyyy HH:..

How to select a single field for all documents in a MongoDB collection?

In my MongoDB, I have a student collection with 10 records having fields name and roll. One record of this collection is: { "_id" : ObjectId("53d9feff55d6b4dd1171dd9e"), "name" : "Swati", ..

MIT vs GPL license

The MIT license is GPL-compatible. Is the GPL license MIT-compatible? i.e. I can include MIT-licensed code in a GPL-licensed product, but can I include GPL-licensed code in a MIT-licensed product? It..

Coding Conventions - Naming Enums

Is there a convention for naming enumerations in Java? My preference is that an enum is a type. So, for instance, you have an enum Fruit{Apple,Orange,Banana,Pear, ... } NetworkConnectionType{LAN,..

Can I set enum start value in Java?

I use the enum to make a few constants: enum ids {OPEN, CLOSE}; the OPEN value is zero, but I want it as 100. Is it possible?..

How to create a shortcut using PowerShell

I want to create a shortcut with PowerShell for this executable: C:\Program Files (x86)\ColorPix\ColorPix.exe How can this be done?..

Optimal way to concatenate/aggregate strings

I'm finding a way to aggregate strings from different rows into a single row. I'm looking to do this in many different places, so having a function to facilitate this would be nice. I've tried solutio..

How to get text with Selenium WebDriver in Python

I'm trying to get text using Selenium WebDriver and here is my code. Please note that I don't want to use XPath, because in my case the ID gets changed on every relaunch of the web page. My code: text..

How to upgrade OpenSSL in CentOS 6.5 / Linux / Unix from source?

How do I upgrade OpenSSL in CentOS 6.5? I have used these commands, but nothings happens: cd /usr/src wget tar -zxf openssl-1.0.1g.tar.gz cd o..

Django - makemigrations - No changes detected

I was trying to create migrations within an existing app using the makemigrations command but it outputs "No changes detected". Usually I create new apps using the startapp command but did not use it..

How to get Top 5 records in SqLite?

I have tried this which did not work. select top 5 * from [Table_Name] ..

Sublime text 3. How to edit multiple lines?

I was using Notepad++ and now I want to use the same cool features in Sublime but I don't know how. I want to edit multiple lines at the same time like this: But I don't want to Ctrl+Click at each ..

What are differences between AssemblyVersion, AssemblyFileVersion and AssemblyInformationalVersion?

There are three assembly version attributes. What are differences? Is it ok if I use AssemblyVersion and ignore the rest? MSDN says: AssemblyVersion: Specifies the version of the assembly bei..

How to replace all special character into a string using C#

I would like to replace all special characters in a string with a comma (,). For Example: Hello@Hello&Hello(Hello) the output - Hello,Hello,Hello,Hello, (I don't known how to use regexp i..

Bootstrap - Uncaught TypeError: Cannot read property 'fn' of undefined

I'm using jquery, backbonejs, underscorejs and bootstrap for my company project. Sometimes I got this error in chrome. Uncaught TypeError: Cannot read property 'fn' of undefined My shim is like..

Set the value of a variable with the result of a command in a Windows batch file

When working in a Bash environment, to set the value of a variable as the result of a command, I usually do: var=$(command -args) where var is the variable set by the command command -args. I can t..

How can I see the current value of my $PATH variable on OS X?

$ $PATH returns: -bash: /usr/local/share/npm/bin:/Library/Frameworks/Python.framework/Versions/2.7/bin:/usr/local/bin:/usr/local/sbin:~/bin:/Library/Frameworks/Python.framework/Versions/Curre..

Check if a div does NOT exist with javascript

Checking if a div exists is fairly simple if(document.getif(document.getElementById('if')){ } But how can I check if a div with the given id does not exist?..

MySQL & Java - Get id of the last inserted value (JDBC)

Possible Duplicate: How to get the insert ID in JDBC? Hi, I'm using JDBC to connect on database through out Java. Now, I do some insert query, and I need to get the id of last inserted va..

"The page has expired due to inactivity" - Laravel 5.5

My register page is showing the form properly with CsrfToken ({{ csrf_field() }}) present in the form). Form HTML <form class="form-horizontal registration-form" novalidate method="POST" action="..

IIS7 URL Redirection from root to sub directory

I am using Windows Server 2008 with IIS7. I need to redirect the users who come to to Here is the file structure I have for the projects: -Sites..

Echo newline in Bash prints literal \n

In Bash, tried this: echo -e "hello\nworld" But it doesn't print a newline, only \n. How can I make it print the newline? I'm using Ubuntu 11.04...

How to detect if CMD is running as Administrator/has elevated privileges?

From inside a batch file, I would like to test whether I'm running with Administrator/elevated privileges. The username doesn't change when "Run as Administrator" is selected, so that doesn't work. ..

Why does Google prepend while(1); to their JSON responses?

Why does Google prepend while(1); to their (private) JSON responses? For example, here's a response while turning a calendar on and off in Google Calendar: while (1); [ ['u', [ ['smsSentFlag',..

Upgrading Node.js to latest version

So, I have Node.js installed and now when I tried to install Mongoosejs I got an error telling me that I don't have the needed version of Node.js (I have v0.4.11 and v0.4.12 is needed). How can I upg..

How to use wget in php?

I have this parameters to download a XML file: wget --http-user=user --http-password=pass How I have to use that in php to open this xml file?..

How to convert string representation of list to a list?

I was wondering what the simplest way is to convert a string representation of a list like the following to a list: x = '[ "A","B","C" , " D"]' Even in cases w..

How to unpackage and repackage a WAR file

I have a WAR file. I would like to open it, edit an XML file, remove some jars and then re-package it. I used WINRAR to open the WAR file and I removed some Jars and did an 'Add to Archive' in WinRar..

C++ for each, pulling from vector elements

I am trying to do a foreach on a vector of attacks, each attack has a unique ID say, 1-3. The class method takes the keyboard input of 1-3. I am trying to use a foreach to run through my elements in..

Check if input value is empty and display an alert

How is it possible to display an alert with jQuery if I click the submit button and the value of the input field is empty? <input type="text" id="myMessage" name="shoutbox_..

Removing a non empty directory programmatically in C or C++

How to delete a non empty directory in C or C++? Is there any function? rmdir only deletes empty directory. Please provide a way without using any external library. Also tell me how to delete a file..

How to assign from a function which returns more than one value?

Still trying to get into the R logic... what is the "best" way to unpack (on LHS) the results from a function returning multiple values? I can't do this apparently: R> functionReturningTwoValues..

How do I find the width & height of a terminal window?

As a simple example, I want to write a CLI script which can print = across the entire width of the terminal window. #!/usr/bin/env php <?php echo str_repeat('=', ???); or #!/usr/bin/env python ..

How to create timer in angular2

I need a timer in Angular 2, which tick after a time interval and do some task (may be call some functions). How to do this with Angular 2?..

Running AngularJS initialization code when view is loaded

When I load a view, I'd like to run some initialization code in its associated controller. To do so, I've used the ng-init directive on the main element of my view: <div ng-init="init()"> bl..

jQuery position DIV fixed at top on scroll

I have a page that's fairly long and within the layout's menu, there's a flyout menu. I'd like this flyout portion of the menu to show at the top of the page even when the user has scrolled the menu b..

CASE (Contains) rather than equal statement

Is there a method to use contain rather than equal in case statement? For example, I am checking a database table has an entry lactulose, Lasix (furosemide), oxazepam, propranolol, rabeprazole, sert..

How can I lookup a Java enum from its String value?

I would like to lookup an enum from its string value (or possibly any other value). I've tried the following code but it doesn't allow static in initialisers. Is there a simple way? public enum Verbo..

Using String Format to show decimal up to 2 places or simple integer

I have got a price field to display which sometimes can be either 100 or 100.99 or 100.9, What I want is to display the price in 2 decimal places only if the decimals are entered for that price , for ..

Remove Trailing Spaces and Update in Columns in SQL Server

I have trailing spaces in a column in a SQL Server table called Company Name. All data in this column has trailing spaces. I want to remove all those, and I want to have the data without any trailin..

Removing duplicate rows in Notepad++

Is it possible to remove duplicated rows in Notepad++, leaving only a single occurrence of a line?..

How do I fix a "Expected Primary-expression before ')' token" error?

Here is my code. I keep getting this error: error: expected primary-expression before ')' token Anyone have any ideas how to fix this? void showInventory(player& obj) { // By Johnny :D fo..

SQL - select distinct only on one column

I have searched far and wide for an answer to this problem. I'm using a Microsoft SQL Server, suppose I have a table that looks like this: +--------+---------+-------------+-------------+ | ID | ..

How can I make my string property nullable?

I want to make the Middle Name of person optional. I have been using code first approach. For integer data type its easy just by using ? operator to make in nullable. I am looking for a way to ..

angular.service vs angular.factory

I have seen both angular.factory() and angular.service() used to declare services; however, I cannot find angular.service anywhere in official documentation. What is the difference between the two me..

What is Node.js' Connect, Express and "middleware"?

Despite knowing JavaScript quite well, I'm confused what exactly these three projects in Node.js ecosystem do. Is it something like Rails' Rack? Can someone please explain?..

How can I clear the terminal in Visual Studio Code?

I need to clean the contents of the terminal in Visual Studio Code. Every time I use Maven, the output of the terminal is attached to the previous build, which is confusing me. How do I clear the te..

Is it possible to install both 32bit and 64bit Java on Windows 7?

Is it possible to install both 32bit and 64bit Java on Windows 7? I have some applications that I can run under 64bit, but there are some that only run under 32bit...

Git on Windows: How do you set up a mergetool?

I've tried msysGit and Git on Cygwin. Both work just fine in and of themselves and both run gitk and git-gui perfectly. Now how the heck do I configure a mergetool? (Vimdiff works on Cygwin, but pref..

java.lang.UnsupportedClassVersionError: Unsupported major.minor version 51.0 (unable to load class frontend.listener.StartupListener)

Possible Duplicate: unsupported major .minor version 51.0 I have eclipse indigo and tomcat 7.0.29. And still no Serlvets can be loaded! I have no other JDK or JRE than the 1.7 one! Compil..

Execute write on doc: It isn't possible to write into a document from an asynchronously-loaded external script unless it is explicitly opened.

I am trying to load a certain script after page load executes, something like this: function downloadJSAtOnload(){ var element = document.createElement("script"); element.src ..

How do I set the icon for my application in visual studio 2008?

How do I set the executable icon for my C++ application in visual studio 2008?..

How to detect responsive breakpoints of Twitter Bootstrap 3 using JavaScript?

Currently, Twitter Bootstrap 3 have the following responsive breakpoints: 768px, 992px and 1200px, representing small, medium and large devices respectively. How can I detect these breakpoints using ..

How to grant remote access to MySQL for a whole subnet?

I can easily grant access to one IP using this code: $ mysql -u root -p Enter password: mysql> use mysql mysql> GRANT ALL ON *.* to root@'' IDENTIFIED BY 'your-root-password'..

Passing additional variables from command line to make

Can I pass variables to a GNU Makefile as command line arguments? In other words, I want to pass some arguments which will eventually become variables in the Makefile...

True and False for && logic and || Logic table

Table true/false for C Language I have heard of a table true false for C Language for and && or || is kind of the mathematics one for which they say if true+true=true and false+true=false I'm ..

Split string into list in jinja?

I have some variables in a jinja2 template which are strings seperated by a ';'. I need to use these strings separately in the code. i.e. the variable is variable1 = "green;blue" {% list1 = {{ varia..

'"SDL.h" no such file or directory found' when compiling

Here's a piece of my current Makefile: CFLAGS = -O2 -Wall -pedantic -std=gnu++11 `sdl-config --cflags --libs` -lSDL_mixer I have libsdl installed properly, SDL.h is in /usr/include/sdl where it bel..

With CSS, how do I make an image span the full width of the page as a background image?

Say, like in this example here: When I do it, I end up getting white borders around the image no matter what I do. What am I doing w..

How to ignore certain files in Git

I have a repository with a file, When I compile it, an additional Hello.class file is generated. I created an entry for Hello.class in a .gitignore file. However, the file still appears t..

Spring - No EntityManager with actual transaction available for current thread - cannot reliably process 'persist' call

I get this error when trying to invoke "persist" method to save entity model to database in my Spring MVC web application. Can't really find any post or page in internet that can relate to this partic..

Scroll to a specific Element Using html

Is there a method in html which makes the webpage scroll to a specific Element using HTML !?..

How to embed PDF file with responsive width

I'm embedding pdf files using something like this: <div class="graph-outline"> <object style="width:100%;" data="path/to/file.pdf?#zoom=85&scrollbar=0&toolbar=0&navpanes=0" t..

List<T> or IList<T>

Can anyone explain to me why I would want to use IList over List in C#? Related question: Why is it considered bad to expose List<T>..

Javascript: set label text

I'm trying to implement a generic function for a form with several fields in the following format. <label id="LblTextCount"></label> <textarea name="text" onKeyPress="checkLength(this,..

AngularJS - ng-if check string empty value

it's a simple example: <a ng-if=" == ''" href="#/details/{{}}"><img src="/img.jpg" class="img-responsive"></a> <a ng-if=" != ''" href="#/details/{{item..

How to style a checkbox using CSS

I am trying to style a checkbox using the following: _x000D_ _x000D_ <input type="checkbox" style="border:2px dotted #00f;display:block;background:#ff0000;" />_x000D_ _x000D_ _x000D_ But the ..

Check if a number has a decimal place/is a whole number

I am looking for an easy way in JavaScript to check if a number has a decimal place in it (in order to determine if it is an integer). For instance, 23 -> OK 5 -> OK 3.5 -> not OK 34.345 -&..

Simple division in Java - is this a bug or a feature?

I'm trying this simple calculation in a Java application: System.out.println("b=" + (1 - 7 / 10)); Obviously I expect the output to be b=0.3, but I actually get b=1 instead. What?! Why does this h..

Make the size of a heatmap bigger with seaborn

I create a heatmap with seaborn df1.index = pd.to_datetime(df1.index) df1 = df1.set_index('TIMESTAMP') df1 = df1.resample('30min').mean() ax = sns.heatmap(df1.iloc[:, 1:6:], annot=True, linewidths=..

How to stop C# console applications from closing automatically?

My console applications on Visual Studio are closing automatically, so I'd like to use something like C's system("PAUSE") to "pause" the applications at the end of its execution, how can I achieve tha..

When do I need to do "git pull", before or after "git add, git commit"?

What is the right way? git add foo.js git commit foo.js -m "commit" git pull git push Or git pull git add foo.js git commit foo.js -m "commit" git push Or git add foo.js git pull git commit foo..

Google Authenticator available as a public service?

Is there public API for using the Google Authenticator (two factor authentication) on self-running (e.g. LAMP stack) web apps?..

Edit existing excel workbooks and sheets with xlrd and xlwt

In the documentation for xlrd and xlwt I have learned the following: How to read from existing work-books/sheets: from xlrd import open_workbook wb = open_workbook("ex.xls") s = wb.sheet_by_index(0)..

Can I prevent text in a div block from overflowing?

Can I prevent text in a div block from overflowing?..

getting the table row values with jquery

I am trying to get the values from an html table row. When I click on the table row delete button, I want to put those values on variables to send to the server. I have found something from here that ..

Is header('Content-Type:text/plain'); necessary at all?

I didn't see any difference with or without this head information yet...

How to stop/cancel 'git log' command in terminal?

In terminal, I ran this command git log . It displayed a list of log but it seems that because it is long, the terminal is not displaying everything. Below logs there is : that I can see more logs wh..

preventDefault() on an <a> tag

I have some HTML and jQuery that slides a div up and down to show or hide` it when a link is clicked: <ul class="product-info"> <li> <a href="#">YOU CLICK THIS TO SHOW/HIDE<..

How to enable local network users to access my WAMP sites?

First of all, I read at least 20 articles about this topic, and not one of them can match up the scenario and I screwed up the process numerous times. So I turn help by offering my specific scenario i..

mysql alphabetical order

i am trying to sort mysql data with alphabeticaly like A | B | C | D when i click on B this query runs select name from user order by 'b' but result showing all records starting with a or c..

How do you get an iPhone's device name

If you open Settings -> General -> About, it'll say Bob's iPhone at the top of the screen. How do you programmatically grab that name?..

How to get the primary IP address of the local machine on Linux and OS X?

I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than The solution should work at least for Linux (Debian and RedHat) and..

IsNumeric function in c#

I know it's possible to check whether the value of a text box or variable is numeric using try/catch statements, but IsNumeric is so much simpler. One of my current projects requires recovering value..

How to multi-line "Replace in files..." in Notepad++

If the free source code editor Notepad++ has the feature "Find in files...", that is without the files being opened in the editor, does it also have the feature "Replace in files..."? Notepad++ is ba..

How do I push a local Git branch to master branch in the remote?

I have a branch called develop in my local repo, and I want to make sure that when I push it to origin it's merged with the origin/master. Currently, when I push it's added to a remote develop branch...

Cannot read property 'getContext' of null, using canvas

I get the error Uncaught TypeError: Cannot read property 'getContext' of null and the important parts in files are... I am wondering since game.js is in a directory below, it cannot find canvas? What ..

MySQL Error #1133 - Can't find any matching row in the user table

Unable to set password for a user using - phpMyAdmin for 5.5.27 - MySQL. When trying to set the password while logged onto phpMyAdmin as the user, it pops up the following error: #1133 - Can'..

How to find the size of integer array

How to find the size of an integer array in C. Any method available without traversing the whole array once, to find out the size of the array...

Why is printing "B" dramatically slower than printing "#"?

I generated two matrices of 1000 x 1000: First Matrix: O and #. Second Matrix: O and B. Using the following code, the first matrix took 8.52 seconds to complete: Random r = new Random(); for (int i..

Xcode stops working after set "xcode-select -switch"

OMG, what I've done? Couple of days ago, I tried using macport to install something, because I'm using Xcode 4.3 and the command-line tool hadn't been installed by the time, macport wouldn't work. S..

Getting coordinates of marker in Google Maps API

I'm using Google Maps API. And I'm using the code below to get the coordinates of the marker. var lat = homeMarker.getPosition().$a; var lng = homeMarker.getPosition().ab; Everything is working fin..

Error parsing XHTML: The content of elements must consist of well-formed character data or markup

As an extension of this question, I'm trying to insert Javascript to a <h:commandButton />'s onclick property as action is already rendering an ajax table. What I want to do: Get the selected i..

How to loop through a collection that supports IEnumerable?

How to loop through a collection that supports IEnumerable?..

How to iterate through range of Dates in Java?

In my script I need to perform a set of actions through range of dates, given a start and end date. Please provide me guidance to achieve this using Java. for ( currentDate = starDate; currentDate &l..

Raise an event whenever a property's value changed?

There is a property, it's named ImageFullPath1 public string ImageFullPath1 {get; set; } I'm going fire an event whenever its value changed. I am aware of changing INotifyPropertyChanged, but I wan..

How to move Jenkins from one PC to another

I am currently using Jenkins on my development PC. I installed it on my development PC, because I had limited knowledge on this tool; so I tested on it in my development PC. Now, I feel comfortable wi..

Detect Android phone via Javascript / jQuery

How would i detect that the device in use is an Android for a mobile website? I need to apply certain css attributes to the Android platform. Thanks..

Android Shared preferences for creating one time activity (example)

I have three activities A,B and C where A and B are forms and after filling and saving the form data in database(SQLITE). I am using intent from A to B and then B to C.What i want is that every time I..

Remove credentials from Git

I'm working with several repositories, but lately I was just working in our internal one and all was great. Today I had to commit and push code into other one, but I'm having some troubles. $ git pu..

How can I get the IP address from NIC in Python?

When an error occurs in a Python script on Unix , an email is sent. I have been asked to add {Testing Environment} to the subject line of the email if the IP address is which is the te..

Merging two CSV files using Python

OK I have read several threads here on Stack Overflow. I thought this would be fairly easy for me to do but I find that I still do not have a very good grasp of Python. I tried the example located a..

PHP calculate age

I'm looking for a way to calculate the age of a person, given their DOB in the format dd/mm/yyyy. I was using the following function which worked fine for several months until some kind of glitch ca..

How to install trusted CA certificate on Android device?

I have created my own CA certificate and now I want to install it on my Android Froyo device (HTC Desire Z), so that the device trusts my certificate. Android stores CA certificates in its Java keys..

Launching Google Maps Directions via an intent on Android

My app needs to show Google Maps directions from A to B, but I don't want to put the Google Maps into my application - instead, I want to launch it using an Intent. Is this possible? If yes, how?..

Is mathematics necessary for programming?

I happened to debate with a friend during college days whether advanced mathematics is necessary for any veteran programmer. He used to argue fiercely against that. He said that programmers need only ..

R dplyr: Drop multiple columns

I have a dataframe and list of columns in that dataframe that I'd like to drop. Let's use the iris dataset as an example. I'd like to drop Sepal.Length and Sepal.Width and use only the remaining colum..

how to solve Error cannot add duplicate collection entry of type add with unique key attribute 'value' in iis 7

I created a website and published it in iis 7. I deleted the default website option in the iis 7 and created the new website in the iis 7. When i click the default document I got the error lik..

Spring data jpa- No bean named 'entityManagerFactory' is defined; Injection of autowired dependencies failed

I'm developing application using spring data jpa,hibernate,mysql,tomcat7,maven and it's create error.I'm trying to figure it out but i failed. error are Cannot resolve reference to bean 'entityMan..

Black transparent overlay on image hover with only CSS?

I'm trying to add a transparent black overlay to an image whenever the mouse is hovering over the image with only CSS. Is this possible? I tried this: But I can't g..

How can I loop through enum values for display in radio buttons?

What is the proper way to loop through literals of an enum in TypeScript? (I am currently using TypeScript 1.8.1.) I've got the following enum: export enum MotifIntervention { Intrusion, Ident..

How to take the nth digit of a number in python

I want to take the nth digit from an N digit number in python. For example: number = 9876543210 i = 4 number[i] # should return 6 How can I do something like that in python? Should I change it to ..

How to delete files recursively from an S3 bucket

I have the following folder structure in S3. Is there a way to recursively remove all files under a certain folder (say foo/bar1 or foo or foo/bar2/1 ..) foo/bar1/1/.. foo/bar1/2/.. foo/bar1/3/.. fo..

how to convert string into time format and add two hours

I have the following requirement in the project. I have a input field by name startDate and user enters in the format YYYY-MM-DD HH:MM:SS. I need to add two hours for the user input in the startDate ..

Example of waitpid() in use?

I know that waitpid() is used to wait for a process to finish, but how would one use it exactly? Here what I want to do is, create two children and wait for the first child to finish, then kill the s..

How to Use Order By for Multiple Columns in Laravel 4?

I want to sort multiple columns in Laravel 4 by using the method orderBy() in Laravel Eloquent. The query will be generated using Eloquent like this: SELECT * FROM mytable ORDER BY coloumn1 DESC, c..

What is "android.R.layout.simple_list_item_1"?

I've started learning Android development and am following a todolist example from a book: // Create the array list of to do items final ArrayList<String> todoItems = new ArrayList<String>..

Background images: how to fill whole div if image is small and vice versa

I have three problems: When I tried to use a background image in a smaller size div, the div shows only part of image. How can I show the full or a specific part of image? I have a smaller image and..

unable to set private key file: './cert.pem' type PEM

I am using curl to download data from a https site using public certificate files. System information: OS: fedora 14 curl: curl 7.30.0 openssl: OpenSSL 1.0.0a-fips The command is, curl -v "https..

Passing command line arguments to R CMD BATCH

I have been using R CMD BATCH my_script.R from a terminal to execute an R script. I am now at the point where I would like to pass an argument to the command, but am having some issues getting it wor..

Comparing Dates in Oracle SQL

I'm trying to get it to display the number of employees that are hired after June 20, 1994, Select employee_id, count(*) From Employee Where to_char(employee_date_hired, 'DD-MON-YY') > 31-DEC-95; ..

jQuery multiple events to trigger the same function

Is there a way to have keyup, keypress, blur, and change events call the same function in one line or do I have to do them separately? The problem I have is that I need to validate some data with a d..

Converting HTML to XML

I have got hundereds of HTML files that need to be conveted in XML. We are using these HTML to serve contents for applications but now we have to serve these contents as XML. HTML files are contain..

What are best practices for multi-language database design?

What is the best way to create multi-language database? To create localized table for every table is making design and querying complex, in other case to add column for each language is simple but not..

Ways to iterate over a list in Java

Being somewhat new to the Java language I'm trying to familiarize myself with all the ways (or at least the non-pathological ones) that one might iterate through a list (or perhaps other collections) ..

Maximum Java heap size of a 32-bit JVM on a 64-bit OS

The question is not about the maximum heap size on a 32-bit OS, given that 32-bit OSes have a maximum addressable memory size of 4GB, and that the JVM's max heap size depends on how much contiguous fr..

What is lazy loading in Hibernate?

What is lazy loading in Java? I don't understand the process. Can anybody help me to understand the process of lazy loading?..

How to close Android application?

I want to close my application, so that it no longer runs in the background. How to do that? Is this good practice on Android platform? If I rely on the "back" button, it closes the app, but it stay..

How to make a ssh connection with python?

Can anyone recommend something for making a ssh connection in python? I need it to be compatible with any OS. I've already tried pyssh only to get an error with SIGCHLD, which I've read is because W..

Download multiple files with a single action

I am not sure if this is possible using standard web technologies. I want the user to be able to download multiple files in a single action. That is click check boxes next to the files, and then get ..

How to check type of object in Python?

I have some value in variable v, how to check it's type? Hint: it is NOT v.dtype. When I do type(v) in debugger, I get type(v) = {type} <type 'h5py.h5r.Reference'> or type(v) = {type} <..

Posting a File and Associated Data to a RESTful WebService preferably as JSON

This is probably going to be a stupid question but I'm having one of those nights. In an application I am developing RESTful API and we want the client to send data as JSON. Part of this application r..

How do I run a VBScript in 32-bit mode on a 64-bit machine?

I have a text file that ends with .vbs that I have written the following in: Set Conn = CreateObject("ADODB.Connection") Conn.Provider = "Microsoft.ACE.OLEDB.12.0" Conn.Properties("Data Source") = "C..

bootstrap popover not showing on top of all elements

I'm working on a bootstrap site and after updating to bootstrap 2.2 from 2.0 everything worked except the popover. The popovers still show up fine, but they don't show up on top of all other elements..

Oracle Convert Seconds to Hours:Minutes:Seconds

I have a requirement to display user available time in Hours:Minutes:Seconds format from a given total number of seconds value. Appreciate if you know a ORACLE function to do the same. I'm using Oracl..

EditorFor() and html properties

Asp.Net MVC 2.0 preview builds provide helpers like Html.EditorFor(c => c.propertyname) If the property name is string, the above code renders a texbox. What if I want to pass in MaxLength and..

Can my enums have friendly names?

I have the following enum public enum myEnum { ThisNameWorks, This Name doesn't work Neither.does.this; } Is it not possible to have enums with "friendly names"?..

Global variables in Javascript across multiple files

A bunch of my JavaScript code is in an external file called helpers.js. Inside the HTML that calls this JavaScript code I find myself in need of knowing if a certain function from helpers.js has been ..

Angular: conditional class with *ngClass

What is wrong with my Angular code? I am getting: Cannot read property 'remove' of undefined at BrowserDomAdapter.removeClass ... <ol class="breadcrumb"> <li *ngClass="{act..

How can I tell when HttpClient has timed out?

As far as I can tell, there's no way to know that it's specifically a timeout that has occurred. Am I not looking in the right place, or am I missing something bigger? string baseAddress = "http:..

Password encryption at client side

Possible Duplicate: About password hashing system on client side I have to secure the passwords of my web site users. What I did was use MD5 encryption hashing in server side. But the prob..

How to run different python versions in cmd

How can I configure windows command dialog to run different python versions in it? For example when I type python2 it runs python 2.7 and when I type python3 it runs python 3.3? I know how to configur..

angular-cli server - how to proxy API requests to another server?

With the angular-cli ng serve local dev server, it's serving all the static files from my project directory. How can I proxy my AJAX calls to a different server?..

Parsing CSV files in C#, with header

Is there a default/official/recommended way to parse CSV files in C#? I don't want to roll my own parser. Also, I've seen instances of people using ODBC/OLE DB to read CSV via the Text driver, and a ..

How to execute a stored procedure within C# program

I want to execute this stored procedure from a C# program. I have written the following stored procedure in a SqlServer query window and saved it as stored1: use master go create procedure dbo.tes..

Android Material and appcompat Manifest merger failed

I have next grade dependencies { implementation fileTree(dir: 'libs', include: ['*.jar']) implementation '' implementation '

How do I set/unset a cookie with jQuery?

How do I set and unset a cookie using jQuery, for example create a cookie named test and set the value to 1?..

INSERT INTO @TABLE EXEC @query with SQL Server 2000

Is it true that SQL Server 2000, you can not insert into a table variable using exec? I tried this script and got an error message EXECUTE cannot be used as a source when inserting into a table varia..

Linq filter List<string> where it contains a string value from another List<string>

I have 2 List objects (simplified): var fileList = Directory.EnumerateFiles(baseSourceFolderStr, fileNameStartStr + "*", SearchOption.AllDirectories); var filterList = new List<string>(); filt..

Get timezone from users browser using moment(timezone).js

What is the best way to get client's timezone and convert it to some other timezone when using moment.js and moment-timezone.js I want to find out what is clients timezone and later convert his date ..

Sort array by value alphabetically php

As the title suggests i want to sort an array by value alphabetically in php. $arr = array( 'k' => 'pig', 'e' => 'dog' ) would become $arr = array( 'e' => 'dog', 'k' =>..

method in class cannot be applied to given types

I'm creating a program that generates 100 random integers between 0 and 9 and displays the count for each number. I'm using an array of ten integers, counts, to store the number of 0s, 1s, ..., 9s.) ..

Get refresh token google api

I can't get my refresh token with my code. I can only get my access token, token type etc., I have followed some tutorials like putting access_type=offline on my login URL: echo "<a href='https://..


What is the best way to issue a http get in I want to get the result of a request like ..

What is the C++ function to raise a number to a power?

How do I raise a number to a power? 2^1 2^2 2^3 etc.....