Possible Duplicate: How to access java-classes in the default-package?
I am using Eclipse 3.5 and I have created a project with some package structure along with the default package. I have one..
I am using below code for sample menu.
<html>
<head>
<title>Tree Demo</title>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/ja..
I want to hash given byte[] array with using SHA1 Algorithm with the use of SHA1Managed.
The byte[] hash will come from unit test.
Expected hash is 0d71ee4472658cd5874c5578410a9d8611fc9aef (case sens..
Consider the following code that reads an array of files in a serial/sequential manner. readFiles returns a promise, which is resolved only once all files have been read in sequence.
var readFile = fu..
This is my code to read a text file. When I run this code, the output keeps saying "File not found.", which is the message of FileNotFoundException. I'm not sure what is the problem in this code.
App..
How would you convert from XML to JSON and then back to XML?
The following tools work quite well, but aren't completely consistent:
xml2json
Has anyone encountered this situation before?..
How can i add the scroll bar to my text area. i have tried with this code but it's not working.
middlePanel=new JPanel();
middlePanel.setBorder(new TitledBorder(new EtchedBorder()..
I'm trying to work out if it's possible to use percentage positions/sizes when creating a layout. What I want is something like this...
^
|
|
| 68%
|
|
v
Gallery (height equivalent of 16% total scree..
I'm trying to dynamically add a validation rule to some dynamic controls:
$("input[id*=Hours]").rules("add", "required");
However this line gives me the following error:
$.data(element.form, "vali..
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..
I am posting some data using ajax. I want to manipulate that data and return to to the calling jQuery script.
Here is my jQuery:
$.ajax({
type: "POST",
url: "somescript.php",
datatype: "html"..
I have installed Eclipse and Tomcat 7. The error is that when I run Tomcat from Eclipse it starts, but after that, when I open localhost:8080 in Google Chrome I get HTTP Error 404(). How can I solve t..
Receiving the following error:
Expression #2 of SELECT list is not in GROUP BY clause and contains nonaggregated column 'world.country.Code' which is not functionally dependent on columns in GROUP BY..
unexpected element (uri:"", local:"Group"). Expected elements are <{}group>
Meet an exception when unmarshalling from xml
JAXBContext jc = JAXBContext.newInstance(Group.class);
Unmarshaller ..
Possible Duplicate:
“Warning: mysql_fetch_array() expects parameter 1 to be resource, boolean given” error while trying to create a php shopping cart
I don't get it, I see no mi..
I am not a programer but I enjoy building prototypes. All of my experience comes from actionScript2.
Here is my question. To simplify my code I would like to figure out how to attach '.click' events ..
Here is my model:
public class NewsCategoriesModel {
public int NewsCategoriesID { get; set; }
public string NewsCategoriesName { get; set; }
}
My controller:
public ActionResult N..
508 Resource Limit is reached - Wordpress
This error occurs again and again, and I can't post a single post without seeing this error:
The website is temporarily unable to service your reques..
I have a huge script for creating tables and porting data from one server. So this sceipt basically has -
Create statements for tables.
Insert for porting the data to these newly created tables.
Cr..
I am designing an app, with several button for users to click on. Once button is clicked, user is directed to appropriate website. How do I accomplish this?..
If I have an object like:
{ 'a' : 'apple', 'b' : 'banana', 'c' : 'carrot' }
If I don't know in advance that the list goes up to 'c', other than looping through the object, is there a way to get th..
I'm calling this function from my asp.net form and getting following error on firebug console while calling ajax.
Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote ..
It is quite simple to run a Unix command from Java.
Runtime.getRuntime().exec(myCommand);
But is it possible to run a Unix shell script from Java code? If yes, would it be a good practice to run a..
I have only found how to wait for user input. However, I only want to pause so that my while true doesn't crash my computer.
I tried pause(1), but it says -bash: syntax error near unexpected token '..
I want to print the second last column or field in awk. The number of fields is variable. I know that I should be able to use $NF but not sure how it can be used.
And this does not seem to work:
awk..
In Visual C++ a DWORD is just an unsigned long that is machine, platform, and SDK dependent. However, since DWORD is a double word (that is 2 * 16), is a DWORD still 32-bit on 64-bit architectures?..
I am using a custom actionbar view, and as you can see in the screenshot below, there is a blank gray space in the actionbar. I want to remove it.
What have I done:
res/values-v11/styles.xml
..
There have been questions about this before:
Twitter Bootstrap CSS that support from RTL languages
But all the answers are good for Bootstrap 2.x
I'm working on a project that is in Arabic (rtl), a..
I often use JPEG images, and I have noticed that there are two very similar file extensions: .jpg, which my mobile's camera and the Preview application use, and .jpeg, with which Image Capture saves t..
I have a query that returns avg(price)
select avg(price)
from(
select *, cume_dist() OVER (ORDER BY price desc) from web_price_scan
where listing_Type='AARM'
and u_kbalikepart..
The function I am using now to check this is the following:
function inArray(needle,haystack)
{
var count=haystack.length;
for(var i=0;i<count;i++)
{
if(haystack[i]===needle){r..
I have the following CSS - how would I describe it in SASS? I've tried reverse compiling it with css2sass, and just keep getting errors.... is it my CSS (which works ;-) )?
@font-face {
font-family..
I'm working with PHP, and I'm making an action page which a form posts to. The page checks for errors, then if everything is fine, it redirects them to the page where the data has been posted. If not,..
I don't see much of a difference between the parameters and the query strings, in the URL. So what is the difference and when should one be used over the other?..
We need to call file.exists() before file.delete() before we can delete a file E.g.
File file = ...;
if (file.exists()){
file.delete();
}
Currently in all our project we create a static m..
I need to add some extra text to an existing PDF using Python, what is the best way to go about this and what extra modules will I need to install.
Note: Ideally I would like to be able to run this o..
What is the difference between dependencyManagement and dependencies?
I have seen the docs at Apache Maven web site.
It seems that a dependency defined under the dependencyManagement can be used in it..
double[][] ServicePoint = new double[10][9]; // <-- gives an error (1)
double[,] ServicePoint = new double[10,9]; // <-- ok (2)
What's their difference? (1) yields an error, what's the reason?..
I have this date format: 2011-09-28 18:01:00 (in varchar), and I want to convert it to datetime changing to this format 28-09-2011 18:01:00. How can I do it?..
Maybe this is a dumb question, but is there any way to convert a boolean value to a string such that 1 turns to "true" and 0 turns to "false"? I could just use an if statement, but it would be nice t..
I have created a folder as user in the root directory.
My project base path is:
/var/www/myproject/
When I want to access the base path as BASEPATH from a controller it's showing:
/var/www/myproj..
I need to simply go through all the cells in a Excel Spreadsheet and check the values in the cells. The cells may contain text, numbers or be blank. I am not very familiar / comfortable working with..
For example, right now I'm using the following to change a couple of files whose Unix paths I wrote to a file:
cat file.txt | while read in; do chmod 755 "$in"; done
Is there a more elegant, safer ..
I want to order a List of objects in C# by many fields, not just by one. For example, let's suppose I have a class called X with two Attributes, A and B, and I have the following objects, in that orde..
I'm trying to run this tool in order to convert a Visual C++ project to makefile.
The project I'm trying to convert project is written in VS2008, so I'm using a reference to Microsoft.VisualStudio.VCP..
When one user tries to run the application, our ClickOnce application is reporting:
Unable to install or run the application. The application requires stdole Version 7.0.3300.0 in the GAC.
It's ..
I have a application in asp.net 3.5 and Database is Sql server 2005.
"Timeout expired. The timeout period elapsed prior to obtaining a connection from the pool. This may have occurred because all p..
I've heard in my degree classes that a HashTable will place a new entry into the 'next available' bucket if the new Key entry collides with another.
How would the HashTable still return the correct V..
I am using CentOS 7.2
When I use yum groupinstall "Development Tools", gcc version is 4.8.5, like this:
I would like to install gcc 5.3
How to approach this with yum?..
This is an example from Google Adsense application page. The loading screen displayed before the main page showed after.
I don't know how to do the same thing with React because if I make loading s..
I'm making a page which has some interaction provided by javascript. Just as an example: links which send an AJAX request to get the content of articles and then display that data in a div. Obviously ..
I'm trying to build GNU grep, and when I run make, I get:
[snip]
/bin/bash: line 9: makeinfo: command not found
What is makeinfo, and how do I get it?
(This is Ubuntu, if it makes a difference)..
I have a modal that uses ng-show="prefs" to determine visibility.
My desire is to use the close button in the modal to set $scope.prefs to false and to use an anchor tag to set the value to true. How..
In a script, I need to check:
a) Is the docker engine running?
b) Given a container name, is that docker container running?
[the initial wording of this question was ambiguous, with some people interp..
I get the error: "Only a type can be imported. XYZ resolves to a package."
Someone has explained the cause here but I am not sure what I supposed to do to fix this. FYI: I am using Eclipse. I have ad..
Is there a reference for the memory size of Python data stucture on 32- and 64-bit platforms?
If not, this would be nice to have it on SO. The more exhaustive the better! So how many bytes are used b..
I know that it's possible to get any XML node using C# if you know the node name, but I want to get the root node so that I can find out the name. Is this possible?
Update: I'm using XMLTextReader to..
I have used Matplotlib to plot lines on a figure. Now I would now like to set the style, specifically the marker, for individual points on the line. How do I do this?
To clarify my question, I want t..
Is there a way to convert HTML like:
<div>
<a href="#"></a>
<span></span>
</div>
or any other HTML string into DOM element? (So that I could use appendChild()). ..
Trying to use Excel VBA to capture all the file attributes from files on disk, including extended attributes. Was able to get it to loop through the files and capture the basic attributes (that come f..
How can I avoid getting this MySQL error Incorrect column specifier for column topic_id ?
MySQL Error...
#1063 - Incorrect column specifier for column 'topic_id'
SQL Schema...
CREATE TABLE disc..
I have strings with extra whitespaces, each time there's more than only one whitespace I'd like it be only one.
Anyone?
I tried searching google, but nothing worked for me.
Thanks..
I want to put my html navigation in a separate php file so when I need to edit it, I only have to edit it once. The problem starts when I want to add the class active to the active page.
I've got th..
R provides two different methods for accessing the elements of a list or data.frame: [] and [[]].
What is the difference between the two, and when should I use one over the other?..
What's wrong with the following code?
Object[] a = new Object[1];
Integer b=1;
a[0]=b;
Integer[] c = (Integer[]) a;
The code has the following error at the last line :
Exception in thread "main..
I keep reading about ping/pong messages in websockets to keep the connection alive, but I'm not sure what they are. Is it a distinct frame type? (I don't see any methods on a javascript WebSocket obj..
I have a Pandas data frame, one of the column contains date strings in the format YYYY-MM-DD
For e.g. '2013-10-28'
At the moment the dtype of the column is object.
How do I convert the column values t..
UPDATE²: With Git 2.23 (August 2019), there's a new command git restore that does this, see the accepted answer.
UPDATE: This will work more intuitively as of Git 1.8.3, see my own answer.
..
I need to get the difference in days between two dates in DB2. I tried a couple of different queries but nothing seems to be working. So basically what i need to get is something like this.
SELECT D..
The Android shell does not have the cp command. Android shell also has no sed or grep or vi. I have no adb daemon available. There is mv command but it rejects to work if source is on a read-only devi..
I have a textbox with the .Multiline property set to true. At regular intervals, I am adding new lines of text to it. I would like the textbox to automatically scroll to the bottom-most entry (the n..
I have to translate some text with Google's translate service. All code I've found doesn't work. I think because they have changed their service. If someone has working code, I would be very glad...
Hi I'm trying to use HikariCP with Spring for connection pool. I'm using jdbcTempLate and JdbcdaoSupport.
This is my spring configuration file for datasource:
<bean id="dataSource" class="com.zax..
A user has many uploads. I want to add a column to the uploads table that references the user. What should the migration look like?
Here is what I have. I'm not sure if I should use (1) :user_id, :i..
I am working on a Spring Boot application. I need to parse an XML file (countries.xml) on start. The problem is that I do not understand where to put it so that I could access it.
My folders structur..
I am accessing a server running CentOS (linux distribution) with an SSH connection.
Since I can't always stay logged in, I use "nohup [command] &" to run my programs.
I couldn't find how to get a..
I'm able to delete, insert and update in my program and I try to do an insert by calling a created stored procedure from my database.
This button insert I made works well.
private void btnAdd_Click(ob..
import random
import pandas as pd
heart_rate = [random.randrange(45,125) for _ in range(500)]
blood_pressure_systolic = [random.randrange(140,230) for _ in range(500)]
blood_pressure_dyastolic = [ran..
How to wait for a process to terminate before executing another process in a batch file? Let's say I have a process notepad.exe that I need to kill before executing wordpad.exe. Then, when wordpad.exe..
I want to set text or number in Google Sheet from script.
I want to set Hello or number 9 in cell F2. I found this code so far:
SpreadsheetApp.getActiveRange().setValue('hello');
but that doesn..
Moving a working C# project from a 64-bit Windows 7 machine to a 32-bit XP machine caused the following error:
Retrieving the COM class factory for component with CLSID {681EF637-F129-4AE9-94BB-61..
I have an image, and I want to set it a specific width and height (in pixels)
But If I set width and height using css (width:150px; height:100px), image will be stretched, and It may be ugly.
How to..
I am creating a GUI with a browse button which I only want to return the path. I've been looking at solutions using code like below.
Tkinter.Button(subframe, text = "Browse", command = self.loadtemp..
I am making a bootstrap website, with a couple of Bootstrap 'Modals'.
I'm trying to customize some of the default features.
Problem is this;
You can close the modal by clicking on the background.
Is ..
I have to keep thousands of strings in memory to be accessed serially in Java. Should I store them in an array or should I use some kind of List ?
Since arrays keep all the data in a contiguous chunk..
I'm very new to swift, so I will probably have a lot of faults in my code but what I'm trying to achieve is send a GET request to a localhost server with paramters. More so I'm trying to achieve it gi..
By default after login django redirects the user to an accounts/profile page or if you edit the LOGIN_REDIRECT_URL you can send the user to another page you specify in the settings.py.
This is great ..
I am trying to remove duplicates from a List of objects based on some property.
can we do it in a simple way using java 8
List<Employee> employee
Can we remove duplicates from it based on id..
I am trying to echo the last command run inside a bash script. I found a way to do it with some history,tail,head,sed which works fine when commands represent a specific line in my script from a parse..
How can I select a certain element in a list of elements? I have the following:
<div class="myclass">my text1</div>
<!-- some other code follows -->
<div>
<p>stuff&l..
I am using firebase for my chat application. In chat object I am adding time stamp using Firebase.ServerValue.TIMESTAMP method.
I need to show the message received time in my chat application using t..
I'm receiving this error when trying to debug my node application using the npm start command.
Error:
npm ERR! Windows_NT 6.3.9600
npm ERR! argv "C:\\Program Files\\nodejs\\\\node.exe" "..
I heard you should define sizes and distances in your stylesheet with em instead of in pixels. So the question is why should I use em instead of px when defining styles in css? Is there a good example..
I am trying to force make file to display next string:
"Please execute next commands:
setenv PATH /usr/local/greenhills/mips5/linux86:$PATH"
The problem is with "$PATH". Command
@echo "setenv PATH..
How do I make a function wait until all jQuery Ajax requests are done inside another function?
In short, I need to wait for all Ajax requests to be done before I execute the next. But how?..
I am using GridView control in asp.net 2005 c# using .
How can I delete a particular row from GridView.
I have written the following code. But it's not working...
DataRow dr = dtPrf_Mstr.NewRow();
..
As per my knowledge,
a mutable string can be changed, and
an immutable string cannot be changed.
Here I want to change the value of String like this,
String str="Good";
str=str+" Morning";
and ot..
I am trying to load a PDF document inside a .NET web browser control. In versions of Adobe Reader prior to v10 (aka "X"), the PDF loaded without the toolbar displayed—you would just see the PDF docu..
Every time that I try to import an Excel file into SQL Server I'm getting a particular error. When I try to edit the mappings the default value for all numerical fields is float. None of the fields ..
I was reading about sql injection and i understand how it works if there is a form where the user can enter his username and login. What i dont get is how websites without a login page can be vulnerab..
In Python, using SQLAlchemy, I want to insert or update a row. I tried this:
existing = db.session.query(Toner)
for row in data:
new = Toner(row[0], row[1], row[2])
It does not work. How do I..
I deployed my MVC-3 application on windows Azure. But now when I am requesting it through staging url it shows me (Sorry, an error occurred while processing your request.). Now I want to see the full ..
Is it possible to specify the JVM to use when you call "java jar jar_name.jar" . I have two JVM installed on my machine. I can not change JAVA_HOME as it may break code that is all ready running.
Kin..
I have a table of tags and want to get the highest count tags from the list.
Sample data looks like this
id (1) tag ('night')
id (2) tag ('awesome')
id (3) tag ('night')
using
SELECT COUNT(*), `T..
How can I work with complex numbers in C? I see there is a complex.h header file, but it doesn't give me much information about how to use it. How to access real and imaginary parts in an efficient wa..
I am learning about the wonders of JdbcTemplate and NamedParameterJdbcTemplate. I like what I see, but is there any easy way to see the underlying SQL that it ends up executing? I'd like to see this f..
Obviously new to Pandas. How can i simply count the number of records in a dataframe.
I would have thought some thing as simple as this would do it and i can't seem to even find the answer in searche..
I am trying to run a dbtest but I get the following error :
"Caused by: org.springframework.beans.factory.BeanCreationException:
Error creating bean with name 'entityManagerFactory' defined in c..
Many Java applications that use shell scripts to configure their environment use the JAVA_HOME environment variable to start the correct version of Java, locate JRE JARs, and so on.
In macOS X 10.6, ..
I'm attempting to write a video poker game in Javascript as a way of getting the basics of it down, and I've run into a problem where the jQuery click event handlers are firing multiple times.
They'r..
Hi I am trying to implement the java logging in my application. I want to use two handlers.
A file handler and my own console handler. Both of my handlers work fine. My logging is send to a file and t..
Is there an option to ignore case with .contains() method?
I have an ArrayList of DVD object. Each DVD object has a few elements, one of them is a title. And I have a method that searches for a speci..
I would like to create a stored procedure with parameters that indicate which fields should be selected.
E.g. I would like to pass two parameters "selectField1" and "selectField2" each as bools.
The..
What is the difference between Timestamp and Datetime SQL Server?
I thought Both formats are capable of storing date + time. Then, Where the difference is lying between them?
But Timestamp is not ca..
Say, I have a script that gets called with this line:
./myscript -vfd ./foo/bar/someFile -o /fizz/someOtherFile
or this one:
./myscript -v -f -d -o /fizz/someOtherFile ./foo/bar/someFile
What's the..
Im trying to scrape data from website: http://uk.investing.com/rates-bonds/financial-futures via vba, like real-time price, i.e. German 5 YR Bobl, US 30Y T-Bond, i have tried excel web query but it on..
I want to post XML data with cURL. I don't care about forms like said in How do I make a post request with curl.
I want to post XML content to some webservice using cURL command line interface. Somet..
How can I hide a TemplateField column in a GridView?
I tried the following:
<asp:TemplateField ShowHeader="False" Visible='<%# MyBoolProperty %>' >
<ItemTemplate>
<asp:LinkB..
My code for a page is like this. i need to scroll part below appbar.
@override
Widget build(BuildContext context) {
return new Scaffold(
appBar: new AppBar(... ),
body: new Stack(
..
On the GitHub site there is a link...
https://help.github.com/articles/generating-ssh-keys
... and it states...
If you have decided not to use the recommended HTTPS method, we can
use SSH keys..
I'm no beginner to using SQL databases, and in particular SQL Server. However, I've been primarily a SQL 2000 guy and I've always been confused by schemas in 2005+. Yes, I know the basic definition ..
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,..
In C# WinApp, how can I add both Text and Value to the items of my ComboBox?
I did a search and usually the answers are using "Binding to a source".. but in my case I do not have a binding source read..
I saw some code like the following in a JSP
<c:if test="<%=request.isUserInRole(RoleEnum.USER.getCode())%>">
<li>user</li>
</c:if>
My confusion is over the "=" tha..
If I use "top" I can see what CPU is busy and what process is using all of my CPU.
If I use "iostat -x" I can see what drive is busy.
But how do I see what process is using all of the drive's throug..
I got a program that writes some data to a file using a method like the one below.
public void ExportToFile(string filename)
{
using(FileStream fstream = new FileStream(filename,FileMode.Create..
I'm creating HTML with a loop that has a column for Action. That column
is a Hyperlink that when the user clicks calls a JavaScript
function and passes the parameters...
example:
<a href="#" OnCl..
I currently use this regular expression to check if a string conforms to a few conditions.
The conditions are
string must be between 8 and 15 characters long.
string must contain at least one numbe..
As we all know we have beans as singleton by default in Spring container and if we have a web application based on Spring framework then in that case do we really need to implement Singleton design pa..
What is the best way to have a enum type represent a set of strings?
I tried this:
enum Strings{
STRING_ONE("ONE"), STRING_TWO("TWO")
}
How can I then use them as Strings?..
I am trying to create an image wall consisting of product photos. Unfortunately, all of them are of different height and width. How can I use css to make all images look the same size? preferably 10..
First of all say apology to ask this repeated Question..
Actually in my spring Application i have user.jsp and professional.jsp
here is my User.jsp:
<form:form action="profile/user" modelAttri..
Conventional IPv4 dotted quad notation separates the address from the port with a colon, as in this example of a webserver on the loopback interface:
127.0.0.1:80
but with IPv6 notation the address..
In numpy, some of the operations return in shape (R, 1) but some return (R,). This will make matrix multiplication more tedious since explicit reshape is required. For example, given a matrix M, if we..
For Binary trees: There's no need to consider tree node values, I am only interested in different tree topologies with 'N' nodes.
For Binary Search Tree: We have to consider tree node values...
I merged branch dog into animal. When I go to commit, I get the following:
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark..
I have a local Git repository called 'skeleton' that I use for storing project skeletons. It has a few branches, for different kinds of projects:
casey@agave [~/Projects/skeleton] git branch
* master..
For some reason I can't find this simple thing in the MDN docs (maybe I'm just missing it).
I expected this to work:
const map = new Map({foo: 'bar'});
map.get('foo'); // 'bar'
...but the first l..
I am hoping you can help with this question. I am using Oracle SQL (SQL Developer for this view)...
If I have a table with the following columns:
ColumnA (Number)
ColumnB (Number)
ColumnC (Numbe..
What I'm doing:
Opening Visual Studio Community 2015
File -> New -> Project
Under Visual C#: Web -> ASP.NET Web Application
Web Application
And press f5 for the popup error "unable to connect to web..
I'm trying to learn neat pythonic ways of doing things, and was wondering why my for loop cannot be refactored this way:
q = [1, 2, 3, 4, 1, 2, 5, 1, 2, 3, 4, 5]
vm = [-1, -1, -1, -1]
for v in vm:
..
Is it possible to have WebSockets with HTTPS?
When switching to HTTPS, my WebSocket returns a security error and works perfectly with regular HTTP.
Below, a snippet;
socket = new WebSocket("ws://my..
I am having trouble getting curl to run on Windows.
I have downloaded a curl zip file from here, but it seems to contain source code, not an executable.
Do I need to compile curl to run it? If yes, ..
Is there any alternative for PHP_excel which can "Export to XLSX/XLS" file in a customized format?
This is a General Reference question for the php tag
..
Let's say I have:
v = rep(c(1,2, 2, 2), 25)
Now, I want to count the number of times each unique value appears. unique(v) returns what the unique values are, but not how many they are.
> uniq..
i'm trying using cURL for a GET request like this:
function connect($id_user){
$ch = curl_init();
$headers = array(
'Accept: application/json',
'Content-Type: application/json',
..
I'm trying to use an Entry field to get manual input, and then work with that data.
All sources I've found claim I should use the get() function, but I haven't found a simple working mini example yet..
I'd like to unload a package without having to restart R (mostly because restarting R as I try out different, conflicting packages is getting frustrating, but conceivably this could be used in a progr..
A Pandas DataFrame contains column named "date" that contains non-unique datetime values.
I can group the lines in this frame using:
data.groupby(data['date'])
However, this splits the data by the..
I would like to set up a cookie that never expires. Would that even be possible?
document.cookie = "name=value; expires=date; path=path;domain=domain; secure";
I don't want to make the date really..
Consider:
>>> r"what"ever"
SyntaxError: invalid syntax
>>> r"what\"ever"
'what\\"ever'
So how do we get the quote, but not the slash?
And please don't suggest r'what"ever', becau..
Is there an easy way to get the selected index of a RadioGroup in Android or do I have to use OnCheckedChangeListener to listen for changes and have something that holds the last index selected?
exam..
How can you align an image inside of a containing div?
Example
In my example, I need to vertically center the <img> in the <div> with class ="frame":
<div class="frame&qu..
I have implemented in my app the mitigation to CSRF attacks following the informations that I have read on some blog post around the internet. In particular these post have been the driver of my imple..
I have an NSArray and I'd like to create a new NSArray with objects from the original array that meet certain criteria. The criteria is decided by a function that returns a BOOL.
I can create an NSMu..
How would I go about drawing a custom UIView that is literally just a ball (a 2D circle)? Would I just override the drawRect method? And can someone show me the code for drawing a blue circle?
Also,..
How can we perform multiple search for multiple words and the line containing them. These words can be in same or different lines.
For example:
1.The CAT goes up and down the ROAD.
2. The DOG goes u..
From the reading that I have done, Core Audio relies heavily on callbacks (and C++, but that's another story).
I understand the concept (sort of) of setting up a function that is called by another ..
I have an Array of primitives, for example for int, int[] foo. It might be a small sized one, or not.
int foo[] = {1,2,3,4,5,6,7,8,9,0};
What is the best way to create an Iterable<Integer> fr..
I have a PHP/AJAX/MYSQL chat application. I want to add video chatting to my application. How can I create live video streaming to be used for live video conferences/chatting in a PHP application. Wha..
How do I do time/hour arithmetic in a Google spreadsheet?
I have a value that is time (e.g., 36:00:00) and I want to divide it by another time (e.g., 3:00:00) and get 12. If I divide just one by the..
In C, how can I copy a string with begin and end indices, so that the string will only be partially copied (from begin index to end index)?
This would be like 'C string copy' strcpy, but with a begi..
I am trying to match a string with a regex in a shell script.
This string is a parameter of the script ( $1 ) and it is a date (MM/DD/YYYY)
The regex I'm trying to use is :
^\d{2}[\/\-]\d{2}[\/\-]\d..
MySQL has an OPTIMIZE TABLE command which can be used to reclaim unused space in a MySQL install. Is there a way (built-in command or common stored procedure) to run this optimization for every table..
How can I get the id of the element that triggered the jQuery .change() function?
The function itself works properly, but I need a specific action for a selector with id="next".
$("select").change(fu..
This is intended to be a general reference question and answer covering many of the never-ending "How do I access data in my JSON?" questions. It is here to handle the broad basics of decoding JSON..
I'm doing a Photoshop-to-XHTML conversion, and the website designer used the Myriad Pro Semi-bold font which looks good in the photoshop file, but when I try the semi-bold option in CSS, it looks pret..
I am attempting to insert data from a dictionary into a database. I want to iterate over the values and format them accordingly, depending on the data type. Here is a snippet of the code I am using:
..
I'm making a simple, very lightweight front-controller. I need to match request paths to different handlers (actions) in order to choose the correct one.
On my local machine HttpServletRequest.getPat..
How do you tell if a browser has auto filled a text-box? Especially with username & password boxes that autofill around page load.
My first question is when does this occur in the page load seque..
I am working with a bash script and I want to execute a function to print a return value:
function fun1(){
return 34
}
function fun2(){
local res=$(fun1)
echo $res
}
When I execute fun2, it d..
This seems like a simple Pivot Table to learn with. I would like to do a count of unique values for a particular value I'm grouping on.
For instance, I have this:
ABC 123
ABC 123
ABC 123
DEF ..
I have a data.frame with character data in one of the columns.
I would like to filter multiple options in the data.frame from the same column. Is there an easy way to do this that I'm missing?
Exampl..
I am looking for a quick way to type in a time and then python convert it into other timezones ( maybe up to 10 different timezones )
Sorry. I am not familar with time in python at all, if someone co..
I have a table
`CREATE TABLE IF NOT EXISTS `PROGETTO`.`ALBERGO` (
`ID` INT(11) NOT NULL COMMENT 'identificativo dell\' albergo' ,
`nome` VARCHAR(45) NULL COMMENT 'Il nome dell\'albergo' ,
`viale` ..
I have Perl script and need to determine the full path and filename of the script during execution. I discovered that depending on how you call the script $0 varies and sometimes contains the fullpath..
I love zsh, but I am not sure where to place my $PATH and other variable assertions? I find that they are scattered between the files .zshrc .zprofile .bashrc .bash_profile, and sometimes doubled.
I ..
I know that there is a "Microsoft Visual C++ Compiler for Python 2.7" but is there, currently or planned, a Microsoft Visual C++ Compiler for Python 3.4 or eve Microsoft Visual C++ Compiler for Python..
Why do some collection data structures not maintain the order of insertion? What is the special thing achieved compared to maintaining order of insertion?
Do we gain something if we don't maintain th..
I have a file of two columns and n number of rows.
column 1 contains names and column2 age.
I want to sort the content of this file in ascending order based on the age (in second column).
The resul..
How can I do something like this? Take the first n elements from an array:
newNumbers = numbers[0..n]
Currently getting the following error:
error: could not find an overload for 'subscript' that ..
I am trying to run the code presented on the second page:
http://ocw.mit.edu/courses/electrical-engineering-and-computer-science/6-00-introduction-to-computer-science-and-programming-fall-2008/video-..