Questions Tagged with #Http.sys

http.sys is Microsoft Windows HTTP protocol stack file

"Unable to launch the IIS Express Web server" error

I receive this error when trying to launch IIS Express from Visual Studio with a project that's configured to listen to an address other than localhost. Visual Studio freezes for about 30 seconds bef..

WCF Error "This could be due to the fact that the server certificate is not configured properly with HTTP.SYS in the HTTPS case"

I'm having a problem using a WCF call from a Windows service to my WCF service running on my web server. This call has been working for a number of weeks, but then stopped working all of a sudden, an..

How to set environment variables in Jenkins?

I would like to be able to do something like: AOEU=$(echo aoeu) and have Jenkins set AOEU=aoeu. The Environment Variables section in Jenkins doesn't do that. Instead, it sets AOEU='$(echo aoeu)'. ..

Exercises to improve my Java programming skills

I have learned basics of Java but want to practice more. I was looking via Google and couldn't find many beginner level problems that I can solve using Java. Any suggestions?..

Adding data attribute to DOM

$('div').data('info', 1); alert($('div').data('info')); //this works $('div[data-info="1"]').text('222'); //but this don't work I'm creating element within jquery. After that, I want to add at..

How to read an excel file in C# without using Microsoft.Office.Interop.Excel libraries

I have a .Net-Windows application in C#. I need to open an excel and process it. How can I do this without using Microsoft.Office.Interop.Excel libraries?..

How to sort a Ruby Hash by number value?

I have a counter hash that I am trying to sort by count. The problem I am running into is that the default Hash.sort function sorts numbers like strings rather than by number size. i.e. Given Hash: ..

Reset input value in angular 2

I have the following input field : <input mdInput placeholder="Name" #filterName name="filterName" > I want to clear value on click of clear button : <button (click)="clearFilters()">C..

Error in Chrome only: XMLHttpRequest cannot load file URL No 'Access-Control-Allow-Origin' header is present on the requested resource

I am following a book example hence the code is very simple. This is the code: jQuery.get("ajax_search_results.php", { s:search_query }, write_results_to_page, "html"); And t..

How to get the current time in YYYY-MM-DD HH:MI:Sec.Millisecond format in Java?

The code below gives me the current time. But it does not tell anything about milliseconds. public static String getCurrentTimeStamp() { SimpleDateFormat sdfDate = new SimpleDateFormat("yyyy-..

Why use multiple columns as primary keys (composite primary key)

This example is taken from w3schools. CREATE TABLE Persons ( P_Id int NOT NULL, LastName varchar(255) NOT NULL, FirstName varchar(255), Address varchar(255), City varchar(255), ..

Call multiple functions onClick ReactJS

I know in vanilla js, we can do onclick="f1();f2()" What would be the equivalent for making two function calls onClick in ReactJS? I know calling one function is like this: onClick={f1} ..

How to show "if" condition on a sequence diagram?

I was wondering, how can one represent "if" statement on a sequence diagram? if (somethingShouldBeDone) { // Do it } else { // Do something else } Can it be represented at all? The th..

Spring jUnit Testing properties file

I have a jUnit Test that has its own properties file(application-test.properties) and its spring config file(application-core-test.xml). One of the method uses an object instantiated by spring confi..

How to change a text with jQuery

I have an h1 with id of toptitle that is dynamically created, and I am not able to change the HTML. It will have a different title depends on a page. Now when it is Profile, I want to change it to New..

Display all views on oracle database

Is there a way to display all the views currently set on an oracle database via sql developer? Thanks...

How to execute Python scripts in Windows?

I have a simple script blah.py (using Python 2): import sys print sys.argv[1] If I execute my script by: python c:/..../blah.py argument It prints argument but if I execute script by: blah.py a..

Sum values from multiple rows using vlookup or index/match functions

I want to sum the values in columns B, C, and D using a formula. I tried combining SUMIF, VLOOKUP and INDEX with MATCH but no luck. I would like to look for France and then add the values in B, C..

VB.NET Inputbox - How to identify when the Cancel Button is pressed?

I have a simple windows application that pops up an input box for users to enter in a date to do searches. How do I identify if the user clicked on the Cancel button, or merely pressed OK without e..

How to return a file using Web API?

I am using ASP.NET Web API. I want to download a PDF with C# from the API (that the API generates). Can I just have the API return a byte[]? and for the C# application can I just do: byte[] pdf = c..

Are there such things as variables within an Excel formula?

I hate repeating functions, particularly in Excel formulas. Is there any way that I can avoid something like: =IF( VLOOKUP(A1, B:B, 1, 0) > 10, VLOOKUP(A1, B:B, 1, 0) - 10, VLOOKUP(A1, B:B, 1, 0)..

Kotlin - How to correctly concatenate a String

A very basic question, what is the right way to concatenate a String in Kotlin? In Java you would use the concat() method, e.g. String a = "Hello "; String b = a.concat("World"); // b = Hello World ..

Convert and format a Date in JSP

From my JSP Page, I am getting Date in this format. Fri May 13 2011 19:59:09 GMT 0530 (India Standard Time) How can I convert this to the pattern yyyy-MM-dd HH:mm:ss?..

Divide a number by 3 without using *, /, +, -, % operators

How would you divide a number by 3 without using *, /, +, -, %, operators? The number may be signed or unsigned...

How do I see the extensions loaded by PHP?

It's got to be somewhere in the phpinfo() dump, but I just don't know where. Is it supposed to be under the "Additional Modules" section? Somewhere else? I'm trying to figure out why some extension..

Provisioning Profiles menu item missing from Xcode 5

After spending a whole day installing a fresh copy of Mac OS X v10.8 (Mountain Lion), Xcode 5, fixing provisioning profiles, certificates, creating new ones, I finally managed to get my..

iOS 8 Snapshotting a view that has not been rendered results in an empty snapshot

In iOS 8 I am having problem capturing images from camera till now I am using this code for UIImagePickerController *controller=[[UIImagePickerController alloc] init]; controller.videoQuality=UIImag..

How to control the width and height of the default Alert Dialog in Android?

AlertDialog.Builder builder = new AlertDialog.Builder(this); builder.setTitle("Title"); builder.setItems(items, new DialogInterface.OnClickListener() { public void onClick(..

TokenMismatchException in VerifyCsrfToken.php Line 67

I know that this is a known error with things like forms in Laravel. But I am facing an issue with basic authentication in Laravel 5.2. I created the auth using Laravel; php artisan make:auth Now..

find difference between two text files with one item per line

I have two files: file 1 dsf sdfsd dsfsdf file 2 ljljlj lkklk dsf sdfsd dsfsdf I want to display what is in file 2 but not in file 1, so file 3 should look like ljljlj lkklk ..

How to delete and recreate from scratch an existing EF Code First database

I am using EF Code First with EF 5 in VS 2012. I use PM update-database command and I have a simple seed method to fill some tables with sample data. I would like to delete and recreate my x.mdb. The..

Format cell if cell contains date less than today

I am trying to get conditional formatting for a row for when a cell in that row contains a date less than or equal to today (yesterday, today, last week etc) I have tried =IF($W$4,TODAY()) which work..

Maven not found in Mac OSX mavericks

After upgrading my Mac OSX 10.8 to 10.9, Maven not found in the /usr/share path but its installed in 10.8. when I try this command: $ maven -version got this result -bash: mvn: command not f..

SQL Server Profiler - How to filter trace to only display events from one database?

How do I limit a SQL Server Profiler trace to a specific database? I can't see how to filter the trace to not see events for all databases on the instance I connect to...

Invert "if" statement to reduce nesting

When I ran ReSharper on my code, for example: if (some condition) { Some code... } ReSharper gave me the above warning (Invert "if" statement to reduce nesting), and..

How to control size of list-style-type disc in CSS?

My HTML first: <ul class="moreLinks" > <div>More from Travelandleisure.com</div> <li><a rel="nofollow" href="">xyz1</a></li> <li><a..

How to set input type date's default value to today?

The HTML5 input types are great, Opera's new built-in date picker is a breeze, and Chrome has at least supported the new input type with a spin-wheel implementation. But is there any way to set the d..

No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin '...' is therefore not allowed access

I'm using .htaccess to rewrite urls and I used html base tag in order to make it work. Now, when I try to make an ajax request I get the following error: XMLHttpRequest cannot load http://www.exa..

java.lang.IllegalArgumentException: No converter found for return value of type

With this code @RequestMapping(value = "/bar/foo", method = RequestMethod.GET) public ResponseEntity<foo> foo() { Foo model; ... return ResponseEntity.ok(model); ..

Load data from txt with pandas

I am loading a txt file containig a mix of float and string data. I want to store them in an array where I can access each element. Now I am just doing import pandas as pd data = pd.read_csv('outpu..

How to randomize (or permute) a dataframe rowwise and columnwise?

I have a dataframe (df1) like this. f1 f2 f3 f4 f5 d1 1 0 1 1 1 d2 1 0 0 1 0 d3 0 0 0 1 1 d4 0 1 0 0 1 The d1...d4 column is t..

SQL Error: ORA-00942 table or view does not exist

I use SQL developer and i made a connection to my database with the system user, after I created a user and made a another connection with that user with all needed privileges. But when I try to proc..

Type or namespace name does not exist

I have a WCF Data Service project built with Visual Studio 2010, which was working fine. All of a sudden, it didn't compile anymore. It was giving me messages like: Error 7 The type or namespace na..

Call to undefined function oci_connect()

I got this error. Fatal error: Call to undefined function oci_connect() $conn = oci_connect('localhost', 'username', 'password') or die(could not connect:'.oci_error) that is the code. This is the..

Use ASP.NET MVC validation with jquery ajax?

I have simple ASP.NET MVC action like this : public ActionResult Edit(EditPostViewModel data) { } The EditPostViewModel have validation attributes like this : [Display(Name = "...", Description..

HTML code for an apostrophe

Seemingly simple, but I cannot find anything relevant on the web. What is the correct HTML code for an apostrophe? Is it &#8217;?..

Reactjs - setting inline styles correctly

I am trying to use Reactjs with a kendo splitter. The splitter has a style attribute like style="height: 100%" With Reactjs, if I have understood things correctly, this can be implemented using an ..

Format JavaScript date as yyyy-mm-dd

I have a date with the format Sun May 11,2014. How can I convert it to 2014-05-11 using JavaScript? _x000D_ _x000D_ function taskDate(dateMilli) {_x000D_ var d = (new Date(dateMilli) + '').split(..

READ_EXTERNAL_STORAGE permission for Android

I'm trying to access media files (music) on the users device to play them; an easy "hello world"-music player app. I've followed some tutorials and they basically give the same code. But it won't wor..

Changing Vim indentation behavior by file type

Could someone explain to me in simple terms the easiest way to change the indentation behavior of Vim based on the file type? For instance, if I open a Python file it should indent with 2 spaces, but ..

Android: Bitmaps loaded from gallery are rotated in ImageView

When I load an image from the media gallery into a Bitmap, everything is working fine, except that pictures that were shot with the camera while holding the phone vertically, are rotated so that I alw..

Print text in Oracle SQL Developer SQL Worksheet window

I am using Oracle SQL (in SQLDeveloper, using the SQL Worksheet). I would like to print a statement before my select, such as PRINT 'Querying Table1'; SELECT * from Table1; What do I use to Print ..

Update row with data from another row in the same table

I've got a table which looks something like this ID | NAME | VALUE | ---------------------------- 1 | Test | VALUE1 | 2 | Test2 | VALUE2 | 1 | Test2 | | 4 ..

WorksheetFunction.CountA - not working post upgrade to Office 2010

The following piece of code works in Excel prior to 2010: myRange = Range("A:A") NumRows = Application.CountA(myRange) There are 38 cells containing text/values in column A. When the code i..

How to enable and use HTTP PUT and DELETE with Apache2 and PHP?

It should be so simple. I've followed every tutorial and forum I could find, yet I can't get it to work. I simply want to build a RESTful API in PHP on Apache2. In my VirtualHost directive I say: &l..

Count number of records returned by group by

How do I count the number of records returned by a group by query, For eg: select count(*) from temptable group by column_1, column_2, column_3, column_4 Gives me, 1 1 2 I need to count the a..

dropping infinite values from dataframes in pandas?

what is the quickest/simplest way to drop nan and inf/-inf values from a pandas DataFrame without resetting mode.use_inf_as_null? I'd like to be able to use the subset and how arguments of dropna, exc..

How to vertically align into the center of the content of a div with defined width/height?

What would be the correct method to vertically center any content in a defined width/height div. In the example there are two contents with different heights, what is the best way to center verticall..

how can I debug a jar at runtime?

I'm into a quite strange position (from my java-newbie point of view): using Eclipse I wrote a "java program" (some .java files with classes into) which essentially (batch) reads a text *.csv file, ..

How to reload apache configuration for a site without restarting apache?

I have edited the variable AllowOverride for one of my websites in sites-enabled directory. How do I reload the new configuration without restarting apache? Is it possible?..

jQuery override default validation error message display (Css) Popup/Tooltip like

I'm trying to over ride the default error message label with a div instead of a label. I have looked at this post as well and get how to do it but my limitations with CSS are haunting me. How can I di..

IOCTL Linux device driver

Can anyone explain me, What is IOCTL? What is it used for? How can I use it? Why can't I define new function that does the same work as IOCTL? ..

Pandas - replacing column values

I know there are a number of topics on this question, but none of the methods worked for me so I'm posting about my specific situation I have a dataframe that looks like this: data = pd.DataFrame([[..

CSS force image resize and keep aspect ratio

I am working with images, and I ran across a problem with aspect ratios. <img src="big_image.jpg" width="900" height="600" alt="" /> As you can see, height and width are already specified. I ..

Why does fatal error "LNK1104: cannot open file 'C:\Program.obj'" occur when I compile a C++ project in Visual Studio?

I've created a new C++ project in Visual Studio 2008. No code has been written yet; Only project settings have been changed. When I compile the project, I receive the following fatal error: fat..

How to manually deploy artifacts in Nexus Repository Manager OSS 3

After installing Nexus Repository Manager OSS 3 I do not see option Artifact Upload to upload artifacts through web page. In Nexus Repository Manager OSS 2.13 there is option to do that operation. A..

How to reload .bashrc settings without logging out and back in again?

If I make changes to .bashrc, how do I reload it without logging out and back in?..

Preg_match backtrack error

When I use the regex (.*)*[0] everything works well: preg_match('/(.*)*[0]/', 'this is a test string'); var_dump(preg_last_error()); // no code's returned But when I add another character to char c..

How to change the default encoding to UTF-8 for Apache?

I am using a hosting company and it will list the files in a directory if the file index.html is not there, it uses iso-8859-1 as the default encoding. If the server is Apache, is there a way to set ..

How to call execl() in C with the proper arguments?

i have vlc (program to reproduce videos) if i type in a shell: /home/vlc "/home/my movies/the movie i want to see.mkv" it opens up an reproduces the movie. however, when I run the following program..

Android failed to load JS bundle

I'm trying to run AwesomeProject on my Nexus5 (android 5.1.1). I'm able to build the project and install it on the device. But when I run it, I got a red screen saying Unable to download JS bundle. D..

How to always show scrollbar

The scrollbar in my scrollview is only visible when I start scrolling. How can I always show it?..

Check whether there is an Internet connection available on Flutter app

I have a network call to be executed. But before doing that I need to check whether the device have internet connectivity. This is what i have done so far: var connectivityResult = new Connectivit..

Bootstrap change carousel height

I have a jsfiddle here - http://jsfiddle.net/gh4Lur4b/8/ It's a full width bootstrap carousel. I'd like to change the height and still keep it full width. Is the height determined by the image heig..

SQL Server reports 'Invalid column name', but the column is present and the query works through management studio

I've hit a bit of an impasse. I have a query that is generated by some C# code. The query works fine in Microsoft SQL Server Management Studio when run against the same database. However when my code..

How can I check if my python object is a number?

In Java the numeric types all descend from Number so I would use (x instanceof Number). What is the python equivalent?..

When should I use uuid.uuid1() vs. uuid.uuid4() in python?

I understand the differences between the two from the docs. uuid1(): Generate a UUID from a host ID, sequence number, and the current time uuid4(): Generate a random UUID. So uuid1 uses machine/seq..

Call method in directive controller from other controller

I have a directive that has its own controller. See the below code: var popdown = angular.module('xModules',[]); popdown.directive('popdown', function () { var PopdownController = function ($sco..

Sprintf equivalent in Java

Printf got added to Java with the 1.5 release but I can't seem to find how to send the output to a string rather than a file (which is what sprintf does in C). Does anyone know how to do this? ..

WPF MVVM ComboBox SelectedItem or SelectedValue not working

Update After a bit of investigating. What seems to be the issue is that the SelectedValue/SelectedItem is occurring before the Item source is finished loading. If I sit in a break point and wait a ..

How to see JavaDoc in IntelliJ IDEA?

I just switched from Eclipse to IntelliJ. IntelliJ lacks one feature from Eclipse - when you put your mouse over a method, Eclipse shows javadoc info. I think the way to show it is to use a shortcut..

log4j:WARN No appenders could be found for logger (running jar file, not web app)

First up - yes, I have read the multiple questions & answers on this topic, and can't get any of the solutions within those to help me. I'm not running Tomcat or JBoss and I don't have a web.xml f..

How to display an IFRAME inside a jQuery UI dialog

The web application that I am upgrading uses jQuery and jQuery UI. I have replaced most instances of window.open and <a target=_blank> with jQuery UI dialog. For example, the terms and condition..

Get local IP address

In the internet there are several places that show you how to get an IP address. And a lot of them look like this example: String strHostName = string.Empty; // Getting Ip address of local machine.....

Duplicate Symbols for Architecture arm64

When I try running my Xcode Project it fails with an error stating that I have duplicate symbols. I looked online where the find these duplicates but have had no luck: Any ideas how to fix this? ..

Node.js, can't open files. Error: ENOENT, stat './path/to/file'

I have developed a node.js program using the express framework on my computer, where it runs fine with no complaints. However, when I run the program on my SUSE Studio appliance, where it is intended..

Logging POST data from $request_body

I have my config setup to handle a bunch of GET requests which render pixels that work fine to handle analytics and parse query strings for logging. With an additional third party data stream, I need ..

COALESCE Function in TSQL

Can someone explain how the COALESCE function in TSQL works? The syntax is as follows COALESCE(x, y) The MSDN document on this function is pretty vague..

Generating random numbers with Swift

I need to generate a random number. It appears the arc4random function no longer exists as well as the arc4random_uniform function. The options I have are arc4random_stir(), arc4random_buf(Unsaf..

How to see the changes in a Git commit?

When I do git diff COMMIT I see the changes between that commit and HEAD (as far as I know), but I would like to see the changes that were made by that single commit. I haven't found any obvious opti..

Creating a simple configuration file and parser in C++

I am trying to create a simple configuration file that looks like this url = http://mysite.com file = main.exe true = 0 when the program runs, I would like it to load the configuration settings int..

ImageView in circular through xml

I'd Like to make any image from my ImageView to be circular with a border. I searched but couldn't find any useful information (anything that I tried didn't work). How can I achieve this through xm..

Strange Characters in database text: Ã, Ã, ¢, â‚ €,

I'm not certain when this first occured. I have a new drop-shipping affiliate website, and receive an exported copy of the product catalog from the wholesaler. I format and import this into Prestasho..

The difference in months between dates in MySQL

I'm looking to calculate the number of months between 2 date time fields. Is there a better way than getting the unix timestamp and the dividing by 2 592 000 (seconds) and rounding up whithin MySQL?..

How to process each output line in a loop?

I have a number of lines retrieved from a file after running the grep command as follows: var=`grep xyz abc.txt` Let’s say I got 10 lines which consists of xyz as a result. Now I need to process..

How to disable the parent form when a child form is active?

How to disable a parent form when child form is active using c#?..

How are VST Plugins made?

I would like to make (or learn how to make) VST plugins. Is there a special SDK for this? how does one yield a .vst instead of a .exe? Also, if one is looking to make Audio Units for Logic Pro, how is..

How do I remove a key from a JavaScript object?

Let's say we have an object with this format: var thisIsObject= { 'Cow' : 'Moo', 'Cat' : 'Meow', 'Dog' : 'Bark' }; I wanted to do a function that removes by key: removeFromObjectByKey('Co..

remove attribute display:none; so the item will be visible

The element is: span { position:absolute; float:left; height:80px; width:150px; top:210px; left:320px; background-color:yellow; display:none; //No..

How to select all instances of a variable and edit variable name in Sublime

If I select a variable (not just any string) in my code, all other instances of that variable get a stroke (white outline) around them: Is there a keyboard shortcut that will let me select all of t..

Disable back button in android

How to disable back button in android while logging out the application?..

Anaconda-Navigator - Ubuntu16.04

This is ubuntu16.04. I can open Anaconda-Navigator from the terminal using anaconda-navigator, but when I click on it, it doesn't open. What am I missing?..

Append to the end of a file in C

I'm trying to append the contents of a file myfile.txt to the end of a second file myfile2.txt in c. I can copy the contents, but I can't find a way to append. Here's my code: FILE *pFile; FILE *pFil..

How to execute mongo commands through shell scripts?

I want to execute mongo commands in shell script, e.g. in a script test.sh: #!/bin/sh mongo myDbName db.mycollection.findOne() show collections When I execute this script via ./test.sh, then the co..

org.postgresql.util.PSQLException: FATAL: sorry, too many clients already

I am trying to connect to a Postgresql database, I am getting the following Error: Error:org.postgresql.util.PSQLException: FATAL: sorry, too many clients already What does the error mean and ho..

Map a 2D array onto a 1D array

I want to represent a 2D array with a 1D array. A function will pass the two indicies (x,y) and the value to store. These two indicies would represent a single element of a 1D array, and set it accord..

How do I get the "id" after INSERT into MySQL database with Python?

I execute an INSERT INTO statement cursor.execute("INSERT INTO mytable(height) VALUES(%s)",(height)) and I want to get the primary key. My table has 2 columns: id primary, auto increment he..

How to add external fonts to android application

I was looking for some stylish fonts for my android application. but the problem is how can i make my android application supportable for external fonts. Thank you...

Large WCF web service request failing with (400) HTTP Bad Request

I've encountered this apparently common problem and have been unable to resolve it. If I call my WCF web service with a relatively small number of items in an array parameter (I've tested up to 50), ..

Display date in dd/mm/yyyy format in vb.net

I want to display date in 09/07/2013 format instead of 09-jul-13. Dim dt As Date = Date.Today MsgBox(dt) ..

Print "hello world" every X seconds

Lately I've been using loops with large numbers to print out Hello World: int counter = 0; while(true) { //loop for ~5 seconds for(int i = 0; i < 2147483647 ; i++) { //another loo..

Should I initialize variable within constructor or outside constructor

When I use Java based on my C++ knowledge, I love to initialize variable using the following way. public class ME { private int i; public ME() { this.i = 100; } } After some t..

Action bar navigation modes are deprecated in Android L

Taking a look at the API diff report for the Android "L" preview, I see that all methods related to navigation modes in the ActionBar class (such as setNavigationMode(), addTab(), selectTab(), &c)..

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

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

How to disable all div content

I was under the assumption that if I disabled a div, all content got disabled too. However, the content is grayed but I can still interact with it. Is there a way to do that? (disable a div and get ..

Put request with simple string as request body

When I execute the following code from my browser the server gives me 400 and complains that the request body is missing. Anybody got a clue about how I can pass a simple string and have it send as th..

Best HTTP Authorization header type for JWT

I'm wondering what is the best appropriate Authorization HTTP header type for JWT tokens. One of the probably most popular type is Basic. For instance: Authorization: Basic QWxhZGRpbjpvcGVuIHNlc2FtZ..

How do I change the formatting of numbers on an axis with ggplot?

I'm using R and ggplot to draw a scatterplot of some data, all is fine except that the numbers on the y-axis are coming out with computer style exponent formatting, i.e. 4e+05, 5e+05, etc. This is una..

Pinging an IP address using PHP and echoing the result

I have the following function that I doesn't work so far. I would like to ping an IP address and then to echo whether the IP is alive or not. function pingAddress($ip){ $pingresult = shell_exec("..

How to limit the maximum value of a numeric field in a Django model?

Django has various numeric fields available for use in models, e.g. DecimalField and PositiveIntegerField. Although the former can be restricted to the number of decimal places stored and the overall ..

EditText, clear focus on touch outside

My layout contains ListView, SurfaceView and EditText. When I click on the EditText, it receives focus and the on-screen keyboard pops up. When I click somewhere outside of the EditText, it still has ..

Retrieving the last record in each group - MySQL

There is a table messages that contains data as shown below: Id Name Other_Columns ------------------------- 1 A A_data_1 2 A A_data_2 3 A A_data_3 4 B B_data_..

Rails.env vs RAILS_ENV

I see both in examples when checking what env one is running in. What's preferred? Are they, for all intents and purposes equal?..

Can I edit an iPad's host file?

I doubt this is possible without extensive jail-breaking, but is it at all possible to edit the iPad's (or any iOS device's) hosts file?..

nginx: how to create an alias url route?

basically an server instance is running at somesite.com/production/folder/here?param=here&count=1 I want to point someite.com/demo to /production/folder/here so when user types somesite.com/pr..

How to create a multiline UITextfield?

I am developing an application where user has to write some information. For this purpose I need a UITextField which is multi-line (in general UITextField is a single line). As I'm Googling I find a ..

adding and removing classes in angularJs using ng-click

I am trying to work how to add a class with ngClick. I have uploaded up my code onto plunker Click here. Looking at the angular documentation i can't figure out the exact way it should be done. Below ..

How to delete shared preferences data from App in Android

How do I delete SharedPreferences data for my application? I'm creating an application that uses a lot of web services to sync data. For testing purposes, I need to wipe out some SharedPreferences va..

Sublime Text from Command Line

I installed Sublime Text and wanted to know how to open rb files in it from the terminal. I saw What is the command to make Sublime Text my core editor? and I see that I can make Sublime my core edito..

How to avoid variable substitution in Oracle SQL Developer with 'trinidad & tobago'

When I try to execute this statement in Oracle SQL Developer 2.1 a dialog box "Enter Substitution Variable" pops up asking for a replacement value for TOBAGO, update t set country = 'Trinidad and Tob..

How to access host port from docker container

I have a docker container running jenkins. As part of the build process, I need to access a web server that is run locally on the host machine. Is there a way the host web server (which can be configu..

How can I determine if a date is between two dates in Java?

How can I check if a date is between two other dates, in the case where all three dates are represented by instances of java.util.Date?..

Parsing JSON from URL

Is there any simplest way to parse JSON from a URL? I used Gson I can't find any helpful examples...

Disabling Warnings generated via _CRT_SECURE_NO_DEPRECATE

What is the best way to disable the warnings generated via _CRT_SECURE_NO_DEPRECATE that allows them to be reinstated with ease and will work across Visual Studio versions?..

Skip to next iteration in loop vba

I am trying to create a simple conditional loop that will go to the next iteration if a condition is true. The code I have so far is: For i = 2 To 24 Level = Cells(i, 4) Return = Cells(i, 5) ..

NPM vs. Bower vs. Browserify vs. Gulp vs. Grunt vs. Webpack

I'm trying to summarize my knowledge about the most popular JavaScript package managers, bundlers, and task runners. Please correct me if I'm wrong: npm & bower are package managers. They just d..

Angular - POST uploaded file

I'm using Angular, TypeScript to send a file, along with JSON Data to a server. Below is my code: import {Component, View, NgFor, FORM_DIRECTIVES, FormBuilder, ControlGroup} from 'angular2/angular2'..

Debugging WebSocket in Google Chrome

Is there a way, or an extension, that lets me watch the "traffic" going through a WebSocket? For debugging purposes I'd like to see the client and server requests/responses...

JavaScript: Difference between .forEach() and .map()

I know that there were a lot of topics like this. And I know the basics: .forEach() operates on original array and .map() on the new one. In my case: function practice (i){ return i+1; }; var a..

Parsing arguments to a Java command line program

What if I wanted to parse this: java MyProgram -r opt1 -S opt2 arg1 arg2 arg3 arg4 --test -A opt3 And the result I want in my program is: regular Java args[] of size=4 org.apache.commons.cli.Opti..

Can I install Python 3.x and 2.x on the same Windows computer?

I'm running Windows and the shell/OS automatically runs Python based on the registry settings when you run a program on the command line. Will this break if I install a 2.x and 3.x version of Python o..

How to get on scroll events?

I need to get scroll events from a div with overflow: scroll in my Angular 2 app. It seems onscroll event do not works on Angular 2. How could I achieve that?..

How do I do a bulk insert in mySQL using node.js

How would one do a bulk insert into mySQL if using something like https://github.com/felixge/node-mysql..

Why does this code using random strings print "hello world"?

The following print statement would print "hello world". Could anyone explain this? System.out.println(randomString(-229985452) + " " + randomString(-147909649)); And randomString() looks like this..

Warning as error - How to get rid of these

I cannot figure out how to get rid of errors that basically should not be halting my compile in Visual Studio 2010 and should not be show stoppers, or at least I will fix them later, but I d..

Adding Http Headers to HttpClient

All: I need to add http headers to the HttpClient before I send a request to a web service. How do I do that for an individual request (as opposed to on the HttpClient to all future requests)? I'm no..

How to get start and end of previous month in VB

Im trying to create some VB code that will get the start and end of the previous month. Im able to the current month which is just: Month(DateValue(Now)) which would return 3. From there I can take..

Hbase quickly count number of rows

Right now I implement row count over ResultScanner like this for (Result rs = scanner.next(); rs != null; rs = scanner.next()) { number++; } If data reaching millions time computing is large.I ..

Is module __file__ attribute absolute or relative?

I'm having trouble understanding __file__. From what I understand, __file__ returns the absolute path from which the module was loaded. I'm having problem producing this: I have a abc.py with one st..

Convert JSONArray to String Array

I want to ask a question about converting a jsonArray to a StringArray on Android. Here is my code to get jsonArray from server. try { DefaultHttpClient defaultClient = new DefaultHttpClient(); ..

(Excel) Conditional Formatting based on Adjacent Cell Value

I'm trying to apply conditional formatting in Excel on a range of cells, based on the adjacent cell's value, to achieve something like this: The goal is to highlight values in Column B (Actual Expe..

Oracle listener not running and won't start

I am getting the following errors while from the lsnrctl status command: C:\Users\pna105>lsnrctl stat LSNRCTL for 64-bit Windows: Version 11.2.0.1.0 - Production on 08-OCT-2014 17:53 :55 Copy..

How to Find And Replace Text In A File With C#

My code so far StreamReader reading = File.OpenText("test.txt"); string str; while ((str = reading.ReadLine())!=null) { if (str.Contains("some text")) { StreamWriter write = new..

setting y-axis limit in matplotlib

I need help with setting the limits of y-axis on matplotlib. Here is the code that I tried, unsuccessfully. import matplotlib.pyplot as plt plt.figure(1, figsize = (8.5,11)) plt.suptitle('plot title..

How to give a pandas/matplotlib bar graph custom colors

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

What is the purpose of "pip install --user ..."?

From pip install --help: --user Install to the Python user install directory for your platform. Typically ~/.local/, or %APPDATA%\Python on Windows. (See the Python documentation fo..

Export pictures from excel file into jpg using VBA

I have an Excel file which includes pictures in column B and I want like to export them into several files as .jpg (or any other picture file format). The name of the file should be generated from tex..

When to Redis? When to MongoDB?

What I want is not a comparison between Redis and MongoDB. I know they are different; the performance and the API is totally different. Redis is very fast, but the API is very 'atomic'. MongoDB will ..

Styling Password Fields in CSS

I'm experiencing a minor issue with fonts in my stylesheet. This is my CSS: body { ... font: normal 62.5% "Lucida Sans Unicode",sans-serif; } #wrapper_page { ... font-size: 1.2em; } input,..

Specifying width and height as percentages without skewing photo proportions in HTML

I was wondering if in the width and height <img> attributes, I could specify width and height as percentages? Well, I guess that is obvious, because when I try so, it resizes, but it appears to..

Hide "NFC Tag type not supported" error on Samsung Galaxy devices

I am working on an app that scans just the UID of MIFARE Classic cards to facilitate attendance registration. I have got it working. However, every time I scan a card on my Galaxy S4, I get a toast st..

How do I point Crystal Reports at a new database

I have a Crystal Reports 2008 user that has over 100 custom developed reports. The reports all query Sql Server databases (SQL 2005). This database server is getting replaced with a new system (runnin..

Is it possible to hide the cursor in a webpage using CSS or Javascript?

I want to hide the cursor when showing a webpage that is meant to display information in a building hall. It doesn't have to be interactive at all. I tried with the cursor property and a transparent c..

nginx error:"location" directive is not allowed here in /etc/nginx/nginx.conf:76

When i restart the nginx with, sudo service nginx restart, Iam facing with this error, Restarting nginx: nginx: [emerg] "location" directive is not allowed here in /etc/nginx/nginx.conf:76 nginx: co..

Failed to execute 'postMessage' on 'DOMWindow': https://www.youtube.com !== http://localhost:9000

This is the error message that I get: Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://www.youtube.com') does not match the recipient window's origin ('http://loc..

How do you debug PHP scripts?

How do you debug PHP scripts? I am aware of basic debugging such as using the Error Reporting. The breakpoint debugging in PHPEclipse is also quite useful. What is the best (in terms of fast and eas..

Querying Datatable with where condition

I have a datatable with two columns, Column 1 = "EmpID" Column 2 = "EmpName" I want to query the datatable, against the column EmpID and Empname. For example, I want to get the values where (Em..

Simple working Example of json.net in VB.net

I have the following simplified JSON string from a provider, its been a long time since I used Visual Studio and vb.Net, so I'm very rusty! { "Venue": { "ID": 3145, "Name": "Big Venue, Clap..

How to stop the task scheduled in java.util.Timer class

I am using java.util.Timer class and I am using its schedule method to perform some task, but after executing it for 6 times I have to stop its task. How should I do that?..

How to declare a type as nullable in TypeScript?

I have an interface in TypeScript. interface Employee{ id: number; name: string; salary: number; } I would like to make salary as a nullable field (Like we can do in C#). Is this possib..

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

Fastest way to update 120 Million records

I need to initialize a new field with the value -1 in a 120 Million record table. Update table set int_field = -1; I let it run for 5 hours before canceling it. I tried running it with tran..

Watch multiple $scope attributes

Is there a way to subscribe to events on multiple objects using $watch E.g. $scope.$watch('item1, item2', function () { }); ..

ERROR 1064 (42000): You have an error in your SQL syntax; Want to configure a password as root being the user

I have just downloaded WAMP. I want to configure a password for the MySQL root user using MySQL console. No password has been set previously. The following is the input mysql-> use mysql ..

Changing website favicon dynamically

I have a web application that's branded according to the user that's currently logged in. I'd like to change the favicon of the page to be the logo of the private label, but I'm unable to find any cod..

OpenJDK8 for windows

Im a bit confused about how to download openjdk8 for windows. If I go to http://openjdk.java.net/install/ then under JDK 8 there are only two sections: "Debian, Ubuntu, etc." and "Fedora, Oracle Linu..

Returning a boolean from a Bash function

I want to write a bash function that check if a file has certain properties and returns true or false. Then I can use it in my scripts in the "if". But what should I return? function myfun(){ ... ret..

comparing two strings in ruby

I've just started to learn ruby and this is probably very easy to solve. How do I compare two strings in Ruby? I've tried the following : puts var1 == var2 //false, should be true (I think) puts var..

How to find the sum of an array of numbers

Given an array [1, 2, 3, 4], how can I find the sum of its elements? (In this case, the sum would be 10.) I thought $.each might be useful, but I'm not sure how to implement it...

How to empty a list?

It seems so "dirty" emptying a list in this way: while len(alist) > 0 : alist.pop() Does a clear way exist to do that?..

Hiding a password in a python script (insecure obfuscation only)

I have got a python script which is creating an ODBC connection. The ODBC connection is generated with a connection string. In this connection string I have to include the username and password for th..

I have 2 dates in PHP, how can I run a foreach loop to go through all of those days?

I'm starting with a date 2010-05-01 and ending with 2010-05-10. How can I iterate through all of those dates in PHP?..

How do you import an Eclipse project into Android Studio now?

Using "Import Project" in Android Studio for an Eclipse project used to change the project structure and generate Gradle files, but right now (I'm using AS 0.5.3) it's only generating IDEA files (.iml..

Can I specify maxlength in css?

Can I replace the maxlength attribute with something in CSS? <input type='text' id="phone_extension" maxlength="4" /> ..

Go to beginning of line without opening new line in VI

For ages now I've used SHIFTO and SHIFT$ to move to the beginning and end of a line in vi. However SHIFTO is more for opening a new line above the cursor. Is there any command which just takes you..

Set div height equal to screen size

I have a div element in twitter-bootstrap which will have content that will overflow vertically outside the screen. I would like the div to take the height of the size of the browser window and let t..

How can I write to the console in PHP?

Is it possible write a string or log into the console? What I mean Just like in JSP, if we print something like system.out.println("some"), it will be there at the console, not at a page...

SDK Location not found Android Studio + Gradle

I have seen this same thing posted quite a few times, but whenever I try to import my project to my new work laptop I keep getting this error. I have pulled the project from git (which his btw runnin..

CakePHP find method with JOIN

Hi, I need to do the following query using the CakePHP find method: SELECT * FROM `messages` INNER JOIN users ON messages.from = users.id WHERE messages.to = 4 ORDER BY messages.datetime DESC Basi..

SEVERE: ContainerBase.addChild: start:org.apache.catalina.LifecycleException: Failed to start error

I encountered this error when I tried to run my application in Tomcat. I already checked the version of tomcat and java home. Both use java 6. Is there a missing jar? Or is it my web xml? I'm not usi..

What is the best way to prevent session hijacking?

Specifically this is regarding when using a client session cookie to identify a session on the server. Is the best answer to use SSL/HTTPS encryption for the entire web site, and you have the best gu..

How to retrieve Request Payload

I'm using PHP, ExtJS and ajax store. It sends data (on create, update, destroy) not in POST or GET. In the Chrome Console I see my outgoing params as JSON in the "Request Payload" field. $_POST and..

How do I fix an "Invalid license data. Reinstall is required." error in Visual C# 2010 Express?

I've tried to install Visual C# 2010 Express edition onto my PC, but whenever I try to run it, I get a error message. Invalid license data. Reinstall is required. I've already tried reinstalling..

Spring @Value is not resolving to value from property file

I've had this working in some other project before, I am just re-doing the same thing but for some reason it's not working. The Spring @Value is not reading from property file, but instead it's taking..

Adding Git-Bash to the new Windows Terminal

I'm trying to add a new terminal (Git Bash) to the new Windows Terminal, however I can't get it to work. I tried changing the commandline property in the profiles array to git-bash.exe but no luck. ..

Bold & Non-Bold Text In A Single UILabel?

How would it be possible to include both bold and non-bold text in a uiLabel? I'd rather not use a UIWebView.. I've also read this may be possible using NSAttributedString but I have no idea how to u..

Is there a way to view two blocks of code from the same file simultaneously in Sublime Text?

Is there a way to view two blocks of code from the same file simultaneously in Sublime Text? I can't find anything in the view options...

Python - Passing a function into another function

I am solving a puzzle using python and depending on which puzzle I am solving I will have to use a special set of rules. How can I pass a function into another function in Python? Example def Game(l..

Create list or arrays in Windows Batch

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

Check if xdebug is working

Without installing a texteditor or an IDE, is it possible to test if xdebug is working, i.e. if it can debug php code? The only part xdebug comes up in phpinfo() is the following: Additional .ini..

Predefined type 'System.ValueTuple´2´ is not defined or imported

I've installed Visual Studio 15 Preview 3 and tried to use the new tuple feature static void Main(string[] args) { var x = DoSomething(); Console.WriteLine(x.x); } static (int x, int y) DoSo..

How to merge two arrays in JavaScript and de-duplicate items

I have two JavaScript arrays: var array1 = ["Vijendra","Singh"]; var array2 = ["Singh", "Shakya"]; I want the output to be: var array3 = ["Vijendra","Singh","Shakya"]; The output array should ha..