Questions Tagged with #Lidar data


Quickly reading very large tables as dataframes

I have very large tables (30 million rows) that I would like to load as a dataframes in R. read.table() has a lot of convenient features, but it seems like there is a lot of logic in the implementati..

Bootstrap 4, How do I center-align a button?

<div class="container"> <div class="row"> <div class="col-xs-12 col-sm-12 col-md-8"> <div v-for="job in job"> <div class="text-center"> <..

Upload Image using POST form data in Python-requests

I'm working with wechat APIs ... here I've to upload an image to wechat's server using this API url = 'http://file.api.we..

how to loop through json array in jquery?

I have a php page from which I get response in json: [{'com':'something'},{'com':'some other thing'}] I want to loop it and append each to a div. This is what I tried: var obj = jQuery.parseJSON(..

SQL-Server: Is there a SQL script that I can use to determine the progress of a SQL Server backup or restore process?

When I backup or restore a database using MS SQL Server Management Studio, I get a visual indication of how far the process has progressed, and thus how much longer I still need to wait for it to fini..

ng-repeat: access key and value for each object in array of objects

I have an array of objects and I am using an ng-repeat to iterate over them, which is easy. The array looks something like this: $scope.steps = [ {companyName: true}, {businessType: true}, ..

Difference between == and === in JavaScript

What is the difference between == and === in JavaScript? I have also seen != and !== operators. Are there more such operators?..

What are the First and Second Level caches in (N)Hibernate?

Can anyone explain in simple words what First and Second Level caching in Hibernate/NHibernate are?..

how to emulate "insert ignore" and "on duplicate key update" (sql merge) with postgresql?

Some SQL servers have a feature where INSERT is skipped if it would violate a primary/unique key constraint. For instance, MySQL has INSERT IGNORE. What's the best way to emulate INSERT IGNORE and ON..

Doctrine 2: Update query with query builder

Hi I've got the following query but it doesn't seem to work. $q = $this->em->createQueryBuilder() ->update('models\User', 'u') ->set('u.username', $username) ->set('

Should composer.lock be committed to version control?

I'm a little confused with composer.lock used in an application with a repository. I saw many people saying that we should not .gitignore composer.lock from the repository. If I update my libraries ..

tsc is not recognized as internal or external command

I updated from VSCode 0.10.6 to 0.10.8, and tried using Typescript for the first time. Unfortunately I when I tell VSCode to build, I get the error: tsc is not a recognized as an internal or externa..

Validate select box

I'm using the jQuery plugin Validation to validate a form. I have a select list looking like this: <select id="select"> <option value="">Choose an option</option> <option value="..

Is there a way to get rid of accents and convert a whole string to regular letters?

Is there a better way for getting rid of accents and making those letters regular apart from using String.replaceAll() method and replacing letters one by one? Example: Input: orcpžsíáýd Output..

Pretty-Printing JSON with PHP

I'm building a PHP script that feeds JSON data to another script. My script builds data into a large associative array, and then outputs the data using json_encode. Here is an example script: $data =..

window.print() not working in IE

I am doing something like this in javascript to print a section of my page on click of a link function printDiv() { var divToPrint = document.getElementById('printArea'); var newWin =

How to do parallel programming in Python?

For C++, we can use OpenMP to do parallel programming; however, OpenMP will not work for Python. What should I do if I want to parallel some parts of my python program? The structure of the code may b..

Deadly CORS when http://localhost is the origin

I am stuck with this CORS problem, even though I set the server (nginx/node.js) with the appropriate headers. I can see in Chrome Network pane -> Response Headers: Access-Control-Allow-Origin:http:/..

What is the boundary in multipart/form-data?

I want to ask a question about the multipart/form-data. In the HTTP header, I find that the Content-Type: multipart/form-data; boundary=???. Is the ??? free to be defined by the user? Or is it gener..

Apply style ONLY on IE

Here is my block of CSS: .actual-form table { padding: 5px 0 15px 15px; margin: 0 0 30px 0; display: block; width: 100%; background: #f9f9f9; border-top: 1px solid #d0d0d0; border-botto..

How to get PID by process name?

Is there any way I can get the PID by process name in Python? PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND ..

Insert current date/time using now() in a field using MySQL/PHP

Since MySQL evidently cannot automatically insert the function now() in a datetime field in adding new records like some other databases, based on comments, I'm explicitly trying to insert it using an..

possibly undefined macro: AC_MSG_ERROR

I have the following in AC_CHECK_PROGS(MAKE,$MAKE make gmake,error) if test "x$MAKE" = "xerror" ;then AC_MSG_ERROR([cannot find a make command]) fi This has been in our project for ..

Simple dynamic breadcrumb

I think this script is of big interest to any noob around here :) including me :) What I want to create is a little code that I can use in any file and will generate a breadcrumb like this: If the f..

Why does git status show branch is up-to-date when changes exist upstream?

Changes exist upstream in a tracked branch, but when I type git status it indicates that my local branch is up-to-date. Is this new behavior, did I change a config setting, or is something wrong? Th..

Change remote repository credentials (authentication) on Intellij IDEA 14

I recently changed my Bitbucket password for security reasons. However, IntelliJ didn't update my repository to the new credentials, so it stops me from pulling/pushing anything to my repository. I am..

How can I see if a Perl hash already has a certain key?

I have a Perl script that is counting the number of occurrences of various strings in a text file. I want to be able to check if a certain string is not yet a key in the hash. Is there a better way of..

JavaScript .replace only replaces first Match

var textTitle = "this is a test" var result = textTitle.replace(' ', '%20'); But the replace functions stops at the first instance of the " " and I get the Result : "this%20is a test" Any ideas o..

Passing parameter to controller from route in laravel

THIS IS A QUESTION FOR LARAVEL 3 Given the following route Route::get('groups/(:any)', array('as' => 'group', 'uses' => 'groups@show')); And the URL I would like to use, http://www.example...

Cut off text in string after/before separator in powershell

Ok so here is what I'm trying to do: I want to make a little powershell script that takes each file of my music library and then does a hash sum of it and writes that into a file like so: test.txt ; ..

Strtotime() doesn't work with dd/mm/YYYY format

I really like the strtotime() function, but the user manual doesn't give a complete description of the supported date formats. strtotime('dd/mm/YYYY') doesn't work, it works only with mm/dd/YYYY forma..

selecting rows with id from another table

Let's call this table terms_relation: +---------+----------+-------------+------------+------------+--+ | term_id | taxonomy | description | created_at | updated_at | | +---------+----------+-------..

Android - Best and safe way to stop thread

I want to know which is the best way to stop a thread in Android. I know I can use AsyncTask instead of it and that there is a cancel() method. I have to use Threads in my situation. Here is how I'm u..


If we have a SELECT statement inside an IF EXISTS, does the execution stop as soon as it finds a record in the table? For example: IF EXISTS(SELECT * FROM table1 WHERE Name='John' ) return 1 els..

MySQL and GROUP_CONCAT() maximum length

I'm using GROUP_CONCAT() in a MySQL query to convert multiple rows into a single string. However, the maximum length of the result of this function is 1024 characters. I'm very well aware that I can ..

What's the difference between "static" and "static inline" function?

IMO both make the function to have a scope of the translation unit only. What's the difference between "static" and "static inline" function? Why should inline be put in a header file, not in .c fil..

Using await outside of an async function

I was attempting to chain two async functions together, because the first had a conditional return parameter that caused the second to either run, or exit the module. However, I've found odd behavior ..

Preventing scroll bars from being hidden for MacOS trackpad users in WebKit/Blink

WebKit/Blink's (Safari/Chrome) default behaviour on MacOS since 10.7 (Mac OS X Lion) is to hide scroll bars from trackpad users when they're not in use. This can be confusing; the scroll bar is often ..

How to get the last N records in mongodb?

I can't find anywhere it has been documented this. By default, the find() operation will get the records from beginning. How can I get the last N records in mongodb? Edit: also I want the returned re..

Pandas: Appending a row to a dataframe and specify its index label

Is there any way to specify the index that I want for a new row, when appending the row to a dataframe? The original documentation provides the following example: In [1301]: df = DataFrame(np.random..

Decompile .smali files on an APK

I downloaded APK Manager that lets me unpack APK files. But it only unpacks it and doesn't decompile the .smali file to .java. Is it possible to decompile the .smali to .java?..

Catching nullpointerexception in Java

I tried using try-catch block to catch NullPointerException but still the following program is giving errors. Am I doing something wrong or is there any other way to catch NullPointerException in the..

Mac SQLite editor

I am aware of CocoaMySQL but I have not seen a Mac GUI for SQLite, is there one? My Google search didn't turn up any Mac related GUI's which is why I'm asking here rather than Google...

You can't specify target table for update in FROM clause

I have a simple mysql table: CREATE TABLE IF NOT EXISTS `pers` ( `persID` int(11) NOT NULL AUTO_INCREMENT, `name` varchar(35) NOT NULL, `gehalt` int(11) NOT NULL, `chefID` int(11) DEFAULT NUL..

Opening a remote machine's Windows C drive

I'm trying to locally mount a machine's C drive that is on my LAN. I need to able to browse the contents of the other machine when tracing through code. I once saw a sys admin do some crazy windows ..

How are software license keys generated?

License keys are the defacto-standard as an anti-piracy measure. To be honest, this strikes me as (in)Security Through Obscurity, although I really have no idea how license keys are generated. What is..

'LIKE ('%this%' OR '%that%') and something=else' not working

I have a select query where I am trying to search strings for multiple patterns LIKE ('%this%' or '%that%' ) and something=else Returns zero results However LIKE '%this%' and something=else re..

Thread Safe C# Singleton Pattern

I have some questions regarding the the singleton pattern as documented here: The following code is an extract from the article: using System; ..

How to return string value from the stored procedure

Alter procedure S_Comp(@str1 varchar(20),@r varchar(100) out) as declare @str2 varchar(100) set @str2 ='welcome to sql server. Sql server is a product of Microsoft' if(PATINDEX('%'+@str1 +'%',@str2)..

Creating a simple XML file using python

What are my options if I want to create a simple XML file in python? (library wise) The xml I want looks like: <root> <doc> <field1 name="blah">some value1</field1> ..

How to print binary number via printf

Possible Duplicate: Is there a printf converter to print in binary format? Here is my program #include<stdio.h> int main () { int i,a=2; i=~a; printf("a=%d\ni=%d\n",a,i); ..

Writing data to a local text file with javascript

I have created a procedure to write content to a text file in my local machine. <form id="addnew"> <input type="text" class="id"> <input type="text" class="content"> <..

SQL time difference between two dates result in hh:mm:ss

I am facing some difficulty with calculating the time difference between two dates. What I want is, I have two dates let say @StartDate = '10/01/2012 08:40:18.000' @EndDate='10/04/2012 09:52:48.000..

Struct inheritance in C++

Can a struct be inherited in C++?..

Python List & for-each access (Find/Replace in built-in list)

I originally thought Python was a pure pass-by-reference language. Coming from C/C++ I can't help but think about memory management, and it's hard to put it out of my head. So I'm trying to think of..

How to delete stuff printed to console by System.out.println()?

In a Java application I'm using some calls to System.out.println(). Now I want to find a way to programmatically delete this stuff. I couldn't find any solution with google, so are there any hints?..

What's the difference between @JoinColumn and mappedBy when using a JPA @OneToMany association

What is the difference between: @Entity public class Company { @OneToMany(cascade = CascadeType.ALL , fetch = FetchType.LAZY) @JoinColumn(name = "companyIdRef", referencedColumnName = "compa..

How to add number of days to today's date?

I need to be able to add 1, 2 , 5 or 10 days to today's date using jQuery...

conditional Updating a list using LINQ

I had a list List<Myclass> li = new List<Myclass>(); where Myclass is class Myclass { public string name {get;set;} public decimal age {get;set;} } items in li looks like i want ..

Psql could not connect to server: No such file or directory, 5432 error?

I'm trying to run psql on my Vagrant machine, but I get this error: psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix doma..

Detecting scroll direction

So I am trying to use the JavaScript on scroll to call a function. But I wanted to know if I could detect the direction of the the scroll without using jQuery. If not then are there any workarounds? ..

Best way to find os name and version in Unix/Linux platform

I need to find the OS name and version on Unix/Linux platform. For this I tried following: lsb_release utility /etc/redhat-release or specific file But it does not seem to be best solution as LSB_..

Best way to select random rows PostgreSQL

I want a random selection of rows in PostgreSQL, I tried this: select * from table where random() < 0.01; But some other recommend this: select * from table order by random() limit 1000; I ha..

Removing App ID from Developer Connection

How do I remove an App ID from the developer program portal area? I mistakenly added a couple of app id's under the wrong login and would like to remove them, but I am not seeing a way to do so...

Setting button text via javascript

I am setting up a button via javascript, but the button shows not the text. Any recommendation on how to fix it? var b = document.createElement('button'); b.setAttribute('content', 'test content');..

How to make a transparent HTML button?

I am using dreamweaver to create a website and I thought of just using Photoshop to create backgrounds. I decided to do so only because in case I'd choose to change the button name easily by just edit..

How to get cell value from DataGridView in VB.Net?

I have a problem, how can i get value from cell of datagridview ---------------------------------- id | p/w | post | ---------------------------------- 1 | 1234 | A ..

Fill remaining vertical space with CSS using display:flex

In a 3-row layout: the top row should be sized according to its contents the bottom row should have a fixed height in pixels the middle row should expand to fill the container The problem is that ..

How to limit file upload type file size in PHP?

I have an upload form and am checking the file size and file type to limit the uploaded file to 2 megabytes and either .pdf, .jpg, .gif or .png file types. My goal is to have an alert message display..

What are enums and why are they useful?

Today I was browsing through some questions on this site and I found a mention of an enum being used in singleton pattern about purported thread safety benefits to such solution. I have never used enu..

Installing Bower on Ubuntu

I'm trying to install Bower on XUbuntu 13.10, following the instructions on the Bower home page, after doing sudo apt-get install npm and sudo npm install -g bower I get the following after issuing bo..

PHP mail function doesn't complete sending of e-mail

<?php $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $from = 'From:'; $to = 'contac[email protected]'; $subject = 'Customer Inquir..

No value accessor for form control with name: 'recipient'

I got this error after upgrading to Angular 2 Rc.5. This is my component template: <md-input [(ngModel)]="recipient" name="recipient" placeholder="Name" class="col-sm-4" (blur)..

Simple JavaScript problem: onClick confirm not preventing default action

I'm making a simple remove link with an onClick event that brings up a confirm dialog. I want to confirm that the user wants to delete an entry. However, it seems that when Cancel is clicked in the di..

Time stamp in the C programming language

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

setting min date in jquery datepicker

Hi i want to set min date in my jquery datepicker to (1999-10-25) so i tried the below code its not working. $(function () { $('#datepicker').datepicker({ dateFormat: 'yy-mm-dd', ..

Reload child component when variables on parent component changes. Angular2

I have a MasterComponent which loads header, footer, sidebar etc. On the header there is a dropdown whose options are set once the user is logged in. I want the header to be constant even if I navigat..

Avoid browser popup blockers

I'm developing an OAuth authentication flow purely in JavaScript and I want to show the user the "grant access" window in a popup, but it gets blocked. How can I prevent pop up windows created by eit..

"Find next" in Vim

To search forward in Vim for cake, I'd type /cake, but the cursor jumps to the first match when I press return. Is there a Vim command analogous to "find next"?..

How can I make Bootstrap 4 columns all the same height?

Disclaimer. This question was asked many times before. But since time has passed and now we are close to Bootstrap 4 release with full flexbox support, it is time for new answers for the same question..

Check if record exists from controller in Rails

In my app a User can create a Business. When they trigger the index action in my BusinessesController I want to check if a Business is related to the If yes: display the business. ..

SQL error "ORA-01722: invalid number"

A very easy one for someone, The following insert is giving me the ORA-01722: invalid number why? INSERT INTO CUSTOMER VALUES (1,'MALADY','Claire','27 Smith St Caulfield','0419 853 694'); INSE..

Extract the first (or last) n characters of a string

I want to extract the first (or last) n characters of a string. This would be the equivalent to Excel's LEFT() and RIGHT(). A small example: # create a string a <- paste('left', 'right', sep = '')..

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

Number of lines in a file in Java

I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file I was wondering if there i..

How do I install PyCrypto on Windows?

I've read every other google source and SO thread, with nothing working. Python 2.7.3 32bit installed on Windows 7 64bit. Download, extracting, and then trying to install PyCrypto results in "Unable ..

Read properties file outside JAR file

I have a JAR file where all my code is archived for running. I have to access a properties file which need to be changed/edited before each run. I want to keep the properties file in the same director..

How to change the background color of the options menu?

I'm trying to change the default color for the options menu which is white: I want a black background for every item on the options menu. I've tried some shoots like android:itemBackground="#000000" ..

iPhone keyboard, Done button and resignFirstResponder

This is probably a dumb question, but I can't find the answer in the docs. Did the "Done" button on the pop-up keyboard always cause the keyboard to disappear? I see a lot of code around the web like ..

Client to send SOAP request and receive response

Trying to create a C# client (will be developed as a Windows service) that sends SOAP requests to a web service (and gets the results). From this question I saw this code: protected virtual WebReque..

How do I determine height and scrolling position of window in jQuery?

I need to grab the height of the window and the scrolling offset in jQuery, but I haven't had any luck finding this in the jQuery docs or Google. I'm 90% certain there's a way to access height and sc..

How to perform a for loop on each character in a string in Bash?

I have a variable like this: words="??????" I want to make a for loop on each of the characters, one at a time, e.g. first character="?", then character="?", character="?", etc. The only way I kno..

What does -> mean in C++?

Possible Duplicates: What is the difference between the dot (.) operator and -> in C++? What is the arrow operator (->) synonym for in C++? The header says it all. What does -> me..

List comprehension on a nested list?

I have this nested list: l = [['40', '20', '10', '30'], ['20', '20', '20', '20', '20', '30', '20'], ['30', '20', '30', '50', '10', '30', '20', '20', '20'], ['100', '100'], ['100', '100', '100', '100'..

How to apply border radius in IE8 and below IE8 browsers?

I would like to know how to apply border-radius to IE8 and below IE8 browsers. I know that border-radius is a HTML5 feature and IE8 doesn't support it. I found that by using .htc we can achieve this..

How do I strip all spaces out of a string in PHP?

How can I strip / remove all spaces of a string in PHP? I have a string like $string = "this is my string"; The output should be "thisismystring" How can I do that?..

How to debug ORA-01775: looping chain of synonyms?

I'm familiar with the issue behind ORA-01775: looping chain of synonyms, but is there any trick to debugging it, or do I just have to "create or replace" my way out of it? Is there a way to query t..

Class JavaLaunchHelper is implemented in two places

Today I upgraded my Intellij Idea on macOS Sierra, and now, when I run apps in console I have this error: objc[3648]: Class JavaLaunchHelper is implemented in both /Library/Java/JavaVirtualMachine..

Detecting input change in jQuery?

When using jquery .change on an input the event will only be fired when the input loses focus In my case, I need to make a call to the service (check if value is valid) as soon as the input value is ..

Replace HTML page with contents retrieved via AJAX

I have an HTML page with a typical structure: <html> <head> <script src="..." ></script> <style>...</style> </head> <body> content <..

How do I pass a URL with multiple parameters into a URL?

Basically I'm trying to pass a URL like this: into a URL like this:

Test if numpy array contains only zeros

We initialize a numpy array with zeros as bellow: np.zeros((N,N+1)) But how do we check whether all elements in a given n*n numpy array matrix is zero. The method just need to return a True if all ..

How to check if an email address exists without sending an email?

I have come across this PHP code to check email address using SMTP without sending an email. Has anyone tried anything similar or does it work for you? Can you tell if an email customer / user enters..

How do I uniquely identify computers visiting my web site?

I need to figure out a way uniquely identify each computer which visits the web site I am creating. Does anybody have any advice on how to achieve this? Because i want the solution to work on all mach..

What's the Android ADB shell "dumpsys" tool and what are its benefits?

I'm looking for the full list of ADB shell dumpsys commands with a full explanation of all of the commands. Where can I find this information?..

yii2 hidden input value

In Yii2 I'm trying to construct hidden input echo $form->field($model, 'hidden1')->hiddenInput()->label(false); But I also need it to have some value option, how can I do that ?..

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

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

What do &lt; and &gt; stand for?

I know that the entities &lt; and &gt; are used for < and >, but I am curious what these names stand for. Does &lt; stand for something like "Left tag" or is it just a code?..

SQLException : String or binary data would be truncated

I have a C# code which does lot of insert statements in a batch. While executing these statements, I got "String or binary data would be truncated" error and transaction roledback. To find out the w..

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

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

What is the best way to know if all the variables in a Class are null?

This would mean that the class was initialized, but the variables were not set. A sample Class: public class User { String id = null; String name = null; public String getId() { ..

Show default value in Spinner in android

I want to show a dropdown for gender selection. I passed a string array as String arr[]=new String[]{"male","female"}; but the problem is that is shows default selection with the value of "male" an..

PHPExcel how to set cell value dynamically

How to set cell/column value dynamically using PHPExcel library? I am fetching result set from MySQL database and I want to write data in excel format using PHPExcel library. Looking at example $ob..

Use of the MANIFEST.MF file in Java

I noticed that JAR, WAR and EAR files have a MANIFEST.MF file under the META-INF folder. What is the use of the MANIFEST.MF file? What all things can be specified in this file?..

Undoing a git rebase

Does anybody know how to easily undo a git rebase? The only way that comes to mind is to go at it manually: git checkout the commit parent to both of the branches then create a temp branch from th..

Assembly - JG/JNLE/JL/JNGE after CMP

I don't understand the JG/JNLE/JL/JNGE instructions, which come after CMP. for example, If I have: CMP al,dl jg label1 When al=101; dl =200. On what we ask the jg? Is it on al>dl? or al-dl>..

How to increase Heap size of JVM

I am getting the following error: Exception in thread "main" java.lang.OutOfMemoryError: Java heap space at SQLite.Vm.step(Native Method) at SQLite.Database.get_table(

Difference between socket and websocket?

I'm building web app that needs to communicate with another application using socket connections. This is new territory for me, so want to be sure that sockets are different than websockets. It seems..

Error - Unable to access the IIS metabase

After installing Visual Studio 2012 and opening my solution I get a series of errors in this form: The Web Application Project Foo is configured to use IIS. Unable to access the IIS Metabase. Yo..

How to Customize a Progress Bar In Android

I am working on an app in which I want to show a ProgressBar, but I want to replace the default Android ProgressBar. So how can I customize the ProgressBar? Do I need some graphics and animation for..

Undefined index with $_POST

I am trying to relearn some PHP basics for making a simple login script, however I get an error I have not received before(I made the same script a little over a year ago and never had this error. I s..

Only on Firefox "Loading failed for the <script> with source"

I want to integrate Marketo form with my existing website on yii framework. My code works on all the browsers except Firefox. Excerpt from my code: $('#button').click(function () { var formD..

-didSelectRowAtIndexPath: not being called

I'm writing an iOS app with a table view inside a tab view. In my UITableViewController, I implemented -tableView:didSelectRowAtIndexPath:, but when I select a row at runtime, the method isn't being c..

Set height of chart in Chart.js

I want to draw a horizontal bar chart with Chart.js but it keeps scaling the chart instead of using the height I assign the canvas form the script. Is there any way to set the height of the graph fro..


I have been given a specification that requires the ISO 8601 date format, does any one know the conversion codes or a way of getting these 2 examples: ISO 8601 Extended Date 2000-01-14T13:42Z ISO 86..

How to convert float to varchar in SQL Server

I have a float column with numbers of different length and I'm trying to convert them to varchar. Some values exceed bigint max size, so I can't do something like this cast(cast(float_field as bigin..

no sqljdbc_auth in java.library.path

I have a Java EE Web Application which connects to a SQL Server 2008 instance. I don't have any problem connecting and retrieving to all my tables, except for one of them. The error in the Tomcat log ..

What's the difference between getRequestURI and getPathInfo methods in HttpServletRequest?

I'm making a simple, very lightweight front-controller. I need to match request paths to different handlers (actions) in order to choose the correct one. On my local machine HttpServletRequest.getPat..

Get current application physical path within Application_Start

I'm not able to get the current physical path within Application_Start using HttpContext.Current.Request.PhysicalApplicationPath because there is no Request object at that time. How else can I ge..

How to search for a string in cell array in MATLAB?

Let's say I have the cell array strs = {'HA' 'KU' 'LA' 'MA' 'TATA'} What should I do if I want to find the index of 'KU'?..

initializing a boolean array in java

I have this code public static Boolean freq[] = new Boolean[Global.iParameter[2]]; freq[Global.iParameter[2]] = false; could someone tell me what exactly i'm doing wrong here and how would i correc..

No module named setuptools

I want to install setup file of twilio. When I install it through given command it is given me an error: No module named setuptools. Could you please let me know what should I do? I am using p..

javascript regex - look behind alternative?

Here is a regex that works fine in most regex implementations: (?<!filename)\.js$ This matches .js for a string which ends with .js except for filename.js Javascript doesn't have regex lookbehi..

How to create CSV Excel file C#?

I'm looking for a class for creating CSV Excel files. Expected features: Extremely simple to use Escapes commas and quotes so excel handles them fine Exports date and datetimes in timezone-proof fo..

static linking only some libraries

How can I statically link only a some specific libraries to my binary when linking with GCC? gcc ... -static ... tries to statically link all the linked libraries, but I haven't got the static versio..

Bitwise operation and usage

Consider this code: x = 1 # 0001 x << 2 # Shift left 2 bits: 0100 # Result: 4 x | 2 # Bitwise OR: 0011 # Result: 3 x & 1 # Bitwise AND: 0001 # Result: 1 I can..

DataTables: Uncaught TypeError: Cannot read property 'defaults' of undefined

When using the Bootstrap integration for DataTables, I see the following error in the console: Uncaught TypeError: Cannot read property 'defaults' of undefined (dataTables.bootstrap.js:20) This caus..

CSS Div Background Image Fixed Height 100% Width

I'm trying to setup a series of div's with a background image that each have their own fixed height, and stretch to fill up the width, even if there is overflow on the top/bottom that is clipped. I j..

No function matches the given name and argument types

My function is: CREATE OR REPLACE FUNCTION FnUpdateSalegtab09 ( iacyrid Integer,iRepId Integer,iDrId Integer,ivrid Integer,imode smallint,itrno varchar,itrdate timestamp,iacid Integer,ivrno varcha..

How do I open port 22 in OS X 10.6.7

I am trying to open port 22 on osx so I can connect to localhost using ssh. This is my current situation: ssh localhost ssh: connect to host localhost port 22: Connection refused I have generated ..

Kubernetes Pod fails with CrashLoopBackOff

I 'm Following this guide in order to set up a pod using minikube and pull an image from a private repository hosted at: When trying to set up a pod to pull the image i see CrashLoopBa..

Prevent multiple instances of a given app in .NET?

In .NET, what's the best way to prevent multiple instances of an app from running at the same time? And if there's no "best" technique, what are some of the caveats to consider with each solution?..

how to check for datatype in node js- specifically for integer

I tried the following to check for the datatype (specifically for integer), but not working. var i = "5"; if(Number(i) = 'NaN') { console.log('This is not number')); } ..

Just get column names from hive table

I know that you can get column names from a table via the following trick in hive: hive> set hive.cli.print.header=true; hive> select * from tablename; Is it also possible to just get the co..

What is the iPad user agent?

From what I gather, the iPad is using iPhone OS, but with a different screen resolution from the iPhone and iPod touch. So many sites may have to change their user agent detection to adapt to the iPad..

WebForms UnobtrusiveValidationMode requires a ScriptResourceMapping for 'jquery'. Please add a ScriptResourceMapping named jquery(case-sensitive)

I'm building a web application using Visual Studio 2012. I'm attempting to add word count into my textbox. However after adding the the javascript codes and the html codes. I receive the error as st..

Disable pasting text into HTML form

Is there a way using JavaScript to disable the ability to paste text into a text field on an HTML form? E.g. I have a simple registration form where the user is required to input their email twice. T..

Best way to add Activity to an Android project in Eclipse?

When adding an activity to an existing Android project, I manually create a new class - is that the best / preferred way? How do others handle that?..

Transfer data from one HTML file to another

I'm new to HTML and JavaScript, what I'm trying to do is from an HTML file I want to extract the things that set there and display it to another HTML file through JavaScript. Here's what I've done so..

I want to multiply two columns in a pandas DataFrame and add the result into a new column

I'm trying to multiply two existing columns in a pandas Dataframe (orders_df) - Prices (stock close price) and Amount (stock quantities) and add the calculation to a new column called 'Value'. For som..

How to remove part of a string before a ":" in javascript?

If I have a string Abc: Lorem ipsum sit amet, how can I use JavaScript/jQuery to remove the string before the : including the :. For example the above string will become: Lorem ipsum sit amet...

Angular2: child component access parent class variable/function

I have a variable in the parent component that might be changed by child, parent will be using this variable in the view and thus has to propagate changes. import {Component, View} from 'angular2/cor..

Multipart File upload Spring Boot

Im using Spring Boot and want to use a Controller to receive a multipart file upload. When sending the file I keep getting the error 415 unsupported content type response and the controller is never r..

Find Oracle JDBC driver in Maven repository

I want to add the oracle jdbc driver to my project as dependency (runtime scope) - ojdbc14. In MVNrepository site the dependency to put in the POM is: <dependency> <groupId>

How can I connect to a Tor hidden service using cURL in PHP?

I'm trying to connect to a Tor hidden service using the following PHP code: $url = 'http://jhiwjjlqpyawmpjx.onion/' $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_RET..

Best way to do a PHP switch with multiple values per case?

How would you do this PHP switch statement? Also note that these are much smaller versions, the 1 I need to create will have a lot more values added to it. Version 1: switch ($p) { case 'hom..

How to call a JavaScript function within an HTML body

I have a JavaScript function that fills a table: <script> var col1 = ["Full time student checking (Age 22 and under) ", "Customers over age 65", "Below $500.00"]; var col2 = ["None", "None", ..

"X does not name a type" error in C++

I have two classes declared as below: class User { public: MyMessageBox dataMsgBox; }; class MyMessageBox { public: void sendMessage(Message *msg, User *recvr); Message receiveMessage(); vec..

How to convert JSON to CSV format and store in a variable

I have a link that opens up JSON data in the browser, but unfortunately I have no clue how to read it. Is there a way to convert this data using JavaScript in CSV format and save it in JavaScript file..

Timer function to provide time in nano seconds using C++

I wish to calculate the time it took for an API to return a value. The time taken for such an action is in the space of nano seconds. As the API is a C++ class/function, I am using the timer.h to cacu..

How to create an alert message in jsp page after submit process is complete

I am trying to add a message in my jsp after the process is done by hitting the submit button. function onSubmit() { alert("Master_Data.xlsx and Consistency_Check_Data.xlsx are located under d:/stage..

Does Java have something like C#'s ref and out keywords?

Something like the following: ref example: void changeString(ref String str) { str = "def"; } void main() { String abc = "abc"; changeString(ref abc); System.out.println(abc); //pri..

How do you make an element "flash" in jQuery

I'm brand new to jQuery and have some experience using Prototype. In Prototype, there is a method to "flash" an element — ie. briefly highlight it in another color and have it fade back to norma..

How to enable ASP classic in IIS7.5

I am running IIS 7.5 in Windows 7 and have already gone into "Turn Windows features on or off" and enabled ASP in "Internet Information Services/World Wide Web Service/application Development Features..

How to load a jar file at runtime

I was asked to build a java system that will have the ability to load new code (expansions) while running. How do I re-load a jar file while my code is running? or how do I load a new jar? Obviously..

How do I specify the JDK for a GlassFish domain?

I've got GlassFish 2.1.1 installed. I have a 1.5 and a 1.6 JDK installed. Even though my JAVA_HOME variable is set to the 1.5 version (and both "java -version" and "javac -version" display 1.5), whene..

What is the easiest way to clear a database from the CLI with in Django?

I am using Django to build a website with MySQL. Now as I am learning so I need to change the Model very often so I want that all tables get cleared and new table get created. But syncdb doesn't touc..

Python Selenium accessing HTML source

How can I get the HTML source in a variable using the Selenium module with Python? I wanted to do something like this: from selenium import webdriver browser = webdriver.Firefox() browser.get("http..

Getting the location from an IP address

I want to retrieve information like the city, state, and country of a visitor from their IP address, so that I can customize my web page according to their location. Is there a good and reliable way t..

Git commit with no commit message

How can I commit changes without specifying commit message? Why is it required by default?..

Is it possible to pull just one file in Git?

I am working on a Git branch that has some broken tests, and I would like to pull (merge changes, not just overwrite) these tests from another branch where they are already fixed. I know I can do gi..

Select elements by attribute

I have a collection of checkboxes with generated ids and some of them have an extra attribute. Is it possible to use JQuery to check if an element has a specific attribute? For example, can I verify i..

Getting key with maximum value in dictionary?

I have a dictionary: keys are strings, values are integers. Example: stats = {'a':1000, 'b':3000, 'c': 100} I'd like to get 'b' as an answer, since it's the key with a higher value. I did the fo..

How to rename files and folder in Amazon S3?

Is there any function to rename files and folders in Amazon S3? Any related suggestions are also welcome...

How to check if a variable exists in a FreeMarker template?

I have a Freemarker template which contains a bunch of placeholders for which values are supplied when the template is processed. I want to conditionally include part of the template if the userName v..

How do I make an input field accept only letters in javaScript?

function validate() { if( =="" ){ alert("Enter a name");; return false; } This is what I've written it for an empty string, now i need it to ac..

Support for ES6 in Internet Explorer 11

According to this page, ES6 features are not implemented in IE 11. Does IE 11 have a plan for implementing them one day or can I forget about it? Is there a..

Why my regexp for hyphenated words doesn't work?

I'm writting a regular expression for match with simple words and single hyphenated words using re module of python, so for example in: test_case_input = """the wide-field infrared survey explorer is..

Date validation with ASP.NET validator

I'm trying to use an ASP.NET RangeValidator to validate a date on a textbox. The format of the date entered on the textbox is dd MMMM yyyy. How can I use the range validator to validate a valid date?..

Contains method for a slice

Is there anything similar to a slice.contains(object) method in Go without having to do a search through each element in a slice? ..

Only mkdir if it does not exist

In my bash script I do: mkdir product; When I run the script more than once I get: mkdir: product: File exists In the console. So I am looking to only run mkdir if the dir doesn't exist. Is th..

How to get the full url in Express?

Let's say my sample url is and I say I have the following route app.get('/one/two', function (req, res) { var url = req.url; } The value of url will be /one/two..

Does React Native styles support gradients?

I see that someone made this for it: But is there support for it in RN itself? Something like style = StyleSheet.create({ backgroundGra..

Is there a way to get the XPath in Google Chrome?

I have a webpage I want to use with YQL. But I need the XPath of a specific item. I can see it in the debug tools area for Google Chrome but I don't see a way to copy that XPath. Is there a way to ..

converting Java bitmap to byte array

Bitmap bmp = intent.getExtras().get("data"); int size = bmp.getRowBytes() * bmp.getHeight(); ByteBuffer b = ByteBuffer.allocate(size); bmp.copyPixelsToBuffer(b); byte[] bytes = new b..

Plot Normal distribution with Matplotlib

please help me to plot the normal distribution of the folowing data: DATA: import numpy as np import matplotlib.pyplot as plt from scipy.stats import norm h = [186, 176, 158, 180, 186, 168, 168, 16..

Executing Javascript code "on the spot" in Chrome?

I have a page in chrome which contains many textboxes and I wish to feed values automatically to them. I already have the list of name-value pairs, so if I could simple execute a series of Javascript ..

Find empty or NaN entry in Pandas Dataframe

I am trying to search through a Pandas Dataframe to find where it has a missing entry or a NaN entry. Here is a dataframe that I am working with: cl_id a c d e ..

How to implement private method in ES6 class with Traceur

I use Traceur Compiler to have advantage with ES6 features now. I want to implement this stuff from ES5: function Animal() { var self = this, sayHi; sayHi = function() { s..

npm behind a proxy fails with status 403

I'm trying to run npm behind a proxy. I've tried both entering the proxy directly or through Authoxy: npm config set proxy http://localhost:8999 npm config set https-proxy http://localhost:8999 Reg..

Oracle PL Sql Developer cannot find my tnsnames.ora file

I have an Oracle tnsnames.ora file from my previous workplace. I want to pick it up with my newly installed PL SQL Developer on another computer. I have copied the file into ..ORACLE/product/11.2.0/cl..

How to overwrite existing files in batch?

The following command copies and moves a file but I also need it to overwrite the file it's replacing. xcopy /s c:\mmyinbox\test.doc C:\myoutbox ..

Detect Android phone via Javascript / jQuery

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

putting datepicker() on dynamically created elements - JQuery/JQueryUI

I have dynamically created textboxes, and I want each of them to be able to display a calendar on click. The code I am using is: $(".datepicker_recurring_start" ).datepicker(); Which will only work..

Ajax - 500 Internal Server Error

I am trying to learn AJAX for this project at work. I have a site that loads medications that a patient is taking. I call this AJAX function up recursively so that it will append a new table containi..

console.log timestamps in Chrome?

Is there any quick way of getting Chrome to output timestamps in console.log writes (like Firefox does). Or is prepending new Date().getTime() the only option?..

How to add "active" class to wp_nav_menu() current menu item (simple way)

I am creating custom Wordpress theme using a starter theme _Underscores. I am also using Bootstrap as a front-end framework. I would like to modify wp_nav_menu so that it assigns current menu item cl..

How do you auto format code in Visual Studio?

I know Visual Studio can auto format to make my methods and loops indented properly, but I cannot find the setting...

Select max value of each group

Name Value AnotherColumn ----------- Pump 1 8000.0 Something1 Pump 1 10000.0 Something2 Pump 1 10000.0 Something3 Pump 2 3043 Something4 Pump 2 4594 Something5 Pump 2 6165 Somethi..

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