Questions Tagged with #Soap extension

Return list using select new in LINQ

This is my method which gives me error. public List<Project> GetProjectForCombo() { using (MyDataContext db = new MyDataContext (DBHelper.GetConnectionString())) { var query = fr..

How do you check if a string is not equal to an object or other string value in java?

I have been trying to make a clock that the user can set. I wanted the user to be asked questions and they answer in words like yes or no. I have done it for things that don't change using this code s..

Extract column values of Dataframe as List in Apache Spark

I want to convert a string column of a data frame to a list. What I can find from the Dataframe API is RDD, so I tried converting it back to RDD first, and then apply toArray function to the RDD. In t..

Using the "animated circle" in an ImageView while loading stuff

I am currently using in my application a listview that need maybe one second to be displayed. What I currently do is using the @id/android:empty property of the listview to create a "loading" text. ..

Connection refused to MongoDB errno 111

I have a Linode server running Ubuntu 12.04 LTS and MongoDB instance (service is running and CAN connect locally) that I can't connect to from an outside source. I have added these two rules to my IP..

C# Select elements in list as List of string

In C# i need to get all values of a particular property from an object list into list of string List<Employee> emplist = new List<Employee>() { ..

How to set image width to be 100% and height to be auto in react native?

I am trying to display list of images in a scrollview. Width should be 100%, while height should be automatic, keeping aspect ratio. The searches I did pointed to various solutions which give fullscr..

An Iframe I need to refresh every 30 seconds (but not the whole page)

I have this bit of code <iframe marginwidth="0" marginheight="0" width="240" height="80" scrolling="no" frameborder=0 src="irc_online.php"..

How do I make the first letter of a string uppercase in JavaScript?

How do I make the first letter of a string uppercase, but not change the case of any of the other letters? For example: "this is a test" -> "This is a test" "the Eiffel Tower" -> "The Eiffel Tower"..

In Python how should I test if a variable is None, True or False

I have a function that can return one of three things: success (True) failure (False) error reading/parsing stream (None) My question is, if I'm not supposed to test against True or False, how sho..

What is the "proper" way to cast Hibernate Query.list() to List<Type>?

I'm a newbie with Hibernate, and I'm writing a simple method to return a list of objects matching a specific filter. List<Foo> seemed a natural return type. Whatever I do, I can't seem to make ..

How to round to 2 decimals with Python?

I am getting a lot of decimals in the output of this code (Fahrenheit to Celsius converter). My code currently looks like this: def main(): printC(formeln(typeHere())) def typeHere(): globa..

How to initialize array to 0 in C?

I need a big null array in C as a global. Is there any way to do this besides typing out char ZEROARRAY[1024] = {0, 0, 0, /* ... 1021 more times... */ }; ?..

How to parse JSON and access results

I am using CURL to send a request. The response dataType is json. How can I parse this data and insert it into the database? <?php $url = 'http://sms2.cdyne.com/sms.svc/SimpleSMSsendWithPostback?..

The type or namespace cannot be found (are you missing a using directive or an assembly reference?)

I get the following error when I try to compile my C# program: The type or namespace name 'Login' could not be found (are you missing a using directive or an assembly reference?) using System; us..

How to Access Hive via Python?

https://cwiki.apache.org/confluence/display/Hive/HiveClient#HiveClient-Python appears to be outdated. When I add this to /etc/profile: export PYTHONPATH=$PYTHONPATH:/usr/lib/hive/lib/py I can then..

Creating table variable in SQL server 2008 R2

what is table variable? And how to create a table variable (virtual in-memory table) with columns that match the existing Stored procedure resultset. I executed the procedure and after executing it, ..

Check if a given key already exists in a dictionary

I wanted to test if a key exists in a dictionary before updating the value for the key. I wrote the following code: if 'key1' in dict.keys(): print "blah" else: print "boo" I think this is not ..

What does the PHP error message "Notice: Use of undefined constant" mean?

PHP is writing this error in the logs: "Notice: Use of undefined constant". Error in logs: PHP Notice: Use of undefined constant department - assumed 'department' (line 5) PHP Notice: Use of undef..

How to bind Events on Ajax loaded Content?

I have a link, myLink, that should insert AJAX-loaded content into a div (appendedContainer) of my HTML page. The problem is that the click event I have bound with jQuery is not being executed on the ..

Replace missing values with column mean

I am not sure how to loop over each column to replace the NA values with the column mean. When I am trying to replace for one column using the following, it works well. Column1[is.na(Column1)] <- ..

Sort table rows In Bootstrap

Can someone please show me an example of code that I would have to use to sort a column of a table in Bootstrap? For example, if I want to sort by price, or by name...

Showing empty view when ListView is empty

For some reason the empty view, a TextView in this case, always appears even when the ListView is not empty. I thought the ListView would automatically detect when to show the empty view. <Relativ..

How to call a Web Service Method?

I have a web service that contains this method: [WebMethod] public static List<string> GetFileListOnWebServer() { DirectoryInfo dInfo = new DirectoryInfo(HostingEnvironment.MapPath("~/Upload..

JavaScript, getting value of a td with id name

Originally I was using input with an id and grabbing it's value with getElementById. Currently, I'm playing with <td>s. How can I grab the values of the <td>? Originally I used: <inpu..

Set selected item of spinner programmatically

I am working on an android project and I am using a spinner which uses an array adapter which is populated from the database. I can't find out how I can set the selected item programmatically from t..

Try-catch speeding up my code?

I wrote some code for testing the impact of try-catch, but seeing some surprising results. static void Main(string[] args) { Thread.CurrentThread.Priority = ThreadPriority.Highest; Process.Ge..

ProgressDialog in AsyncTask

I'm trying to display a custom progressdialog while loading RSS feed from an HTTP server, I made a hard search, but nothing helped me to do this, the only thing I know is that the solution should use ..

Delete the first five characters on any line of a text file in Linux with sed

I need a one-liner to remove the first five characters on any line of a text file. How can I do that with sed?..

Limiting the output of PHP's echo to 200 characters

I'm trying to limit my PHP echo to only 200 characters and then if there are any more replace them with "...". How could I modify the following statement to allow this? <?php echo $row['style-inf..

How can I completely uninstall nodejs, npm and node in Ubuntu

The Question is similar to How do I completely uninstall Node.js, and reinstall from beginning (Mac OS X) but for Ubuntu, and just for uninstalling. Installation was done by: sudo apt-get install node..

How to exit in Node.js

What is the command that is used to exit? (i.e terminate the Node.js process)..

C# with MySQL INSERT parameters

Good day to all, I'm using Visual C# 2010 and MySQL Version 5.1.48-community. I hope you can help me with this code. I don't find it working on me. What am I missing? string connString = Configuratio..

How to add a filter class in Spring Boot?

I wonder, if there is any annotation for a Filter class (for web applications) in Spring Boot? Perhaps @Filter? I want to add a custom filter in my project. The Spring Boot Reference Guide mentione..

Printing all global variables/local variables?

How can I print all global variables/local variables? Is that possible in gdb?..

Parsing JSON Object in Java

I have JSON object as follows: member = "{interests : [{interestKey:Dogs}, {interestKey:Cats}]}"; In Java I want to parse the above json object and store the values in an arraylist. I am seeking s..

How to create a folder with name as current date in batch (.bat) files

I don't know much about windows .bat file syntax. My simple requirement is to create a folder at a specific location with name as current date. I tried searching this on google but didn't get any good..

Can't push to GitHub because of large file which I already deleted

Currently I have Empty GitHub repo SSH server repo (main) Local Repo SSH server repo was the most up-to-date repo (production site) so I did a Git clone from there to local. I then tried to do a g..

how to remove time from datetime

The field DATE in the database has the following format: 2012-11-12 00:00:00 I would like to remove the time from the date and return the date like this: 11/12/2012 ..

Python time measure function

I want to create a python function to test the time spent in each function and print its name with its time, how i can print the function name and if there is another way to do so please tell me def ..

Checkout subdirectories in Git?

Is it possible to check out subdirectories of a repository in Git? Imagine I am setting up a new WordPress installation. I will create two new directories for my plugin and theme customization: wor..

Count specific character occurrences in a string

What is the simplest way to count the number of occurrences of a specific character in a string? That is, I need to write a function, countTheCharacters(), so that str = "the little red hen" count =..

Python find elements in one list that are not in the other

I need to compare two lists in order to create a new list of specific elements found in one list but not in the other. For example: main_list=[] list_1=["a", "b", "c", "d", "e"] list_2=["a", "f", "c"..

bash shell nested for loop

I want to write a nested for loop that has to work in the bash shell prompt. nested for loop in Single line command. For example, for i in a b; do echo $i; done a b In the above example, for loo..

open_basedir restriction in effect. File(/) is not within the allowed path(s):

I'm getting this error on an avatar upload on my site. I've never gotten it before and nothing was changed recently for me to begin getting this error... Warning: is_writable() [function.is-writable..

How can I merge properties of two JavaScript objects dynamically?

I need to be able to merge two (very simple) JavaScript objects at runtime. For example I'd like to: var obj1 = { food: 'pizza', car: 'ford' } var obj2 = { animal: 'dog' } obj1.merge(obj2); //obj1..

What is a clearfix?

Recently I was looking through some website's code, and saw that every <div> had a class clearfix. After a quick Google search, I learned that it is for IE6 sometimes, but what actually is a c..

Detect if a Form Control option button is selected in VBA

I have a code that work just fine using ActiveX option buttons. However, I want the macro to run on a Mac as well so I am trying to replace my ActiveX controls with form controls. With ActiveX, all I ..

Excel 2013 horizontal secondary axis

I have made a scatter plot and I want to have a secondary axis for the x-axis. It used to be easy to do in 2010, but I have no idea where Microsoft put this option in the 2013 version of Excel. ..

Mocking Logger and LoggerFactory with PowerMock and Mockito

I have the following Logger I want to mock out, but to validate log entries are getting called, not for the content. private static Logger logger = LoggerFactory.getLogger(GoodbyeController...

Checking for NULL pointer in C/C++

In a recent code review, a contributor is trying to enforce that all NULL checks on pointers be performed in the following manner: int * some_ptr; // ... if (some_ptr == NULL) { // Handle null-po..

How to change default JRE for all Eclipse workspaces?

I have one JRE in C:\Program Files (x86)\Java\jre6 and that was the only one at the time I installed Eclipse. I have subsequently installed a complete JDK in C:\home\SFTWR\jdk1.6.0_21 and changed my ..

How to get the PID of a process by giving the process name in Mac OS X ?

I am writing a script to monitor the CPU and MEM of any given process. For that i need to send in the name of the process to be monitored as a commandline argument. For example. ./monitorscript <..

How to disable the resize grabber of <textarea>?

How to disable the grabber in the <textarea>? I mean that triangle thing which appears in the right-bottom corner of the <textarea>...

Getting value from table cell in JavaScript...not jQuery

I can't believe how long this has taken me but I can't seem to figure out how to extract a cell value from an HTML table as I iterate through the table with JavaScript. I am using the following to it..

How to emulate a BEFORE INSERT trigger in T-SQL / SQL Server for super/subtype (Inheritance) entities?

This is on Azure. I have a supertype entity and several subtype entities, the latter of which needs to obtain their foreign keys from the primary key of the super type entity on each insert. In Oracl..

ImportError: Couldn't import Django

I've already configured virtualenv in pycharm, when using the python manage.py command, this is error shown: E:\video course\Python\code\web_worker\MxOnline>python manage.py runserver Traceback (m..

What is the best way to remove a table row with jQuery?

What is the best method for removing a table row with jQuery?..

C++ -- expected primary-expression before ' '

I am new to C++ and programming, and have run into an error that I cannot figure out. When I try to run the program, I get the following error message: stringPerm.cpp: In function ‘int main()’: st..

Using a list as a data source for DataGridView

I've extracted the setting names and their respective values out of a configuration file into an ordered dictionary. The dictionary contains keys and values which are of the ICollection class. I want ..

Is there a command to refresh environment variables from the command prompt in Windows?

If I modify or add an environment variable I have to restart the command prompt. Is there a command I could execute that would do this without restarting CMD?..

Retrieving a List from a java.util.stream.Stream in Java 8

I was playing around with Java 8 lambdas to easily filter collections. But I did not find a concise way to retrieve the result as a new list within the same statement. Here is my most concise approach..

Angular 4 checkbox change value

how could you achieve in Angular 4 that when you register in a checkbox save an "A" or "B" value. As much as I try, he is only sending me true or false, I hope someone can help me...

Inner text shadow with CSS

I am currently playing around with CSS3 and trying to achieve a text effect like this (the black blurry inner shadow): But I cannot find a way to create text shadows inside the text. I wonder wheth..

Using Spring MVC Test to unit test multipart POST request

I have the following request handler for saving autos. I have verified that this works when I use e.g. cURL. Now I want to unit test the method with Spring MVC Test. I have tried to use the fileUpload..

oracle.jdbc.driver.OracleDriver ClassNotFoundException

This is my code for which I am getting error. My classes12.jar has been imported as an external jar. import java.io.IOException; import java.io.PrintWriter; import java.sql.Connection; import java.sq..

Can I dynamically add HTML within a div tag from C# on load event?

Mind you, I am using master pages, but can I locate a div within the page and throw some html in there? Thanks. ..

Changing text of UIButton programmatically swift

Simple question here. I have a UIButton, currencySelector, and I want to programmatically change the text. Here's what I have: currencySelector.text = "foobar" Xcode gives me the error "Expected De..

Iterating through a variable length array

How do I iterate over a Java array of variable length. I guess I would setup a while loop, but how would I detect that I have reached the end of the array. I guess I want something like this [just ..

Git submodule update

I'm not clear on what the following means (from the Git submodule update documentation): ...will make the submodules HEAD be detached, unless --rebase or --merge is specified... How does --rebas..

SQL Server Operating system error 5: "5(Access is denied.)"

I am starting to learn SQL and I have a book that provides a database to work on. These files below are in the directory but the problem is that when I run the query, it gives me this error: Msg 5..

How to call C++ function from C?

I know this. Calling C function from C++: If my application was in C++ and I had to call functions from a library written in C. Then I would have used //main.cpp extern "C" void C_library_functio..

How to implement HorizontalScrollView like Gallery?

I want to implement Horizontal ScrollView with some features of Gallery, In Gallery the scroll made at some distance it arrange in pair, i.e If we have three images shown in screen, clicking last im..

int array to string

In C#, I have an array of ints, containing digits only. I want to convert this array to string. Array example: int[] arr = {0,1,2,3,0,1}; How can I convert this to a string formatted as: "012301"..

json_encode() escaping forward slashes

I'm pulling JSON from Instagram: $instagrams = json_decode($response)->data; Then parsing variables into a PHP array to restructure the data, then re-encoding and caching the file: file_put_cont..

TypeError: method() takes 1 positional argument but 2 were given

If I have a class... class MyClass: def method(arg): print(arg) ...which I use to create an object... my_object = MyClass() ...on which I call method("foo") like so... >>>..

Convert normal Java Array or ArrayList to Json Array in android

Is there any way to convert a normal Java array or ArrayList to a Json Array in Android to pass the JSON object to a webservice? ..

Include files from parent or other directory

I'm needing to include a file from the parent directory, and other sub-directories, into a sub-directory. I've done it before by simply using include('/rootdirectory/file.php'); but now it won't seem ..

How to create a HTML Table from a PHP array?

How do I create a HTML table from a PHP array? A table with heading as 'title', 'price', and 'number'. $shop = array( array("rose", 1.25, 15), array("daisy", 0.75, 25), array("orchid",..

Execute Shell Script after post build in Jenkins

I am trying to execute a shell script if either the build pass or fails after post-build in Jenkins. I cannot see this option in post build to execute some shell script except for running a target...

PostgreSQL: how to convert from Unix epoch to date?

The statement gives me the date and time. How could I modify the statement so that it returns only the date (and not the time)? SELECT to_timestamp( TRUNC( CAST( epoch_ms AS bigint ) / 1000 ) ); ..

How to detect if a string contains at least a number?

How to detect if a string contains at least a number (digit) in SQL server 2005?..

iframe to Only Show a Certain Part of the Page

I am working on iframes, and I need to show a certain portion of the page [say, the top right ] in an iframe with about 300px width and 150px height. Example: Say I wanted to put an iframe of www.my..

Actionbar notification count icon (badge) like Google has

Is there a android standard badge or method to show action bar notification icon with a count like on Google examples? If not, then what is the best way to make it? I'm new to android, please help...

Can I update a component's props in React.js?

After starting to work with React.js, it seems like props are intended to be static (passed in from the parent component), while state changes based upon events. However, I noticed in the docs a refe..

`getchar()` gives the same output as the input string

I am confused by a program mentioned in K&R that uses getchar(). It gives the same output as the input string: #include <stdio.h> main(){ int c; c = getchar(); while(c != EOF){..

Git add all subdirectories

I'm having trouble adding a folder and all of it's subdirectories to my git repository. I realized this is a very popular question after doing some googling and I've tried each suggestion with no luck..

embedding image in html email

I'm trying to send a multipart/related html email with embedded gif images. This email is generated using Oracle PL/SQL. My attempts have failed, with the image showing up as a red X (in Outlook 200..

Downloading a large file using curl

I need to download remote file using curl. Here's the sample code I have: $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); $st = curl_exec($ch); ..

Where is the visual studio HTML Designer?

Where is the Visual Studio HTML Designer? I see that there are options for the HTML Designer but I can't open it. So I just want to ask why I can't find the designer and how do I open it. When I cre..

R for loop skip to next iteration ifelse

Suppose you have a for loop like so for(n in 1:5) { #if(n=3) # skip 3rd iteration and go to next iteration cat(n) } How would one skip to the next iteration if a certain condition is met?..

How to change node.js's console font color?

I had to change the console background color to white because of eye problems, but the font is gray colored and it makes the messages unreadable. How can I change it?..

Add Facebook Share button to static HTML page

Is there any way to add a Facebook Share Button to a static HTML page? I've implemented a simple web site with no server side, just a bunch of html pages and I was abble to add a Like button because i..

How to run .jar file by double click on Windows 7 64-bit?

Running a .jar file in a command line works fine, but i am not able to run any .jar file by double clicking on my Windows 7 (64). It seems nothing happens after the double click. I tried the ftype hi..

How can I increase a scrollbar's width using CSS?

Is it possible to increase the width of a scrollbar on a <div> element placed inside the <body>? I am not talking about the default scrollbar on the browser itself, this page runs in full..

Most efficient solution for reading CLOB to String, and String to CLOB in Java?

I have a big CLOB (more than 32kB) that I want to read to a String, using StringBuilder. How do I do this in the most efficient way? I can not use the "int length" constructor for StringBuilder since ..

How to scale an Image in ImageView to keep the aspect ratio

In Android, I defined an ImageView's layout_width to be fill_parent (which takes up the full width of the phone). If the image I put to ImageView is bigger than the layout_width, Android will scale i..

Stretch and scale CSS background

Is there a way to get a background in CSS to stretch or scale to fill its container?..

How can I add a space in between two outputs?

This is the code I am working with. public void displayCustomerInfo() { System.out.println(Name + Income); } I use a separate main method with this code to call the method above: first.displa..

Subset a dataframe by multiple factor levels

How can I avoid using a loop to subset a dataframe based on multiple factor levels? In the following example my desired output is a dataframe. The dataframe should contain the rows of the original..

Creating an empty file in C#

What's the simplest/canonical way to create an empty file in C#/.NET? The simplest way I could find so far is: System.IO.File.WriteAllLines(filename, new string[0]); ..

How to set default values for Angular 2 component properties?

When writing Angular 2.0 components, how does one set default values for properties? For example - I want to set foo to 'bar' by default, but the binding might immediately resolve to 'baz'. How does ..

How to model type-safe enum types?

Scala doesn't have type-safe enums like Java has. Given a set of related constants, what would be the best way in Scala to represent those constants?..

Checking session if empty or not

I want to check that session is null or empty i.e. some thing like this: if(Session["emp_num"] != null) { if (!string.IsNullOrEmpty(Session["emp_num"].ToString())) { /..

Convert ASCII TO UTF-8 Encoding

How to convert ASCII encoding to UTF8 in PHP..

Accessing an SQLite Database in Swift

I'm looking for a way to access an SQLite database in my app with Swift code. I know that I can use an SQLite Wrapper in Objective C and use the bridging header, but I'd rather be able to do this pro..

How to set or change the default Java (JDK) version on OS X?

How can you change the default version of Java on a mac?..

How to export table data in MySql Workbench to csv?

I am wondering how do I export table data into a csv? I read that I need to use mysql workbench command line but I can not figure out how to launch the cmd line(don't know what the command is). Runni..

Iterate through object properties

_x000D_ _x000D_ var obj = {_x000D_ name: "Simon",_x000D_ age: "20",_x000D_ clothing: {_x000D_ style: "simple",_x000D_ hipster: false_x000D_ }_x000D_ }_x000D_ _x000D_ fo..

Bootstrap 4 multiselect dropdown

I read on many forums that the problem of select and multiselect has been resolved after the beta version of bootstrap 4. Unfortunately I am unable to display the multiselect as in (bootstrap 3) in (..

Why is AJAX returning HTTP status code 0?

For some reason, while using AJAX (with my dashcode developed application) the browser just stops uploading and returns status codes of 0. Why does this happen?..

Bootstrap Responsive Text Size

I am trying to build a responsive layout using bootstrap and currently am defining some of the titles with font-size:3em; But when the layout is shrunk down this is too big. How can I responsively re..

curl : (1) Protocol https not supported or disabled in libcurl

I'm trying to install the Rails environments on Ubuntu 11.04. When I launch the command rvm install 1.9.2 --with-openssl-dir=/usr/local the following error is received: curl : (1) Protocol https not ..

Update query using Subquery in Sql Server

I have a simple table Structure like this: Table tempData +------------------+ ¦ NAME ¦ MARKS ¦ ¦----------+-------¦ ¦ Narendra ¦ 80 ¦ ¦ Ravi ¦ 85 ¦ ¦ Sanjay ¦ 90 ¦ ..

Make multiple-select to adjust its height to fit options without scroll bar

Apparently this doesn't work: select[multiple]{ height: 100%; } it makes the select have 100% page height... auto doesn't work either, I still get the vertical scrollbar. Any other ide..

Can scrapy be used to scrape dynamic content from websites that are using AJAX?

I have recently been learning Python and am dipping my hand into building a web-scraper. It's nothing fancy at all; its only purpose is to get the data off of a betting website and have this data put..

How to execute a bash command stored as a string with quotes and asterisk

I try to execute the following command : mysql AMORE -u username -ppassword -h localhost -e "SELECT host FROM amoreconfig" I store it in a string : cmd="mysql AMORE -u username -ppassword -h loc..

How to make the background DIV only transparent using CSS

I am using CSS attrubutes : filter: alpha(opacity=90); opacity: .9; to make the DIV transparent, but when I add another DIV inside this DIV it makes it transparent also. I want to make ..

Overlaying a DIV On Top Of HTML 5 Video

I need to overlay a div ON TOP of a div containing an HTML 5 video. In the example below the overlaying div's id is "video_overlays". See example below: _x000D_ _x000D_ <div id="video_box">_x00..

Parse String date in (yyyy-MM-dd) format

I have a string in the form "2013-09-18". I want to convert it into a java.util.Date. I am doing this SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); Date convertedCurrentDate = sdf.parse(..

How to move (and overwrite) all files from one directory to another?

I know of the mv command to move a file from one place to another, but how do I move all files from one directory into another (that has a bunch of other files), overwriting if the file already exists..

Does Arduino use C or C++?

Coming from Python, the whole C/C++ thing is kind of alien to begin with... and then I see in one place that Arduino uses 'standard' C, and in another that it uses 'standard' C++, so on and so forth. ..

How to get height and width of device display in angular2 using typescript?

I found this solution. Is it valid? import {Component} from '@angular/core'; import {Platform} from 'ionic-angular'; @Component({...}) export MyApp { constructor(platform: Platform) { platform.rea..

C# - Simplest way to remove first occurrence of a substring from another string

I need to remove the first (and ONLY the first) occurrence of a string from another string. Here is an example replacing the string "\\Iteration". This: ProjectName\\Iteration\\Release1\\Iteration..

What is a predicate in c#?

I am very new to using predicates and just learned how to write: Predicate<int> pre = delegate(int a){ a %2 == 0 }; What will the predicate return, and how is it useful when programming?..

Android Layout Animations from bottom to top and top to bottom on ImageView click

I have created a view in Android and I need to animate it from bottom to top and vice-versa. when I clicked on ImageView I need to animate the complete RelativeLayout from bottom to top and it is succ..

Keyboard shortcut for Jump to Previous View Location (Navigate back/forward) in IntelliJ IDEA

I know Ctrl+Shift+Backspace is used to go to the location of the last edit. But I want to jump to whichever location I was most recently at, not necessarily one where I edited anything. For example,..

Convert file to byte array and vice versa

I've found many ways of converting a file to a byte array and writing byte array to a file on storage. What I want is to convert java.io.File to a byte array and then convert a byte array back to a j..

How to get TimeZone from android mobile?

I want to get the time zone from the Android mobile when clicking a button...

How to get Map data using JDBCTemplate.queryForMap

How to load data from JDBCTemplate.queryForMap() and it returns the Map Interface.How the maintained the query data internally in map.I trying to load but i got below exception i.e., org.springframew..

Focus Input Box On Load

How can the cursor be focus on a specific input box on page load? Is it posible to retain initial text value as well and place cursor at end of input? <input type="text" size="25" id="myinputbox..

Vertical rulers in Visual Studio Code

How can vertical rulers (note the plural) be configured in Visual Studio Code? In Sublime Text 2 I can do "rulers": [72, 80, 100, 120] How does this work in Visual Studio? "editor.ruler": 80 p..

"register" keyword in C?

What does the register keyword do in C language? I have read that it is used for optimizing but is not clearly defined in any standard. Is it still relevant and if so, when would you use it?..

What is the difference between <html lang="en"> and <html lang="en-US">?

What is the difference between <html lang="en"> and <html lang="en-US">? What other values can follow the dash? According to w3.org "Any two-letter subcode is understood to be a [ISO3166]..

How to split a number into individual digits in c#?

Say I have 12345. I'd like individual items for each number. A String would do or even an individual number. Does the .Split method have an overload for this?..

How to loop an object in React?

New to React and trying to loop Object attributes but React complains about Objects not being valid React children, can someone please give me some advice on how to resolve this problem? I've added cr..

How can I use Async with ForEach?

Is it possible to use Async when using ForEach? Below is the code I am trying: using (DataContext db = new DataLayer.DataContext()) { db.Groups.ToList().ForEach(i => async { await GetA..

How to Pass Parameters to Activator.CreateInstance<T>()

I want to create an instance of a type that I specify in a generic method that I have. This type has a number of overloaded constructors. I'd like to be able to pass arguments to the constructors, but..

css to make bootstrap navbar transparent

I use bootstrap and I have a navbar in my html file I would like to make this nav bar transparent to show the background image. Can some one teach me how to do this with css? I tried the following css..

how to find array size in angularjs

How to find array size in AngularJS <!DOCTYPE html> <html> <script src="http://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script> <body> &..

Converting a JS object to an array using jQuery

My application creates a JavaScript object, like the following: myObj= {1:[Array-Data], 2:[Array-Data]} But I need this object as an array. array[1]:[Array-Data] array[2]:[Array-Data] So I trie..

Django: Get list of model fields?

I've defined a User class which (ultimately) inherits from models.Model. I want to get a list of all the fields defined for this model. For example, phone_number = CharField(max_length=20). Basically,..

Pass a String from one Activity to another Activity in Android

This is my string: private final String easyPuzzle ="630208010200050089109060030"+ "008006050000187000060500900"+ "090070106810020005..

How do I add a user when I'm using Alpine as a base image?

I'm using alpine (or an image that is based on Alpine) as the base image in my Dockerfile. Which instructions do I need to add to create a user? Eventually I'll use this user to run the application ..

How to give spacing between buttons using bootstrap

I want to give spacing between buttons is there a way to give spacing using bootstrap so that they will be consistent for different screen resolutions. I tried using margin-left But is it the correct..

Correct way of passing 2 dimensional array into a function

I have a 2-dimensional array and I am passing it into a function to carry out certain operations. I'd like to know the correct way of doing it... #define numRows 3 #define numCols 7 #define TotalNum..

What does -1 mean in numpy reshape?

A numpy matrix can be reshaped into a vector using reshape function with parameter -1. But I don't know what -1 means here. For example: a = numpy.matrix([[1, 2, 3, 4], [5, 6, 7, 8]]) b = numpy.res..

Real world use of JMS/message queues?

I was just reading abit about JMS and Apache ActiveMQ. And was wondering what real world use have people here used JMS or similar message queue technologies for ?..

file_get_contents() Breaks Up UTF-8 Characters

I am loading a HTML from an external server. The HTML markup has UTF-8 encoding and contains characters such as l,š,c,t,ž etc. When I load the HTML with file_get_contents() like this: $html = file_..

jQuery Datepicker with text input that doesn't allow user input

How do I use the jQuery Datepicker with a textbox input: $("#my_txtbox").datepicker({ // options }); that doesn't allow the user to input random text in the textbox. I want the Datepicker to pop ..

How to make HTML element resizable using pure Javascript?

I was wondering how we can make a HTML element like <div> or <p> tag element resizable when clicked using pure JavaScript, not the jQuery library or any other library...

Install a Nuget package in Visual Studio Code

How can I install a Nuget Package in Visual Studio Code? I know in Visual Studio, we can do this through the Nuget Package Manager console, but how do I do it in VS Code?..

Detect changed input text box

I've looked at numerous other questions and found very simple answers, including the code below. I simply want to detect when someone changes the content of a text box but for some reason it's not wo..

Capture Signature using HTML5 and iPad

Anyone know how this can be done? Would you use a canvas object, svg, jQuery, etc?..

ImportError: No module named 'django.core.urlresolvers'

I am working on Django project where I need to create a form for inputs. I tried to import reverse from django.core.urlresolvers. I got an error: line 2, in from django.core.urlresolvers import rever..

What is the difference between parseInt(string) and Number(string) in JavaScript?

What is the difference between parseInt(string) and Number(string) in JavaScript?..

What was the strangest coding standard rule that you were forced to follow?

When I asked this question I got almost always a definite yes you should have coding standards. What was the strangest coding standard rule that you were ever forced to follow? And by strangest I m..

How to downgrade from Internet Explorer 11 to Internet Explorer 10?

As a developer, I found the new Internet Explorer version to be a complete nightmare. I turned the windows feature off, but I wasn't able to install Internet Explorer 10. It says that i..

Pandas - How to flatten a hierarchical index in columns

I have a data frame with a hierarchical index in axis 1 (columns) (from a groupby.agg operation): USAF WBAN year month day s_PC s_CL s_CD s_CNT tempf ..

How to configure Fiddler to listen to localhost?

I want to monitor HTTP traffic between a process on my local machine and another (server) process, also running on my local machine. How can I configure Fiddler to listen to traffic to and from loc..

Flexbox: 4 items per row

I'm using a flex box to display 8 items that will dynamically resize with my page. How do I force it to split the items into two rows? (4 per row)? Here is a relevant snip: (Or if you prefer jsfiddl..

Daemon Threads Explanation

In the Python documentation it says: A thread can be flagged as a "daemon thread". The significance of this flag is that the entire Python program exits when only daemon threads are left. The ..

Simplest way to throw an error/exception with a custom message in Swift 2?

I want to do something in Swift 2 that I'm used to doing in multiple other languages: throw a runtime exception with a custom message. For example (in Java): throw new RuntimeException("A custom me..

download file using an ajax request

I want to send an "ajax download request" when I click on a button, so I tried in this way: javascript: var xhr = new XMLHttpRequest(); xhr.open("GET", "download.php"); xhr.send(); download.php: ..

Change the jquery show()/hide() animation?

By default if you specify a speed jquery adds a weird looking animation where it expands from the left end corner. I want it to just slide down. Is there a way to do that without importing something e..

Get an image extension from an uploaded file in Laravel

I have been trying to get the extension from an uploaded file, searching on google, I got no results. The file already exists in a path: \Storage::get('/uploads/categories/featured_image.jpg); Now..

Convert HTML + CSS to PDF

I have an HTML (not XHTML) document that renders fine in Firefox 3 and IE 7. It uses fairly basic CSS to style it and renders fine in HTML. I'm now after a way of converting it to PDF. I have tried..

Is it possible to start activity through adb shell?

I want to start activity through adb shell. So that I can launch a specific activity that is needed..

How to delete last character in a string in C#?

Building a string for post request in the following way, var itemsToAdd = sl.SelProds.ToList(); if (sl.SelProds.Count() != 0) { foreach (var item in itemsToAdd) { paramstr =..

converting epoch time with milliseconds to datetime

I have used a ruby script to convert iso time stamp to epoch, the files that I am parsing has following time stamp structure: 2009-03-08T00:27:31.807 Since I want to keep milliseconds I used follo..

how to delete files from amazon s3 bucket?

I need to write code in python that will delete the required file from an Amazon s3 bucket. I am able to connect to the Amazon s3 bucket, and also to save files, but how can I delete a file?..

iTunes Connect Screenshots Sizes for all iOS (iPhone/iPad/Apple Watch) devices

I'm trying to submit a new application to the App Store but now Apple requires screenshots for iPhones of 4.7 inch and 5.5 inch. Anyone has these screenshot specifications (size)? I tried with: 64..

How can I increase the cursor speed in terminal?

How can I increase the cursor speed in terminal? I have Mac OS X by the way. It would also be interesting to know it for Linux. I don't know what I should search for in Google (or what you like)...

Why is "forEach not a function" for this object?

This is probably something really dumb, but I don't understand why this doesn't work. var a = {"cat":"large"}; a.forEach(function(value, key, map){ console.log(value); }); Uncaught TypeError: ..

How to convert integer to decimal in SQL Server query?

A column height is integer type in my SQL Server table. I want to do a division and have the result as decimal in my query: Select (height/10) as HeightDecimal How do I cast so that the HeightDecim..

What is the difference between required and ng-required?

What is the difference between required and ng-required (form validation)?..

Convert tuple to list and back

I'm currently working on a map editor for a game in pygame, using tile maps. The level is built up out of blocks in the following structure (though much larger): level1 = ( (1,1,1,1,1,1) ..

Declaring and initializing a string array in VB.NET

I was trying to return an array of strings from a function and got surprised by an error. I would have expected this to work, but it produces an error: Public Function TestError() As String() Re..

JUNIT Test class in Eclipse - java.lang.ClassNotFoundException

I'm trying to run my junit test (to verify that a properties file loads correctly) but I get ClassNotFoundException although the class is there and all required libraries are there too. Here it is t..

How do I edit $PATH (.bash_profile) on OSX?

I am trying to edit an entry to PATH, as I did something wrong. I am using Mac OS X 10.10.3 I have tried: > touch ~/.bash_profile; open ~/.bash_profile But the file editor opens with nothin..

RESTful URL design for search

I'm looking for a reasonable way to represent searches as a RESTful URLs. The setup: I have two models, Cars and Garages, where Cars can be in Garages. So my urls look like: /car/xxxx xxx == car i..

Bootstrap Columns Not Working

Can't figure out why the columns aren't being structured with this HTML: <div class="container"> <div class="row"> <div class="col-md-12"> <div class="col..

Use VBA to Clear Immediate Window?

Does anyone know how to clear the immediate window using VBA? While I can always clear it myself manually, I am curious if there is a way to do this programmatically...

Giving height to table and row in Bootstrap

I am using Bootstrap 3 , i am trying to give height to table and row, but nothing is working for me . I tried setting line-height and other properties of table, how can I increase height? <style&..

Can't stop rails server

I am new to rails and I am using an ubuntu machine and the rubymine IDE. The problem is that I am unable to stop the rails server. I tried to stop the server by killing the rails process. But, when I ..

How to save an image locally using Python whose URL address I already know?

I know the URL of an image on Internet. e.g. http://www.digimouth.com/news/media/2011/09/google-logo.jpg, which contains the logo of Google. Now, how can I download this image using Python without a..

casting int to char using C++ style casting

In traditional C you can do: int i = 48; char c = (char)i; //Now c holds the value of 48. //(Of course if i > 255 then c will not hold the same value as i). Which of the c++ casting methods (..

Java 6 Unsupported major.minor version 51.0

I recently uninstalled Java 8, to use Java 6 as I want my code/creations to be usable by more people than just those on Java 8. When I do mvn - version it returns: Exception in thread "main" java.lan..

How to get the size of a JavaScript object?

I want to know the size occupied by a JavaScript object. Take the following function: function Marks(){ this.maxMarks = 100; } function Student(){ this.firstName = "firstName"; this.lastName ..

Undefined reference to pow( ) in C, despite including math.h

Possible Duplicate: Problem using pow() in C what is 'undefined reference to `pow'' I'm having a bit of an issue with a simple piece of coursework for uni that's really puzzli..

How to send a GET request from PHP?

I'm planning to use PHP for a simple requirement. I need to download a XML content from a URL, for which I need to send HTTP GET request to that URL. How do I do it in PHP?..

Git fails when pushing commit to github

I cloned a git repo that I have hosted on github to my laptop. I was able to successfully push a couple of commits to github without problem. However, now I get the following error: Compressing ob..

How can I properly use a PDO object for a parameterized SELECT query

I've tried following the PHP.net instructions for doing SELECT queries but I am not sure the best way to go about doing this. I would like to use a parameterized SELECT query, if possible, to return ..

What is REST? Slightly confused

I was under the assumption that REST was a web service but it seems that I am incorrect in thinking this - so, what is REST? I've read through Wikipedia but still cant quite wrap my head around it. W..

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

Use underscore inside Angular controllers

How do I use underscore library inside angularjs controllers? On this post: AngularJS limitTo by last 2 records somebody suggested to assign an _ variable to the rootScope so that the library will b..

Make REST API call in Swift

I'm trying to use Swift to make a GET call to a REST API, and have tried to follow numerous tutorials, but can't figure it out. Either because I cannot figure out how to translate all the Obj-C to Sw..

How to implement reCaptcha for ASP.NET MVC?

How do I implement reCaptcha in ASP.NET MVC and C#?..

How to correctly use Html.ActionLink with ASP.NET MVC 4 Areas

I recently discovered Areas in ASP.NET MVC 4, which I have successfully implemented, but I'm running into troubles with the @Html.ActionLink helper in my Razor views. The URL this helper generates alw..

React eslint error missing in props validation

I have the next code, eslint throw: react/prop-types onClickOut; is missing in props validation react/prop-types children; is missing in props validation propTypes was defined but eslint does not re..