Questions Tagged with #Collectionviewsource

The Extensible Application Markup Language (XAML) proxy of a CollectionView class.

Error: the entity type requires a primary key

I would like to expand the question asked on this thread Binding listbox to observablecollection by giving it an ability to persistent the data. The structure is mostly the same except I installed E..

An error occurred while updating the entries. See the inner exception for details

When i delete an item in a listbox, i get the error in the question as shown in the screenshot below: I do not know where the inner exception is, but i tried try, catch but i got the same error in t..

ListBox vs. ListView - how to choose for data binding

I'm considering either a ListBox or a ListView for a WPF application. It seems either supports data binding and item templates. My application has a simple list of items that I intend to be able to ..

Can you detect "dragging" in jQuery?

I have a throbber that is to appear when a user clicks a link. The problem is is that that same link can be clicked and dragged to be rearranged. In this case, I wouldn't need the throbber to appear...

How to edit default dark theme for Visual Studio Code?

I'm using Windows 7 64-bit. Is there a way to edit default dark theme in the Visual Studio Code? In %USERPROFILE%\.vscode folder there are only themes from the extensions, while in installation path ..

How to find the array index with a value?

Say I've got this imageList = [100,200,300,400,500]; Which gives me [0]100 [1]200 etc. Is there any way in JavaScript to return the index with the value? I.e. I want the index for 200, I get ret..

byte[] to file in Java

With Java: I have a byte[] that represents a file. How do I write this to a file (ie. C:\myfile.pdf) I know it's done with InputStream, but I can't seem to work it out...

Difference between "@id/" and "@+id/" in Android

What is the diffirence between the @id/ and @+id/? In @+id/ the plus symbol + instructs to create a new resource name and add in to the R.java file but what about @id/? From the documentation of ..

Get an object's class name at runtime

Is it possible to get an object's class/type name at runtime using TypeScript? class MyClass{} var instance = new MyClass(); console.log(instance.????); // Should output "MyClass" ..

Get a list of all functions and procedures in an Oracle database

I'm comparing three Oracle schemas. I want to get a list of all the functions and procedures used in each database. Is this possible via a query? (preferably including a flag as to whether they compi..

Where can I find a list of escape characters required for my JSON ajax return type?

I have an ASP.NET MVC action that is returning a JSON object. The JSON: {status: "1", message:"", output:"<div class="c1"><div class="c2">User generated text, so can be anything</div&..

Select count(*) from result query

I need help from you, this is my sql query: select count(SID) from Test where Date = '2012-12-10' group by SID this is my result: |2| |3| |4| |3| and now I have to count the results from firs..

CURLOPT_RETURNTRANSFER set to true doesnt work on hosting server

I'm trying to process result from $data = curl_exec($ch); instead of printing it on the screen. In order to achieve that I set the option CURLOPT_RETURNTRANSFER to true like this: curl_setopt($ch, CU..

Combine GET and POST request methods in Spring

I have a resource that supports both GET and POST requests. Here a sample code for a sample resource: @RequestMapping(value = "/books", method = RequestMethod.GET) public ModelAndView listBooks(@Mode..

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

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

Flutter - The method was called on null

I'm programming an app that displays two media streams in the same view via one horizontal listView and one vertical listView. I'm currently working on implementing information into the bottom listVie..

NumPy ValueError: The truth value of an array with more than one element is ambiguous. Use a.any() or a.all()

I was calculating eigenvectors and eigenvalues of a matrix in NumPy and just wanted to check the results via assert(). This would throw a ValueError that I don't quite understand, since printing those..

Windows service on Local Computer started and then stopped error

Usually, I get this error: (The "service name" service on Local Computer started and then stopped. Some services stop automatically if they are not in use by other service or programs) when there's so..

Does Java have a complete enum for HTTP response codes?

I'm wondering if there is an enum type in some standard Java class library that defines symbolic constants for all of the valid HTTP response codes. It should support conversion to/from the correspond..

Handling the null value from a resultset in JAVA

I currently have a resultset returned and in one of the columns the string value may be null (i mean no values at all). I have a condition to implement like following rs = st.executeQuery(selectS..

Wait until an HTML5 video loads

I have a video tag, that I dynamically change its source as I am letting the user to choose from a number of videos from the database. The problem is that when I change the src attribute the video doe..

How do I open a new window using jQuery?

I have the following two ways suggested to me. window.location.href = '/Administration/Notes/Create?dsValue=a&selectAnswer=b'; $.get("/Administration/Notes/Create", { dsValue: dsValue, selectedA..

How to keep the local file or the remote file during merge using Git and the command line?

I know how to merge modification using vimdiff, but, assuming I just know that the entire file is good to keep or to throw away, how do I do that? I don't want to open vimdiff for each of them, I ch..

Changing Vim indentation behavior by file type

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

Func vs. Action vs. Predicate

With real examples and their use, can someone please help me understand: When do we need a Func<T, ..> delegate? When do we need an Action<T> delegate? When do we need a Predicate<T>..

What's in an Eclipse .classpath/.project file?

We recently had an issue with an Eclipse project for one of our team members. Tomcat was not deploying JARs of the application. We eventually noticed the .classpath Eclipse file was not the same as ..

Delete file from internal storage

I'm trying to delete images stored in internal storage. I've come up with this so far: File dir = getFilesDir(); File file = new File(dir, id+".jpg"); boolean deleted = file.delete(); And this is f..

How to delete a whole folder and content?

I want the users of my application to be able to delete the DCIM folder (which is located on the SD card and contains subfolders). Is this possible, if so how?..

How to do fade-in and fade-out with JavaScript and CSS

I want to make an HTML div tag fade in and fade out. I have some code that fades out, but when I fade in, the opacity of the div stays at 0.1 and doesn't increase. <!DOCTYPE html PUBLIC "-//W3C/..

Convert number to varchar in SQL with formatting

Is there a way in T-SQL to convert a TINYINT to VARCHAR with custom number formatting? For instance, my TINYINT has a value of 3 and I want to convert it to a VARCH of 03, so that it always shows a 2 ..

add an element to int [] array in java

Want to add or append elements to existing array int[] series = {4,2}; now i want to update the series dynamically with new values i send.. like if i send 3 update series as int[] series = {4,2,3..

PermissionError: [Errno 13] Permission denied

I'm getting this error : Exception in Tkinter callback Traceback (most recent call last): File "C:\Python34\lib\tkinter\__init__.py", line 1538, in __call__ return self.func(*args) File "C:/Users/Mar..

What is MATLAB good for? Why is it so used by universities? When is it better than Python?

I've been recently asked to learn some MATLAB basics for a class. What does make it so cool for researchers and people that works in university? I saw it's cool to work with matrices and plotting thi..

Python __call__ special method practical example

I know that __call__ method in a class is triggered when the instance of a class is called. However, I have no idea when I can use this special method, because one can simply create a new method and p..

How to clear or stop timeInterval in angularjs?

I am making a demo in which I am fetching data from the server after regular intervals of time using $interval Now I need to stop/cancel this. How I can achieve this? If I need to restart the process..

Php artisan make:auth command is not defined

I am trying to run this command in laravel 5.2 but it's not working. php artisan make:auth and prompts with these statements. [InvalidArgumentException] Command "make:auth" is not defined Did..

denied: requested access to the resource is denied : docker

I am following this link to create my first docker Image and it went successfully and now I am trying to push this Image into my docker repository from this link. But whenever I am trying to push this..

Remove white space below image

In Firefox only my video thumbnails are displaying mysterious 2-3 pixels of white space between the bottom of my image and its border (see below). I've tried everything I can think of in Firebug with..

What is the opposite of evt.preventDefault();

Once I've fired an evt.preventDefault(), how can I resume default actions again?..

How to call a method function from another class?

I'm writing a java project that has three different classes. This is what i have have so far. I'm just stuck on how do you call a method function from another class to another class. I have written 2 ..

one line if statement in php

I'd like to to some thing similar to javascripts var foo = true; foo && doSometing(); but this doesnt seem to work in php. I'm trying to add a class to a label if a condition is me..

What do I use for a max-heap implementation in Python?

Python includes the heapq module for min-heaps, but I need a max heap. What should I use for a max-heap implementation in Python?..

Python Pandas Error tokenizing data

I'm trying to use pandas to manipulate a .csv file but I get this error: pandas.parser.CParserError: Error tokenizing data. C error: Expected 2 fields in line 3, saw 12 I have tried to read the..

getOutputStream() has already been called for this response

I google the error message getOutputStream() has already been called for this response and many people said it is because of the space or newline after <% or %>, but in my code , there is no a s..

Explain ExtJS 4 event handling

I've recently started learning ExtJS, and have trouble understanding how to handle Events. I have no experience of any previous versions of ExtJS. From reading various manuals, guides and documentat..

How do you format code in Visual Studio Code (VSCode)

What is the equivalent of Ctrl + K + F and Ctrl + K + D on Windows in Visual Studio for formatting, or "beautifying" code in the Visual Studio Code editor?..

How can I connect to MySQL in Python 3 on Windows?

I am using ActiveState Python 3 on Windows and wanted to connect to my MySQL database. I heard that mysqldb was the module to use. I can't find mysqldb for Python 3. Is there a repository available w..

Can I style an image's ALT text with CSS?

I have a dark blue page and when the image is loading (or missing) the ALT text is black and difficult to read (in FF). Could I style it (with CSS) to be white?..

clearing a char array c

I thought by setting the first element to a null would clear the entire contents of a char array. char my_custom_data[40] = "Hello!"; my_custom_data[0] = '\0'; However, this only sets the first ele..

how to zip a folder itself using java

Suppose I have the following directory structure. D:\reports\january\ Inside january there are suppose two excel files say A.xls and B.xls. There are many places where it has been written about h..

JavaScript - Replace all commas in a string

I have a string with multiple commas, and the string replace method will only change the first one: var mystring = "this,is,a,test" mystring.replace(",","newchar", -1) Result: "thisnewcharis,a,test..

Copying HTML code in Google Chrome's inspect element

I have a website of which I want to copy an HTML code from - how do I copy all the text in inspect element - so I don't get the website's HTML code, but the code that I have already changed so that I ..

String.Format not work in TypeScript

String.Format does not work in TypeScript. Error: The property 'format' does not exist on value of type '{ prototype: String; fromCharCode(...codes: number[]): string; (value?: any): string; new..

Datetime in where clause

How can I select 12/20/2008 in where clause of sql? The server is SQL server 2005. select * from tblErrorLog where errorDate = '12/20/2008' ..

Run react-native application on iOS device directly from command line?

Is it possible to run react-native application on an iOS device directly from the command line like we do on simulator with react-native run ios --simulator "iPhone 5s"?..

Disable double-tap "zoom" option in browser on touch devices

I want to disable the double-tap zoom functionality on specified elements in the browser (on touch devices), without disabling all the zoom functionality. For example: One element can be tapped multi..

Is this the right way to clean-up Fragment back stack when leaving a deeply nested stack?

I'm using the Android Compatibility library to implement fragments and have extended the layout sample so that a fragment contains a button which fires off another fragment. In the selection pane on ..

How can I give eclipse more memory than 512M?

I have following setup, but when I put 1024 and replace all 512 with 1024, then eclipse won't start at all. How can I have more than 512M memory for my eclipse JVM? -startup plugins/org.eclipse.equin..

How to remove .html from URL?

How to remove .html from the URL of a static page? Also, I need to redirect any url with .html to the one without it. (i.e. www.example.com/page.html to www.example.com/page )...

Forward host port to docker container

Is it possible to have a Docker container access ports opened by the host? Concretely I have MongoDB and RabbitMQ running on the host and I'd like to run a process in a Docker container to listen to..

Fatal error: Call to a member function bind_param() on boolean

I'm busy on a function that gets settings from a DB, and suddenly, I ran into this error: Fatal error: Call to a member function bind_param() on boolean in C:\xampp2\htdocs\application\classes\class...

How to get the azure account tenant Id?

My question is: Is it possible to get the azure active directory tenant id without using powershell command? I found this two blogs and with this help, I'm already able to get the tenant ID and subsc..

How to get a DOM Element from a JQuery Selector

I'm having an impossibly hard time finding out to get the actual DOMElement from a jquery selector. Sample Code: <input type="checkbox" id="bob" /> var checkbox = $("#bob").click(function() ..

Python get current time in right timezone

Right now I use import datetime print(datetime.datetime.now().strftime("%X")) to display the current time as a string. Problem is, my computer is running in Europe/Berlin time zone, and the offset ..

Speed comparison with Project Euler: C vs Python vs Erlang vs Haskell

I have taken Problem #12 from Project Euler as a programming exercise and to compare my (surely not optimal) implementations in C, Python, Erlang and Haskell. In order to get some higher execution tim..

How to get autocomplete in jupyter notebook without using tab?

I would like to get an autocompletion feature in notebooks i.e. when I type something, a dropdown menu appears, with all the possible things I might type, without having to press the tab button. Is th..

Django Template Variables and Javascript

When I render a page using the Django template renderer, I can pass in a dictionary variable containing various values to manipulate them in the page using {{ myVar }}. Is there a way to access the s..

Does Python have a package/module management system?

Does Python have a package/module management system, similar to how Ruby has rubygems where you can do gem install packagename? On Installing Python Modules, I only see references to python setup.py ..

Error: Cannot invoke an expression whose type lacks a call signature

I am brand new to typescript, and I have two classes. In the parent class I have: abstract class Component { public deps: any = {}; public props: any = {}; public setProp(prop: string): any { ..

How to list active / open connections in Oracle?

Is there any hidden table, system variable or something to show active connections in a given moment?..

How to get the CPU Usage in C#?

I want to get the overall total CPU usage for an application in C#. I've found many ways to dig into the properties of processes, but I only want the CPU usage of the processes, and the total CPU like..

How to redirect to logon page when session State time out is completed in asp.net mvc

I have an ASP.NET MVC4 application where I am implementing sessionTimeout like: <configuration> <system.web> <sessionState timeout="2"></sessionState> </system.web&..

Please initialize the log4j system properly. While running web service

Maybe it looks silly to ask this but I am confused. I referred to Configuring Log4j property but it doesn't seem to help. I have written a simple web service HelloWorld. And while running it I am get..

What is apache's maximum url length?

What is the maximum length of a URL in apache? Where is it documented, and is it configurable? I'm implementing an openid identity provider, and would like to know the limitations I'm up against. I k..

Max or Default?

What is the best way to get the Max value from a LINQ query that may return no rows? If I just do Dim x = (From y In context.MyTable _ Where y.MyField = value _ Select y.MyCounter)...

android edittext onchange listener

I know a little bit about TextWatcher but that fires on every character you enter. I want a listener that fires whenever the user finishes editing. Is it possible? Also in TextWatcher I get an instanc..

Force add despite the .gitignore file

Is there a way to force git to add a file despite the .gitignore file?..

iOS 8 UITableView separator inset 0 not working

I have an app where the UITableView's separator inset is set to custom values - Right 0, Left 0. This works perfectly in iOS 7.x, however in iOS 8.0 I see that the separator inset is set to the defaul..

What exactly does big ? notation represent?

I'm really confused about the differences between big O, big Omega, and big Theta notation. I understand that big O is the upper bound and big Omega is the lower bound, but what exactly does big ? (..

ERROR 2003 (HY000): Can't connect to MySQL server on localhost (10061)

I installed MySQL on Microsoft Windows 8 Using a noinstall Zip Archive. But when i tested by executing the following commands on windows prompt, the above error showed up. C:\> "C:\MySQL\bin\mysq..

Create a function with optional call variables

Is there a way to create a parameter in a PowerShell function where you have to call it in order to have it considered? An example given by commandlet (the bold being what I want to do): Invoke-Comm..

How to get row from R data.frame

I have a data.frame with column headers. How can I get a specific row from the data.frame as a list (with the column headers as keys for the list)? Specifically, my data.frame is A B ..

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

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

How do I use $rootScope in Angular to store variables?

How do I use $rootScope to store variables in a controller I want to later access in another controller? For example: angular.module('myApp').controller('myCtrl', function($scope) { var a = //somet..

Run cron job only if it isn't already running

I'm trying to set up a cron job as a sort of watchdog for a daemon that I've created. If the daemon errors out and fails, I want the cron job to periodically restart it... I'm not sure how possible th..

Saving a text file on server using JavaScript

Is it possible to save text to a new text file using JavaScript/jQuery without using PHP? The text I'm trying to save may contain HTML entities, JS, HTML, CSS and PHP scripts that I don't want to esca..

Difference between Role and GrantedAuthority in Spring Security

There are concepts and implementations in Spring Security, such as the GrantedAuthority interface to get an authority to authorize/control an access. I would like that to permissible operations, suc..

How do I get the serial key for Visual Studio Express?

I am Visual Studio 2010 Professional user. But for a reason I need Visual Web Developer 2008 Express edition. I downloaded this, but I need the serial key to activate the product, otherwise it will e..

How to shutdown a Spring Boot Application in a correct way?

In the Spring Boot Document, they said that 'Each SpringApplication will register a shutdown hook with the JVM to ensure that the ApplicationContext is closed gracefully on exit.' When I click ctrl+c..

Possible reason for NGINX 499 error codes

I'm getting a lot of 499 NGINX error codes. I see that this is a client side issue. It is not a problem with NGINX or my uWSGI stack. I note the correlation in uWSGI logs when a get a 499. addres..

How to delete from multiple tables in MySQL?

I am trying to delete from a few tables at once. I've done a bit of research, and came up with this DELETE FROM `pets` p, `pets_activities` pa WHERE p.`order` > :order AN..

How to filter a RecyclerView with a SearchView

I am trying to implement the SearchView from the support library. I want the user to be to use the SearchView to filter a List of movies in a RecyclerView. I have followed a few tutorials so far and ..

To show a new Form on click of a button in C#

I am new to C# can anybody tell me on How to show a new Form on click of a button...

Python None comparison: should I use "is" or ==?

My editor warns me when I compare my_var == None, but no warning when I use my_var is None. I did a test in the Python shell and determined both are valid syntax, but my editor seems to be saying t..

Can't connect to local MySQL server through socket '/tmp/mysql.sock

When I attempted to connect to a local MySQL server during my test suite, it fails with the error: OperationalError: (2002, "Can't connect to local MySQL server through socket '/tmp/mysql.sock' (2)")..

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

How do I delete a Git branch locally and remotely?

I want to delete a branch both locally and remotely. Failed Attempts to Delete a Remote Branch $ git branch -d remotes/origin/bugfix error: branch 'remotes/origin/bugfix' not found. $ git branch -d o..

Expression ___ has changed after it was checked

Why is the component in this simple plunk @Component({ selector: 'my-app', template: `<div>I'm {{message}} </div>`, }) export class App { message:string = 'loading :('; ngAfterV..

set environment variable in python script

I have a bash script that sets an environment variable an runs a command LD_LIBRARY_PATH=my_path sqsub -np $1 /homedir/anotherdir/executable Now I want to use python instead of bash, because I want..

How do I format a date in Jinja2?

Using Jinja2, how do I format a date field? I know in Python I can simply do this: print(car.date_of_manufacture.strftime('%Y-%m-%d')) But how do I format the date in Jinja2?..

What encoding/code page is cmd.exe using?

When I open cmd.exe in Windows, what encoding is it using? How can I check which encoding it is currently using? Does it depend on my regional setting or are there any environment variables to check?..

How to get Device Information in Android

Possible Duplicate: How to detect system information like os or device type I am new to android application development. I developed one small application,and install that application .apk..

Chart.js v2 hide dataset labels

I have the following codes to create a graph using Chart.js v2.1.3: var ctx = $('#gold_chart'); var goldChart = new Chart(ctx, { type: 'line', data: { labels: dates, datasets:..

Try-catch-finally-return clarification

By reading all the questions already asked in this forum related to the topic above (see title), I thoroughly understand that finally gets always called. (except from System.exit and infinite loops). ..

UITableView example for Swift

I've been working with Swift and iOS for a number of months now. I am familiar with many of the ways things are done but I'm not good enough that I can just write things up without looking. I've appre..

Execute a terminal command from a Cocoa app

How can I execute a terminal command (like grep) from my Objective-C Cocoa application?..

How to get instance variables in Python?

Is there a built-in method in Python to get an array of all a class' instance variables? For example, if I have this code: class hi: def __init__(self): self.ii = "foo" self.kk = "bar" Is..

Do you need to dispose of objects and set them to null?

Do you need to dispose of objects and set them to null, or will the garbage collector clean them up when they go out of scope?..

Day Name from Date in JS

I need to display the name of the day given a date (like "05/23/2014") which I get from a 3rd party. I've tried using Date, but I only get the date. What is the correct way to get the name of the d..

How to use a variable inside a regular expression?

I'd like to use a variable inside a regex, how can I do this in Python? TEXTO = sys.argv[1] if re.search(r"\b(?=\w)TEXTO\b(?!\w)", subject, re.IGNORECASE): # Successful match else: # Match a..

How to Get enum item name from its value

I declared a enum type as this, enum WeekEnum { Mon = 0; Tue = 1; Wed = 2; Thu = 3; Fri = 4; Sat = 5; Sun = 6; }; How can I get the item name "Mon, Tue, etc" when I already have the item value "0, ..

What issues should be considered when overriding equals and hashCode in Java?

What issues / pitfalls must be considered when overriding equals and hashCode?..

Passing Javascript variable to <a href >

<script language="javascript" type="text/javascript"> var scrt_var = 10; </script> HTML Part: <html> this is a <a href ="2.html & Key= scrt_var">Link </a> </..

Write lines of text to a file in R

In the R scripting language, how do I write lines of text, e.g. the following two lines Hello World to a file named "output.txt"?..

how to get the first and last days of a given month

I wish to rewrite a mysql query which use month() and year() functions to display all the posts from a certain month which goes to my function as a 'Y-m-d' parameter format, but I don't know how can I..

onchange event on input type=range is not triggering in firefox while dragging

When I played with <input type="range">, Firefox triggers an onchange event only if we drop the slider to a new position where Chrome and others triggers onchange events while the slider is drag..

Merge two (or more) lists into one, in C# .NET

Is it possible to convert two or more lists into one single list, in .NET using C#? For example, public static List<Product> GetAllProducts(int categoryId){ .... } . . . var productCollection..

How to check if a string "StartsWith" another string?

How would I write the equivalent of C#'s String.StartsWith in JavaScript? var haystack = 'hello world'; var needle = 'he'; haystack.startsWith(needle) == true Note: This is an old question, and as..

Check if a string contains another string

I want to find if a string contains a ","(comma) in it. Do we have any other option other than reading char-by-char?..

How do I put all required JAR files in a library folder inside the final JAR file with Maven?

I am using Maven in my standalone application, and I want to package all the dependencies in my JAR file inside a library folder, as mentioned in one of the answers here: How can I create an executab..

Creating a batch file, for simple javac and java command execution

It is a really simple thing but I cannot get my head around it. I have looked at plenty of StackOverFlow post and as well as on internet. My goal is to create a .bat which will open cmd and execute m..

How can I disable HREF if onclick is executed?

I have an anchor with both HREF and ONCLICK attributes set. If clicked and Javascript is enabled, I want it to only execute ONCLICK and ignore HREF. Likewise, if Javascript is disabled or unsupported,..

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

Check array position for null/empty

I have an array which might contain empty/null positions (e.g: array[2]=3, array[4]=empty/unassigned). I want to check in a loop whether the array position is null. array[4]==NULL //this doesn't wor..

How do I count cells that are between two numbers in Excel?

I need a formula to count the number of cells in a range that are between 10 and 10.000: I have: =COUNTIF(B2:B292,>10 AND <10.000) But how do I put the comparison operators in without gett..

Uncaught syntaxerror: unexpected identifier?

I can't seem to correct the error the console is talking about can anyone help me. My code is below. I created a web form that saves the data to local storage and displays it on screen then deletes al..

How do I create a chart with multiple series using different X values for each series?

I want to draw several graphs and combine them into one figure. I will explain the problem in an example. Let's say that I want to draw two graphs with these points: Graph #1 (X and Y are defining a ..

How can I select rows by range?

Possible Duplicate: Select statement in SQLite recognizing row number For example, SELECT * FROM table WHERE [row] BETWEEN x AND y How can this be done? I've done some reading but haven't ..

Uncaught ReferenceError: angular is not defined - AngularJS not working

I'm attempting to learn angular and I am struggling with a simple button click. I followed an example which has an identical code to the one below. The result I am looking for is for the button click..

SQL Views - no variables?

Is it possible to declare a variable within a View? For example: Declare @SomeVar varchar(8) = 'something' gives me the syntax error: Incorrect syntax near the keyword 'Declare'. ..

java Compare two dates

I want to compare two dates and check if the date has expired or not. Here is the code I used : SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd hh:ss:ii"); Date date1 = sdf.parse("20012-10-4..

how to read xml file from url using php

I have to read an XML file from an URL $map_url = "http://maps.google.com/maps/api/directions/xml?origin=".$merchant_address_url."&destination=".$customer_address_url."&sensor=false"; This ..

Can you put two conditions in an xslt test attribute?

Is this right for When 4 < 5 and 1 < 2 ? <xsl:when test="4 &lt; 5 AND 1 &lt; 2" > <!-- do something --> </xsl:when> ..

How to print to console when using Qt

I'm using Qt4 and C++ for making some programs in computer graphics. I need to be able to print some variables in my console at run-time, not debugging, but cout doesn't seem to work even if I add the..

How do you loop through each line in a text file using a windows batch file?

I would like to know how to loop through each line in a text file using a Windows batch file and process each line of text in succession...

Getting a File's MD5 Checksum in Java

I am looking to use Java to get the MD5 checksum of a file. I was really surprised but I haven't been able to find anything that shows how to get the MD5 checksum of a file. How is it done?..

How to identify a strong vs weak relationship on ERD?

A dashed line means that the relationship is strong, whereas a solid line means that the relationship is weak. On the following diagram how do we decide that the relationship between the Room and Clas..

"Javac" doesn't work correctly on Windows 10

the problem is that I upgraded to Windows 10 and now I'm installing my tools to programming and now that I installed the JDK 7 of Java, when I try to use in the cmd the command: - "javac" Th..

Can I loop through a table variable in T-SQL?

Is there anyway to loop through a table variable in T-SQL? DECLARE @table1 TABLE ( col1 int ) INSERT into @table1 SELECT col1 FROM table2 I use cursors as well, but cursors seem less flexible tha..

AngularJS ngClass conditional

Is there any way to make an expression for something like ng-class to be a conditional? For example, I have tried the following: <span ng-class="{test: 'obj.value1 == \'someothervalue\''}">tes..

Activity transition in Android

How can I define the transition between two activities for Android 1.5 and later? I would like an activity to fade in...

How to copy an object by value, not by reference

I want to make a copy of an object, then after some logic, re-assign the original object the value of the copy. example: User userCopy = //make a copy foreach(...) { user.Age = 1; user.ID = -1;..

How to format a java.sql Timestamp for displaying?

How do I formate a java.sql Timestamp to my liking ? ( to a string, for display purposes)..

grep without showing path/file:line

How do you grep and only return the matching line? i.e. The path/filename is omitted from the results. In this case I want to look in all .bar files in the current directory, searching for the term F..

DTO pattern: Best way to copy properties between two objects

In my application's architecture I usually send the object or list of objects from the data access layer to the web layer via the service layer, in which these objects get transformed from a DAO objec..

How to add a new line in textarea element?

I want to add a newline in a textarea. I tried with \n and <br/> tag but are not working. You can see above the HTML code. Can you help me to insert a newline in a textarea? <textarea cols='6..

How do you remove Subversion control for a folder?

I have a folder, c:\websites\test, and it contains folders and files that were checked out from a repository that no longer exists. How do I get Subversion to stop tracking that folder and any of the ..

How to always show scrollbar

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

Size-limited queue that holds last N elements in Java

A very simple & quick question on Java libraries: is there a ready-made class that implements a Queue with a fixed maximum size - i.e. it always allows addition of elements, but it will silently r..

How to trigger the onclick event of a marker on a Google Maps V3?

How do I trigger the onclick event of a marker on a Google Maps from outside the map? I use version 3 of the API. I've seen many tutorials for version 2, but can't find this for version 3. I have a ..

HTML5 Number Input - Always show 2 decimal places

Is there's any way to format an input[type='number'] value to always show 2 decimal places? Example: I want to see 0.00 instead of 0...

accessing a file using [NSBundle mainBundle] pathForResource: ofType:inDirectory:

I have a file paylines.txt added inside the folder named TextFiles which resides inside the Resources folder of my iOS project in Xcode. This is the code I use to access the file: NSString* filePath..

Python OpenCV2 (cv2) wrapper to get image size?

How to get the size of an image in cv2 wrapper in Python OpenCV (numpy). Is there a correct way to do that other than numpy.shape(). How can I get it in these format dimensions: (width, height) list?..

How to remove entry from $PATH on mac

I was trying to install Sencha Touch SDK tools 2.0.0 but could not run it properly. It created an entry in the $PATH variable. Later I deleted the sencha sdk tools folder but didn't realize that the ..

How to draw border around a UILabel?

Is there a way for UILabel to draw a border around itself? This is useful for me to debug the text placement and to see the placement and how big the label actually is...

Android getResources().getDrawable() deprecated API 22

With new android API 22 getResources().getDrawable() is now deprecated. Now the best approach is to use only getDrawable(). What changed? ..

Basic http file downloading and saving to disk in python?

I'm new to Python and I've been going through the Q&A on this site, for an answer to my question. However, I'm a beginner and I find it difficult to understand some of the solutions. I need a very..

How do I "shake" an Android device within the Android emulator to bring up the dev menu to debug my React Native app

I am working on a cross-platform React Native mobile app. I am writing console.log statements as I develop. I want to see these logging statements in Chrome while I'm running the Android app in the de..

Deny access to one specific folder in .htaccess

I'm trying to deny users from accessing the site/includes folder by manipulating the URL. I don't know if I have to deny everything and manually make individual exceptions to allow, if I can just den..

How to assign text size in sp value using java code

If I assign an integer value to change a certain text size of a TextView using java code, the value is interpreted as pixel (px). Now does anyone know how to assign it in sp?..

How to avoid a System.Runtime.InteropServices.COMException?

In my Microsoft Surface project, I always get a lot of the following exceptions: 'MuReSe.vshost.exe' (Managed (v2.0.50727)): Loaded 'C:\Windows\assembly\GAC_32\mscorlib\2.0.0.0__b77a5c561934e089\msco..

Should a 502 HTTP status code be used if a proxy receives no response at all?

According to the RFC: 10.5.3 502 Bad Gateway The server, while acting as a gateway or proxy, received an invalid response from the upstream server it accessed in attempting to fulfill the re..

Measure string size in Bytes in php

I am doing a real estate feed for a portal and it is telling me the max length of a string should be 20,000 bytes (20kb), but I have never run across this before. How can I measure byte size of a var..

Iterate through every file in one directory

How do I write a loop in ruby so that I can execute a block of code on each file? I'm new to ruby, and I've concluded that the way to do this is a do each loop. The ruby file will be executed from a ..

How do I correctly upgrade angular 2 (npm) to the latest version?

Recently I started Angular 2 tutorial at https://angular.io/docs/ts/latest/tutorial/. and left off with Angular 2 beta 8. Now I resumed the tutorial and latest beta is beta 14. If I simply do npm up..

C++ deprecated conversion from string constant to 'char*'

I have a class with a private char str[256]; and for it I have an explicit constructor: explicit myClass(const char *func) { strcpy(str,func); } I call it as: myClass obj("example"); When I..

Selecting all text in HTML text input when clicked

I have the following code to display a textbox in a HTML webpage. <input type="text" id="userid" name="userid" value="Please enter the user ID" /> When the page displays, the text contains th..

Get Base64 encode file-data from Input Form

I've got a basic HTML form from which I can grab a bit of information that I'm examining in Firebug. My only issues is that I'm trying to base64 encode the file data before it's sent to the server whe..

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

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

How to know what the 'errno' means?

When calling execl(...), I get an errno=2. What does it mean? How can I know the meaning of this errno?..

How to push to History in React Router v4?

In the current version of React Router (v3) I can accept a server response and use browserHistory.push to go to the appropriate response page. However, this isn't available in v4, and I'm not sure wha..

Get raw POST body in Python Flask regardless of Content-Type header

Previously, I asked How to get data received in Flask request because request.data was empty. The answer explained that request.data is the raw post body, but will be empty if form data is parsed. Ho..

Barcode scanner for mobile phone for Website in form

I have inventory maintenance website up and running. currently the back end users are manually typing the item id on the system and using to search and do their work. I would like to automate the typi..

Predicate in Java

I am going through the code which uses Predicate in Java. I have never used Predicate. Can someone guide me to any tutorial or conceptual explanation of Predicate and its implementation in Java?..

Using R to list all files with a specified extension

I'm very new to R and am working on updating an R script to iterate through a series of .dbf tables created using ArcGIS and produce a series of graphs. I have a directory, C:\Scratch, that will cont..

When to use an interface instead of an abstract class and vice versa?

This may be a generic OOP question. I wanted to do a generic comparison between an interface and an abstract class on the basis of their usage. When would one want to use an interface and when would..

Convert String to Calendar Object in Java

I am new to Java, usually work with PHP. I am trying to convert this string: Mon Mar 14 16:02:37 GMT 2011 Into a Calendar Object so that I can easily pull the Year and Month like this: String ..

How to capture no file for fs.readFileSync()?

Within node.js readFile() shows how to capture an error, however there is no comment for the readFileSync() function regarding error handling. As such, if I try to use readFileSync() when there is no ..

How to switch activity without animation in Android?

How can I use properly the Intent flag FLAG_ACTIVITY_NO_ANIMATION in AndroidManifest file? I supose my problem is trivial, but I can't find good example or solution to it. <intent-filter> ..

Java 8 lambdas, Function.identity() or t->t

I have a question regarding the usage of the Function.identity() method. Imagine the following code: Arrays.asList("a", "b", "c") .stream() .map(Function.identity()) // <- Thi..

Where does forever store console.log output?

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

jquery json to string?

Instead of going from a json string and using $.parseJSON, I need to take my object and store it in a variable as string representing json. (A library I'm dealing with expects a malformed json type s..

Create a CSV File for a user in PHP

I have data in a MySQL database. I am sending the user a URL to get their data out as a CSV file. I have the e-mailing of the link, MySQL query, etc. covered. How can I, when they click the link, ha..

Maven: The packaging for this project did not assign a file to the build artifact

I'm using Maven 3.0.3 on Mac 10.6.6. I have a JAR project and when I run the command "mvn clean install:install", I'm getting the error, [ERROR] Failed to execute goal org.apache.maven.plugins:mave..

Plotting time in Python with Matplotlib

I have an array of timestamps in the format (HH:MM:SS.mmmmmm) and another array of floating point numbers, each corresponding to a value in the timestamp array. Can I plot time on the x axis and the ..

Take multiple lists into dataframe

How do I take multiple lists and put them as different columns in a python dataframe? I tried this solution but had some trouble. Attempt 1: Have three lists, and zip them together and use that res..

How to run a script file remotely using SSH

I want to run a script remotely. But the system doesn't recognize the path. It complains that "no such file or directory". Am I using it right? ssh kev@server1 `./test/foo.sh` ..

postgresql port confusion 5433 or 5432?

I have installed postgresql on OSX. When I run psql, I get $ psql psql: could not connect to server: No such file or directory Is the server running locally and accepting connections on Unix ..

How to solve the memory error in Python

I am dealing with several large txt file, each of them has about 8000000 lines. A short example of the lines are: usedfor zipper fasten_coat usedfor zipper fasten_jacket usedfor zipper fasten_pant us..

How do I connect to a Websphere Datasource with a given JNDI name?

I'm using Websphere Portal 7.0 and creating a portlet with RAD 8.0. My portlet is trying to make a db2 connection to a remote server. I wrote a java program locally to do a basic JDBC connection to th..

How do I make background-size work in IE?

Is there any known way to make the CSS style background-size work in IE?..

jQuery .ajax() POST Request throws 405 (Method Not Allowed) on RESTful WCF

I am sending a post request to a RESTFUL WCF service application. I am able to successfully send a POST request through Fiddler. However when I do this through the jQuery Ajax method the function r..

Example using Hyperlink in WPF

I've seen several suggestions, that you can add hyperlink to WPF application through Hyperlink control. Here's how I'm trying to use it in my code: <Window xmlns="http://schemas.microsof..

Python foreach equivalent

I am diving into Python and I have a question about foreach iteration. I am new to Python and I have some experience in C#. So I am wondering, if there is some equivalent function in Python for iterat..

How do I round a double to two decimal places in Java?

This is what I did to round a double to 2 decimal places: amount = roundTwoDecimals(amount); public double roundTwoDecimals(double d) { DecimalFormat twoDForm = new DecimalFormat("#.##"); re..

Convert pandas dataframe to NumPy array

I am interested in knowing how to convert a pandas dataframe into a NumPy array. dataframe: import numpy as np import pandas as pd index = [1, 2, 3, 4, 5, 6, 7] a = [np.nan, np.nan, np.nan, 0.1, 0...

How do you make websites with Java?

This might be a really trivial question, but I've been writing Java programs at my school and I just found out that I can create websites with Java as well. How can I do that? Any good books/tutori..

How to Add Stacktrace or debug Option when Building Android Studio Project

I was trying to investigate the project build error in the console output as follow: :myapp:processDebugResources FAILED FAILURE: Build failed with an exception. * What went wrong: Execution failed..

Professional jQuery based Combobox control?

Are there any professional Combobox controls (dropdown list with autosuggestion) based on the jQuery library? It should be able to handle large datasets and have some skinning options. A multi-column..

How do I launch the Android emulator from the command line?

I'm on Mac, working on Android development from the terminal. I have successfully created the HelloWorld project and now I'm trying to run it from the command line in the Android emulator. Which com..

How to style components using makeStyles and still have lifecycle methods in Material UI?

I get the below error whenever I try to use makeStyles() with a component with lifecycle methods: Invalid hook call. Hooks can only be called inside of the body of a function component. This could..

java comparator, how to sort by integer?

Im trying to learn comparator in java and I have found this great example online, my question is how would this code be changed so that the pet names are ordered by age and in descending order so that..

The conversion of the varchar value overflowed an int column

For some value of @nReservationID: SELECT @phoneNumber= CASE WHEN ISNULL(rdg2.nPhoneNumber ,0) = 0 THEN ISNULL(rdg2.nMobileNumber, 0) ELSE ISNULL(rdg2.nPhoneNumber ,0) END from tblRe..