Questions Tagged with #Nonclient

How to clear the entire array?

I have an array like this: Dim aFirstArray() As Variant How do I clear the entire array? What about a collection?..

SyntaxError: Unexpected token o in JSON at position 1

I parse few data using a type class in my controller I'm getting data as follows: { "data":{ "userList":[ { "id":1, "name":"soni" } ] ..

Java 8 stream reverse order

General question: What's the proper way to reverse a stream? Assuming that we don't know what type of elements that stream consists of, what's the generic way to reverse any stream? Specific question..

typeof !== "undefined" vs. != null

I often see JavaScript code which checks for undefined parameters etc. this way: if (typeof input !== "undefined") { // do stuff } This seems kind of wasteful, since it involves both a type loo..

How do I dynamically assign properties to an object in TypeScript?

If I wanted to programatically assign a property to an object in Javascript, I would do it like this: var obj = {}; obj.prop = "value"; But in TypeScript, this generates an error: The property ..

How to update/modify an XML file in python?

I have an XML document that I would like to update after it already contains data. I thought about opening the XML file in "a" (append) mode. The problem is that the new data will be written after th..

Difference between array_map, array_walk and array_filter

What exactly is the difference between array_map, array_walk and array_filter. What I could see from documentation is that you could pass a callback function to perform an action on the supplied array..

How to redirect output of an already running process

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

How do I check if a directory exists? "is_dir", "file_exists" or both?

I want to create a directory if it does not exist already. Is using the is_dir function enough for that purpose? if ( !is_dir( $dir ) ) { mkdir( $dir ); } Or should I combine is_dir with f..

How to force Eclipse to ask for default workspace?

I noticed that after installing cdt, Eclipse always loads the default workspace. The workspace listed in the config.ini in osgi.instance.area.default. Eclipse does not ask which workspace to open rega..

Oracle timestamp data type

what is the different between timestamp data type without parameter and with parameter 0: timestamp VS timestamp(0)..

$this->session->set_flashdata() and then $this->session->flashdata() doesn't work in codeigniter

Please take a look at the following code: $this->session->set_flashdata('message', 'This is a message.'); var_dump($this->session->flashdata('message')); It returns bool(false). I hope..

What is Ruby's double-colon `::`?

What is this double-colon ::? E.g. Foo::Bar. I found a definition: The :: is a unary operator that allows: constants, instance methods and class methods defined within a class or module, to be a..

Apple Cover-flow effect using jQuery or other library?

Does anyone know how to achieve the cover-flow effect using JavaScript to scroll through a bunch of images. I'm not talking about the 3D rotating itunes cover-art, but the effect that happens when yo..

Update data on a page without refreshing

I have a website where I need to update a status. Like for a flight, you are departing, cruise or landed. I want to be able to refresh the status without having my viewers to have and reload the whole..

Combine two OR-queries with AND in Mongoose

I want to combine two OR-queries with AND in Monoose, like in this SQL statement: SELECT * FROM ... WHERE (a = 1 OR b = 1) AND (c=1 OR d=1) I tried this in a NodeJS module which only gets the model..

Are static class variables possible in Python?

Is it possible to have static class variables or methods in Python? What syntax is required to do this?..

Why "no projects found to import"?

I am trying to "import existing project into workspace". As the "root directory" I select the directory where all my .java (and .class) files are located. Eclipse writes me that "no projects are found..

How to get Wikipedia content using Wikipedia's API?

I want to get the first paragraph of a Wikipedia article. What is the API query to do so?..

How to change column datatype in SQL database without losing data

I have SQL Server database and I just realized that I can change the type of one of the columns from int to bool. How can I do that without losing the data that is already entered into that table? ..

Google OAUTH: The redirect URI in the request did not match a registered redirect URI

I am trying to make an upload to YouTube from my Java based web app, I spent a few days to understand what and where is the problem and I cannot get it, for now I am pulling my hair out off my head. ..

How to use QTimer

In Qt I'm trying to set a QTimer that calls a function called "update" every second. Here is my .cpp file: #include "mainwindow.h" #include "ui_mainwindow.h" #include <QTimer> #include "QDebug"..

how to make a whole row in a table clickable as a link?

I'm using Bootstrap and the following doesn't work: <tbody> <a href="#"> <tr> <td>Blah Blah</td> <td>1234567</td> ..

What does "Table does not support optimize, doing recreate + analyze instead" mean?

I am working on MySQL 5.5 and trying to do index rebuild using an OPTIMIZE TABLE query. I am getting the error below: Table does not support optimize, doing recreate + analyze instead What does ..

What is the difference between Python's list methods append and extend?

What's the difference between the list methods append() and extend()?..

Formatting a field using ToText in a Crystal Reports formula field

I'm trying to create a Crystal Reports formula field (to calculate the percentage change in a price) that will return "N/A" if a particular report field is null, but return a number to two decimal pla..

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

How to list only top level directories in Python?

I want to be able to list only the directories inside some folder. This means I don't want filenames listed, nor do I want additional sub-folders. Let's see if an example helps. In the current direct..

Proper Linq where clauses

I write a fair amount of linq in my day to day life, but mostly simple statements. I have noticed that when using where clauses, there are many ways to write them and each have the same results as fa..

Convert a character digit to the corresponding integer in C

Is there a way to convert a character to an integer in C? For example, from '5' to 5?..

Curl command without using cache

Is there a way to tell curl command not to use server's side cache? e.g; I have this curl command: curl -v www.example.com how can I ask curl to send a fresh request to not use the cache? Note: I ..

sed: print only matching group

I want to grab the last two numbers (one int, one float; followed by optional whitespace) and print only them. Example: foo bar <foo> bla 1 2 3.4 Should print: 2 3.4 So far, I have the fo..

How to print a query string with parameter values when using Hibernate

Is it possible in Hibernate to print generated SQL queries with real values instead of question marks? How would you suggest to print queries with real values if it is not possible with Hibernate API..

How to scale a BufferedImage

Following the javadocs, I have tried to scale a BufferedImage without success here is my code: BufferedImage image = MatrixToImageWriter.getBufferedImage(encoded); Graphics2D grph = image.createGraph..

Password Protect a SQLite DB. Is it possible?

I have to face a new little project. It will have about 7 or 9 tables, the biggest of them will grow by a max rate of 1000 rows a month. I thought about SQLite as my db... But i will need to protect ..

How can I export tables to Excel from a webpage

How can I export tables to Excel from a webpage. I want the export to contain all the formatting and colours...

How to connect wireless network adapter to VMWare workstation?

How can I connect wireless network adapter to wmvare workstation ?(My Host OS is Win Seven Ultimate, my Guest OS is Fedora 13 & my VMWare version is 6.5.0) I'm running win seven on my Dell Vostro ..

ALTER COLUMN in sqlite

How do I alter column in sqlite? This is in Postgresql ALTER TABLE books_book ALTER COLUMN publication_date DROP NOT NULL; I believe there is no ALTER COLUMN in sqlite at all, only ALTER TABLE is s..

How to select first and last TD in a row?

How can you select the first and the last TD in a row? tr > td[0], tr > td[-1] { /* styles */ } ..

back button callback in navigationController in iOS

I have pushed a view onto the navigation controller and when I press the back button it goes to the previous view automatically. I want to do a few things when back button is pressed before popping th..

Lotus Notes email as an attachment to another email

This is in Notes 8.5 environment. I just wanted to know how to attach an email to another email as real attachment not a "Document Link". I intended to attach an email, so I drag & dropped an e..

(grep) Regex to match non-ASCII characters?

On Linux, I have a directory with lots of files. Some of them have non-ASCII characters, but they are all valid UTF-8. One program has a bug that prevents it working with non-ASCII filenames, and I ha..

Closing Excel Application using VBA

I have used the following without success. The active workbook closes, indeed, but the excel window remains open. Application.ActiveWindow.Close SaveChanges:=False ActiveWorkbook.Close SaveChanges:=F..

Encoding Error in Panda read_csv

I'm attempting to read a CSV file into a Dataframe in Pandas. When I try to do that, I get the following error: UnicodeDecodeError: 'utf-8' codec can't decode byte 0x96 in position 55: invalid sta..

Passing a string with spaces as a function argument in bash

I'm writing a bash script where I need to pass a string containing spaces to a function in my bash script. For example: #!/bin/bash myFunction { echo $1 echo $2 echo $3 } myFunction "f..

jQuery CSS Opacity

What's wrong? I want to change the opacity if #nav .drop is display:block; jQuery(document).ready(function(){ if (jQuery('#nav .drop').css('display') === 'block') { jQuery('#main').css('o..

How do I display Ruby on Rails form validation error messages one at a time?

I'm trying to understand how I can achieve this. Can anyone advise me or point me in the right direction? What I currently do, which is shown in the code snippet below, allows me to display 1 error f..

How to take screenshot of a div with JavaScript?

I am building something called the "HTML Quiz". It's completely ran on JavaScript and it's pretty cool. At the end, a results box pops up that says "Your Results:" and it shows how much time they too..

What are the differences between git remote prune, git prune, git fetch --prune, etc

My situation is this... someone working on the same repo has deleted a branch from his local & remote repo... Most people who have asked about this kind of problem on Stack Overflow, or other sit..

SQL Server Management Studio missing

i just installed sql server 2008 r2 and SQL Server Management Studio. After installation i found that the SQL Server Management Studio has not been installed. i wanted to install SQL Server Managemen..

SQL Server® 2016, 2017 and 2019 Express full download

All previous version of SQL Server Express were available in both web and full downloads. But I cannot find full download of SQL Server® 2016 Express. Does it exist? Asked the same question on MSDN ..

Programmatically set the initial view controller using Storyboards

How do I programmatically set the InitialViewController for a Storyboard? I want to open my storyboard to a different view depending on some condition which may vary from launch to launch...

Get absolute path of initially run script

I have searched high and low and get a lot of different solutions and variables containing info to get the absolute path. But they seem to work under some conditions and not under others. Is there o..

Git Clone - Repository not found

git clone <url> gives the message fatal: repository 'url' not found I tried the options in the link, but it didn't work. ..

How to compare two date values with jQuery

I have two String fields which represent Dates in my page and I would like to compare these two fields to know if my first date < second date. How can I do this? <tr> <td align="right..

How do you add an ActionListener onto a JButton in Java

private JButton jBtnDrawCircle = new JButton("Circle"); private JButton jBtnDrawSquare = new JButton("Square"); private JButton jBtnDrawTriangle = new JButton("Triangle"); private JButton jBtnSelectio..

How do I verify that an Android apk is signed with a release certificate?

How can I check that an Android apk is signed with a release and not debug cert?..

Generate fixed length Strings filled with whitespaces

I need to produce fixed length string to generate a character position based file. The missing characters must be filled with space character. As an example, the field CITY has a fixed length of 15 ..

How to subtract/add days from/to a date?

I'm trying to build folders to store data pulls. I want to label the folders with the day of that data in the pull. Ex. I pull 5 days ago data from mysql i want to name the folder the date from 5 day..

How to remove last n characters from every element in the R vector

I am very new to R, and I could not find a simple example online of how to remove the last n characters from every element of a vector (array?) I come from a Java background, so what I would like to..

How to select ALL children (in any level) from a parent in jQuery?

I have to .unbind() all elements from a parent node. How can I select all children (at any level) from a parent? Tried : $('#google_translate_element *').unbind('click'); but it works only for th..

include external .js file in node.js app

I have an app.js node application. As this file is starting to grow, I would like to move some part of the code in some other files that I would "require" or "include" in the app.js file. I'm trying ..

XAMPP - Error: MySQL shutdown unexpectedly

I have reinstalled XAMPP for some reason and MySQL is not working, giving the following error in the console: 01:56:03 [mysql] Error: MySQL shutdown unexpectedly. 01:56:03 [mysql] This may be d..

How to read fetch(PDO::FETCH_ASSOC);

I am trying to build a web application using PHP and I am using memcached for storing user data from the DB. For example lets say that I have this code: $sql = "SELECT * FROM users WHERE user_id..

For div to extend full height

Is there a method I can use for a div to extend to full height? I've got a sticky footer in it as well. Here's the web page: Website removed. The middle bit I'm talking about is the white div, midcon..

Can't use SURF, SIFT in OpenCV

I'm trying a simple thing like detector = cv2.SIFT() and get this bad error detector = cv2.SIFT() AttributeError: 'module' object has no attribute 'SIFT' I do not understand that because cv2 is ..

Easy way to print Perl array? (with a little formatting)

Is there an easy way to print out a Perl array with commas in between each element? Writing a for loop to do it is pretty easy but not quite elegant....if that makes sense...

Write to CSV file and export it?

In C# ASP.net, could someone show me how I can write entries from an Array/List to a CSV file on the server and then open the file? I think the second part would be something like - Response.Redirect(..

How to edit binary file on Unix systems

On Windows machines there are lots of third party editors available to edit a binary file. Any idea how can I edit a binary file on Unix system?..

Bootstrap 4: responsive sidebar menu to top navbar

So I've been searching and searching for guidance in this with no avail. Basically, I just want to have a sidebar, but when the screen gets small, aka smartphones screen size, it transforms into a na..

How to get Current Timestamp from Carbon in Laravel 5

I want to get current timestamp in laravel 5 and I have done this- $current_time = Carbon\Carbon::now()->toDateTimeString(); I am getting eror- 'Carbon not found'- What can I do? Can anyone ..

"call to undefined function" error when calling class method

this is the error Fatal error: Call to undefined function assign( this is the code, as you can see i obviously have defined the function so why is it not working class shades { function create($n..

PermGen elimination in JDK 8

I have installed JDK 8 and trying to run Eclipse. I am getting following warning message: Java HotSpot(TM) 64-Bit Server VM warning: ignoring option MaxPermSize=512m; support was removed in 8.0 Wh..

Can I have multiple Xcode versions installed?

Is it possible to have more than one version of Xcode installed at the same time? If so, please post any tip, tricks, or potential issues to watch out for. EDIT: The reason I want to install multi..

Plot width settings in ipython notebook

I've got the following plots: It would look nicer if they have the same width. Do you have any idea how to do it in ipython notebook when I am using %matplotlib inline? UPDATE: To generate both f..

How do you uninstall MySQL from Mac OS X?

I accidentally installed the PowerPC version of MySQL on my Intel Mac in Snow Leopard, and it installed without a problem but of course doesn't run properly. I just didn't pay enough attention. Now wh..

LIKE vs CONTAINS on SQL Server

Which one of the following queries is faster (LIKE vs CONTAINS)? SELECT * FROM table WHERE Column LIKE '%test%'; or SELECT * FROM table WHERE Contains(Column, "test"); ..

How to disable submit button once it has been clicked?

I have a submit button at the end of the form. I have added the following condition to the submit button: onClick="this.disabled=true; this.value='Sending…'; this.form.submit();" But when it mov..

How to enter a multi-line command

Is it possible to split a PowerShell command line over multiple lines? In Visual Basic I can use the underscore (_) to continue the command in the next line...

Remove duplicates in the list using linq

I have a class Items with properties (Id, Name, Code, Price). The List of Items is populated with duplicated items. For ex.: 1 Item1 IT00001 $100 2 Item2 IT0000..

Using LIKE in an Oracle IN clause

I know I can write a query that will return all rows that contain any number of values in a given column, like so: Select * from tbl where my_col in (val1, val2, val3,... valn) but if val1, for exa..

sweet-alert display HTML code in text

I am using sweet-alert plugin to display an alert. With a classical config (defaults), everything goes OK. But when I want to add a HTML tag into the TEXT, it display <b>...</b> without ma..

Return back to MainActivity from another activity

The MainActivity contains some buttons. Each button opens a new activity via an intent. These activities then have a button to return to the MainActivity via an intent. But when I press a button to r..

Git diff -w ignore whitespace only at start & end of lines

I love to use git diff -w to ignore whitespace differences. But, I just noticed that it ignores even whitespace differences in the middle of lines. How could I only ignore whitespace differences that ..

Homebrew install specific version of formula?

How do I install a specific version of a formula in homebrew? For example, postgresql-8.4.4 instead of the latest 9.0...

Parse JSON in C#

I'm trying to parse some JSON data from the Google AJAX Search API. I have this URL and I'd like to break it down so that the results are displayed. I've currently written this code, but I'm pretty lo..

Error when trying to access XAMPP from a network

I get following error when trying to access Xampp from a network I've tried but does not get any idea how to resolve it. Any help??I really confused Access Forbidden : Access to the requested Object ..

Random date in C#

I'm looking for some succinct, modern C# code to generate a random date between Jan 1 1995 and the current date. I'm thinking some solution that utilizes Enumerable.Range somehow may make this more s..

Least common multiple for 3 or more numbers

How do you calculate the least common multiple of multiple numbers? So far I've only been able to calculate it between two numbers. But have no idea how to expand it to calculate 3 or more numbers. ..

How to open a file for both reading and writing?

Is there a way to open a file for both reading and writing? As a workaround, I open the file for writing, close it, then open it again for reading. But is there a way to open a file for both reading ..

How to check programmatically if an application is installed or not in Android?

We have installed applications programmatically. If the application is already installed in the device the application is open automatically. Otherwise install the particular application. Guide Me..

Open another page in php

Possible Duplicate: PHP page redirect how do i redirect to another page in php, once a process is finished. for example my <form> tag sets the action attribute to "process.php". Afte..

What is the difference between Hibernate and Spring Data JPA

What are the main differences between Hibernate and Spring Data JPA? When should we not use Hibernate or Spring Data JPA? Also, when may Spring JDBC template perform better than Hibernate / Spring Dat..

What is a 'multi-part identifier' and why can't it be bound?

I continually get these errors when I try to update tables based on another table. I end up rewriting the query, change the order of joins, change some groupings and then it eventually works, but I ju..

Create PostgreSQL ROLE (user) if it doesn't exist

How do I write an SQL script to create a ROLE in PostgreSQL 9.1, but without raising an error if it already exists? The current script simply has: CREATE ROLE my_user LOGIN PASSWORD 'my_password'; ..

How to make sure that a certain Port is not occupied by any other process

I am working on a Java EE Application in a Windows environment. (I am using Windows 7) I am using Tomcat Server, unfortunately port number 8080 is busy (used by Oracle). Now I want to assign a differ..

How do you convert CString and std::string std::wstring to each other?

CString is quite handy, while std::string is more compatible with STL container. I am using hash_map. However, hash_map does not support CStrings as keys, so I want to convert the CString into a std::..

Python: instance has no attribute

I have a problem with list within a class in python. Here's my code : class Residues: def setdata(self, name): self.name = name self.atoms = list() a = atom C = Residues() C.atom..

Build an iOS app without owning a mac?

Please correct me if I'm wrong. I'm new to mobile development and I would like to develop an app to submit to the apple store. But I am heavily discouraged by the prices of the macs that I am develo..

How to display special characters in PHP

I've seen this asked several times, but not with a good resolution. I have the following string: $string = "<p>Résumé</p>"; I want to print or echo the string, but the output will ret..

Number of rows affected by an UPDATE in PL/SQL

I have a PL/SQL function (running on Oracle 10g) in which I update some rows. Is there a way to find out how many rows were affected by the UPDATE? When executing the query manually it tells me how ma..

How do I get extra data from intent on Android?

How can I send data from one activity (intent) to another? I use this code to send data: Intent i=new Intent(context,SendMessage.class); i.putExtra("id", user.getUserAccountId()+""); i.putExtra("nam..

How to import image (.svg, .png ) in a React Component

I am trying to import an image file in one of my react component. I have the project setup with web pack Here's my code for the component import Diamond from '../../assets/linux_logo.jpg'; export..

Insertion Sort vs. Selection Sort

I am trying to understand the differences between Insertion Sort and Selection Sort. They both seem to have two components: an unsorted list and a sorted list. They both seem to take one element from..

How to replace (or strip) an extension from a filename in Python?

Is there a built-in function in Python that would replace (or remove, whatever) the extension of a filename (if it has one)? Example: print replace_extension('/home/user/somefile.txt', '.jpg') In my ..

Simple example for Intent and Bundle

I'm new to android with almost no knowledge about Java and XML. I'm learning it through pdfs that i'm getting on net. I have learnt about Toast, a bit about Intents but me not able to understand anyth..

How to run a shell script at startup

On an Amazon S3 Linux instance, I have two scripts called start_my_app and stop_my_app which start and stop forever (which in turn runs my Node.js application). I use these scripts to manually start a..

How to convert index of a pandas dataframe into a column?

This seems rather obvious, but I can't seem to figure out how to convert an index of data frame to a column? For example: df= gi ptt_loc 0 384444683 593 1 384444684 594..

How to select Python version in PyCharm?

I have PyCharm 1.5.4 and have used the "Open Directory" option to open the contents of a folder in the IDE. I have Python version 3.2 selected (it shows up under the "External Libraries" node). How ..

How to retrieve field names from temporary table (SQL Server 2008)

I'm using SQL Server 2008. Say I create a temporary table like this one: create table #MyTempTable (col1 int,col2 varchar(10)) How can I retrieve the list of fields dynamically? I would like to see..

How do I get the MAX row with a GROUP BY in LINQ query?

I am looking for a way in LINQ to match the follow SQL Query. Select max(uid) as uid, Serial_Number from Table Group BY Serial_Number Really looking for some help on this one. The above query gets..

How to create file execute mode permissions in Git on Windows?

I use Git in Windows, and want to push the executable shell script into git repo by one commit. Usually I need to do two steps (git commit). $ vi install.sh $ git add install.sh $ git commit -am "..

jQuery multiselect drop down menu

I have a simple html multi select drop down list: <select id="transactionType" multiple="multiple" size="10"> <option value="ALLOC">ALLOC</option> <option value="LOAD1">LO..

Building with Lombok's @Slf4j and Intellij: Cannot find symbol log

I have a maven project that builds with no problems from the command line. However, when I build it with IntelliJ, I get the error: java: FileName.java:89: cannot find symbol symbol : variable log ..

Ubuntu: OpenJDK 8 - Unable to locate package

So I just installed Ubuntu, and this is my first time working in a Linux environment, so bear with my noobishness here. Anyway, I downloaded the Java 8 JDK directly from Oracle, but I understand ther..

Looping through all rows in a table column, Excel-VBA

I'm currently working on a data set which is formatted as a table, with headers. What I need to do is cycle through all cells in a specific column and change the contents. Through research on MSDN I..

Trying to get the average of a count resultset

I have the following SQL:(bitemp) SELECT COUNT (*) AS Count FROM Table T WHERE (T.Update_time = (SELECT MAX (B.Update_time ) FROM Table B WHERE (B.Id = T.Id))..

Why I've got no crontab entry on OS X when using vim?

I would like to use cron on my Mac. I choose it over launchd, because I want to be able to use my new knowledge on Linux as well. However, I cannot seem to get the crontab -e command to work. It fires..

CRC32 C or C++ implementation

I'm looking for an implementation of CRC32 in C or C++ that is explicitly licensed as being no cost or public domain. The implementation here seems nice, but the only thing it says about the license ..

How to save a BufferedImage as a File

I am using the imgscalr Java library to resize an image . The result of a resize() method call is a BufferedImage object. I now want to save this as a file (usually .jpg). How can I do that? I want ..

Add text at the end of each line

I'm on Linux command line and I have file with 127.0.0.1 128.0.0.0 121.121.33.111 I want 127.0.0.1:80 128.0.0.0:80 121.121.33.111:80 I remember my colleagues were using sed for that, but after r..

How to calculate distance from Wifi router using Signal Strength?

I would like to calculate the exact location of a mobile device inside a building ( so no GPS access) I want to do this using the signal strength(in dBm) of at least 3 fixed wifi signals(3 fixed rout..

"Unable to find remote helper for 'https'" during git clone

I am unable to clone HTTPS repositories. I can clone SSH repos fine, but not HTTPS repos. I cannot test the GIT protocol since I am behind a corporate firewall. This is what I am trying to do: $ git..

Server Discovery And Monitoring engine is deprecated

I am using Mongoose with my Node.js app and this is my configuration: mongoose.connect(process.env.MONGO_URI, { useNewUrlParser: true, useUnifiedTopology: true, useCreateIndex: true, use..

VBA: activating/selecting a worksheet/row/cell

Hello Stackoverflowers, I'm trying to use a button, that first goes to another excel file in a specific directory. While performing something, I want to add a row in a sheet the excel file i'm runnin..

filters on ng-model in an input

I have a text input and I don't want to allow users to use spaces, and everything typed will be turned into lowercase. I know I'm not allowed to use filters on ng-model eg. ng-model='tags | lowercas..

Excel 2010 VBA - Close file No Save without prompt

I want to close a Excel 2010 file with VBA.. but when the code runs, it shows a prompt confirmation.... i dont want to see this prompt.. didnt work: Application.DisplayAlerts = False ActiveWorkbook..

What's the best way to make a d3.js visualisation layout responsive?

Assume I have a histogram script that builds a 960 500 svg graphic. How do I make this responsive so on resize the graphic widths and heights are dynamic? <script> var n = 10000, // number of..

Append column to pandas dataframe

This is probably easy, but I have the following data: In data frame 1: index dat1 0 9 1 5 In data frame 2: index dat2 0 7 1 6 I want a data frame with the following form: index..

jQuery: how to get which button was clicked upon form submission?

I have a .submit() event set up for form submission. I also have multiple forms on the page, but just one here for this example. I'd like to know which submit button was clicked without applying a ...

How do I collapse sections of code in Visual Studio Code for Windows?

How do I fold or collapse sections of code in Visual Studio Code? Is this feature supported?..

Generic List - moving an item within the list

So I have a generic list, and an oldIndex and a newIndex value. I want to move the item at oldIndex, to newIndex...as simply as possible. Any suggestions? Note The item should be end up between th..

Fastest way to extract frames using ffmpeg?

Hi I need to extract frames from videos using ffmpeg.. Is there a faster way to do it than this: ffmpeg -i file.mpg -r 1/1 $filename%03d.jpg ?..

Programmatically scroll to a specific position in an Android ListView

How can I programmatically scroll to a specific position in a ListView? For example, I have a String[] {A,B,C,D....}, and I need to set the top visible item of the ListView to the index 21 of my Stri..

Running a command in a new Mac OS X Terminal window

I've been trying to figure out how to run a bash command in a new Max OS X Terminal.app window. As, an example, here's how I would run my command in a new bash process: bash -c "my command here" Bu..

How to start a stopped Docker container with a different command?

I would like to start a stopped Docker container with a different command, as the default command crashes - meaning I can't start the container and then use 'docker exec'. Basically I would like to ..

count files in specific folder and display the number into 1 cel

I am trying to know how many files there are in 1 specific folder with .xls extension. I read hundreds of examples with message boxes, but that is not what I'm looking for. I just want to have the num..

React-Router: No Not Found Route?

Consider the following: var AppRoutes = [ <Route handler={App} someProp="defaultProp"> <Route path="/" handler={Page} /> </Route>, <Route handler={App} so..

How can I give the Intellij compiler more heap space?

When I make an Intellij project, I keep getting the following out of memory error. I already increased my heap size in idea.vmoptions: -Xms128m -Xmx2048m -XX:MaxPermSize=1024m -XX:ReservedCodeCache..

RESTful call in Java

I am going to make a RESTful call in Java. However, I don't know how to make the call. Do I need to use the URLConnection or others? Can anyone help me. thank you...

Embed website into my site

What I am trying to do is embed a website into mine. When you search something on their page their embed site redirects through their pages though it will still be on my web page. Any help will be app..

How can I check if an argument is defined when starting/calling a batch file?

I'm trying to use the following validation logic in a batch file but the "usage" block never executes even when no parameter is supplied to the batch file. if ("%1"=="") goto usage @echo This should..

Set EditText cursor color

I am having this issue where I am using the Android's Holo theme on a tablet project. However, I have a fragment on screen which has a white background. I am adding an EditText component on this fragm..

FirstOrDefault: Default value other than null

As I understand it, in Linq the method FirstOrDefault() can return a Default value of something other than null. What I haven't worked out is what kind of things other than null can be returned by th..

Laravel 5 call a model function in a blade view

I want to build a blade view from 3 tables: "inputs_details" - fields: article_type (values: 'p' for product,'s' for service), article_id, .... "products" - fields: id, name "services" - fields: id,..

Where do I call the BatchNormalization function in Keras?

If I want to use the BatchNormalization function in Keras, then do I need to call it once only at the beginning? I read this documentation for it: http://keras.io/layers/normalization/ I don't see w..

How to start new line with space for next line in Html.fromHtml for text view in android

Could anyone tell me how to start new line with space for next line in Html.fromHtml for text view in android? I used <br> tag for next line; I can't achieve to give space because &nbsp; wi..

Comparing two dictionaries and checking how many (key, value) pairs are equal

I have two dictionaries, but for simplification, I will take these two: >>> x = dict(a=1, b=2) >>> y = dict(a=2, b=2) Now, I want to compare whether each key, value pair in x has ..

SQL select * from column where year = 2010

This is probably a simple where clause but I want to say, from columnX (which is datetime) I want all rows where just the year = 2010. so: select * from mytable where Columnx = ..

How to make Apache serve index.php instead of index.html?

If I put the following line in a index.html file, to make Apache include the index.php file: <?php include("/Live/ls_client/index.php"); ?> visiting the index.html page shows me this: ..

ImportError: No module named pip

OS: Mac OS X 10.7.5 Python Ver: 2.7.5 I have installed setuptools 1.0 with ez_setup.py from https://pypi.python.org/pypi/setuptools Then I download pip.1.4.1 pkg from https://pypi.python.org/pypi/pi..

How do I compare two DateTime objects in PHP 5.2.8?

Having a look on the PHP documentation, the following two methods of the DateTime object would both seem to solve my problem: DateTime::diff : Get the difference and use that to determine which is m..

TensorFlow not found using pip

I'm trying to install TensorFlow using pip: $ pip install tensorflow --user Collecting tensorflow Could not find a version that satisfies the requirement tensorflow (from versions: ) No matching dist..

How to add additional libraries to Visual Studio project?

Allergro is an open souce C++ addon library for graphics manipulation. How do I add this library to my compiler? The instructions don't work for me as I have Windows 7. I don't know if the OS matters..

How can I create a two dimensional array in JavaScript?

I have been reading online and some places say it isn't possible, some say it is and then give an example and others refute the example, etc. How do I declare a 2 dimensional array in JavaScript? (..

How to extract or unpack an .ab file (Android Backup file)

I am running an android 4.0.3 device, and I want to extract the back up file created by : adb backup -f ~/data.ab -noapk app.package.name The above line works inside the CMD (windows) and I am able..

Hibernate: How to set NULL query-parameter value with HQL?

How can I set a Hibernate Parameter to "null"? Example: Query query = getSession().createQuery("from CountryDTO c where c.status = :status and c.type =:type") .setParameter("status", status, Hiberna..

How to bind bootstrap popover on dynamic elements

I'm using Twitter Bootstrap's popover on the dynamic list. The list item has a button, when I click the button, it should show up popover. It works fine when I tested on non-dynamic. this is my Jav..

Blur or dim background when Android PopupWindow active

I would like to be able to either blur or dim the background when I show my popup window using popup.showAtLocation, and unblur/dim the background when popup.dismiss is called. I have tried applying ..

Java: Multiple class declarations in one file

In Java, you can define multiple top level classes in a single file, providing that at most one of these is public (see JLS §7.6). See below for example. Is there a tidy name for this technique (a..

SVG gradient using CSS

I'm trying to get a gradient applied to an SVG rect element. Currently, I'm using the fill attribute. In my CSS file: rect { cursor: pointer; shape-rendering: crispEdges; fill: #a71a2e; ..

python: get directory two levels up

Ok...I dont know where module x is, but I know that I need to get the path to the directory two levels up. So, is there a more elegant way to do: import os two_up = os.path.dirname(os.path.dirname(_..

Display progress bar while doing some work in C#?

I want to display a progress bar while doing some work, but that would hang the UI and the progress bar won't update. I have a WinForm ProgressForm with a ProgressBar that will continue indefinitely ..

How to retrieve an Oracle directory path?

I created the following Oracle Directory csvDir: create or replace directory csvDir as 'd:\oracle\oradata\external_data\downloadedFiles'; Now, how can I retrieve the path from this csvDir alias? ..

How to use jQuery to get the current value of a file input field

From what I've ready you should be able to use the 'value' property of a file input field to get the currently set path of that field. But when I do this: $('#fileinput').value() I get 'undefined..

position fixed is not working

I have the following html... <div class="header"></div> <div class="main"></div> <div class="footer"></div> And following css... .header{ position: fixed; backg..

Finding duplicate integers in an array and display how many times they occurred

I'm working on a code that prints out duplicated integers from an array with the number of their occurrence. I'm not allowed to use LINQ, just a simple code. I think I'm so close but confused about ho..

package javax.servlet.http does not exist

I have the jre7 and jdk1.7.0 installed along with the Tomcat 7.0 but it shows this error. servlet.http is not the only one that "does not exist", there are also other (servlet.) components. Can anybo..

How to redirect stdout to both file and console with scripting?

I want to run a python script and capture the output on a text file as well as want to show on console. I want to specify it as a property of the python script itself. NOT to use the command echo "h..

Vibrate and Sound defaults on notification

I'm trying to get a default vibrate and sound alert when my notification comes in, but so far no luck. I imagine it's something to do with the way I set the defaults, but I'm unsure of how to fix it. ..

How to commit changes to a new branch

I just made changes to a branch. How can I commit the changes to the other branch? I am trying to use: git checkout "the commmit to the changed branch" -b "the other branch" However, I don't think..

How can I do an OrderBy with a dynamic string parameter?

I want to do this: var orderBy = "Nome, Cognome desc"; var timb = time.Timbratures.Include("Anagrafica_Dipendente") .Where(p => p.CodDipendente == 1); if(orderBy != "") timb = timb.Order..

System.drawing namespace not found under console application

I selected console application as my C# project. But the imports that seemed to work under windows form project doesnt seem to work here. It says that the drawing namespace does not exist. using Syst..

What's the purpose of git-mv?

From what I understand, Git doesn't really need to track file rename/move/copy operations, so what's the real purpose of git mv? The man page isn't specially descriptive... Is it obsolete? Is it an in..

how to use php DateTime() function in Laravel 5

I am using laravel 5. I have try to use the $now = DateTime(); $timestamp = $now->getTimestamp(); But it shows error likes this. FatalErrorException in ProjectsController.php line 70: Call ..

Use SQL Server Management Studio to connect remotely to an SQL Server Express instance hosted on an Azure Virtual Machine

Initial Attempt I have an Azure VM with Windows Server 2012, on which I just installed SQL Server 2012 Express Database Engine component. Then, I followed the instructions here to connect remotely wi..

What does Include() do in LINQ?

I tried to do a lot of research but I'm more of a db guy - so even the explanation in the MSDN doesn't make any sense to me. Can anyone please explain, and provide some examples on what Include() stat..

Check if an element contains a class in JavaScript?

Using plain JavaScript (not jQuery), Is there any way to check if an element contains a class? Currently, I'm doing this: _x000D_ _x000D_ var test = document.getElementById("test");_x000D_ var testC..

How to remove an element from an array in Swift

How can I unset/remove an element from an array in Apple's new language Swift? Here's some code: let animals = ["cats", "dogs", "chimps", "moose"] How could the element animals[2] be removed from ..

Laravel 5 not finding css files

I've just installed a Laravel 5 project on MAMP and my pages are not finding the css files. This is the link to my css in my app.blade.php file: <link href="/css/app.css" rel="stylesheet"> A..

Seeing the underlying SQL in the Spring JdbcTemplate?

I am learning about the wonders of JdbcTemplate and NamedParameterJdbcTemplate. I like what I see, but is there any easy way to see the underlying SQL that it ends up executing? I'd like to see this f..

C# - How to get Program Files (x86) on Windows 64 bit

I'm using: FileInfo( System.Environment.GetFolderPath( System.Environment.SpecialFolder.ProgramFiles) + @"\MyInstalledApp" In order to determine if a program is detected on a users..

How to add RSA key to authorized_keys file?

I've created an RSA public key and I want to add that to authorized_keys file, but there is no such file in my Ubuntu 11.10 machine. How can I add the key to authorized_keys?..

Padding characters in printf

I am writing a bash shell script to display if a process is running or not. So far, I got this: printf "%-50s %s\n" $PROC_NAME [UP] The code gives me this output: JBoss ..

What does "use strict" do in JavaScript, and what is the reasoning behind it?

Recently, I ran some of my JavaScript code through Crockford's JSLint, and it gave the following error: Problem at line 1 character 1: Missing "use strict" statement. Doing some searching, I rea..

Getting list of tables, and fields in each, in a database

I'm looking at creating a basic ORM (purely for fun), and was wondering, is there a way to return the list of tables in a database and also the fields for every table? Using this, I want to be able t..

C# "as" cast vs classic cast

Possible Duplicate: Casting vs using the ‘as’ keyword in the CLR I recently learned about a different way to cast. Rather than using SomeClass someObject = (SomeClass) obj; one can u..

Getting a UnhandledPromiseRejectionWarning when testing using mocha/chai

So, I'm testing a component that relies on an event-emitter. To do so I came up with a solution using Promises with Mocha+Chai: it('should transition with the correct event', (done) => { const cF..

Typescript - multidimensional array initialization

I'm playing with Typescript and I wonder, how to properly instantiate and declare multidimensional array. Here's my code: class Something { private things: Thing[][]; constructor() { ..

powershell 2.0 try catch how to access the exception

This is the try catch in PowerShell 2.0 $urls = "http://www.google.com", "http://none.greenjump.nl", "http://www.nu.nl" $wc = New-Object System.Net.WebClient foreach($url in $urls) { try { ..

MySQL/Writing file error (Errcode 28)

I have the following error with one of our web applications - Query3 failed: Error writing file '/tmp/MY1fnqpm' (Errcode: 28) ... INSERT MailList... (removed the rest of the query for security reaso..

Is there a Wikipedia API?

On my Wikipedia user page, I run a Wikipedia script that displays my statistics (number of pages edited, number of new pages, monthly activity, etc.). I'd like to put this information on my blog. I..

python pip - install from local dir

I have to download a git python repo and install since the pypi version is not updated. Normally I would do this: pip install mypackage pip install mypackage[redis] Now I have the repo cloned in t..

Angular - Can't make ng-repeat orderBy work

I've tried many examples of ng-repeat with orderBy, but I can't make my json work with it. <div ng-app> <script type="text/javascript" src="http://code.angularjs.org/1.0.1/angular-1.0.1...

$(this).serialize() -- How to add a value?

currently I have the following: $.ajax({ type: 'POST', url: this.action, data: $(this).serialize(), }); This works fine, however I would like to add a value to data, so I tried $.ajax(..

Press Keyboard keys using a batch file

I am trying to develop a batch file which can automatically press left arrow and right arrow key for n number of times with some pause in between. Could anybody please help me with this? P.S: I tried..

Pandas DataFrame column to list

I am pulling a subset of data from a column based on conditions in another column being met. I can get the correct values back but it is in pandas.core.frame.DataFrame. How do I convert that to list..

How do I disable a href link in JavaScript?

I have a tag <a href="#"> Previous </a> 1 2 3 4 <a href="#"> Next </a> and in some conditions I want this tag to be completely disabled. Code from comments (this is how the li..

Entity Framework Query for inner join

What would be the query for: select s.* from Service s inner join ServiceAssignment sa on sa.ServiceId = s.Id where sa.LocationId = 1 in entity framework? This is what I wrote: var serv = (fro..

How to convert PDF files to images

I need to convert PDF files to images. If the PDF file is multi-page,I just need one image that contains all of the PDF pages. Is there an open source solution which is not charged like the Acrobat p..