Questions Tagged with #Imovie

java create date object using a value string

I am using this to get the current time : java.util.Calendar cal = java.util.Calendar.getInstance(); System.out.println(new java.text.SimpleDateFormat("EEEE, dd/MM/yyyy/hh:mm:ss") .fo..

Variables within app.config/web.config

Is it is possible to do something like the following in the app.config or web.config files? <appSettings> <add key="MyBaseDir" value="C:\MyBase" /> <add key="Dir1" value="[MyBaseDir]..

Run Android studio emulator on AMD processor

Android newbie. My processor is AMD, not Intel, so I can't open the emulator in Android studio. This answer has the comment: 'You can run the ARM (non Intel) emulator image. From your list, just cho..

How do I serialize a Python dictionary into a string, and then back to a dictionary?

How do I serialize a Python dictionary into a string, and then back to a dictionary? The dictionary will have lists and other dictionaries inside it...

Object array initialization without default constructor

#include <iostream> class Car { private: Car(){}; int _no; public: Car(int no) { _no=no; } void printNo() { std::cout<<_no<<std::endl; } }; void printCarNumbe..

iOS - Dismiss keyboard when touching outside of UITextField

I'm wondering how to make the keyboard disappear when the user touches outside of a UITextField...

Android EditText delete(backspace) key event

How can I detect delete (backspace) key event for a editText? I've tried using TextWatcher, but when the editText is empty, when I press delete key, nothing happens. I want to detect delete key press ..

jQuery .on('change', function() {} not triggering for dynamically created inputs

The problem is that I have some dynamically created sets of input tags and I also have a function that is meant to trigger any time an input value is changed. $('input').on('change', function() { ..

java.io.StreamCorruptedException: invalid stream header: 7371007E

I have a client Server application which communicate using objects. when I send only one object from the client to server all works well. when I attempt to send several objects one after another on th..

SQL (MySQL) vs NoSQL (CouchDB)

I am in the middle of designing a highly-scalable application which must store a lot of data. Just for example it will store lots about users and then things like a lot of their messages, comments etc..

Check if element exists in jQuery

How do I check if an element exists if the element is created by .append() method? $('elemId').length doesn't work for me...

How to convert a Django QuerySet to a list

I have the following: answers = Answer.objects.filter(id__in=[answer.id for answer in answer_set.answers.all()]) then later: for i in range(len(answers)): # iterate through all existing Questi..

How to change the remote repository for a git submodule?

I've created a git repository with a submodule in it. I'm able to tell the submodule itself to change its remote repository path, but I'm not sure how to tell the parent repository how to change the r..

What are all the user accounts for IIS/ASP.NET and how do they differ?

Under Windows Server 2008 with ASP.NET 4.0 installed there is a whole slew of related user accounts, and I can't understand which one is which, how to they differ, and which one is REALLY the one that..

How to check if a map contains a key in Go?

I know I can iterate over a map m by, for k, v := range m { ... } and look for a key but is there a more efficient way of testing a key's existence in a map? I couldn't find the answer in the lan..

make arrayList.toArray() return more specific types

So, normally ArrayList.toArray() would return a type of Object[]....but supposed it's an Arraylist of object Custom, how do I make toArray() to return a type of Custom[] rather than Object[]?..

Memory errors and list limits?

I need to produce large and big (very) matrices (Markov chains) for scientific purposes. I perform calculus that I put in a list of 20301 elements (=one row of my matrix). I need all those data in mem..

Immediate exit of 'while' loop in C++

How do I exit a while loop immediately without going to the end of the block? For example, while (choice != 99) { cin >> choice; if (choice == 99) //Exit here and don't get add..

onNewIntent() lifecycle and registered listeners

I'm using a singleTop Activity to receive intents from a search-dialog via onNewIntent(). What I noticed is that onPause() is called before onNewIntent(), and then afterwards it calls onResume(). Vi..

How can I install a package with go get?

I want to install packages from github to my gopath, I have tried this: go get github.com:capotej/groupcache-db-experiment.git the repository is here...

Output a NULL cell value in Excel

Possible Duplicate: Return empty cell from formula in Excel I have an IF statement. If a cell = n, then do something, else output NULL =IF(A1=5, "Success", NULL) // #NAME? =IF(A1=5, "Suc..

setting global sql_mode in mysql

I am trying to set sql_mode in mysql but it throws an error. Command: set global sql_mode='NO_BACKSLASH_ESCAPES','STRICT_TRANS_TABLE','NO_AUTO_CREATE_USER','NO_ENGINE_SUBSTITUTION' Is this not t..

How do you get the current text contents of a QComboBox?

Using pyqt4 and python 2.6, I am using a qcombobox to provide a list of options. I am having problems with using the selected option. I have been able to use a signal to trigger a method when the opti..

Why powershell does not run Angular commands?

I have started to learn Angular but I note that powershell in Windows gives me an error whenever I make an angular command like: ng new new-app or ng serve this is the error what I got: ng : Fi..

String delimiter in string.split method

I have following data: 1||1||Abdul-Jabbar||Karim||1996||1974 I want to delimit the tokens. Here the delimiter is "||". My delimiter setter is: public void setDelimiter(String delimiter) { ch..

Query to display all tablespaces in a database and datafiles

How to write a query to display all tablespaces in database suppose db and it's corresponding datafiles belong to user SCOTT. I can connect to SCOTT account and see it but I like to connect to sys as ..

https with WCF error: "Could not find base address that matches scheme https"

I go to https://mywebsite/MyApp/Myservice.svc and get the following error: (The link works if I use http:// ) "The service '/MyApp/MyService.svc' cannot be activated due to an exception during compi..

Min and max value of input in angular4 application

I have an angular4 application with a form. In this one I have an input to enter a percentage. So, I want to block the input with value between 0 and 100. I tried to add min="0" and max="100" but I ca..

Is it bad to have my virtualenv directory inside my git repository?

I'm thinking about putting the virtualenv for a Django web app I am making inside my git repository for the app. It seems like an easy way to keep deploy's simple and easy. Is there any reason why I s..

How to properly make a http web GET request

i am still new on c# and i'm trying to create an application for this page that will tell me when i get a notification (answered, commented, etc..). But for now i'm just trying to make a simple call t..

Are 2 dimensional Lists possible in c#?

I'd like to set up a multidimensional list. For reference, I am working on a playlist analyzer. I have a file/file-list, which my program saves in a standard list. One line from the file in each list..

Programmatically change input type of the EditText from PASSWORD to NORMAL & vice versa

In my application, I have an EditText whose default input type is set to android:inputType="textPassword" by default. It has a CheckBox to its right, which is when checked, changes the input..

How can I specify a display?

When I run some programs over SSH, such as firefox &, I get an error Error: no display specified I would like to open many displays, still showing the stdout of each program. Initial Questi..

gradle build fails on lint task

I have a simple android project that I created with Android Studio 0.4.0. I use Gradle 1.9 and Gradle Android Plugin 0.7. Yesterday I've added Jake Wharton's ButterKnife library in my gradle build sc..

The CSRF token is invalid. Please try to resubmit the form

I'm getting this error message every time I try to submit the form: The CSRF token is invalid. Please try to resubmit the form My form code is this: <form novalidate action="{{path('signup_i..

What does [object Object] mean? (JavaScript)

One of my alerts is giving the following result: [object Object] What does this mean exactly? (This was an alert of some jQuery object.)..

Get filename from file pointer

If I have a file pointer is it possible to get the filename? fp = open("C:\hello.txt") Is it possible to get "hello.txt" using fp?..

How do I implement Cross Domain URL Access from an Iframe using Javascript?

I need to access the Parent Domain URL from my Iframe which is in another domain. For example, "example.com" is my website which has an Iframe from another parent domain, such as "google.com". Here I..

java.net.MalformedURLException: no protocol

I am getting Java exception like: java.net.MalformedURLException: no protocol My program is trying to parse an XML string by using: Document dom; DocumentBuilderFactory dbf = DocumentBuilderFacto..

how to add key value pair in the JSON object already declared

I have declared a JSON Object and added some key value pair in that like: var obj = {}; and added some data into it like: obj = { "1":"aa", "2":"bb" }; But I want to add more key value pair in ..

Python: What OS am I running on?

What do I need to look at to see whether I'm on Windows or Unix, etc?..

Why is my CSS bundling not working with a bin deployed MVC4 app?

I have bin deployed an MVC4 application to my hosting provider, based on advice given here and one or two on-the-fly fixes, but the most immediately apparent problem is that the bundling for css doesn..

System.currentTimeMillis() vs. new Date() vs. Calendar.getInstance().getTime()

In Java, what are the performance and resource implications of using System.currentTimeMillis() vs. new Date() vs. Calendar.getInstance().getTime() As I understand it, System.currentTimeM..

How do I change a PictureBox's image?

I have a program in C# with a PictureBox object inside a Form. How do I change its picture? The pictures to chose from are in bin/Pics; they are jpeg in format, if that matters....

Where does forever store console.log output?

I installed forever and am using it, finding it quite funny. But I realized that the logs are placed to somewhere else. Is there any tips?..

How to turn IDENTITY_INSERT on and off using SQL Server 2008?

Why am I getting an error doing an insert when IDENTITY_INSERT is set to OFF? How do I turn it on properly in SQL Server 2008? Is it by using SQL Server Management Studio? I have run this query: ..

Remove values from select list based on condition

I have the following in the page <select name="val" size="1" > <option value="A">Apple</option> <option value="C">Cars</option> <option value="H">Honda</option&..

In PHP with PDO, how to check the final SQL parametrized query?

In PHP, when accessing MySQL database with PDO with parametrized query, how can you check the final query (after having replaced all tokens)? Is there a way to check what gets really executed by the ..

Declare and assign multiple string variables at the same time

I'm declaring some strings that are empty, so it won't throw errors later on. I've read that this was the proper way: string Camnr = Klantnr = Ordernr = Bonnr = Volgnr = Omschrijving = Startdatum = ..

how to get all markers on google-maps-v3

Is there a way to get all the markers on Google Maps?..

What does the 'static' keyword do in a class?

To be specific, I was trying this code: package hello; public class Hello { Clock clock = new Clock(); public static void main(String args[]) { clock.sayTime(); } } But it ga..

Chrome violation : [Violation] Handler took 83ms of runtime

I'm trying to implement the Facebook's logout functionality in my project. Login works just fine. But I'm facing the getting the following message in JavaScript console with the logout code. [Viol..

How do I import a .bak file into Microsoft SQL Server 2012?

Been Googling this for awhile and no answer....can anyone help?..

maven "cannot find symbol" message unhelpful

This is a really simple question, and it's probably a setting somewhere I don't know about, but Google is being particularly unhelpful for this question, giving results about compilation errors, not h..

Anyway to prevent the Blue highlighting of elements in Chrome when clicking quickly?

Most of the time I'm not worried about it but I have an image carousel and if I click on the next and previous divs quickly, they will be highlighted in Chrome. I tried using outline:none but no effe..

Disable button in jQuery

My page creates multiple buttons as id = 'rbutton_"+i+"'. Below is my code: <button type='button' id = 'rbutton_"+i+"' onclick=disable(i);>Click me</button> In Javascript function disa..

In Oracle SQL: How do you insert the current date + time into a table?

I've written below code, but it only seems to insert the current date and not the current time. Anyone knows how to do that? insert into errortable (dateupdated,table1id) values (TO_DATE(sysdate, 'dd..

How to obtain the last path segment of a URI

I have as input a string that is a URI. how is it possible to get the last path segment (that in my case is an id)? This is my input URL: String uri = "http://base_path/some_segment/id" and..

Load local images in React.js

I have installed React using create-react-app. It installed fine, but I am trying to load an image in one of my components (Header.js, file path: src/components/common/Header.js) but it's not loading...

What's the difference between echo, print, and print_r in PHP?

I use echo and print_r much, and almost never use print. I feel echo is a macro, and print_r is an alias of var_dump. But that's not the standard way to explain the differences...

AJAX jQuery refresh div every 5 seconds

I got this code from a website which I have modified to my needs: <head> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.3/jquery.min.js"></script>..

CSS transition with visibility not working

In the fiddle below, I've a transition on visibility and opacity separately. The latter works but the former doesn't. Moreover, in case of visibility, the transition time is interpreted as delay on ho..

start MySQL server from command line on Mac OS Lion

I installed mySQL for my Mac. Beside starting the SQL server with mySQL.prefPane tool installed in System Preference, I want to know the instruction to start from command-line. I do as follow: After ..

Get safe area inset top and bottom heights

On the new iPhone X, what would be the most proper way to get both top and bottom height for the unsafe areas? ..

C++ [Error] no matching function for call to

I can't compile my code because of some errors. Here some of them : In function 'int main(int, char**)': [Error] no matching function for call to 'deckOfCards::shuffle(deckOfCards&)' [Note] c..

jquery dialog save cancel button styling

I am using jquery ui dialogs in my application. How do I style the "Save" and "Cancel" buttons differently in a jquery dialog? So "Save" is more appealing than the "Cancel". I could use a hyper link f..

Xcode doesn't see my iOS device but iTunes does

I have a strange problem. I have an iPad with iOS 5.0.1 (9A405) and iOS SDK 5.0.1 with Xcode 4.2 (Build 4C199) installed on my Mac. Xcode doesn't see my device. It says "iOS Device" not "Sauron's iP..

Count textarea characters

I am developing a character count for my textarea on this website. Right now, it says NaN because it seems to not find the length of how many characters are in the field, which at the beginning is 0, ..

Using "super" in C++

My style of coding includes the following idiom: class Derived : public Base { public : typedef Base super; // note that it could be hidden in // protected/private ..

How to update Xcode from command line

I am trying to update Xcode from the command line. Initially I tried running: xcode-select --install which resulted in this message: xcode-select: error: command line tools are already installed..

Entity Framework: "Store update, insert, or delete statement affected an unexpected number of rows (0)."

I am using Entity Framework to populate a grid control. Sometimes when I make updates I get the following error: Store update, insert, or delete statement affected an unexpected number of rows (0)..

How to exit from ForEach-Object in PowerShell

I have the following code: $project.PropertyGroup | Foreach-Object { if($_.GetAttribute('Condition').Trim() -eq $propertyGroupConditionName.Trim()) { $a = $project.RemoveChild($_); ..

Wait for a void async method

How can I wait for a void async method to finish its job? for example, I have a function like below: async void LoadBlahBlah() { await blah(); ... } now I want to make sure that everything..

Apache Server (xampp) doesn't run on Windows 10 (Port 80)

I have installed the Windows 10 Insider Program. Everything works, except Apache. When I try to start it, it says that port 80 is blocked. Is there a way to unblock it or tell Apache to use another po..

Remove all child elements of a DOM node in JavaScript

How would I go about removing all of the child elements of a DOM node in JavaScript? Say I have the following (ugly) HTML: <p id="foo"> <span>hello</span> <div>world&..

How to find my php-fpm.sock?

I'm running Wordpress with: Nginx + PHP-FPM + APC + W3 Total Cache + PageSpeed. After 3 days researching and configuring, I succeeded to make it work. I configured PHP-FPM to run via 127.0.0.1:9000. ..

How do I find out my root MySQL password?

I just installed MySQL on Ubuntu and the root user can't log in :) How can I recover or find out my password? Using blank for password does not work...

strange error in my Animation Drawable

A strange error when trying to start Activity. i think the error in my Animation Drawable LogCat: 12-31 06:37:45.138: E/AndroidRuntime(922): FATAL EXCEPTION: main 12-31 06:37:45.138: E/Andr..

Is there a concise way to iterate over a stream with indices in Java 8?

Is there a concise way to iterate over a stream whilst having access to the index in the stream? String[] names = {"Sam","Pamela", "Dave", "Pascal", "Erik"}; List<String> nameList; Stream<I..

Differences between Octave and MATLAB?

I'm a programmer who knows Python, Ruby and some C who is trying to decide whether to learn GNU Octave or Matlab. I know that they have a lot in common, but it isn't clear to me how similar the syntax..

How to get script of SQL Server data?

I'm looking for a way to do something analogous to the MySQL dump from SQL Server. I need to be able to pick the tables and export the schema and the data (or I can export the schema via SQL Server Ma..

spark submit add multiple jars in classpath

I am trying to run a spark program where i have multiple jar files, if I had only one jar I am not able run. I want to add both the jar files which are in same location. I have tried the below but it ..

How do I get the localhost name in PowerShell?

How do I get the localhost (machine) name in PowerShell? I am using PowerShell 1.0...

How to initialize an array of objects in Java

I want to initialize an array of Player objects for a BlackJack game. I've read a lot about various ways to initialize primitive objects like an array of ints or an array of strings but I cannot take ..

What is the best practice for creating a favicon on a web site?

Question What is the best practice for creating a favicon on a web site? and is an .ico file with both 16x16 and 32x32 images better than a .png file with 16x16 only? Could the right method preferre..

Origin http://localhost is not allowed by Access-Control-Allow-Origin

I'm trying to do a fetch from backbone.js to my node.js server. However, I get the following error in the console: Origin http://localhost is not allowed by Access-Control-Allow-Origin. I added the ..

Memory address of variables in Java

Please take a look at the picture below. When we create an object in java with the new keyword, we are getting a memory address from the OS. When we write out.println(objName) we can see a "special" ..

What is the difference between Visual Studio Express 2013 for Windows and Visual Studio Express 2013 for Windows Desktop?

What is the difference between Visual Studio Express 2013 for Windows and Visual Studio Express 2013 for Windows Desktop? Do they both support the exactly the same things as Visual Studio Express 201..

Facebook key hash does not match any stored key hashes

I'm really having troubles with the Facebook hash key. I generated it in my Eclipse.. proof: Then I went to https://developers.facebook.com/ and registered a new app. And finally I've set my hash..

What does the function then() mean in JavaScript?

I’ve been seeing code that looks like: myObj.doSome("task").then(function(env) { // logic }); Where does then() come from?..

Oracle DateTime in Where Clause?

I have sql something like this: SELECT EMP_NAME, DEPT FROM EMPLOYEE WHERE TIME_CREATED >= TO_DATE('26/JAN/2011','dd/mon/yyyy') -> This returns 10 rows and TIME_CREATED = '26-JAN-2011' Now when ..

Best practices for adding .gitignore file for Python projects?

I'm trying to collect some of my default settings, and one thing I realized I don't have a standard for is .gitignore files. There's a great thread showing a good .gitignore for Visual Studio projects..

ORA-01031: insufficient privileges when selecting view

When I try to execute a view that includes tables from different schemas an ORA-001031 Insufficient privileges is thrown. These tables have execute permission for the schema where the view was create..

Windows equivalent of 'touch' (i.e. the node.js way to create an index.html)

On a windows machine I get this error 'touch' is not recognized as an internal or external command, operable program or batch file. when I follow the instructions to do: touch index.html app.js..

jQuery UI themes and HTML tables

Is there any way to theme an HTML table (CSS) with using the jQuery CSS themes? All of my components look like they belong together except for my HTML table which looks different...

REST API Best practices: Where to put parameters?

A REST API can have parameters in at least two ways: As part of the URL-path (i.e. /api/resource/parametervalue ) As a query argument (i.e. /api/resource?parameter=value ) What is the best pract..

How do I convert an enum to a list in C#?

Is there a way to convert an enum to a list that contains all the enum's options?..

Setting SMTP details for php mail () function

I have been looking for an answer and tried many things to this problem. My script works fine on my webhost but when moving it to an other dedicated server the mail never gets delivered. Now i need t..

Date only from TextBoxFor()

I'm having trouble displaying the only date part of a DateTime into a textbox using TextBoxFor<,>(expression, htmlAttributes). The model is based on Linq2SQL, field is a DateTime on SQL and in the..

XPath OR operator for different nodes

How can I do with XPath: //bookstore/book/title or //bookstore/city/zipcode/title Just //title won't work because I also have //bookstore/magazine/title p.s. I saw a lot of or examples but mainly..

How to specify non-default shared-library path in GCC Linux? Getting "error while loading shared libraries" when running

There is a laptop on which I have no root privilege. onto the machine I have a library installed using configure --prefix=$HOME/.usr . after that, I got these files in ~/.usr/lib : libXX.so.16.0.0 lib..

Excel Define a range based on a cell value

Is it possible to define a range based on a value given in a cell. So, for example: My selection is A1:A5 That are five cells. is it possible to let excel determine this by setting a cell value (lik..

Uninstalling Android ADT

This seems like a trivial task, but I can't find an option to cleanly de-install the ADT from my Eclipse installation. Of course, I could just delete the folder of the SDK, but this just throws errors..

Pass multiple parameters to rest API - Spring

I am trying to figure out if it is possible to pass a JSON object to rest API, Or pass a multiple parameters to that API ? And how to read these parameters in Spring ? Lets assume that the url looks l..

access key and value of object using *ngFor

I am a bit confused about how to get the key and value of an object in angular2 while using *ngFor for iterating over the object. I know in angular 1.x there is a syntax like ng-repeat="(key, value)..

How do getters and setters work?

I'm from the php world. Could you explain what getters and setters are and could give you some examples?..

Fixed page header overlaps in-page anchors

If I have a non-scrolling header in an HTML page, fixed to the top, having a defined height: Is there a way to use the URL anchor (the #fragment part) to have the browser scroll to a certain point in ..

Python function overloading

I know that Python does not support method overloading, but I've run into a problem that I can't seem to solve in a nice Pythonic way. I am making a game where a character needs to shoot a variety of..

use std::fill to populate vector with increasing numbers

I would like to fill a vector<int> using std::fill, but instead of one value, the vector should contain numbers in increasing order after. I tried achieving this by iterating the third paramete..

CSS opacity only to background color, not the text on it?

Can I assign the opacity property to the background property of a div only and not to the text on it? I've tried: background: #CCC; opacity: 0.6; but this doesn't change the opacity...

Installing tkinter on ubuntu 14.04

I want to run python code on Ubuntu 14.04, but when I execute it, it gives me the following error message Traceback (most recent call last): File "main.py", line 2, in <module> from tkint..

How to save and load cookies using Python + Selenium WebDriver

How can I save all cookies in Python's Selenium WebDriver to a .txt file, and then load them later? The documentation doesn't say much of anything about the getCookies function...

Writing String to Stream and reading it back does not work

I want to write a String to a Stream (a MemoryStream in this case) and read the bytes one by one. stringAsStream = new MemoryStream(); UnicodeEncoding uniEncoding = new UnicodeEncoding(); String mes..

How to manually update datatables table with new JSON data

I am using plugin jQuery datatables and load my data which I have loaded in DOM at the bottom of page and initiates plugin in this way: var myData = [ { "id": 1, "first_name": "Jo..

What are the file limits in Git (number and size)?

Does anyone know what are the Git limits for number of files and size of files?..

JS jQuery - check if value is in array

I am more of a PHP person, not JS - and I think my problem is more a syntax problem .. I have a small jQuery to "validate" and check input value . It works ok for single words, but I need array. I ..

How to make a movie out of images in python

I currently try to make a movie out of images, but i could not find anything helpful . Here is my code so far: import time from PIL import ImageGrab x =0 while True: try: x+= 1 ..

How should I import data from CSV into a Postgres table using pgAdmin 3?

Is there any plugin or library which I need to use for this? I want to try this on my local system first and then do the same on Heroku Postgresql..

json_encode is returning NULL?

For some reason the item "description" returns NULL with the following code: <?php include('db.php'); $result = mysql_query('SELECT * FROM `staff` ORDER BY `id` DESC LIMIT 2') or die(mysql_error(..

How to check if a string starts with "_" in PHP?

Example: I have a $variable = "_foo", and I want to make absolutely sure that $variable does not start with an underscore "_". How can I do that in PHP? Is there some access to the char array behind t..

How do you add swap to an EC2 instance?

I'm currently running an ec2 micro instance and i've been finding that the instance occasionally runs out of memory. Other than using a larger instance size, what else can be done?..

How to vertically center a <span> inside a div?

The code: <div id="theMainDiv" style=" border:solid 1px gray; cursor:text; width:400px; padding:0px;" > <span id="tag1_outer" style=" background:#e2e6f..

Get array of object's keys

I would like to get the keys of a JavaScript object as an array, either in jQuery or pure JavaScript. Is there a less verbose way than this? var foo = { 'alpha' : 'puffin', 'beta' : 'beagle' }; var ..

Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted (CodeIgniter + XML-RPC)

I have a bunch of client point of sale (POS) systems that periodically send new sales data to one centralized database, which stores the data into one big database for report generation. The client P..

What is the simplest way to write the contents of a StringBuilder to a text file in .NET 1.1?

I have to use StringBuilder instead of a List of strings because of being stuck with .NET 1.1 for this project. I want to write a series of debug messages I've written to a file to study at my leisu..

How can you create multiple cursors in Visual Studio Code

What are the keyboard shortcuts for creating multiple cursors in VS Code?..

Add days Oracle SQL

SELECT ORDER_NUM, CUSTOMER_NUM, CUSTOMER_NAME, ADD_DAYS (ORDER_DATE, 20) FROM CUSTOMER, ORDERS; Oracle Express says ADD_DAYS invalid? Any ideas what Am I doing wrong?..

Using a cursor with dynamic SQL in a stored procedure

I have a dynamic SQL statement I've created in a stored procedure. I need to iterate over the results using a cursor. I'm having a hard time figuring out the right syntax. Here's what I'm doing. SELE..

Non greedy (reluctant) regex matching in sed?

I'm trying to use sed to clean up lines of URLs to extract just the domain. So from: http://www.suepearson.co.uk/product/174/71/3816/ I want: http://www.suepearson.co.uk/ (either with or withou..

LINQ-to-SQL vs stored procedures?

I took a look at the "Beginner's Guide to LINQ" post here on StackOverflow (Beginners Guide to LINQ), but had a follow-up question: We're about to ramp up a new project where nearly all of our databa..

Sum all the elements java arraylist

If I had: ArrayList<Double> m = new ArrayList<Double>(); with the double values ??inside, how should I do to add up all the ArrayList elements? public double incassoMargherita() { double..

How to check db2 version

How to check db2 version on Z/OS using only SQL commands? Thanks, Melita..

How to hide code from cells in ipython notebook visualized with nbviewer?

I have an ipython/jupyter notebook that I visualize using NBviewer. How can I hide all the code from the notebook rendered by NBviewer, so that only the output of code (e.g. plots and tables) and the..

Using the Jersey client to do a POST operation

In a Java method, I'd like to use a Jersey client object to do a POST operation on a RESTful web service (also written using Jersey) but am not sure how to use the client to send the values that will ..

PHPDoc type hinting for array of objects?

So, in PHPDoc one can specify @var above the member variable declaration to hint at its type. Then an IDE, for ex. PHPEd, will know what type of object it's working with and will be able to provide a ..

Cannot assign requested address - possible causes?

I have a program that consists of a master server and distributed slave servers. The slave servers send status updates to the server, and if the server hasn't heard from a specific slave in a fixed pe..

How to convert characters to HTML entities using plain JavaScript

I have the following: var text = "Übergroße Äpfel mit Würmern"; I'm searching for a Javascript function to transform the text so that every special letter is represented by its HTML entity sequ..

String, StringBuffer, and StringBuilder

Please tell me a real time situation to compare String, StringBuffer, and StringBuilder?..

Select Pandas rows based on list index

I have a dataframe df : 20060930 10.103 NaN 10.103 7.981 20061231 15.915 NaN 15.915 12.686 20070331 3.196 NaN 3.196 2.710 20070630 7.907 Na..

What is your single most favorite command-line trick using Bash?

We all know how to use <ctrl>-R to reverse search through history, but did you know you can use <ctrl>-S to forward search if you set stty stop ""? Also, have you ever tried running bind ..

Quick way to retrieve user information Active Directory

How to query user information from Active Directory? I have code that works, but it's really slow. I'm using C#. This is the code I currently use: static void Main(string[] args) { S..

How to restore to a different database in sql server?

I have a backup of Database1 from a week ago. The backup is done weekly in the scheduler and I get a .bak file. Now I want to fiddle with some data so I need to restore it to a different database - Da..

Why is this HTTP request not working on AWS Lambda?

I'm getting started with AWS Lambda and I'm trying to request an external service from my handler function. According to this answer, HTTP requests should work just fine, and I haven't found any docum..

Swapping two variable value without using third variable

One of the very tricky questions asked in an interview. Swap the values of two variables like a=10 and b=15. Generally to swap two variables values, we need 3rd variable like: temp=a; a=b; b=temp; ..

Intent from Fragment to Activity

I was trying to go to another page using button, but it always fail. Here is my First Class with its XML: public class FindPeopleFragment extends Fragment { public FindPeopleFragment(){} @..

How to get the current directory in a C program?

I'm making a C program where I need to get the directory that the program is started from. This program is written for UNIX computers. I've been looking at opendir() and telldir(), but telldir() retu..

How to debug PDO database queries?

Before moving to PDO, I created SQL queries in PHP by concatenating strings. If I got database syntax error, I could just echo the final SQL query string, try it myself on the database, and tweak it u..

TypeError: expected str, bytes or os.PathLike object, not _io.BufferedReader

I'm trying to iterate through a group of files in a folder on my local machine and upload only ones where the file names contain "Service_Areas" to my FTP site using using this code (Python 3.6.1 32 b..

How to use timeit module

I understand the concept of what timeit does but I am not sure how to implement it in my code. How can I compare two functions, say insertion_sort and tim_sort, with timeit?..

Is there a difference between `continue` and `pass` in a for loop in python?

Is there any significant difference between the two python keywords continue and pass like in the examples for element in some_list: if not element: pass and for element in some_list: ..

jQuery get the name of a select option

I have a dropdown list with several option, each option has a name attribute. When I select an option, a different list of checkboxes needs to appear - when another options is selected, that checkbox ..

Set View Width Programmatically

I am trying to set the width and height of a view in code to show an ad for a free app I am working on. All of the UI is done in XML with the exception of this ad. Here is the code that displays the a..

Time stamp in the C programming language

How do I stamp two times t1 and t2 and get the difference in milliseconds in C?..

.bashrc: Permission denied

I try to work with a project in vagrant. I have made the command vagrant ssh, and connected to VM. Now I need to edit .bashrc file to set path to the source code. But first I couldn't find that file...

How to convert seconds to time format?

For some reason I convert a time format like: 03:30 to seconds 3*3600 + 30*60, now. I wanna convert it back to its first (same) format up there. How could that be? My attempt: 3*3600 + 30*60 = 12600..

convert string array to string

I would like to convert a string array to a single string. string[] test = new string[2]; test[0] = "Hello "; test[1] = "World!"; I would like to have something like "Hello World!"..

How do I get milliseconds from epoch (1970-01-01) in Java?

I need to get the number of milliseconds from 1970-01-01 UTC until now UTC in Java. I would also like to be able to get the number of milliseconds from 1970-01-01 UTC to any other UTC date time...

Deny direct access to all .php files except index.php

I want to deny direct access to all .php files except one: index.php The only access to the other .php files should be through php include. If possible I want all files in the same folder. UPDATE: ..

How to set base url for rest in spring boot?

I'm trying to to mix mvc and rest in a single spring boot project. I want to set base path for all rest controllers (eg. example.com/api) in a single place (I don't want annotate each controller with ..

Easy way to test a URL for 404 in PHP?

I'm teaching myself some basic scraping and I've found that sometimes the URL's that I feed into my code return 404, which gums up all the rest of my code. So I need a test at the top of the code to ..

Test or check if sheet exists

Dim wkbkdestination As Workbook Dim destsheet As Worksheet For Each ThisWorkSheet In wkbkorigin.Worksheets 'this throws subscript out of range if there is not a sheet in the destination 'wo..

How to open up a form from another form in VB.NET?

This I thought would be easy. I have not used VB.NET all that much, and I am trying to open up a form from a button click. The form will not show and I get a null exception error. What is wrong with ..

Resize a large bitmap file to scaled output file on Android

I have a large bitmap (say 3888x2592) in a file. Now, I want to resize that bitmap to 800x533 and save it to another file. I normally would scale the bitmap by calling Bitmap.createBitmap method but i..

Communication between multiple docker-compose projects

I have two separate docker-compose.yml files in two different folders: ~/front/docker-compose.yml ~/api/docker-compose.yml How can I make sure that a container in front can send requests to a cont..

How to convert seconds to HH:mm:ss in moment.js

How can I convert seconds to HH:mm:ss? At the moment I am using the function below render: function (data){ return new Date(data*1000).toTimeString().replace(/.*(\d{2}:\d{2}:\d{2}).*/, "$1");; ..

Detect Windows version in .net

How can I detect the Windows OS versions in .net? What code can I use?..

How to take backup of a single table in a MySQL database?

By default, mysqldump takes the backup of an entire database. I need to backup a single table in MySQL. Is it possible? How do I restore it?..

How to create a fixed-size array of objects

In Swift, I am trying to create an array of 64 SKSpriteNode. I want first to initialize it empty, then I would put Sprites in the first 16 cells, and the last 16 cells (simulating an chess game). Fro..

Sorting a list with stream.sorted() in Java

I'm interested in sorting a list from a stream. This is the code I'm using: list.stream() .sorted((o1, o2)->o1.getItem().getValue().compareTo(o2.getItem().getValue())) .collect(Collectors...

Unable to generate an explicit migration in entity framework

I am adding a new migration but this message shows: Unable to generate an explicit migration because the following explicit migrations are pending: [201203170856167_left]. Apply the pending ex..

Textarea Auto height

I want to make height of textarea equal to height of the text within it (And remove the scroll bar) HTML <textarea id="note">SOME TEXT</textarea> CSS textarea#note { width:100%; ..

Logarithmic returns in pandas dataframe

Python pandas has a pct_change function which I use to calculate the returns for stock prices in a dataframe: ndf['Return']= ndf['TypicalPrice'].pct_change() I am using the following code to get lo..

moment.js - UTC gives wrong date

Why does moment.js UTC always show the wrong date. For example from chrome's developer console: moment(('07-18-2013')).utc().format("YYYY-MM-DD").toString() // or moment.utc(new Date('07-18-2013')).f..

Run jar file with command line arguments

How can I run a jar file in command prompt and pass arguments to it. ie: "test.jar -get" would be entered in command prompt/terminal..

Get total number of items on Json object?

Possible Duplicate: Length of Javascript Object (ie. Associative Array) I have an object similar to this one: var jsonArray = { '-1': { '-1': 'b', '2': 'a', '10': 'c' }, ..

Django - filtering on foreign key properties

I'm trying to filter a table in Django based on the value of a particular field of a ForeignKey. For example, I have two models: class Asset(models.Model): name = models.TextField(max_length=150..

How do you get the length of a string?

How do you get the length of a string in jQuery?..

How does DateTime.Now.Ticks exactly work?

In my application I generate files at random opportunities. To ensure a unique naming, I tried to use the nano seconds since 1.1.1970: long time = DateTime.Now.Ticks; String fileName = Convert.ToStri..

How to read a line from the console in C?

What is the simplest way to read a full line in a C console program The text entered might have a variable length and we can't make any assumption about its content...

Register comdlg32.dll gets Regsvr32: DllRegisterServer entry point was not found

I have Windows 7, 64-bit. I'm trying to register a .dll (comdlg32.dll) using regsvr32. But I get an error that says the dll is read but the DLLRegistryServer entry point is not found. I have run the..

How to call a method after bean initialization is complete?

I have a use case where I need to call a (non-static) method in the bean only-once at the ApplicationContext load up. Is it ok, if I use MethodInvokingFactoryBean for this? Or we have a some better so..

C# - What does the Assert() method do? Is it still useful?

I am debugging with breakpoints and I realize the assert call? I thought it was only for unit tests. What does it do more than breakpoint? Since I can breakpoint, why should I use Assert?..

SQL GROUP BY CASE statement with aggregate function

I have a column that looks something like this: CASE WHEN col1 > col2 THEN SUM(col3*col4) ELSE 0 END AS some_product And I would like to put it in my GROUP BY clause, but this seems to c..

How to track down a "double free or corruption" error

When I run my (C++) program it crashes with this error. * glibc detected * ./load: double free or corruption (!prev): 0x0000000000c6ed50 *** How can I track down the error? I tried using prin..

How to make google spreadsheet refresh itself every 1 minute?

My google spreadsheet is using GOOGLEFINANCE('symbol','price) function to retrieve stock prices of my portfolio. Unfortunately, I have to refresh manually now. How can I make the spreadsheet refresh i..

Choose folders to be ignored during search in VS Code

Right now when I use ?+O to search for files, the fuzzy matching appears to operate over all files in the current project. Unfortunately, this includes a number of files from build and vendor director..

How to avoid Python/Pandas creating an index in a saved csv?

I am trying to save a csv to a folder after making some edits to the file. Every time I use pd.to_csv('C:/Path of file.csv') the csv file has a separate column of indexes. I want to avoid printing t..

How to link HTML5 form action to Controller ActionResult method in ASP.NET MVC 4

I have a basic form for which I want to handle buttons inside the form by calling the ActionResult method in the View's associated Controller class. Here is the following HTML5 code for the form: <..

Increase number of axis ticks

I'm generating plots for some data, but the number of ticks is too small, I need more precision on the reading. Is there some way to increase the number of axis ticks in ggplot2? I know I can tell g..

Undefined symbols for architecture arm64

I am getting a Apple Mach-O Linker Error everytime I import a file from CocoaPods. Undefined symbols for architecture arm64: "_OBJC_CLASS_$_FBSession", referenced from: someFile ld: symbol(s) not f..

disable past dates on datepicker

How to disable past dates from the current date on a datetimepicker? I tried few posts for similar question but was unable to achieve it, Below is what I tried <link href="http://netdna.bootstrapc..

prevent property from being serialized in web API

I'm using an MVC 4 web API and asp.net web forms 4.0 to build a rest API. It's working great: [HttpGet] public HttpResponseMessage Me(string hash) { HttpResponseMessage httpResponseMessage; L..

Why does this CSS margin-top style not work?

I try to add margin values on a div inside another div. All works fine except the top value, it seems to be ignored. But why? What I expected: What I get: Code: _x000D_ _x000D_ #outer {_x000D_ ..

Unable to compile class for JSP

I am working in a JSP project. While runnning the project using Netbeans with Tomcat 6 server, I got the following exception, org.apache.jasper.JasperException: Unable to compile class for JSP: An ..

What is unit testing and how do you do it?

Exact duplicate of many posts: What is unit testing? What Makes a Good Unit Test? New to Unit Testing Unit Testing - definitions Learning Unit Testing How to properly mock and unit test Unit Te..

Cannot implicitly convert type 'System.Collections.Generic.IEnumerable<AnonymousType#1>' to 'System.Collections.Generic.List<string>

I have the code below: List<string> aa = (from char c in source select new { Data = c.ToString() }).ToList(); But what about List<string> aa = (from char c1 in sour..

Getting the class name from a static method in Java

How can one get the name of the class from a static method in that class. For example public class MyClass { public static String getClassName() { String name = ????; // what goes here so..

Android Stop Emulator from Command Line

This question is identical to How to shut down Android emulator via command line. However, after attempting the suggested solution from the first answer adb emu kill has not proven successful for me...

How to use apply a custom drawable to RadioButton?

It looks like we can use the following in a RadioButton: android:button="@drawable/myCustomStateBackground" but that drawable only occupies the spot where the radio drawable would normally go. Idea..

How to inject a Map using the @Value Spring Annotation?

How can I inject values into a Map from the properties file using the @Value annotation in Spring? My Spring Java class is and I tried using the $, but got the following error message: Could not auto..