Questions Tagged with #Blackberry simulator

Use BlackBerry device simulators to demonstrate and test how the BlackBerry device software, screen, keyboard and trackwheel will work with your application. These simulators will also simulate behavior in various wireless network conditions. Device simulators are great tools for testing, training and for use in presentations. More information http://www.blackberry.com/developers/downloads/simulators/

How to obtain the last index of a list?

Suppose I've the following list: list1 = [1, 2, 33, 51] ^ | indices 0 1 2 3 How do I obtain the last index, which in this case would be 3, of that list..

Redirection of standard and error output appending to the same log file

I need to collect the standard output and error log from several processes into one single log file. So every output must append to this log file. I want to call all the jobs with lines like this: ..

Comparing two columns, and returning a specific adjacent cell in Excel

I am using a combination of if, vlookup, match, iserror functions, and unfortunately I've not been able to find the right formula. Comparing two columns for matches is easy enough. the tough part has..

How do I link object files in C? Fails with "Undefined symbols for architecture x86_64"

So I'm trying trying to use a function defined in another C (file1.c) file in my file (file2.c). I'm including the header of file1 (file1.h) in order to do this. However, I keep getting the following..

Why should I use var instead of a type?

Possible Duplicate: ReSharper and var After I have installed ReSharper it demands(by warnings) that I use var whenever possible, for example UnhandledExceptionEventArgs ue = (UnhandledExce..

C++ vector of char array

I am trying to write a program that has a vector of char arrays and am have some problems. char test [] = { 'a', 'b', 'c', 'd', 'e' }; vector<char[]> v; v.push_back(test); Sorry this has to..

How to execute an .SQL script file using c#

I'm sure this question has been answered already, however I was unable to find an answer using the search tool. Using c# I'd like to run a .sql file. The sql file contains multiple sql statements, so..

converting epoch time with milliseconds to datetime

I have used a ruby script to convert iso time stamp to epoch, the files that I am parsing has following time stamp structure: 2009-03-08T00:27:31.807 Since I want to keep milliseconds I used follo..

Reading a text file using OpenFileDialog in windows forms

I am new to the OpenFileDialog function, but have the basics figured out. What I need to do is open a text file, read the data from the file (text only) and correctly place the data into separate text..

Executing multiple SQL queries in one statement with PHP

How to join those multiple queries into one (can I?) $query = "DELETE FROM aktywne_kody WHERE kodsms ='$kodSMSgracza' AND typkodu ='$id'"; mysql_query($query) or die(mysql_error()); $query = "INSERT..

SVN: Is there a way to mark a file as "do not commit"?

With TortoiseSVN, I can move a file into the ignore-on-commit changelist, so that when I commit a whole tree, changes to that file do not get committed. Is there a way to do something like that using..

Uploading both data and files in one form using Ajax?

I'm using jQuery and Ajax for my forms to submit data and files but I'm not sure how to send both data and files in one form? I currently do almost the same with both methods but the way in which the..

What is the best way to compare floats for almost-equality in Python?

It's well known that comparing floats for equality is a little fiddly due to rounding and precision issues. For example: https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-..

Capturing TAB key in text box

I would like to be able to use the Tab key within a text box to tab over four spaces. The way it is now, the Tab key jumps my cursor to the next input. Is there some JavaScript that will capture the ..

What is the difference between Scope_Identity(), Identity(), @@Identity, and Ident_Current()?

I know Scope_Identity(), Identity(), @@Identity, and Ident_Current() all get the value of the identity column, but I would love to know the difference. Part of the controversy I'm having is what do t..

How to show MessageBox on asp.net?

if I need to show a MessageBox on my ASP.NET WebForm, how to do it? I try: Messagebox.show("dd"); But it's not working...

Div table-cell vertical align not working

I am trying to simply center text horizontally and vertically using DIV and display type as table-cell but it is not working in either IE8 or Firefox. Below is the CSS that I am using and that is all..

Cannot open include file: 'stdio.h' - Visual Studio Community 2017 - C++ Error

I am trying to Build a Solution on Visual Studio Community 2017, but I keep getting the error "Cannot open include file: 'stdio.h' ". I've read through several similar questions, but still can't fix t..

Installing J2EE into existing eclipse IDE

I have Eclipse Galileo (Version: 3.5.2), which I use to develop Jave SE applications. I want to learn Java EE. How do I incorporate Java EE? Or do I need to install a Java EE specific Eclipse IDE? Fo..

How to stop INFO messages displaying on spark console?

I'd like to stop various messages that are coming on spark shell. I tried to edit the log4j.properties file in order to stop these message. Here are the contents of log4j.properties # Define the ro..

JSTL if tag for equal strings

I've got a variable from an object on my JSP page: <%= ansokanInfo.getPSystem() %> The value of the variable is NAT which is correct and I want to apply certain page elements for this value. H..

Validate phone number with JavaScript

I found this code in some website, and it works perfectly. It validates that the phone number is in one of these formats: (123) 456-7890 or 123-456-7890 The problem is that my client (I don't know ..

tsconfig.json: Build:No inputs were found in config file

I have an ASP.NET core project and I'm getting this error when I try to build it: error TS18003: Build:No inputs were found in config file 'Z:/Projects/client/ZV/src/ZV/Scripts/tsconfig.json'. Specif..

SQL Server Restore Error - Access is Denied

I created a database on my local machine and then did a backup called tables.bak of table DataLabTables. I moved that backup to a remote machine without that table and tried to do a restore but get ..

How do I see all foreign keys to a table or column?

In MySQL, how do I get a list of all foreign key constraints pointing to a particular table? a particular column? This is the same thing as this Oracle question, but for MySQL...

Proper way to set response status and JSON content in a REST API made with nodejs and express

I am playing around with Nodejs and express by building a small rest API. My question is, what is the good practice/best way to set the code status, as well as the response data? Let me explain with ..

How to import a new font into a project - Angular 5

I want to import a new font to my Angular 5 project. I have tried: 1) Copying the file to assets/fonts/ 2) adding it to .angular-cli.json styles but I have checked that the file is not a .css, it ..

Docker error: invalid reference format: repository name must be lowercase

Ran into this Docker error with one of my projects: invalid reference format: repository name must be lowercase What are the various causes for this generic message? I already figured it out after ..

How to make a simple image upload using Javascript/HTML

Does any one know how to do a simple image upload and display it on the page. This is what I'm looking for. User(me) will choose a image The page will display the image without refreshing the page ..

Powershell get ipv4 address into a variable

Is there an easy way in powershell 3.0 Windows 7 to get the local computer's ipv4 address into a variable?..

What causes: "Notice: Uninitialized string offset" to appear?

I have a form that users fill out, and on the form there are multiple identical fields, like "project name", "project date", "catagory", etc. Based on how many forms a user is submitting, my goal is t..

Checking if a string can be converted to float in Python

I've got some Python code that runs through a list of strings and converts them to integers or floating point numbers if possible. Doing this for integers is pretty easy if element.isdigit(): newe..

How to dynamically create a class?

I have a class which looks like this: public class Field { public string FieldName; public string FieldType; } And an object List<Field> with values: {"EmployeeID","int"}, {"Employee..

Can a class member function template be virtual?

I have heard that C++ class member function templates can't be virtual. Is this true? If they can be virtual, what is an example of a scenario in which one would use such a function?..

Get battery level and state in Android

How can I get battery level and state (plugged in, discharging, charging, etc)? I researched the developer docs and I found a BatteryManager class. But it doesn't contain any methods, just constants. ..

How to convert interface{} to string?

I'm using docopt to parse command-line arguments. This works, and it results in a map, such as map[<host>:www.google.de <port>:80 --help:false --version:false] Now I would like to conca..

Adding elements to object

I need to populate a json file, now I have something like this: {"element":{"id":10,"quantity":1}} And I need to add another "element". My first step is putting that json in a Object type using car..

How can I "disable" zoom on a mobile web page?

I am creating a mobile web page that is basically a big form with several text inputs. However (at least on my Android cellphone), every time I click on some input the whole page zooms there, obscuri..

What are the aspect ratios for all Android phone and tablet devices?

I'm looking for a list of all screen aspect ratios for popular Android based Phones and Tablets...

Global variable Python classes

What is the proper way to define a global variable that has class scope in python? Coming from a C/C++/Java background I assume that this is correct: class Shape: lolwut = None def __init_..

How to read the content of a file to a string in C?

What is the simplest way (least error-prone, least lines of code, however you want to interpret it) to open a file in C and read its contents into a string (char*, char[], whatever)?..

JavaScript: function returning an object

I'm taking some JavaScript/jQuery lessons at codecademy.com. Normally the lessons provide answers or hints, but for this one it doesn't give any help and I'm a little confused by the instructions. I..

Best way to format multiple 'or' conditions in an if statement (Java)

A simple question but Google hasn't been helping much. I have an if statement with many conditions (have to check for 10 or 15 constants to see if any of them are present.) Instead of writing someth..

URL string format for connecting to Oracle database with JDBC

I'm a newbie to Java-related web development, and I can't seem to get a simple program with JDBC working. I'm using off-the-shelf Oracle 10g XE and the Eclipse EE IDE. From the books and web pages I'v..

The import android.support cannot be resolved

I am trying to run the code provided HERE I downloaded the code from their Github and imported into Android SDK, but it shows error at the lines import android.support.v4.app.FragmentActivity; impo..

How to get terminal's Character Encoding

Now I change my gnome-terminal's character encoding to "GBK" (default it is UTF-8), but how can I get the value(character encoding) in my Linux?..

Android, landscape only orientation?

How can I make it so the screen orientation is always landscape? Do I need to add something to the manifest.xml?..

How can I get the average (mean) of selected columns

I would like to get the average for certain columns for each row. I have this data: w=c(5,6,7,8) x=c(1,2,3,4) y=c(1,2,3) length(y)=4 z=data.frame(w,x,y) Which returns: w x y 1 5 1 1 2 6 2 2 ..

Java 8 stream map on entry set

I'm trying to perform a map operation on each entry in a Map object. I need to take a prefix off the key and convert the value from one type to another. My code is taking configuration entries from a..

PHP array value passes to next row

I have an array building multiple instances of the following fields: <div class="checkbox_vm"> <input type="hidden" name="fk_row[]" value="<?php echo $i; ?>"> <input type..

Display a table/list data dynamically in MVC3/Razor from a JsonResult?

I have a view page, users.cshtml. And I have a JsonResult action method, jsongetusers() that returns the list of users in json format. On users.cshtml page load, I want to get the list of users, bui..

IF EXISTS in T-SQL

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

how to delete a specific row in codeigniter?

I am new in codeigniter.In my view page I am showing the data from database in a table where I have two anchor tags for update and delete. I want to delete a specific row from database through id. m..

Postgresql Select rows where column = array

This is a summary of what I am trying to do: $array[0] = 1; $array[1] = 2; $sql = "SELECT * FROM table WHERE some_id = $array" Obviously, there are some syntax issues, but this is what I want to d..

Convert int to char in java

Below is a code snippet, int a = 1; char b = (char) a; System.out.println(b); But what I get is empty output. int a = '1'; char b = (char) a; System.out.println(b); I will get 1 as my output. ..

How do I remove an item from a stl vector with a certain value?

I was looking at the API documentation for stl vector, and noticed there was no method on the vector class that allowed the removal of an element with a certain value. This seems like a common operati..

How to apply bold text style for an entire row using Apache POI?

How to make an entire excel row cells bold text using Apache POI? E.g: Column headings should be in bold. Instead of applying style for each and every cell of heading row, how can I apply some style ..

How do I dynamically set HTML5 data- attributes using react?

I'd like to render an HTML5 attribute of a <select> input so that I can use jquery image picker with react. My code is: var Book = React.createClass({ render: function() { return ( ..

PHP - Extracting a property from an array of objects

I've got an array of cats objects: $cats = Array ( [0] => stdClass Object ( [id] => 15 ), [1] => stdClass Object ( ..

Setting background color for a JFrame

Just how do you set the background color for a JFrame?..

How do I see the current encoding of a file in Sublime Text?

How do I see the current encoding of a file in Sublime Text? This seems like a pretty simple thing to do but searching has not yielded much. Any pointers would be appreciated!..

How to get the primary IP address of the local machine on Linux and OS X?

I am looking for a command line solution that would return me the primary (first) IP address of the localhost, other than 127.0.0.1 The solution should work at least for Linux (Debian and RedHat) and..

Excel VBA calling sub from another sub with multiple inputs, outputs of different sizes

I would like to call a sub from another sub inside in the same module. The first sub would be my main code and there I would call the second subroutine. Second subroutine receives multiple inputs as i..

Best way to get identity of inserted row?

What is the best way to get IDENTITY of inserted row? I know about @@IDENTITY and IDENT_CURRENT and SCOPE_IDENTITY but don't understand the pros and cons attached to each. Can someone please explain..

What is the meaning of polyfills in HTML5?

What is the meaning of polyfills in HTML5? I saw this word in many sites about HTML5, e.g. HTML5-Cross-Browser-Polyfills. So here we're collecting all the shims, fallbacks, and polyfills in orde..

Join between tables in two different databases?

In MySQL, I have two different databases -- let's call them A and B. Is it possible to perform a join between a table that is in database A, to a table that is in database B?..

Remove spaces from std::string in C++

What is the preferred way to remove spaces from a string in C++? I could loop through all the characters and build a new string, but is there a better way?..

What does $1 mean in Perl?

What does $1 mean in Perl? Further, what does $2 mean? How many $number variables are there?..

Sending credentials with cross-domain posts?

According to Requests with credentials, Firefox will only send credentials along with cross-domain posts if invocation.withCredentials = "true"; is set… But it doesn't seem like jQuery's Ajax AP..

Android set bitmap to Imageview

Hi i have a string in Base64 format. I want to convert it ot a bitmap and then display it to an ImageView. This is the code: ImageView user_image; Person person_object; @Override protected void onCre..

What is "pass-through authentication" in IIS 7?

In IIS 7, after I specify the physical path for my website and click the "Test Settings" button, I get the following warning: The server is configured to use pass-through authentication with a bui..

onMeasure custom view explanation

I tried to do custom component. I extended View class and do some drawing in onDraw overrided method. Why I need to override onMeasure? If I didn't, everything seen to be right. May someone explain it..

Split text with '\r\n'

I was following this article And I came up with this code: string FileName = "C:\\test.txt"; using (StreamReader sr = new StreamReader(FileName, Encoding.Default)) { string[] stringSeparators..

Multiple distinct pages in one HTML file

Is there any way to have multiple distinct HTML pages contained within a single HTML file? For example, suppose I have a website with two pages: Page 1 : click here for page 2 and Page 2 : click ..

Press Keyboard keys using a batch file

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

"Input string was not in a correct format."

I am working on a project in which I have a form through which I can edit a question available in a list view. Whenever I select a row from the list view and click on the 'modify' button, the text box..

Can someone explain how to implement the jQuery File Upload plugin?

EDIT (Oct 2019): 6 years later and jQuery File Upload is clearly still driving folks insane. If you're finding little solace in the answers here, try a search of NPM for a modern alternative. It's not..

Using wire or reg with input or output in Verilog

When you declare something as input or output, how do you know if you have to also declare it as a reg or a wire?..

Find records from one table which don't exist in another

I've got the following two tables (in MySQL): Phone_book +----+------+--------------+ | id | name | phone_number | +----+------+--------------+ | 1 | John | 111111111111 | +----+------+--------------..

How do I view the SQL generated by the Entity Framework?

How do I view the SQL generated by entity framework ? (In my particular case I'm using the mysql provider - if it matters)..

React Native Error: ENOSPC: System limit for number of file watchers reached

I have setup a new blank react native app. After installing few node modules I got this error. Running application on PGN518. internal/fs/watchers.js:173 throw error; ^ Error: ENOSPC: System l..

How to import data from text file to mysql database

I have a 350MB file named text_file.txt containing this tab delimited data: 345868230 1646198120 1531283146 Keyword_1531283146 1.55 252910000 745345566 1646198120 1539847239 another_15312..

int to unsigned int conversion

I'm just amazed to know that I can't convert signed to unsigned int by casting! int i = -62; unsigned int j = (unsigned int)i; I thought I already knew this since I started to use casts, but I can'..

Vue.js img src concatenate variable and text

I want to concatenate Vue.js variable with image URL. What I computed: imgPreUrl : function() { if (androidBuild) return "android_asset/www/"; else return ""; } If I build for android: &l..

How to increase the max upload file size in ASP.NET?

I have a form that excepts a file upload in ASP.NET. I need to increase the max upload size to above the 4 MB default. I have found in certain places referencing the below code at msdn. [Configurat..

Using $_POST to get select option value from HTML

I use select as below: <select name="taskOption"> <option>First</option> <option>Second</option> <option>Third</option> </select> How do ..

Accessing members of items in a JSONArray with Java

I'm just getting started with using json with java. I'm not sure how to access string values within a JSONArray. For instance, my json looks like this: { "locations": { "record": [ { ..

Why should I use an IDE?

In another question, Mark speaks highly of IDEs, saying "some people still just dont know "why" they should use one...". As someone who uses vim for programming, and works in an environment where mos..

Fill formula down till last row in column

I'm trying to draw down the formula that's in cell M3 to the end of the data set. I'm using column L as my base to determine the last cell with data. My formula is a concatenation of two cells with a..

How to write header row with csv.DictWriter?

Assume I have a csv.DictReader object and I want to write it out as a CSV file. How can I do this? I know that I can write the rows of data like this: dr = csv.DictReader(open(f), delimiter='\t') # ..

Add Custom Headers using HttpWebRequest

I am not really sure what type of headers these highlighted values are, but how should I add them using HttpWebRequest? Is the highlighted part considered body of the http request or header data? I..

Example of Mockito's argumentCaptor

Can anyone please provide me an example showing how to use the org.mockito.ArgumentCaptor class and how it is different from simple matchers that are provided with mockito. I read the provided mockit..

How can I change the user on Git Bash?

I want to sign out an actual user so I can sign in with another user. What I see in Git bash is: MINGW64 ~/Documents/NetBeansProjects/ConstructorJava (master) git push -u origin/master remote: Pe..

Center Div inside another (100% width) div

Quite a "simple" problem here and not sure why it's being so complicated. Have a 100% (width) sized div. Have another div positioned in the middle of this div (sized 940px width) Any ideas? :) ..

Sizing elements to percentage of screen width/height

Is there a simple (non-LayoutBuilder) way to size an element relative to screen size (width/height)? For example: how do I set the width of a CardView to be 65% of the screen width. It can't be done ..

Change DIV content using ajax, php and jQuery

I have a div which contains some text for the database: <div id="summary">Here is summary of movie</div> And list of links: <a href="?id=1" class="movie">Name of movie</a> ..

Ruby Arrays: select(), collect(), and map()

The syntax for mapping: a = ["a", "b", "c", "d"] #=> ["a", "b", "c", "d"] a.map {|item|"a" == item} #=> [true, false, false, false] a.select {|item|"a" == item} #=> ["a"] Quest..

Android Studio Rendering Problems : The following classes could not be found

I just update Android Studio, and when I restarted it, the preview window rendering failed, and I was told that The following classes could not be found: - android.support.v7.internal.widget.A..

Merging 2 branches together in GIT

I've only just started to use GIT and think its wonderful, however I'm a little confused over what the merge command does. Let us say we have a working project in the branch "A". I go home and make ..

Postgres: How to convert a json string to text?

Json value may consist of a string value. eg.: postgres=# SELECT to_json('Some "text"'::TEXT); to_json ----------------- "Some \"text\"" How can I extract that string as a postgres text value..

If using maven, usually you put log4j.properties under java or resources?

Where should I put the log4j.properties file when using the conventional Maven directories? ..

Error C1083: Cannot open include file: 'stdafx.h'

When I compiled this program (from C++ Programming Language 4th edition): main.cpp #include <stdafx.h> #include <iostream> #include <cmath> #include "vector.h" using namespace std;..

CSV parsing in Java - working example..?

I want to write a program for a school java project to parse some CSV I do not know. I do know the datatype of each column - although I do not know the delimiter. The problem I do not even marginally..

MySQL: Large VARCHAR vs. TEXT?

I've got a messages table in MySQL which records messages between users. Apart from the typical ids and message types (all integer types) I need to save the actual message text as either VARCHAR or TE..

Why are the Level.FINE logging messages not showing?

The JavaDocs for java.util.logging.Level state: The levels in descending order are: SEVERE (highest value) WARNING INFO CONFIG FINE FINER FINEST (lowest value) Source import java.util.loggi..

Convert DataFrame column type from string to datetime, dd/mm/yyyy format

How can I convert a DataFrame column of strings (in dd/mm/yyyy format) to datetimes?..

Row Offset in SQL Server

Is there any way in SQL Server to get the results starting at a given offset? For example, in another type of SQL database, it's possible to do: SELECT * FROM MyTable OFFSET 50 LIMIT 25 to get resu..

Angular HttpClient "Http failure during parsing"

I try to send an POST request from Angular 4 to my Laravel backend. My LoginService has this method: login(email: string, password: string) { return this.http.post(`http://10.0.1.19/login`, { em..

Remove non-numeric characters (except periods and commas) from a string

If I have the following values: $var1 = AR3,373.31 $var2 = 12.322,11T How can I create a new variable and set it to a copy of the data that has any non-numeric characters removed, with the excep..

How to display items side-by-side without using tables?

For example you want to display an image beside a text, usually I would do this: <table> <tr> <td><img ...></td> <td>text</td> </t..

How to define servlet filter order of execution using annotations in WAR

If we define webapp specific servlet filters in WAR's own web.xml, then the order of execution of the filters will be the same as the order in which they are defined in the web.xml. But, if we define..

Connecting to remote URL which requires authentication using Java

How do I connect to a remote URL in Java which requires authentication. I'm trying to find a way to modify the following code to be able to programatically provide a username/password so it doesn't th..

Why should I use the keyword "final" on a method parameter in Java?

I can't understand where the final keyword is really handy when it is used on method parameters. If we exclude the usage of anonymous classes, readability and intent declaration then it seems almos..

Apache won't run in xampp

I have just installed XAMPP and everything works fine except that I can't get apache to run. It seems that port 80 is the problem, I have disabled Skype to use port 80 but it doesn't seem to fix it. ..

Creating a .dll file in C#.Net

I had created a project which is C# console application project for which I need to call this project dll in another windows application project. I had built the project in visual studio 2010 and chec..

How to check if a file exists in Ansible?

I have to check whether a file exists in /etc/. If the file exists then I have to skip the task. Here is the code I am using: - name: checking the file exists command: touch file.txt when: $(! -s ..

How to remove pip package after deleting it manually

I deleted a pip package with rm -rf command thinking that the package will be removed. Now the package has been deleted but it still shows up in pip list and I'm unable to remove it with pip uninstall..

How can I convert a .py to .exe for Python?

I'm trying to convert a fairly simple Python program to an executable and couldn't find what I was looking for, so I have a few questions (I'm running Python 3.6): The methods of doing this that I ha..

Getting and removing the first character of a string

I would like to do some 2-dimensional walks using strings of characters by assigning different values to each character. I was planning to 'pop' the first character of a string, use it, and repeat fo..

How to build a DataTable from a DataGridView?

I may well be looking at this problem backwards but I am curious none the less. Is there a way to build a DataTable from what is currently displayed in the DataGridView? To be clear, I know you can..

How to make connection to Postgres via Node.js

I find myself trying to create a postgres database, so I installed postgres and started a server with initdb /usr/local/pgsql/data, then I started that instance with postgres -D /usr/local/pgsql/data ..

I want to declare an empty array in java and then I want do update it but the code is not working

I want to declare an empty array in java and then I want do update it but the code is not working... public class JavaConversion { public static void main(String args[]) { int array[]..

How to retrieve Jenkins build parameters using the Groovy API?

I have a parameterized job that uses the Perforce plugin and would like to retrieve the build parameters/properties as well as the p4.change property that's set by the Perforce plugin. How do I retri..

100% Min Height CSS layout

What's the best way to make an element of 100% minimum height across a wide range of browsers ? In particular if you have a layout with a header and footer of fixed height, how do you make the..

How to maximize the browser window in Selenium WebDriver (Selenium 2) using C#?

Is there any way to maximize the browser window using WebDriver (Selenium 2) with C#?..

Installing Git on Eclipse

How can I install Git on Eclipse? I found tutorials on http://cho.hapgoods.com/wordpress/?p=159 but there was said that "You should then see the eight Eclipse projects 'org.spearce.something.'" I don'..

Check if not nil and not empty in Rails shortcut?

I have a show page for my Users and each attribute should only be visible on that page, if it is not nil and not an empty string. Below I have my controller and it is quite annoying having to write th..

How to resolve "The requested URL was rejected. Please consult with your administrator." error?

I have a ASP application. On click of a particular link, some VB scripts are executed and an ASP page is to be shown, but instead I get a screen that says: Information Not Available. The request..

Why and when to use angular.copy? (Deep Copy)

I've been saving all the data received from services direct to local variable, controller, or scope. What I suppose would be considered a shallow copy, is that correct? Example: DataService.callFunc..

List of lists into numpy array

How do I convert a simple list of lists into a numpy array? The rows are individual sublists and each row contains the elements in the sublist...

Cannot uninstall angular-cli

I've tried several times to uninstall my angular-cli in order to update it but even if I follow the instructions provided on github: npm uninstall -g @angular/cli npm cache clean npm install -g @ang..

TypeError: Missing 1 required positional argument: 'self'

I can't get past the error: Traceback (most recent call last): File "C:\Users\Dom\Desktop\test\test.py", line 7, in <module> p = Pump.getPumps() TypeError: getPumps() missing 1 r..

Setting new value for an attribute using jQuery

I am trying to set a new vale of a custom attribute of a div using attr(). I found out it can be done using .attr( attributeName, value ), but when I try it it's not working. Here is the part of my c..

Convert a SQL query result table to an HTML table for email

I am running a SQL query that returns a table of results. I want to send the table in an email using dbo.sp_send_dbMail. Is there a straightforward way within SQL to turn a table into an HTML table? ..

How to place Text and an Image next to each other in HTML?

I want the text and the image to be next to each other but I want the image to be on the far left of the screen and I want the text to be on the far right of the screen. This is what I currently have...

Will Google Android ever support .NET?

Now that the G1 with Google's Android OS is now available (soon), will the android platform ever support .Net?..

What is "overhead"?

I am a student in Computer Science and I am hearing the word "overhead" a lot when it comes to programs and sorts. What does this mean exactly?..

Retrieving the COM class factory for component failed

I am using an excel object (COM component) for excel manipulation. It works fine on my PC, but when I deploy the application to our Intranet I am getting this error: Retrieving the COM class facto..

Performing user authentication in Java EE / JSF using j_security_check

I'm wondering what the current approach is regarding user authentication for a web application making use of JSF 2.0 (and if any components do exist) and Java EE 6 core mechanisms (login/check permiss..

Doctrine findBy 'does not equal'

How do I do WHERE id != 1 In Doctrine? I have this so far $this->getDoctrine()->getRepository('MyBundle:Image')->findById(1); But how do I do a "do not equals"? This maybe daft, but ..

Terminating idle mysql connections

I see a lot of connections are open and remain idle for a long time, say 5 minutes. Is there any solution to terminate / close it from server without restarting the mysql service? I am maintaining ..

Get source JARs from Maven repository

Does anyone have any idea if you can find source JARs on Maven repositories?..

The entitlements specified...profile. (0xE8008016). Error iOS 4.2

I am getting the 'dreaded' error The entitlements specified in your application’s Code Signing Entitlements file do not match those specified in your provisioning profile. (0xE8008016). when trying ..

Android Studio Gradle Already disposed Module

I have installed Android Studio version 1.0.1. I have imported my projects from eclipse and it works fine. Then I deleted a module and reimported it into my Android Studio project. The gradle build sa..

Using Server.MapPath in external C# Classes in ASP.NET

I'm trying to get the absolute path of certain files in a C# class. Server.MapPath works great of course for ASPX and their code-behind pages, but that doesn't exist in another class file. I tried H..

Trying to add adb to PATH variable OSX

I am trying to develop for android and I want to add the adb to my PATH so that I can launch it really easily. I have added directories before by for some reason adb does not want to be found. This is..

Get current cursor position in a textbox

I need a code to find current position of cursor in a textbox/textarea. It should work with chrome and firefox. Following is the code which I am using: <!DOCTYPE html> <html> <head&g..

CertPathValidatorException : Trust anchor for certificate path not found - Retrofit Android

I am creating an android application which uses https for communication with the server. I am using retrofit and OkHttp for making requests. These works fine for standard http requests. The following ..

How to format a string as a telephone number in C#

I have a string "1112224444' it is a telephone number. I want to format as 111-222-4444 before I store it in a file. It is on a datarecord and I would prefer to be able to do this without assigning a ..

..The underlying connection was closed: An unexpected error occurred on a receive

I have the following code: private Uri currentUri; private void Form1_Load(object sender, EventArgs e) { currentUri = new Uri(@"http://www.stackoverflow.com"); HttpWebRequest myRequest = (Ht..

Can we pass parameters to a view in SQL?

Can we pass a parameter to a view in Microsoft SQL Server? I tried to create view in the following way, but it doesn't work: create or replace view v_emp(eno number) as select * from emp where emp..

Windows 7 SDK installation failure

I seem to be completely unable to install the Windows 7 SDK onto my machine, and the only solution I've found on the web is to make a swathe of registry changes. I've done this - still no success. Thi..

submitting a form when a checkbox is checked

is there are way to submit a form when a checkbox is checked? <form id="formName" action="<?php echo $_SERVER['PHP_SELF'];?>" method="get"> <input type ="checkbox" name="cBox[]" va..

Replace Line Breaks in a String C#

How can I replace Line Breaks within a string in C#?..

How to add AUTO_INCREMENT to an existing column?

How do I add auto_increment to an existing column of a MySQL table?..

Why is it common to put CSRF prevention tokens in cookies?

I'm trying to understand the whole issue with CSRF and appropriate ways to prevent it. (Resources I've read, understand, and agree with: OWASP CSRF Prevention CHeat Sheet, Questions about CSRF.) As I..

Which is the best Linux C/C++ debugger (or front-end to gdb) to help teaching programming?

I teach a sort of "lite" C++ programming course to novices ("lite" meaning no pointers, no classes, just plain old C, plus references and STL string and vectors). Students have no previous experience ..

Understanding the difference between Object.create() and new SomeFunction()

I recently stumbled upon the Object.create() method in JavaScript, and am trying to deduce how it is different from creating a new instance of an object with new SomeFunction(), and when you would wan..

How do I copy directories recursively with gulp?

I am trying to stage a project from a working directory to a server (same machine). Using the following code: gulp.src([ 'index.php', 'css/**', 'js/**', 'src/**', ]) .pipe(gulp.dest('..

jQuery Scroll To bottom of the page

After my page is done loading. I want jQUery to nicely scroll to the bottom of the page, animating quickly, not a snap/jolt. Do iI need a plugin like ScrollTo for that? or is that built into jQuery s..

Hiding table data using <div style="display:none">

So, I've hidden whole tables like this, which works fine: <div style="display:none"> <table> <tr><th>Test Table</th><tr> <tr><td>123456789</td>&l..

Mean per group in a data.frame

I have a data.frame and I need to calculate the mean per group (i.e. per Month, below). Name Month Rate1 Rate2 Aira 1 12 23 Aira 2 18 73 Aira 3 ..

MacOS Xcode CoreSimulator folder very big. Is it ok to delete content?

My ~/Library/Developer/CoreSimulator/Devices folder is 26 Gb in size. Is it safe to just delete all the content? Will those files be automatically regenerated?..

Method call if not null in C#

Is it possible to somehow shorten this statement? if (obj != null) obj.SomeMethod(); because I happen to write this a lot and it gets pretty annoying. The only thing I can think of is to implem..

How to start Apache and MySQL automatically when Windows 8 comes up

I am using XAMPP, version 3.2.1. I just installed it on Windows 8. Every time I need to go to the XAMPP Control Panel to start services (MySQL, Apache,...); in Windows 7 it started automatic..

How do you rename a Git tag?

Today I was looking through the logs for a project and realized that I fat fingered a tag name some time ago. Is there some way to rename the tag? Google hasn't turned up anything useful. I realize I..

Fastest method to escape HTML tags as HTML entities?

I'm writing a Chrome extension that involves doing a lot of the following job: sanitizing strings that might contain HTML tags, by converting <, > and & to &lt;, &gt; and &amp;, ..

How can I use a JavaScript variable as a PHP variable?

I'm trying to include JavaScript variables into PHP code as PHP variables, but I'm having problems doing so. When a button is clicked, the following function is called: <script type="text/javascri..

Show current assembly instruction in GDB

I'm doing some assembly-level debugging in GDB. Is there a way to get GDB to show me the current assembly instruction in the same way that it shows the current source line? The default output after ev..

Creating a textarea with auto-resize

There was another thread about this, which I've tried. But there is one problem: the textarea doesn't shrink if you delete the content. I can't find any way to shrink it to the correct size - the clie..

Adding rows dynamically with jQuery

I'm building a form where I need multiple optional inputs, what I have is basically this: Every time a user presses the plus button a new row of form inputs should be added to the form, how can I do..

Remove file extension from a file name string

If I have a string saying "abc.txt", is there a quick way to get a substring that is just "abc"? I can't do an fileName.IndexOf('.') because the file name could be "abc.123.txt" or something and I ob..

downcast and upcast

I am new to C# (and OOP). When I have some code like the following: class Employee { // some code } class Manager : Employee { //some code } Question 1: If I have other code that does thi..

How to set <Text> text to upper case in react native

How to set <Text> some text </Text> as upper case in react native <Text style={{}}> Test </Text> Need to show that Test as TEST...

How do I alias commands in git?

I saw a screencast where someone had gotten git st git ci to work. When I do it I get an error asking me if I meant something else. Being a git newb, I need to know what you have to do to get thi..

Html5 Full screen video

Is there any way to do this? I wan to play video in full screen. Without browser. setting width:100%; height:100%; keep browser visible yet..

The HTTP request is unauthorized with client authentication scheme 'Ntlm' The authentication header received from the server was 'NTLM'

I know there's a lot of questions on SO similar to this, but I couldn't find one for this particular issue. A couple of points, first: I have no control over our Sharepoint server. I cannot tweak any..

Add string in a certain position in Python

Is there any function in Python that I can use to insert a value in a certain position of a string? Something like this: "3655879ACB6" then in position 4 add "-" to become "3655-879ACB6"..

How can I insert into a BLOB column from an insert statement in sqldeveloper?

Is it possible to insert into a BLOB column in oracle using sqldeveloper? i.e. something like: insert into mytable(id, myblob) values (1,'some magic here'); ..

ADB Shell Input Events

What is the basic difference between adb shell input keyevent and adb shell sendevent? Which one should I use for inputting a character? Are the keycodes the same that we pass to both the commands?..

Convert digits into words with JavaScript

I am making a code which converts the given amount into words, heres is what I have got after googling. But I think its a little lengthy code to achieve a simple task. Two Regular Expressions and two ..

How to markdown nested list items in Bitbucket?

I'm trying to see my markdown nested list items rendered with corresponding indentation when viewed in a browser live from the Bitbucket pages. But I can't figure out how it works even when using thei..

How to create NSIndexPath for TableView

I need delete row 1 of a table in a function I have defined. In order to use deleteRowAtIndexPath you must use an IndexPath with a section and row defined. How can I create an indexpath like this? A..

deny directory listing with htaccess

I have a folder, for example : /public_html/Davood/ and too many sub folder in folder, for example : /public_html/Davood/Test1/ , /public_html/Davood/Test1/Test/ , /public_html/Davood/Test2/ , ... I ..

How to check cordova android version of a cordova/phonegap project?

I have received a Security Alert from Google this week that tells me to upgrade my android version of cordova app. The email from google is as below - This is a notification that your --apps ids--, i..

How to iterate over associative arrays in Bash

Based on an associative array in a Bash script, I need to iterate over it to get the key and value. #!/bin/bash declare -A array array[foo]=bar array[bar]=foo I actually don't understand how to ge..

What is the simplest and most robust way to get the user's current location on Android?

The LocationManager API on Android seems like it's a bit of a pain to use for an application that only needs an occasional and rough approximation of the user's location. The app I'm working on isn't..

css 100% width div not taking up full width of parent

I have two divs on a page. a grid-container that takes a background and an internal grid that needs to be positioned in the center of the other grid. My css: html, body{ margin:0; padding:0; w..

How to remove/delete a large file from commit history in Git repository?

I accidentally dropped a DVD-rip into a website project, then carelessly git commit -a -m ..., and, zap, the repo was bloated by 2.2 gigs. Next time I made some edits, deleted the video file, and comm..

Why Visual Studio 2015 can't run exe file (ucrtbased.dll)?

I have installed the Visual Studio 2015 and created Win32 project with some code. I compiled it successfully, but I can't launch exe file, because I don't have some ucrtbased.dll...So how can I solve ..

python exception message capturing

import ftplib import urllib2 import os import logging logger = logging.getLogger('ftpuploader') hdlr = logging.FileHandler('ftplog.log') formatter = logging.Formatter('%(asctime)s %(levelname)s %(mess..

SQL use CASE statement in WHERE IN clause

Is it posible to use case in where in clause? Something like this: DECLARE @Status VARCHAR(50); SET @Status='published'; SELECT * FROM Product P WHERE P.Status IN (CASE WHEN @Status='publish..

What is an MvcHtmlString and when should I use it?

The documentation for MvcHtmlString is not terribly enlightening: Represents an HTML-encoded string that should not be encoded again. It's not clear to me what exactly the implications of this a..

X-Frame-Options Allow-From multiple domains

I have an ASP.NET 4.0 IIS7.5 site which I need secured using the X-Frame-Options header. I also need to enable my site pages to be iframed from my same domain as well as from my facebook app. Curren..

How do I create test and train samples from one dataframe with pandas?

I have a fairly large dataset in the form of a dataframe and I was wondering how I would be able to split the dataframe into two random samples (80% and 20%) for training and testing. Thanks!..

ASP MVC href to a controller/view

I have this: <li><a href="/Users/Index)" class="elements"><span>Clients</span></a></li> Which works fine. But if I am already on this page or on the controller e..

How can I trim beginning and ending double quotes from a string?

I would like to trim a beginning and ending double quote (") from a string. How can I achieve that in Java? Thanks!..

Half circle with CSS (border, outline only)

I'm trying to create a circle with CSS, which looks exactly like on the following picture: ...with only one div: <div class="myCircle"></div> and by using only CSS definitions. No SV..

Can't create project on Netbeans 8.2

I have windows 10 OS, I just downloaded JDK 9, and Netbeans 8.2 version with All features. When I want to create (Java) project, it just can't do it. Doesn't give me an error or something, just this b..

Word wrapping in phpstorm

How can I enable Word wraping in phpstorm? I need to enable it only for some of my files (with extension .txt). Is is possible?..