Questions Tagged with #Android controls

What is HTTP "Host" header?

Given that the TCP connection is already established when the HTTP request is sent, the IP address and port are implicitly known -- a TCP connection is an IP + Port. So, why do we need the Host header..

setOnItemClickListener on custom ListView

I have a custom ListView. This ListView contains 1 Image and 6 TextViews. To retrieve the value I have created a setOnItemClickListener(...). Whenever I click on the ListView how could I actually retr..

Not class selector in jQuery

Is there a simple selector expression to not select elements with a specific class? <div class="first-foo" /> <div class="first-moo" /> <div class="first-koo" /> <div class="firs..

An object reference is required to access a non-static member

I'm having this error come up and I'm not sure why... I've tried to look it up, people are saying to create an object of the class or create the methods as static... but I'm unsure how. Here's my cod..

How can I remove a pytz timezone from a datetime object?

Is there a simple way to remove the timezone from a pytz datetime object? e.g. reconstructing dt from dt_tz in this example: >>> import datetime >>> import pytz >>> dt = da..

Why doesn't wireshark detect my interface?

I just installed Wireshark, but when I click capture > interfaces, the dialog box appears, but it does not contain my network interface. When click on capture > interfaces it appears as in the ..

Warning message: In `...` : invalid factor level, NA generated

I don't understand why I got this warning message. > fixed <- data.frame("Type" = character(3), "Amount" = numeric(3)) > fixed[1, ] <- c("lunch", 100) Warning message: In `[<-.factor`(..

`ui-router` $stateParams vs. $state.params

With ui-router, it's possible to inject either $state or $stateParams into a controller to get access to parameters in the URL. However, accessing parameters through $stateParams only exposes paramete..

The import org.apache.commons cannot be resolved in eclipse juno

I having the problem while compiling the my project in eclipse. It was shoving the error The import org.apache.commons cannot be resolved. Please anyone tell me what does this error tells. and how ..

How to add url parameters to Django template url tag?

In my view to get url parameters like this: date=request.GET.get('date','') In my url I am trying to pass parameters in this way with the url template tag like this: <td><a href="{% url..

How to show full height background image?

I have a photo type (not landscape) background image with 979px width by 1200px height. I would like to set it to float left and show 100% full image height fixed, without the need to scroll up/down (..

Postgres user does not exist?

I have just installed Postgres and have been tinkering with it and various configurations for 1-2 hours. I am stuck on being unable to change to the postgres-user $ su - postgres yields the followin..

jQuery - multiple $(document).ready ...?

Question: If I link in two JavaScript files, both with $(document).ready functions, what happens? Does one overwrite the other? Or do both $(document).ready get called? For example, <script type..

How to parse JSON in Kotlin?

I'm receiving a quite deep JSON object string from a service which I must parse to a JSON object and then map it to classes. How can I transform a JSON string to object in Kotlin? After that the map..

RESTful API methods; HEAD & OPTIONS

I'm writing a RESTful API module for an application in PHP, and I'm a bit mixed on the verbs HEAD and OPTIONS. OPTIONS  Used to retrieve the available HTTP verbs for a given resource? HEAD ..

Entity Framework Core: A second operation started on this context before a previous operation completed

I'm working on a ASP.Net Core 2.0 project using Entity Framework Core <PackageReference Include="Microsoft.EntityFrameworkCore" Version="2.0.1" /> <PackageReference Include="Microsoft.Ent..

Find a string between 2 known values

I need to be able to extract a string between 2 tags for example: "00002" from "morenonxmldata<tag1>0002</tag1>morenonxmldata" I am using C# and .NET 3.5...

Convert textbox text to integer

I need to convert the text in the textbox of my xaml code to an integer value in C#. I am using .NET 4.0 and Visual Studio 2010. Is there a way to do it in xaml tags itself or do i need to write a con..

How to force addition instead of concatenation in javascript

I'm trying to add all of the calorie contents in my javascript like this: $(function() { var data = []; $( "#draggable1" ).draggable(); $( "#draggable2" ).draggable(); $( "#draggable..

Returning JSON from a PHP Script

I want to return JSON from a PHP script. Do I just echo the result? Do I have to set the Content-Type header?..

How can I make a link from a <td> table cell

I have the following: <td> some text <div>a div</div> </td> I'd like to make the entire <td>...</td> a hyperlink. I'd prefer without the use of JavaScript. ..

Python 3 - Encode/Decode vs Bytes/Str

I am new to python3, coming from python2, and I am a bit confused with unicode fundamentals. I've read some good posts, that made it all much clearer, however I see there are 2 methods on python 3, t..

Convert a 1D array to a 2D array in numpy

I want to convert a 1-dimensional array into a 2-dimensional array by specifying the number of columns in the 2D array. Something that would work like this: > import numpy as np > A = np.array(..

Python MYSQL update statement

I'm trying to get this Python MYSQL update statement correct(With Variables): cursor.execute ("UPDATE tblTableName SET Year=%s" % Year ", Month=%s" % Month ", Day=%s" % Day ", Hour=%s" % Hour ", Minu..

'Syntax Error: invalid syntax' for no apparent reason

I've been trying to get a fix and can't find why the error keeps appearing. Pmin,Pmax,w,fi1 and fi2 have all been assigned finite values guess=Pmin+(Pmax-Pmin)*((1-w**2)*fi1+(w**2)*fi2) When i r..

Check if string contains only digits

I want to check if a string contains only digits. I used this: var isANumber = isNaN(theValue) === false; if (isANumber){ .. } But realized that it also allows + and -. Basically, I wanna make..

Use jquery to set value of div tag

I have this html div tag defined: <div style="height:100px; width:100px" class="total-title"> first text </div> I have jquery code to change its value: $('div.total-title').html('..

Using Pipes within ngModel on INPUT Elements in Angular

I've an HTML INPUT field. <input [(ngModel)]="item.value" name="inputField" type="text" /> and I want to format its value and use an existing pipe: .... [(ngModel)]="item.va..

CS1617: Invalid option ‘6’ for /langversion; must be ISO-1, ISO-2, 3, 4, 5 or Default

Kept getting that error when running a fresh ASP.NET MVC application (straight out of VS 2015 Community) on a Windows 2008 Server machine. ..

release Selenium chromedriver.exe from memory

I set up a python code to run Selenium chromedriver.exe. At the end of the run I have browser.close() to close the instance. (browser = webdriver.Chrome()) I believe it should release chromedriver.exe..

how to use "AND", "OR" for RewriteCond on Apache?

Is this how to use AND, OR for RewriteCond on Apache? rewritecond A [or] rewritecond B rewritecond C [or] rewritecond D RewriteRule ... something becomes if ( (A or B) and (C or D) ) rewrite_it. S..

Android - how to make a scrollable constraintlayout?

I want to make a layout that lets me scroll down using constraint layout, but I don't know how to go about it. Should the ScrollView be the parent of the ConstraintLayout like this? <?xml version=..

How to Apply Mask to Image in OpenCV?

I want to apply a binary mask to a color image. Please provide a basic code example with proper explanation of how the code works. Also, is there some option to apply a mask permanently so all functio..

OR, AND Operator

Newbie question. How to calculate the value of the formula A f B, where f - the binary function OR or AND?..

How to append elements at the end of ArrayList in Java?

I am wondering, how do I append an element to the end of an ArrayList in Java? Here is the code I have so far: public class Stack { private ArrayList<String> stringList = new ArrayList<..

How to get current foreground activity context in android?

Whenever my broadcast is executed I want to show alert to foreground activity...

css transform, jagged edges in chrome

I've been using CSS3 transform to rotate images and textboxes with borders in my website. The problem is that the border look jagged in Chrome, like a (low-resolution) game without Anti-Aliasing. In ..

Superscript in Python plots

I want to label my x axis at follows : pylab.xlabel('metres 10^1') But I don't want to have the ^ symbol included . pylab.xlabel('metres 10$^{one}$') This method works and will superscript lette..

How does one represent the empty char?

I'm currently writing a little program but I keep getting this error when compiling error: empty character constant I realize it's because I'm trying to replace a valid char with empty space c[i..

ASP.NET MVC 4 Custom Authorize Attribute with Permission Codes (without roles)

I need to control the access to views based on users privilege levels (there are no roles, only privilege levels for CRUD operation levels assigned to users) in my MVC 4 application. As an example; ..

UnsupportedClassVersionError: JVMCFRE003 bad major version in WebSphere AS 7

I am getting this error java.lang.UnsupportedClassVersionError: JVMCFRE003 bad major version; class=map/CareMonths, offset=6 My Eclipse's Java compiler is set to 1.6 and my installed Java SDK in C:\..

Getting the error "Java.lang.IllegalStateException Activity has been destroyed" when using tabs with ViewPager

I have an application that consists of using ActionBarSherlock in tab mode.I have 5 tabs and the content of each tab is handled using fragments. For tab2 though, I have a fragment the xml file of whic..

Setting onClickListener for the Drawable right of an EditText

In my app I have a EditText with a search Icon on the right side. I used the code given below. <EditText android:id="@+id/search" android:layout_width="0dp" android:layout..

conflicting types for 'outchar'

I am a newbie to C programming. I'm learning by reading the chapters and doing the examples from the book "Teach Yourself C" by Herbert Schildt. I'm trying to run this program in Dev C: #include <..

How to display a database table on to the table in the JSP page

My problem is that the table in my database is not able to be displayed at the table in my JSP page. I find this code totally right but dont know y m not getting the output right. Please tell me wh..

Clear dropdown using jQuery Select2

I'm trying to programmatically clear a drop down using the fantastic Select2 library. The drop down is dynamically filled with a remote ajax call using the Select2 query option. HTML: <input id="..

Capture the close event of popup window in JavaScript

I need to perform some action before a popup window(using window.open ) closes. Something like will be good: var new_window = window.open('some url') new_window.onBeforeUnload = function(){ my code}..

Change old commit message on Git

I was trying to edit an old commit message as explained here. The thing is that now, when I try to run rebase -i HEAD~5 it says interactive rebase already started. So then I try: git rebase --conti..

Is there an easy way to strike through text in an app widget?

I was wondering if there is an easy way to strike text within an app widget in Android. In a normal activity, it is pretty easy, using textview flags: textView.setPaintFlags(textView.getPaintFlags() ..

How can I align button in Center or right using IONIC framework?

I want the login and register button in right,and Search button in Center, I searched alot but didn't get any solution. And also how can I align text area in a proper position. Here is my html cod..

Change Orientation of Bluestack : portrait/landscape mode

if using the emulator, press CTRL-F12 we will change portrait or landscape mode . How can i do this with BlueStack ?..

How to use find command to find all files with extensions from list?

I need to find all image files from directory (gif, png, jpg, jpeg). find /path/to/ -name "*.jpg" > log How to modify this string to find not only .jpg files?..

What is TypeScript and why would I use it in place of JavaScript?

Can you please describe what the TypeScript language is? What can it do that JavaScript or available libraries cannot do, that would give me reason to consider it?..

How do I fix "The expression of type List needs unchecked conversion...'?

In the Java snippet: SyndFeedInput fr = new SyndFeedInput(); SyndFeed sf = fr.build(new XmlReader(myInputStream)); List<SyndEntry> entries = sf.getEntries(); the last line generates the warni..

Detecting request type in PHP (GET, POST, PUT or DELETE)

How can I detect which request type was used (GET, POST, PUT or DELETE) in PHP?..

How can I strip HTML tags from a string in ASP.NET?

Using ASP.NET, how can I strip the HTML tags from a given string reliably (i.e. not using regex)? I am looking for something like PHP's strip_tags. Example: <ul><li>Hello</li></ul..

Override element.style using CSS

I have an HTML page from page builder, and it injects style attribute directly to the element. I found it's considered as element.style. I want to override it using CSS. I can match the element, but ..

How to remove origin from git repository

Basic question: How do I disassociate a git repo from the origin from which it was cloned? git branch -a shows: * master remotes/origin/HEAD -> origin/master and I want to remove all knowledg..

Column order manipulation using col-lg-push and col-lg-pull in Twitter Bootstrap 3

I'm now reading documentation on Twitter Bootstrap 3, and tried to follow column ordering as shown in this page but hit the wall. I don't understand why such a code works nor how to correctly specif..

Global variables in R

I am poking into the manuals, I wanted to ask the community: How can we set global variables inside a function?..

How to change the DataTable Column Name?

I have one DataTable which has four columns such as StudentID CourseID SubjectCode Marks ------------ ---------- ------------- -------- 1 ..

How can I show data using a modal when clicking a table row (using bootstrap)?

I'm sort of a beginner on the whole web development thing and after researching a lot I still couldn't get this done. Any help is very much appreciated. I'm using latest rails version and bootstrap to..

Reading my own Jar's Manifest

I need to read the Manifest file, which delivered my class, but when I use: getClass().getClassLoader().getResources(...) I get the MANIFEST from the first .jar loaded into the Java Runtime. My app..

Write HTML file using Java

I want my Java application to write HTML code in a file. Right now, I am hard coding HTML tags using java.io.BufferedWriter class. For Example: BufferedWriter bw = new BufferedWriter(new FileWriter(f..

Declare variable MySQL trigger

My question might be simple for you, if you're used to MySQL. I'm used to PostgreSQL SGBD and I'm trying to translate a PL/PgSQL script to MySQL. Here is what I have : delimiter // CREATE TRIGGER p..

How to import existing *.sql files in PostgreSQL 8.4?

I am using PostgreSQL 8.4, and I have some *.sql files to import into a database. How can I do so?..

Bootstrap 3 Horizontal Divider (not in a dropdown)

I know Bootstrap 3 has a horizontal divider you can place inside of dropdown menus to separate links like this: <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu2"> <l..

How to detect if JavaScript is disabled?

There was a post this morning asking about how many people disable JavaScript. Then I began to wonder what techniques might be used to determine if the user has it disabled. Does anyone know of some..

Python 3 Building an array of bytes

I need to build a tcp frame with raw binary data, but all examples and tutorials I've found talking about bytes always involve conversion from a string, and that's not what I need. In short, I need t..

Find duplicates and delete all in notepad++

I have multiple email addresses. I need to find and delete all (including found one). Is this possible in notepad++? example:[email protected], [email protected], [email protected], [email protected],..

css ellipsis on second line

CSS text-overflow: ellipsis on second line, is this possible? I can't find it on the net. example: what I want is like this: I hope someone could help me. I need an ellipsis on the second line of...

How to edit default.aspx on SharePoint site without SharePoint Designer

On several occations, I have faced the situation that the default.aspx page on a Site doesn't work. More specifically, a reference to a WebPart and/or Control is throwing a error because the assembly ..

Autocompletion of @author in Intellij

I'm migrating from Eclipse to Intellij Idea. One thing I couldn't figure out yet is autocompletion of the @author JavaDoc tag. When typing @a in Eclipse, there are two proposals: @author - author na..

What is the Swift equivalent to Objective-C's "@synchronized"?

I've searched the Swift book, but can't find the Swift version of @synchronized. How do I do mutual exclusion in Swift?..

Using CSS for a fade-in effect on page load

Can CSS transitions be used to allow a text paragraph to fade-in on page load? I really like how it looked on http://dotmailapp.com/ and would love to use a similar effect using CSS. The domain has s..

Differences between "java -cp" and "java -jar"?

What is the difference between running a Java application withjava -cp CLASSPATH and java -jar JAR_FILE_PATH? Is one of them preferred to the other for running a Java application? I mean which one of ..

Check if an image is loaded (no errors) with jQuery

I'm using JavaScript with the jQuery library to manipulate image thumbnails contained in a unordered list. When the image is loaded it does one thing, when an error occurs it does something else. I'm ..

Cannot delete or update a parent row: a foreign key constraint fails

When doing: DELETE FROM `jobs` WHERE `job_id` =1 LIMIT 1 It errors: #1451 - Cannot delete or update a parent row: a foreign key constraint fails (paymesomething.advertisers, CONSTRAINT advertise..

How to pass command line arguments to a shell alias?

How do I pass the command line arguments to an alias? Here is a sample: alias mkcd='mkdir $1; cd $1;' But in this case the $xx is getting translated at the alias creating time and not at runtime...

Get list of all input objects using JavaScript, without accessing a form object

I need to get all the input objects and manipulate the onclick param. The following does the job for <a> links. Looking for something like this for input tags. for (var ls = document.links, nu..

SSRS expression to format two decimal places does not show zeros

I am using the following expression to format my value to show only two decimal points. Which Works fine if the value is not 0. However when the value is 0 it does not show 0. eg. Expression used =..

Responsive image align center bootstrap 3

I do a catalog using Bootstrap 3. When displayed on tablets, the product images look ugly because of their small size (500x500) and a width of 767 pixels in the browser. I want to put the image in the..

SharePoint : How can I programmatically add items to a custom list instance

I am really looking for either a small code snippet, or a good tutorial on the subject. I have a C# console app that I will use to somehow add list items to my custom list. I have created a custom c..

In R, dealing with Error: ggplot2 doesn't know how to deal with data of class numeric

I'm new to R and haven't done any programming before... When I attempt to create a box chart with standard error bars I get the error message mentioned in the title. I used a script I found on R Coo..

What is an .inc and why use it?

I often see examples in PHP that include.inc files. What is the meaning of .inc? What it is used for? What are the disadvantages and advantages of using it?..

Get Windows version in a batch file

I need to get the OS version with a batch file. I 've seen a lot of examples online, many uses something like this code: @echo off ver | find "XP" > nul if %ERRORLEVEL% == 0 goto ver_xp if not e..

UTL_FILE.FOPEN() procedure not accepting path for directory?

I am trying to write in a file stored in c:\ drive named vin1.txt and getting this error .Please suggest! > ERROR at line 1: ORA-29280: invalid > directory path ORA-06512: at > "SYS.UTL_FILE..

How can I get the executing assembly version?

I am trying to get the executing assembly version in C# 3.0 using the following code: var assemblyFullName = Assembly.GetExecutingAssembly().FullName; var version = assemblyFullName .Split(',')[1].Sp..

How do I write a compareTo method which compares objects?

I am learning about arrays, and basically I have an array that collects a last name, first name, and score. I need to write a compareTo method that will compare the last name and then the first name ..

Setting Authorization Header of HttpClient

I have an HttpClient that I am using for a REST API. However I am having trouble setting up the Authorization header. I need to set the header to the token I received from doing my OAuth request. I sa..

Streaming via RTSP or RTP in HTML5

I'm building a web app that should play back an RTSP/RTP stream from a server http://lscube.org/projects/feng. Does the HTML5 video/audio tag support the rtsp or rtp? If not, what would the easiest s..

Difference between CR LF, LF and CR line break types?

I'd like to know the difference (with examples if possible) between CR LF (Windows), LF (Unix) and CR (Macintosh) line break types. ..

Is it possible to refresh a single UITableViewCell in a UITableView?

I have a custom UITableView using UITableViewCells. Each UITableViewCell has 2 buttons. Clicking these buttons will change an image in a UIImageView within the cell. Is it possible to refresh each ce..

Hibernate: "Field 'id' doesn't have a default value"

I'm facing what I think is a simple problem with Hibernate, but can't solve it (Hibernate forums being unreachable certainly doesn't help). I have a simple class I'd like to persist, but keep getting..

IIS Config Error - This configuration section cannot be used at this path

I am getting the below error when I try to run my website. The website is hosted on Windows 2012 R2. Config error: This configuration section cannot be used at this path. This happens when the sect..

Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain

How do you fix this XCode error : Code Sign error: The identity 'iPhone Developer' doesn't match any valid certificate/private key pair in the default keychain ..

How can I convert my Java program to an .exe file?

If I have a Java source file (*.java) or a class file (*.class), how can I convert it to a .exe file? I also need an installer for my program...

Why does find -exec mv {} ./target/ + not work?

I want to know exactly what {} \; and {} \+ and | xargs ... do. Please clarify these with explanations. Below 3 commands run and output same result but the first command takes a little time and the f..

TypeScript-'s Angular Framework Error - "There is no directive with exportAs set to ngForm"

I keep getting this error while using TypeScript's Angular2-forms framework: There is no directive with "exportAs" set to "ngForm" Here's my code project dependencies : "dependencies": { ..

Counter exit code 139 when running, but gdb make it through

My question sounds specific, but I doubt it still can be of a C++ debug issue. I am using omnet++ which is to simulate wireless network. omnet++ itself is a c++ program. I encountered a queer phenom..

Attempt to present UIViewController on UIViewController whose view is not in the window hierarchy

Just started using Xcode 4.5 and I got this error in the console: Warning: Attempt to present < finishViewController: 0x1e56e0a0 > on < ViewController: 0x1ec3e000> whose view is not in the w..

How to delete the last row of data of a pandas dataframe

I think this should be simple, but I tried a few ideas and none of them worked: last_row = len(DF) DF = DF.drop(DF.index[last_row]) #<-- fail! I tried using negative indices but that also lead ..

Adding Access-Control-Allow-Origin header response in Laravel 5.3 Passport

I'm new to Laravel and am doing some Laravel 5.3 Passport project with OAuth2.0 password grant. When I curl the API with the params it responds with token. However, in browser it needs an additional s..

Linq select objects in list where exists IN (A,B,C)

I have a list of orders. I want to select orders based on a set of order statuses. So essentially select orders where order.StatusCode in ("A", "B", "C") // Filter the orders based on the order stat..

Tomcat won't stop or restart

I tried stopping tomcat. It failed with this message: Tomcat did not stop in time. PID file was not removed. I then tried again and got this: PID file (/opt/tomcat/work/catalina.pid) found but ..

No resource found that matches the given name: attr 'android:keyboardNavigationCluster'. when updating to Support Library 26.0.0

I've got this issue while updating to the latest Support Library version 26.0.0 (https://developer.android.com/topic/libraries/support-library/revisions.html#26-0-0): Error:(18, 21) No resource f..

Convert DataTable to CSV stream

Currently have a DataTable, but wish to stream it to the user via a WebHandler. FileHelpers has CommonEngine.DataTableToCsv(dt, "file.csv"). However it saves it to a file. How can I save it to a strea..

How can I use the $index inside a ng-repeat to enable a class and show a DIV?

I have a set of <li> elements. <ul> <li ng-class="{current: selected == 100}"> <a href ng:click="selected=100">ABC</a> </li> <li ng-class="{current: ..

setMaxResults for Spring-Data-JPA annotation?

I am trying to incorporate Spring-Data-JPA into my project. One thing that confuses me is how do I achieve setMaxResults(n) by annotation ? for example, my code: public interface UserRepository extend..

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

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

How to get the selected item of a combo box to a string variable in c#

Can anyone tell me how to get the selected item of a ComboBox to a string variable? string selected = cmbbox.SelectedItem.ToString(); MessageBox.Show(selected); This gives me System.Data.DataRowVie..

Best Practice: Software Versioning

Is there any guideline or standard best practice how to version a software you develop in your spare time for fun, but nevertheless will be used by some people? I think it's necessary to version such ..

How to append a date in batch files

I have the following line in a batch file (that runs on an old Windows 2000 box): 7z a QuickBackup.zip *.backup How do I append the date to the QuickBackup.zip file. So if I ran the batch file toda..

How to pretty-print a numpy.array without scientific notation and with given precision?

I'm curious, whether there is any way to print formatted numpy.arrays, e.g., in a way similar to this: x = 1.23456 print '%.3f' % x If I want to print the numpy.array of floats, it prints several d..

Deploying my application at the root in Tomcat

I have the war file of my application. I need to deploy this at the root level. The current URL is http://localhost:8080/war_name/application_name...

Capture screenshot of active window?

I am making a screen capturing application and everything is going fine. All I need to do is capture the active window and take a screenshot of this active window. Does anyone know how I can do this..

How can I list all collections in the MongoDB shell?

In the MongoDB shell, how do I list all collections for the current database that I'm using?..

How to store arrays in MySQL?

I have two tables in MySQL. Table Person has the following columns: id | name | fruits The fruits column may hold null or an array of strings like ('apple', 'orange', 'banana'), or ('strawberry'), ..

How do I send a JSON string in a POST request in Go

I tried working with Apiary and made a universal template to send JSON to mock server and have this code: package main import ( "encoding/json" "fmt" "github.com/jmcvetta/napping" "l..

What is the precise meaning of "ours" and "theirs" in git?

This might sound like too basic of a question, but I have searched for answers and I am more confused now than before. What does "ours" and "theirs" mean in git when merging my branch into my other b..

How do I test which class an object is in Objective-C?

How do I test whether an object is an instance of a particular class in Objective-C? Let's say I want to see if object a is an instance of class b, or class c, how do I go about doing it?..

How to create empty data frame with column names specified in R?

Possible Duplicate: Create an Empty Data.Frame I need to create an empty data frame in R with specified column names. Any simplest way ?..

Use querystring variables in MVC controller

I am new to C#.net MVC and am trying to add FullCalendar to an MVC application. The FullCalendar script automatically adds ?start={}&end={} to the URL...which is fine, but I have no idea how to..

How can I schedule a daily backup with SQL Server Express?

I'm running a small web application with SQL server express (2005) as backend. I can create a backup with a SQL script, however, I'd like to schedule this on a daily basis. As extra option (should-ha..

how to overlap two div in css?

I have two div likes , <div class="imageDiv"></div> <div class="imageDiv"></div> and css class , .imageDiv { margin-left: 100px; background: #fff; ..

Does svn have a `revert-all` command?

If I want to throw away all of my changes, and return to the code that is on the repository, I do the following: $ rm -fr * $ svn up This is easy enough, but I'm wondering if there is a single comm..

An internal error occurred during: "Updating Maven Project". java.lang.NullPointerException

I'm developing a Java EE web project. When I try to add a dependency, this error message appears. I use Eclipse Kepler. An internal error occurred during: "Updating Maven Project". java.lang.NullP..

Using NotNull Annotation in method argument

I just started using the @NotNull annotation with Java 8 and getting some unexpected results. I have a method like this: public List<Found> findStuff(@NotNull List<Searching> searchingLi..

Location of GlassFish Server Logs

I have NetBeans IDE installed on a Windows 7 64-bit machine. Obviously, NetBeans comes with the GlassFish server. I am currently having problems with a project and would like to check the server log..

Find oldest/youngest datetime object in a list

I've got a list of datetime objects, and I want to find the oldest or youngest one. Some of these dates might be in the future. from datetime import datetime datetime_list = [ datetime(2009, 10,..

How do I check if the Java JDK is installed on Mac?

How do you check if Java SDK is installed on a Mac? Is there a command line for this?..

How to subtract one month using moment.js?

I have a current month generated using moment().format('MMM YYYY'). I need to get last six months using this current month. How to subtract one month using moment.js?..

Find object by id in an array of JavaScript objects

I've got an array: myArray = [{'id':'73','foo':'bar'},{'id':'45','foo':'bar'}, etc.] I'm unable to change the structure of the array. I'm being passed an id of 45, and I want to get 'bar' for that ..

Changing column names of a data frame

I have a data frame called "newprice" (see below) and I want to change the column names in my program in R. > newprice Chang. Chang. Chang. 1 100 36 136 2 120 -33 ..

How do I get the title of the current active window using c#?

I'd like to know how to grab the Window title of the current active window (i.e. the one that has focus) using C#. ..

Better way to check variable for null or empty string?

Since PHP is a dynamic language what's the best way of checking to see if a provided field is empty? I want to ensure that: null is considered an empty string a white space only string is conside..

How do I vertically center an H1 in a div?

First of all, my apologies. I know there are various solutions posted for this issue here, but for the life of me I can't get any of them to work. For a responsive website I'm trying to center an h1..

How to pass ArrayList of Objects from one to another activity using Intent in android?

I have the following in code in my onClick() method as List<Question> mQuestionsList = QuestionBank.getQuestions(); Now I have the intent after this line, as follows : Intent resultInten..

Inline comments for Bash?

I'd like to be able to comment out a single flag in a one-line command. Bash only seems to have from # till end-of-line comments. I'm looking at tricks like: ls -l $([ ] && -F is turned off) ..

How can I reference a dll in the GAC from Visual Studio?

This assembly is in the GAC: Microsoft.SqlServer.Management.RegisteredServers.dll How can I add a reference to this assembly in Visual Studio? I can view the file in c:\windows\assembly\..

Call a method of a controller from another controller using 'scope' in AngularJS

I am trying to call a method of second controller in first controller by using scope variable. This is a method in my first controller: $scope.initRestId = function(){ var catapp = document.g..

Table and Index size in SQL Server

Can we have a SQL query which will basically help in viewing table and index sizes in SQl Server. How SQL server maintains memory usage for tables/indexes?..

Check if a given time lies between two times regardless of date

I have timespans: String time1 = 01:00:00 String time2 = 05:00:00 I want to check if time1 and time2 both lies between 20:11:13 and 14:49:00. Actually, 01:00:00 is greater than 20:11:13 and less tha..

Algorithm for Determining Tic Tac Toe Game Over

I've written a game of tic-tac-toe in Java, and my current method of determining the end of the game accounts for the following possible scenarios for the game being over: The board is full, and no ..

Center Contents of Bootstrap row container

I have the code below and I'd like to center the "well" elements of the outer "row" div. I've tried various approaches such as text-align: center (which just centers the text and not the inner DIV el..

How to remove empty cells in UITableView?

i am trying to display a simple UITableView with some data. I wish to set the static height of the UITableView so that it doesn't displays empty cells at the end of the table. how do I do that? code:..

Best way to store data locally in .NET (C#)

I'm writing an application that takes user data and stores it locally for use later. The application will be started and stopped fairly often, and I'd like to make it save/load the data on application..

ImportError: No module named pythoncom

I am a newbie (just 1 week) to this Python world. I tried installing django-mssql, but when I tried to import the library (using import sqlserver_ado.dbapi), I got this error message: ImportError: No..

How to pretty print nested dictionaries?

How can I pretty print a dictionary with depth of ~4 in Python? I tried pretty printing with pprint(), but it did not work: import pprint pp = pprint.PrettyPrinter(indent=4) pp.pprint(mydict) I si..

Converting milliseconds to minutes and seconds with Javascript

Soundcloud's API gives the duration of it's tracks as milliseconds. JSON looks like this: "duration": 298999 I've tried many functions I found on here to no avail. I'm just looking for something to..

Why does integer division in C# return an integer and not a float?

Does anyone know why integer division in C# returns an integer and not a float? What is the idea behind it? (Is it only a legacy of C/C++?) In C#: float x = 13 / 4; //== operator is overridden he..

What does %w(array) mean?

I'm looking at the documentation for FileUtils. I'm confused by the following line: FileUtils.cp %w(cgi.rb complex.rb date.rb), '/usr/lib/ruby/1.6' What does the %w mean? Can you point me to th..

JQuery: dynamic height() with window resize()

I'm having an issue identical to this poster: Jquery problem with height() and resize() But the solution doesn't fix my issue. I have three stacked divs, and I want to use JQuery to make the middle o..

jQuery - getting custom attribute from selected option

Given the following: <select id="location"> <option value="a" myTag="123">My option</option> <option value="b" myTag="456">My other option</option> </select&g..

jQuery SVG vs. Raphael

I'm working on an interactive interface using SVG and JavaScript/jQuery, and I'm trying to decide between Raphael and jQuery SVG. I'd like to know What the trade-offs are between the two Where the ..

Unexpected token < in first line of HTML

I have an HTML file : <!DOCTYPE HTML> <html lang="en-US" ng-app="Todo"> <head> <meta charset="UTF-8"> <title>DemoAPI</title> <meta name="viewport">..

How can I parse a time string containing milliseconds in it with python?

I am able to parse strings containing date/time with time.strptime >>> import time >>> time.strptime('30/03/09 16:31:32', '%d/%m/%y %H:%M:%S') (2009, 3, 30, 16, 31, 32, 0, 89, -1) ..

How to find the lowest common ancestor of two nodes in any binary tree?

The Binary Tree here is may not necessarily be a Binary Search Tree. The structure could be taken as - struct node { int data; struct node *left; struct node *right; }; The maximum solu..

java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String() in Java EE application

I am developing a Java EE application in which I need Base64 Encoding/Decoding So I added commons-codec-1.5.jar in WEB-INF/lib folder of my application and used import org.apache.commons.codec.bina..

How do I "select Android SDK" in Android Studio?

After a successful import of an Eclipse-Android-Project into "Android Studio 1.4", I get the error "Please select Android SDK" when I click on the button to run the application in simulator, bu..

ReactJS SyntheticEvent stopPropagation() only works with React events?

I'm trying to use event.stopPropagation() within a ReactJS component to stop a click event from bubbling up and triggering a click event that was attached with JQuery in legacy code, but it seems like..

How to convert int[] to Integer[] in Java?

I'm new to Java and very confused. I have a large dataset of length 4 int[] and I want to count the number of times that each particular combination of 4 integers occurs. This is very similar to cou..

What does the function then() mean in JavaScript?

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

Sum across multiple columns with dplyr

My question involves summing up values across multiple columns of a data frame and creating a new column corresponding to this summation using dplyr. The data entries in the columns are binary(0,1). I..

How do I change screen orientation in the Android emulator?

How do we change emulator screen orientation to landscape or portrait?..

PyCharm import external library

I am using PyCharm as an editor for python code in Houdini. Whenever I try to import the main Houdini library (hou) I get an error flagged in PyCharm. If I include the code snippet:- try: import..

What's the difference between MyISAM and InnoDB?

I understand that this question has been asked before, but most of the time it is asked in relation to a specific database or table. I cannot find an answer on this site that describes the two engines..

How do I capture the output of a script if it is being ran by the task scheduler?

Using Windows Server 2008, how do I go about capturing the output of a script that is being ran with the windows task scheduler? I'm testing a rather long custom printing batch-script, and for debugg..

Using "If cell contains #N/A" as a formula condition.

I need help on my Excel sheet. How can I declare the following IF condition properly? if A1 = "n/a" then C1 = B1 else if A1 != "n/a" or has value(int) then C1 = A1*B1 ..

C# Generics and Type Checking

I have a method that uses an IList<T> as a parameter. I need to check what the type of that T object is and do something based on it. I was trying to use the T value, but the compiler does not..

Downloading jQuery UI CSS from Google's CDN

I am planning on using Google to download the jQuery lib for both UI and Core. My question is, do they allow me to download the CSS for it or should I have to host it myself? Also if I use Google to ..

Full Page <iframe>

I have the example code below. This works fine with all browsers except for browsers on mobile devices. The overflow tag is the issue. Works with all except for mobile: margin: 0; padding: 0; heigh..

Visual Studio keyboard shortcut to display IntelliSense

What's the keyboard shortcut for Visual Studio 2005 and Visual Studio 2008 to display the IntelliSense box if one accidentally hits ESC and wants the box come back again? ..

Convert string to List<string> in one line?

I have a string: var names = "Brian,Joe,Chris"; Is there a way to convert this to a List<string> delimited by , in one line?..

How do I delete everything in Redis?

I want to delete all keys. I want everything wiped out and give me a blank database. Is there a way to do this in Redis client?..

How do I detect a page refresh using jquery?

How might I capture the page reload event? I have a messaging system which loses all its input when the user refreshes the page. I want to use ajax to re-populate, hence my need to detect when the pa..

Disabling enter key for form

I have been trying to disable the Enter key on my form. The code that I have is shown below. For some reason the enter key is still triggering the submit. The code is in my head section and seems to b..

How do I move files in node.js?

How can I move files (like mv command shell) on node.js? Is there any method for that or should I read a file, write to a new file and remove older file?..

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

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

How to call on a function found on another file?

I'm recently starting to pick up C++ and the SFML library, and I was wondering if I defined a Sprite on a file appropriately called "player.cpp" how would I call it on my main loop located at "main.cp..

JFrame background image

I am creating a GUI, albeit a simple one, and I want to have a background image (2048 X 2048) fill up the whole window and a square to the left top corner where the occasional 64 X 64 image can be loa..

How can I change NULL to 0 when getting a single value from a SQL function?

I have a query that counts the price of all items between two dates. Here is the select statement: SELECT SUM(Price) AS TotalPrice FROM Inventory WHERE (DateAdded BETWEEN @StartDate AND @EndDate) ..

Redirecting to URL in Flask

I'm new to Python and Flask and I'm trying to do the equivalent of Response.redirect as in C# - ie: redirect to a specific URL - how do I go about this? Here is my code: import os from flask import ..

jQuery - prevent default, then continue default

I have a form that, when submitted, I need to do some additional processing before it should submit the form. I can prevent default form submission behavior, then do my additional processing (it's bas..

FromBody string parameter is giving null

This is probably something very basic, but I am having trouble figuring out where I am going wrong. I am trying to grab a string from the body of a POST, but "jsonString" only shows as null. I also ..

Can't find AVD or SDK manager in Eclipse

Seems like I'm having some problems after updating my android sdk tools and platform-tools using the sdk manager. The problem is that, after updating, I found that the avd or sdk options in the window..

MySQL Database won't start in XAMPP Manager-osx

I downloaded XAMPP about a month ago and it was working just fine. Today I installed a voice recognition software and then restarted my computer. Ever since, MySQL won't start in my manager-osx applic..

WARNING in budgets, maximum exceeded for initial

When build my angular 7 project with --prod, i have a warning in budgets. I have a angular 7 project, i want to build it, but i have a warning: WARNING in budgets, maximum exceeded for initial. Budg..

How to filter WooCommerce products by custom attribute

I'm trying to filter WooCommerce product archive by custom attributes. For example, there are 5 products with attribute "color" containing "red", and another 3 with attribute "color" containing "blue..

File Upload to HTTP server in iphone programming

Can anyone provide me some links or examples to upload files to the HTTP server using iphone APIs...

How do I find the location of Python module sources?

How do I learn where the source file for a given Python module is installed? Is the method different on Windows than on Linux? I'm trying to look for the source of the datetime module in particular, ..

Set initial focus in an Android application

In my Android application it automatically focuses the first Button I have in my layout, giving it an orange outline. How can I set the initial focus preferably in XML, and can this be set to nothing?..

Difference between dict.clear() and assigning {} in Python

In python, is there a difference between calling clear() and assigning {} to a dictionary? If yes, what is it? Example:d = {"stuff":"things"} d.clear() #this way d = {} #vs this way ..

What is the difference between git pull and git fetch + git rebase?

Another question says that git pull is like a git fetch + git merge. But what is the difference between git pull and git fetch + git rebase?..

Why is my locally-created script not allowed to run under the RemoteSigned execution policy?

Since this question continues to attract responses that are either refuted by the question body or don't address the actual problem, please read this simple summary of what you need to know: ..

Fastest way to determine if record exists

As the title suggests... I'm trying to figure out the fastest way with the least overhead to determine if a record exists in a table or not. Sample query: SELECT COUNT(*) FROM products WHERE produc..

Looping through a Scripting.Dictionary using index/item number

Similar to this issue, when using a Scripting.Dictionary object in VBA, the outcome of the code below is unexpected. Option Explicit Sub test() Dim d As Variant Dim i As Integer Dim s A..

HTML email in outlook table width issue - content is wider than the specified table width

My HTML email template is displaying correctly without major problems in Gmail, Apple Mail and iOS Mail. Outlook however is a horrifying mess and I can't for the life of me figure out what I've done w..

Linux / Bash, using ps -o to get process by specific name?

I am trying to use the ps -o command to get just specific info about processes matching a certain name. However, I am having some issues on this, when I try to use this even to just get all processes,..

How to update gradle in android studio?

I installed Android Studio 0.1.9. Today I got and update to version 0.2 and of course I updated. After the installation I restarted Android Studio but now I get this message: Project is using an ..