I am trying to make a button, such that when the user clicks on it, it changes its style while the mouse button is being held down. I also want it to change its style in a similar way if it is touched..
I want to achieve a sliding effect from left to right when I move from one activity to another. For that I am using the following code, but I am not getting any results. Please correct me.
In java bo..
After answering a question about how to force-free objects in Java (the guy was clearing a 1.5GB HashMap) with System.gc(), I was told it's bad practice to call System.gc() manually, but the comments ..
In my application, I have an EditText whose default input type is set to android:inputType="textPassword" by default. It has a CheckBox to its right, which is when checked, changes the input..
I need to start a service at boot time. I searched a lot. They are talking about Broadcastreceiver. As I am new to android development, I didn't get a clear picture about services on Android. Please p..
I have an error message of 'Object Required' when I run this sub. I have a version for copying each specific sheet, which works fine, but this sub is for all sheets within the WB ie to copy each one'..
I downloaded APK Manager that lets me unpack APK files.
But it only unpacks it and doesn't decompile the .smali file to .java.
Is it possible to decompile the .smali to .java?..
ORACLE does not permit NULL values in any of the columns that comprise a primary key. It appears that the same is true of most other "enterprise-level" systems.
At the same time, most systems also al..
Hi i want to send mail via microsoft cmd console. I tried many way, but i didnt succeed.
i tried this article http://jpsoft.com/help/index.htm?sendmail.htm
sendmail "[email protected] bcc:[email protected]" T..
Possible Duplicate:
How do you install an APK file in the Android emulator?
I download an APK file and I want to run it on an Android emulator but I don't know how. Please help me. Thanks..
I have a small table and a certain field contains the type "character varying". I'm trying to change it to "Integer" but it gives an error that casting is not possible.
Is there a way around this or ..
A strange error when trying to start Activity. i think the error in my Animation Drawable LogCat: 12-31 06:37:45.138: E/AndroidRuntime(922): FATAL EXCEPTION: main 12-31 06:37:45.138: E/Andr..
I am looking for a concise way to convert an Iterator to a Stream or more specifically to "view" the iterator as a stream.
For performance reason, I would like to avoid a copy of the iterator in a ne..
I have a website (Flash) localized into a dozen of languages and I want to auto-define a default value depending on the user's browser settings in order to minimize the steps to access the content.
F..
How do I replace a line of text found within a text file?
I have a string such as:
Do the dishes0
And I want to update it with:
Do the dishes1
(and vise versa)
How do I accomplish this?
Actio..
In the GCC compiler we see several 'intermediate languages': RTL, GENERIC and GIMPLE. This answer hints at the idea of an intermediate representation in scalac. My question is: is there an 'interm..
I need to click the 'Ok' button inside an alert window with a Selenium command. I've tried assertAlert or verifyAlert but they don't do what I want.
It's possible the click the 'Ok' button? If so, ca..
I want to develop a SDK that encapsules the OAuth 2.0 functions. I have checked the differences between OAuth 1.0 & 2.0, and I have some confusion on Authorization Header (1.0 and
2.0), OAuth 1...
I got the error message:
Error: object 'x' not found
Or a more complex version like
Error in mean(x) :
error in evaluating the argument 'x' in selecting a method for function 'mean..
I am trying to develop an image-based web site. I am really confused about the best image type for faster page loading speeds and best compression practices. Please advise me on the best way to compre..
I was wondering if in the width and height <img> attributes, I could specify width and height as percentages?
Well, I guess that is obvious, because when I try so, it resizes, but it appears to..
Is there local file manipulation that's been done with JavaScript? I'm looking for a solution that can be accomplished with no install footprint like requiring Adobe AIR.
Specifically, I'd like to re..
I am trying to dump a Postgresql database using the pg_dump tool.
$ pg_dump books > books.out
How ever i am getting this error.
pg_dump: server version: 9.2.1; pg_dump version: 9.1.6
pg_dump:..
I am trying to use this method without a closure
def copyAndReplaceText(source, dest, targetText, replaceText){
dest.write(source.text.replaceAll(targetText, replaceText))
}
def source = new Fi..
I have seen the following href used in webpages from time to time. However, I don't understand what this is trying to do or the technique. Can someone elaborate please?
<a href="javascript:;">..
I'm starting off with a numpy array of an image.
In[1]:img = cv2.imread('test.jpg')
The shape is what you might expect for a 640x480 RGB image.
In[2]:img.shape
Out[2]: (480, 640, 3)
However, thi..
Is there a way to make Python logging using the logging module automatically output things to stdout in addition to the log file where they are supposed to go? For example, I'd like all calls to logge..
How do you assign the result of an exec call to a variable in SQL? I have a stored proc called up_GetBusinessDay, which returns a single date.
Can you do something like this:
exec @PreviousBusine..
I want to enable HTML5 mode for my app. I have put the following code for the configuration, as shown here:
return app.config(['$routeProvider','$locationProvider', function($routeProvider,$locationP..
Let's say I have a string
Str1 = "TN 81 NZ 0025"
str2 = "DL 11C AA 1111"
two = first2(str1)
print(two)
>>>TN
How do I get the first two letters of these strings. I need the first2 functi..
This FAQ is about Aggregates and PODs and covers the following material:
What are Aggregates?
What are PODs (Plain Old Data)?
How are they related?
How and why are they special?
What changes for..
I'm trying to use javac with the windows command prompt, but it's not working.
After adding the directory "C:\Program Files\Java\jdk1.6.0_16\bin\" to the end of the PATH environment variable, the jav..
I am trying to use find -exec with multiple commands without any success. Does anybody know if commands such as the following are possible?
find *.txt -exec echo "$(tail -1 '{}'),$(ls '{}')" \;
Ba..
I am trying to learn to open a modal dialog box at the click of the button in AngularJS but unable to do so. I checked the chrome console but there are no errors. Also, since I am learning AngularJS, ..
I want a button with an image in it. I am using this:
<input type="submit" name="submit" src="images/stack.png" />
But it does not show the image. I want the whole button to be the image...
I'm trying to run a basic and very simple code in python.
from PIL import Image
import pytesseract
im = Image.open("sample1.jpg")
text = pytesseract.image_to_string(im, lang = 'eng')
print(text)
..
I'm having a bit of a problem trying to import data from a CSV and have a couple of questions on it that I haven't managed to solve myself yet.
First off here's my code to help put things in perspect..
I have been googling and playing with every combination I know but I cannot get my checkboxes to be initialised as checked.
Example:
<ul class="object administrator-checkbox-list">
<li ..
I'm sorry for asking, but I can't find why I'm getting this errors, especially after the program is running.
The erros to be exact are:
>>>
Welcome! This program will convert measures for ..
OK, I thought this was a simple git scenario, what am I missing?
I have a master branch and a feature branch. I do some work on master, some on feature, and then some more on master. I end up with so..
I am fairly new to python.
I am trying to make a script that will read sudoku solutions and determent if they are correct or not.
Things I need:
1] Prompt the user to enter a file/file path which i..
I need to display the email address from left side of a UIButton, but it is being positioned in the centre.
Is there any way to set the alignment to the left side of a UIButton?
This is my current ..
I have a ListView in my second activity.OnItemClick of it I called a webservice and trying to fetch data. And after that I am moving to third activity which also have a ListView having description of ..
I'm trying to display a Back button on the Action bar to move previous page/activity or to the main page (first opening).
And I can not do it.
my code.
ActionBar actionBar = getActionBar();
actionBa..
With this configuration i found the error
The phpMyAdmin configuration storage is not completely configured, some
extended features have been deactivated. To find out why click here.
W..
I want to reset a file upload field when the user selects another option.
Is this possible via JavaScript? I'm suspecting that the file upload element is treated differently because it interacts with..
My app runs fine but gdb fails to debug it with the following error
(gdb) run
Starting program: /path/to/app
Unable to find Mach task port for process-id 83767: (os/kern) failure (0x5).
I am on OS..
I have coded the following FileWriter:
try {
FileWriter writer = new FileWriter(new File("file.txt"), false);
String sizeX = jTextField1.getText();
String sizeY = jTextField2.getText();
..
I am trying to figure out how to get labels to show on either Google sheets, Excel, or Numbers.
I have information that looks like this
name|x_val|y_val
----------------
a | 1| 1
b | 2|..
I have a Java class. How can I unit test it?
In my case, I have class does a binary sum. It takes two byte[] arrays, sums them, and returns a new binary array...
What does the following exception mean; how can I fix it?
This is the code:
Toast toast = Toast.makeText(mContext, "Something", Toast.LENGTH_SHORT);
This is the exception:
java.lang.RuntimeExcept..
I am fairly new to git, yet currently using it to manage our code in a team environment. I had some rebasing issues, and I fixed them using:
git checkout --ours filename.txt
git add filename.txt
git r..
I want to list every file and directory contained in a directory and subdirectories of that directory. If I chose C:\ as the directory, the program would get every name of every file and folder on the..
This is just a snippet of my code:
print("Total score for %s is %s ", name, score)
But I want it to print out:
"Total score for (name) is (score)"
where name is a variable in a list and scor..
IIS has an annoying feature for low traffic websites where it recycles unused worker processes, causing the first user to the site after some time to get an extremely long delay (30+ seconds).
I've b..
I'm trying to timeout an HttpSession in Java. My container is WebLogic.
Currently, we have our session timeout set in the web.xml file, like this
<session-config>
<session-timeout>1..
Is it possible to define a CSS style for an element, that is only applied if the matching element contains a specific element (as the direct child item)?
I think this is best explained using an examp..
I've recently come across the const keyword in JavaScript. From what I can tell, it is used to create immutable variables, and I've tested to ensure that it cannot be redefined (in Node.js):
const x ..
What's the difference between selecting with a where clause and filtering in Spark?
Are there any use cases in which one is more appropriate than the other one?
When do I use
DataFrame newdf = df...
I am having trouble copying files from a remote server using SSH. Using PuTTY I log in to the server using SSH. Once I find the file I would like to copy over to my computer, I use the command:
scp u..
I have just installed CentOS 6 64bit version, I'm trying to install a 32-bit application on a 64-bit machine and got this error:
/lib/ld-linux.so.2: bad ELF interpreter: No such file or directory
..
Ever since switching from TABLE-layout to DIV-layout, one common problem remains:
PROBLEM: you fill your DIV with dynamic text and inevitably there is a super-long word that extends over the edge of ..
Is there anything out there like Github that is for your own local server? I am curious if there is like a PHP script or even a desktop client that mimics Github's functionality, I love Github but it..
I've a lot of tables in Lovefield and their respective Interfaces for what columns they have.
Example:
export interface IMyTable {
id: number;
title: string;
createdAt: Date;
isDeleted: boolea..
I'm trying to re-size a image in HTML, it's got width 314px and height 212px. I want to re-size it to 50%...
but using this I still get a bigger image instead of a half-size image.
<img src="ima..
In T-SQL, this is allowed:
DECLARE @SelectedValue int
SELECT @SelectedValue = MyIntField FROM MyTable WHERE MyPrimaryKeyField = 1
So, it's possible to get the value of a SELECT and stuff it in a va..
I want to load a *.txt file and insert the content into a div.
Here my code:
js:
$(document).ready(function() {
$("#lesen").click(function() {
$.ajax({
url : "helloworld.txt"..
I found the following way hex to binary conversion:
String binAddr = Integer.toBinaryString(Integer.parseInt(hexAddr, 16));
While this approach works for small hex numbers, a hex number such as th..
Right now the way I do http requests (borrowed from this answer) is this:
POST(url, data) {
var headers = new Headers(), authtoken = localStorage.getItem('authtoken');
headers.app..
I have a makefile for my project and also I am passing some argument and based on that argument i am seting some flag. I am able to do this . but now I want to do the same using cmake. I have created ..
I'm trying to install indefero on a CentOS 5.3 VMware 'box' and I ran into a problem.
Quite early in the installation I get an error that I've been able to narrow down to this:
[root@code /var/www/ht..
I have been trying to make a clock that the user can set. I wanted the user to be asked questions and they answer in words like yes or no. I have done it for things that don't change using this code s..
Is there a way for the standard java SSL sockets to disable hostname verfication for ssl connections with a property? The only way I found until now, is to write a hostname verifier which returns true..
I've been looking for a solution on how I can use multiple ssh keys and I figured out, that it will work with a config file in the .ssh directory, but it doesn't work on windows.
My problem is that I..
Using pip install for any module apparently on my Ubuntu 16.04 system with python 2.7.11+ throws this error:
TypeError: unsupported operand type(s) for -=: 'Retry' and 'int'
What is wrong with pip?..
I have the following class:
public class EmailData
{
public string FirstName{ set; get; }
public string LastName { set; get; }
public string Location{ set; get; }
}
I then did the follo..
I have a string ${testmystring} in my .sh script and I want to check if this string does not contain another string.
if [[ ${testmystring} doesNotContain *"c0"* ]];then
# testmystring doe..
I am attempting to work with a very large dataset that has some non-standard characters in it. I need to use unicode, as per the job specs, but I am baffled. (And quite possibly doing it all wrong.)
..
I am Using Jenkins 2 for compiling Java Projects, I want to read the version from a pom.xml, I was following this example:
https://github.com/jenkinsci/pipeline-plugin/blob/master/TUTORIAL.md
The ex..
Need to store values from foreach loop into an array, need help doing that.
The code below does not work, only stores the last value, tried $items .= ..., but that is not doing the trick either, any..
I am confused about the meaning of access modifiers with respect to inheritance. What is the difference between inheritance involving the private, protected and public keywords?..
What are my options if I want to create a simple XML file in python? (library wise)
The xml I want looks like:
<root>
<doc>
<field1 name="blah">some value1</field1>
..
I have cloned a git repository to my dev server and then switched to the dev branch but now I can't do a git pull to update the branch.
How do I update the code on the server ?..
Is it possible to change the option menu items programmatically? Can anyone provide me with an example please?
Also, I want to disable certain items, so that they don't listen to the clicks, is it po..
I have a long list of float numbers ranging from 1 to 5, called "average", and I want to return the list of indices for elements that are smaller than a or larger than b
def find(lst,a,b):
result..
How can I escape the equals sign (=) in Java property files? I would like to put something as the following in my file:
table.whereclause=where id=100
..
I have first executed the command: export LD_LIBRARY_PATH=/usr/local/lib
Then I have opened .bash_profile file: vi ~/.bash_profile.
In this file, I put:
LD_LIBRARY_PATH=/usr/local/lib
export LD_LIBR..
Code:
public class Test {
public static void main(String[] args) {
String str = "University";
System.out.println(str.substring(4, 7));
}
}
Output: ers
I do not really un..
I'm trying to run a HTTP Request in Swift, to POST 2 parameters to a URL.
Example:
Link: www.thisismylink.com/postName.php
Params:
id = 13
name = Jack
What is the simplest way to do that?
I don..
I'm trying to run the program I'm debugging as a different user. Now, this can be done by running the exe and attaching from Visual Studio, but this is cumbersome.
What I've tried to do is use the "R..
When I run react-native run-ios the build succeeds but I get the error below. I've checked all over the place but nothing seems to be working. Using sudo in front of the command does not help either. ..
The following Perl script (my.pl) can read from either the file on the command line args or from STDIN:
while (<>) {
print($_);
}
perl my.pl will read from STDIN, while perl my.pl a.txt will..
The standard predefined macro __FILE__ available in C shows the full path to the file. Is there any way to short the path? I mean instead of
/full/path/to/file.c
I see
to/file.c
or
file.c
..
With the recent up gradation of the Apple developer accounts, I am facing a difficulty that while trying to create the push notification certificates, it is providing me with (.p8) certificate instead..
I'm using a flex box to display 8 items that will dynamically resize with my page. How do I force it to split the items into two rows? (4 per row)?
Here is a relevant snip:
(Or if you prefer jsfiddl..
This doesn't work -vm %JAVA_HOME%/bin/javaw.exe
How can I replace %JAVA_HOME% with full path on Windows 8 when path contains space ("Program Files" directory)..
I have to check the time in a Linux terminal.
What is the command for getting date and time in a Linux terminal?
Is there a way in which we can set a custom function?..
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..
I am attempting to install an Android app on my brand new Nexus 10. I have a .apk file. I have downloaded the Android SDK, installed "Android SDK Tools", "Android SDK Platform-tools", and Google USB D..
I tried to understand the utility of backbone.js from its site http://documentcloud.github.com/backbone, but I still couldn't figure out much.
Can anybody help me by explaining how it works and how c..
Today, I upgraded all of my jQuery plugs-in with jQuery 1.9.1. And I started to use jQueryUI tooltip with jquery.ui.1.10.2. Everything was good. But when I used HTML tags in the content (in the title ..
How do I add a column after another column within MS SQL by using SQL query?
TempTable
ID int,
Type nvarchar(20),
Active bit
NewTable
ID int,
Type nvarchar(20),
Description text,
..
I've seen various people suggesting that Dataframe.explode is a useful way to do this, but it results in more rows than the original dataframe, which isn't what I want at all. I simply want to do the ..
How can I get rid of all the changes in all the files of my repository?
Say I am in a branch and I did some changes. git status returns a set of files in the "Changes not staged for commit" and I not..
I'm pretty new to the language. Let's say I have a string from an HTTP request, such as
char * request = "GET /favicon.ico HTTP/1.1";
And I specifically want to know if favicon is in that request, ..
Pycharm does not show plot from the following code:
import pandas as pd
import numpy as np
import matplotlib as plt
ts = pd.Series(np.random.randn(1000), index=pd.date_range('1/1/2000', periods=1000..
We have two columns in a DataTable, like so:
COL1 COL2
Abc 5
Def 8
Ghi 3
We're trying to sort this datatable based on COL2 in decreasing order.
COL1 COL2
ghi 8
a..
I was trying to install Azure using Install-Module Azure in PowerShell. I got the following error:
PS C:\Windows\system32> Install-Module Azure
Install-Module : The term 'Install-Module' is not re..
I read the docs on the Laravel website, Stack Overflow, and Google but still don't understand the difference between Route::resource and Route::controller.
One of the answers said Route::resource wa..
On December 1, 2009, Google announced support for asynchronous Google Analytics tracking.
The asynchronous tracking is achieved using the async directive for the <script> tag.
Which browsers s..
I have the following code;
<?php
function countryCityFromIP($ipAddr)
{
$url = "http://api.ipinfodb.com/v3/ip-city/?key=5cfaab6c5af420b7b0f88d289571b990763e37b66761b2f053246f9db07ca..
I'm having trouble with a query written in LINQ and Lambda. So far, I'm getting a lot of errors here's my code:
int id = 1;
var query = database.Posts.Join(database.Post_Metas,
..
I am getting an error net::ERR_INSECURE_RESPONSE in the Chrome console when fetching some data from my API
This error usually occurs as a result of an unsigned certificate; however, it is not an issu..
I have a form that looks like this
<form action="receiver.pl" method="post">
<input name="signed" type="checkbox">
<input value="Save" type="submit">
</form>
and I would..
I have an abstract base class and I want to declare a field or a property that will have a different value in each class that inherits from this parent class.
I want to define it in the baseclass so..
I have two variables, one is called PaidThisMonth, and the other is called OwedPast. They are both results of some subqueries in SQL. How can I select the smaller of the two and return it as a value t..
I am trying to set/get the text of my RichTextBox, but Text is not among list of its properties when I want to get test.Text...
I am using code behind in C# (.net framework 3.5 SP1)
RichTextBox test..
How to get and set the position of an element with the jQuery .offset method?
Let's say I have a div layer1 and another layer2. How can I get the position of layer1 and set the same position to layer..
Is it possible to make an ajax request inside another ajax request?
because I need some data from first ajax request to make the next ajax request.
First I'm using Google Maps API to get LAT & LN..
I'm relatively new to AngularJS and suspect I'm not grasping a concept. I'm also using Twitter Bootstrap and I've got jQuery loaded.
Workflow: User clicks a link from a list, "master" section is upda..
I don't use the RI or RDoc output from the gems I install in my machine or in the servers I handle (I use other means of documentation).
Every gem I install installs RI and RDoc documentation by defa..
this is mentioned every article about mobile web, but nowhere I can found an explanation of what exactly does this attribute measure.
Can anyone please elaborate what does queries like this check?
@m..
The project that I am working on (Node.js) implies lots of operations with the file system (copying, reading, writing, etc.).
Which methods are the fastest?..
I have a small problem with list. So i have a list called l:
l = ['Facebook;Google+;MySpace', 'Apple;Android']
And as you can see I have only 2 strings in my list. I want to separate my list l by '..
I'm playing with these Windows 8 WinRT tasks, and I'm trying to cancel a task using the method below, and it works to some point. The CancelNotification method DOES get called, which makes you think t..
I create dynamic a table with <tr> and <td> tags. One of the td tags gets the id "detailInfo". I have an onclick function on some button. I would like to set some value in the td "detailIn..
In the pyplot document for scatter plot:
matplotlib.pyplot.scatter(x, y, s=20, c='b', marker='o', cmap=None, norm=None,
vmin=None, vmax=None, alpha=None, linewidths=None,
..
When do you use which in general? Examples are highly encouraged!
I am referring so MySql, but can't imagine the concept being different on another DBMS..
Is there a way to calculate the number of years between dates. Not sure how to do this while accounting for leap and what not. Is it possible to do an IF statement maybe in the SELECT?
Thanks..
I am getting this error on my website which requests Geolocation data from the user:
getCurrentPosition() and watchPosition() are deprecated on insecure origins, and support will be removed in the..
I have macro, if I put in cell E1 name of the file, macro search trough C:\Users\Marek\Desktop\Makro\ directory, find it and put the needed values in specific cells of my original file with macro.
..
I am trying to configure the default settings for my GUI with Vim. I already made research on the web, but all the solutions I found and tried did not work.
Here are some of the things I tried (in th..
I have a folder, c:\websites\test, and it contains folders and files that were checked out from a repository that no longer exists. How do I get Subversion to stop tracking that folder and any of the ..
I have started developing with Android Studio. In Eclipse I was using Ctrl + Shift + F, but in Android Studio it does not work. It will be different.
How can I jump to any method in a .java file? I w..
So, I'm using this code to open another modal window in a current opened modal window:
<a onclick=\"$('#login').modal('hide');$('#lost').modal('show');\" href='#'>Click</a>
What happens..
I have forgoten my passphrase in Git. How do I reset it? I found two solutions on Stack Overflow, but I want to know what process to follow to reset it or to get it...
Is it possible to set a transparency or alpha level on SVG fill colours?
I've tried adding two values to the fill tag (changing it from fill="#044B94" to fill="#044B9466"), but this doesn't work...
How can i add a line of text to a multi-line TextBox?
e.g. pseudocode;
textBox1.Clear();
textBox1.Lines.Add("1000+");
textBox1.Lines.Add("750-999");
textBox1.Lines.Add("400-749");
...snip...
textBox..
When I tried to change the window icon in the top left corner from the ugly red "TK" to my own favicon using the code below, Python threw an error:
from tkinter import *
root = Tk()
#some buttons, w..
Suppose I have a line segment going from (x1,y1) to (x2,y2). How do I calculate the normal vector perpendicular to the line?
I can find lots of stuff about doing this for planes in 3D, but no 2D stuf..
What are the C++ rules for calling the superclass constructor from a subclass one?
For example, I know in Java, you must do it as the first line of the subclass constructor (and if you don't, an impl..
I have a DataSet full of costumers. I was wondering if there is any way to filter the dataset and only get the information I want. For example, to get CostumerName and CostumerAddress for a costumer t..
With cURL, we can pass a username with an HTTP web request as follows:
$ curl -u <your_username> https://api.github.com/user
The -u flag accepts a username for authentication, and then cURL ..
The question is as follows:
How can I get the server path to the web directory in Symfony2 from inside the controller (or from anywhere else for that reason)
What I've already found (also, by search..
I am using Log4J in my application for logging. Previously I was using debug call like:
Option 1:
logger.debug("some debug text");
but some links suggest that it is better to check isDebugEnabled(..
Let's assume I'm creating a simple class to work similar to a C-style struct, to just hold data elements. I'm trying to figure out how to search a list of objects for objects with an attribute equali..
Is it possible to get the RGB value pixel under the mouse? Is there a complete example of this? Here's what I have so far:
function draw() {
var ctx = document.getElementById('canvas').getContex..
What's the most pythonic way to scp a file in Python? The only route I'm aware of is
os.system('scp "%s" "%s:%s"' % (localfile, remotehost, remotefile) )
which is a hack, and which doesn't work o..
When running:
sudo /sbin/ldconfig
the following error appears:
/sbin/ldconfig: /usr/local/lib/ is not a symbolic link
When I run file:
file /usr/local/lib/
/usr/local/lib/: dire..
This is a Perl program, run using a terminal (Windows Command Line). I am trying to create an "if this and this is true, or this and this is true" if statement using the same block of code f..
In Notepad++ I have set "replace tab with 2 spaces".
When coding in Python I copy-pasted some code from the web and it appeared indented correctly. But running the code resulted in indentation errors..
I have a JSON object
JSONObject jsonObject = new JSONObject();
I'm able to populate the object successfully but, when I try to parse a boolean JSON value I get an error:
08-28 15:06:15.809: E/B..
I have an activity with a listview. When the user click the item, the item "viewer" opens:
List1.setOnItemClickListener(new OnItemClickListener() {
@Override
public void onItemClick(AdapterVi..
I have three tables, A, B, C, where A is many to one B, and B is many to one C. I'd like a list of all C's in A.
My tables are something like this: A[id, valueA, lookupB], B[id, valueB, lookupC], C[..
I have two queries :
Queries Simplified excluding Joins
Query 1 : select ProductName,NumberofProducts (in inventory) from Table1.....;
Query 2 : select ProductName, NumberofProductssold from Table2....
Here is a regex that works fine in most regex implementations:
(?<!filename)\.js$
This matches .js for a string which ends with .js except for filename.js
Javascript doesn't have regex lookbehi..
I want to Change the background colour on click . This is my code work that i tried.pls help me out :)
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js">
$(docu..
I would like to have a table on my website. The problem is that this table will have about 400 lines. How can I limit the table's height, and apply scrollbar to it?
This is my code:
<div class="sp..
I made a data.frame in R that is not very big, but it takes quite some time to build. I would to save it as a file, which I can than again open in R?..
How to added password validation rule in the validator?
Validation rule:
The password contains characters from at least three of the following five categories:
English uppercase characters (A – ..
I found this solution. Is it valid?
import {Component} from '@angular/core';
import {Platform} from 'ionic-angular';
@Component({...})
export MyApp {
constructor(platform: Platform) {
platform.rea..
I need to compare two dates in java. I am using the code like this:
Date questionDate = question.getStartDate();
Date today = new Date();
if(today.equals(questionDate)){
System.out.println("Both..
What are the ways get the docker host's hostname from inside a container running on that host besides using environment variables? I know I can pass the hostname as an environment variable to the cont..
What if I want to split a string using a delimiter that is a word?
For example, This is a sentence.
I want to split on is and get This and a sentence.
In Java, I can send in a string as a delimiter..
I would like to populate columns in sheet2 from sheet1. If I have column A in Sheet1 I want A in Sheet2 to have the same information.
I tried using =sheet1!A1 but it only returns the value from A1 in..
Let's say I have a method m() that takes an array of Strings as an argument. Is there a way I can just declare this array in-line when I make the call? i.e. Instead of:
String[] strs = {"blah", "he..
I want call execution for a myScript1.ps1 script inside a second myScript2.ps1 script inside Powershell ISE.
The following code inside MyScript2.ps1, works fine from Powershell Administration, but do..
Is it possible without using regular expression?
For example, I want to check that a string is a valid domain:
domain-name
abcd
example
Are valid domains. These are invalid of course:
domaia@name..
I am currently working on an application that requires several "dangerous" permissions. So I tried adding "ask for permission" as required in Android Marshmallow(API Level 23), but couldn't find how t..
If I do the following:
import subprocess
from cStringIO import StringIO
subprocess.Popen(['grep','f'],stdout=subprocess.PIPE,stdin=StringIO('one\ntwo\nthree\nfour\nfive\nsix\n')).communicate()[0]
I..
What is the use of Collections.singletonList() in Java? I understand that it returns a list with one element. Why would I want to have a separate method to do that? How does immutability play a role h..
I’d like to make the browser to scroll the page to a given anchor, just by using JavaScript.
I have specified a name or id attribute in my HTML code:
<a name="anchorName">..</a>
or
..
I have a file where I want to grep for lines that start with either -rwx or drwx AND end in any number.
I've got this, but it isnt quite right. Any ideas?
grep [^.rwx]*[0-9] usrLog.txt
..
I have two times, a start and a stop time, in the format of 10:33:26 (HH:MM:SS). I need the difference between the two times. I've been looking through documentation for Python and searching online ..
I need to use UTF-8 in my resource properties using Java's ResourceBundle. When I enter the text directly into the properties file, it displays as mojibake.
My app runs on Google App Engine.
Can any..
In a Windows (Windows XP) batch script I need to format the current date and time for later use in files names, etc.
It is similar to Stack Overflow question How to append a date in batch files,..
Often I will have a JavaScript file that I want to use which requires certain variables be defined in my web page.
So the code is something like this:
<script type="text/javascript" src="file.js"..
I'm capturing an image and setting it to image view.
public void captureImage() {
Intent intentCamera = new Intent("android.media.action.IMAGE_CAPTURE");
File filePhoto = new File(Environmen..
When I have a column with separated values, I can use the unnest() function:
myTable
id | elements
---+------------
1 |ab,cd,efg,hi
2 |jk,lm,no,pq
3 |rstuv,wxyz
select id, unnest(string_to_array(..
Is it possible to pass a lambda function as a function pointer? If so, I must be doing something incorrectly because I am getting a compile error.
Consider the following example
using DecisionFn = b..