I feel a bit thick at this point. I've spent days trying to fully wrap my head around suffix tree construction, but because I don't have a mathematical background, many of the explanations elude me as..
Is it possible with Python to set the timezone just like this in PHP:
date_default_timezone_set("Europe/London");
$Year = date('y');
$Month = date('m');
$Day = date('d');
$Hour = date('H');
$Minute =..
I'm developing game app and using Symfony 2.0. I have many AJAX requests to the backend. And more responses is converting entity to JSON. For example:
class DefaultController extends Controller
{ ..
I'm trying to put together a shopping list app, based on input fields, ArrayList, and ListView. The app will be based on Fragments. However, I have encountered a problem and I do not know how to solve..
I came across this example in the Matplotlib website. I was wondering if it was possible to increase the figure size.
I tried with
f.figsize(15,15)
but it does nothing...
//go through each question
foreach($file_data as $value) {
//separate the string by pipes and place in variables
list($category, $question) = explode('|', $value);
//place in assoc array
..
I have a C# winforms app that runs a macro in another program. The other program will continually pop up windows and generally make things look, for lack of a better word, crazy. I want to implement..
I'm getting mad with list indexes, and can't explain what I'm doing wrong.
I have this piece of code in which I want to create a list of lists, each one containing values of the same circuit paramete..
I have a question regarding the usage of the Function.identity() method.
Imagine the following code:
Arrays.asList("a", "b", "c")
.stream()
.map(Function.identity()) // <- Thi..
I have the name of the "sort by property" in a string. I will need to use Lambda/Linq to sort the list of objects.
Ex:
public class Employee
{
public string FirstName {set; get;}
public string L..
When I try to compile my c++ project using Visual Studio 2010 in either Win32 or x64 mode I get the following error:
>C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\include\winnt.h(135): fata..
I am using the arm-linux-androideabi-g++ compiler. When I try to compile a simple "Hello, World!" program it compiles fine. When I test it by adding a simple exception handling in that code it works t..
I have implement the simple TCP server and TCP client classes which can send the message from client to server and the message will be converted to upper case on the server side, but how can I achieve..
I have to do something like this in C. It works only if I use a char, but I need a string. How can I do this?
#define USER "jack" // jack or queen
#if USER == "jack"
#define USER_VS "queen"
#elif US..
I am using the datatables jquery plugin and want to sorty by dates.
I know they got a plugin but I can't find where to actually download it from
http://datatables.net/plug-ins/sorting
I believe I n..
Is there any way in MySQL to get the first 10 distinct rows of a table.
i.e. Something like...
SELECT TOP 10 distinct *
FROM people
WHERE names='SMITH'
ORDER BY names asc
However this method do..
I have installed two PHP versions in my WAMP server. When I am using 5.3.10, my wamp server is running just fine. But when I switch to older version of PHP (5.2.9) my wamp server tray icon is showing ..
With PCRE, how can you construct an expression that will only match if a string is not found.
If I were using grep (which I'm not) I would want the -v option.
A more concrete example: I want my r..
I am trying to use PHPMailer to send e-mails over SMTP but so far have had no luck. I've gone through a number of SO questions, PHPMailer tutorials and forum posts but still cannot get it to work. I'l..
I am using spring 3 MVC and i have below classes.
External system would call my application using below URL:
http://somehost/root/param1/param2/param3
I have a spring MVC controller method as belo..
A few hours ago I read about the aria-label attribute, which:
Defines a string value that labels the current element.
But in my opinion this is what the title attribute was supposed to do. I loo..
For INSERT, UPDATE and DELETE SQL statements executed directly against the database, most database providers return the count of rows affected. For stored procedures, the number of records affected is..
I'm building an installer for an application. The user gets to select a datasource they have configured and nominate what type of database it is. I want to confirm that the database type is indeed Or..
In WebDriver, if I use sendKeys it will append my string to the value that already exists in the field. I can't clear it by using clear() method because the second I do that, the webpage will throw a..
Update: A sample project reproducing this bug can be found here at Microsoft Connect. I have also tested and verified that the solution given in the accepted answer below works on that sample project...
Are lexers and parsers really that different in theory?
It seems fashionable to hate regular expressions: coding horror, another blog post.
However, popular lexing based tools: pygments, geshi, or..
I have two radio buttons and want to post the value of the selected one.
How can I get the value with jQuery?
I can get all of them like this:
$("form :radio")
How do I know which one is selected?..
Trying to setup docker from brew, however the engine does not seem to be included in any of the any of the official formulas.
brew install docker-machine docker-compose
So these only installs the c..
I have a project which requires printing an HTML table with many rows.
My problem is the way the table is printed over multiple page. It will sometimes cut a row in half, making it unreadable because..
Apparently, I have completely misunderstood its semantics. I thought of something like this:
A client downloads javascript code MyCode.js from http://siteA - the origin.
The response header of MyCod..
I referred lot many links but still I am not able to get any point from that I can start my development. I want to measure my image height, width and distance using camera. I found this app . I want t..
I'm trying to get it to display the number of employees that are hired after June 20, 1994,
Select employee_id, count(*)
From Employee
Where to_char(employee_date_hired, 'DD-MON-YY') > 31-DEC-95;
..
I've booted up a CentOS server on rackspace and executed yum install httpd'd. Then services httpd start. So, just the barebones.
I can access its IP address remotely over ssh (22) no problem, so ther..
By using Thymeleaf as template engine, is it possible to add/remove dynamically a CSS class to/from a simple div with the th:if clause?
Normally, I could use the conditional clause as follows:
<a..
I'm working with HTML5 elements on my webpage. By default input type="date" shows date as YYYY-MM-DD.
The question is, is it possible to change its format to something like: DD-MM-YYYY? ..
I'm having a bit of trouble getting a Python regex to work when matching against text that spans multiple lines. The example text is ('\n' is a newline)
some Varying TEXT\n
\n
DSJFKDAFJKDAFJDSAKFJADS..
Is there any way to retrieve only one specific commit from a remote Git repo without cloning it on my PC? The structure of remote repo is absolutely same as that of mine and hence there won't be any c..
How is this achieved? Here it says the java version is:
WebDriver driver; // Assigned elsewhere
JavascriptExecutor js = (JavascriptExecutor) driver;
js.executeScript("return document.title");
But I..
Why is it that whenever I do :-
JSON.parse('"something"')
it just parses fine but when I do:-
var m = "something";
JSON.parse(m);
it gives me an error saying:-
Unexpected token s
..
According to the beginner guide, to setup the ADT Plugin, one of the procedures is
http://developer.android.com/sdk/eclipse-adt.html#installing
For the SDK Location in the main
panel, click Bro..
I have a small problem here.I need to convert a string read from console into each character of string. For example string: "aabbab" I want to this string into array of string.How would I do that? ..
I got an error about dbpath (/data/db/) does not exist, but /etc/mongodb.conf named it dbpath = /var/lib/mongodb.
So, which is the default dbpath for MongoDB?..
I have a very long and complicated json object but I only want to get the items/keys in the first level!
Example:
{
"1": "a",
"3": "b",
"8": {
"12": "c",
"25": "d"
..
I have a list of checkboxes with the same name attribute, and I need to validate that at least one of them has been selected.
But when I use the html5 attribute "required" on all of them, th..
MSDN references JavaScript's Set collection abstraction. I've got an array of objects that I'd like to convert to a set so that I am able to remove (.delete()) various elements by name:
var array = [..
I have the latest 64 bit version of PostgreSQL. I am running Win 7 64 bit. I had installed the ODBC driver (via the initial installer) when I installed PG, and upgraded it to the latest version from h..
A numpy matrix can be reshaped into a vector using reshape function with parameter -1. But I don't know what -1 means here.
For example:
a = numpy.matrix([[1, 2, 3, 4], [5, 6, 7, 8]])
b = numpy.res..
I have two lists as below
tags = [u'man', u'you', u'are', u'awesome']
entries = [[u'man', u'thats'],[ u'right',u'awesome']]
I want to extract entries from entries when they are in tags:
result = [..
I am in need of a way to get the binary representation of a string in python. e.g.
st = "hello world"
toBinary(st)
Is there a module of some neat way of doing this?..
I am using the mtcars dataset. I want to find the number of records for a particular combination of data. Something very similar to the count(*) group by clause in SQL. ddply() from plyr is working fo..
I want to convert a DateTime instance into a TimeSpan instance, is it possible?
I've looked around but I couldn't find what I want, I only find time difference. More specifically, I want to convert ..
I have had this problem with every web page I have created. There is always a top margin above the 'main container' div I use to place my content in the center of the page. I am using a css style sh..
I frequently find myself with a folder open in Windows, wishing to have a command prompt open with the same working directory.
I am aware of Power Toys "Command Prompt", but that only works as a cont..
I have added a setting to my config.yml file as such:
app.config:
contact_email: [email protected]
...
For the life of me, I can't figure out how to read it into a variable. I tried someth..
I have read up on remove the character 'u' in a list but I am using google app engine and it does not seem to work!
def get(self):
players = db.GqlQuery("SELECT * FROM Player")
print players
..
In a view, i have a column comments which may contain large string.
I just want to select first 60 characters and append the '...' at the end of the selected string.
For selecting first 60 characters..
I wonder, if there is any annotation for a Filter class (for web applications) in Spring Boot? Perhaps @Filter?
I want to add a custom filter in my project.
The Spring Boot Reference Guide mentione..
How do you animate the change of background color of a view on Android?
For example:
I have a view with a red background color. The background color of the view changes to blue. How can I do a smo..
As you can see here, I have a button that launches a modal. Setting an href url for the button this url is automatically loaded into modal by Bootstrap 3.
The fact is this page is loaded into modal ro..
I have a "connect four board" which I simulate with a 2d array (array[x][y] x=x coordinate, y = y coordinate). I have to use "System.out.println", so I have to iterate through the rows.
I need a way..
I need to write a project that's only compatible with Java 1.5. I have Java 1.6 installed. Is there some form of backwards compatibility to get Eclipse to compile with 1.5?
Do I have to install Java ..
I'm asking this as a reminder to myself the next time I use CMake. It never sticks, and Google results aren't great.
What's the syntax to set and use variables in CMake?..
I'm passing a variable to another page in a url using sessions like this but it seems that I can't concatenate another variable to the same url and retrieve it in the next page successfully
Page 1..
For example with have this code:
var json = {
"user1" : {
"id" : 3
},
"user2" : {
"id" : 6
},
"user3" : {
"id" : 1
}
}
How can I sort this json to be..
Okay so i am using the FileUploader module to upload my file from angular to my REST API:
var uploader = $scope.uploader = new FileUploader({
url: api.getUrl('uploadCompetence',null)
});
This i..
Sometimes I use anchors styled as buttons and sometimes I just use buttons. I want to disable specific clicky-things so that:
They look disabled
They stop being clicked
How can I do this?..
I have a table that looks like this caller 'makerar'
cname | wmname | avg
--------+-------------+------------------------
canada | zoro | 2.0000000000000000
spain | luf..
I am implementing facebook count function using cron file. In which cron runs every 10 minutes and counts the total likes of a page.
for($i=0;$i<3;$i++){
$source_url =$cars[$i];
$rest_url ..
I have a tag, <input type="submit" class="like"/>.
I want to have the text inside the button say "Like", but right now, it says "Submit".
class="like" is the CSS of the button, by the way...
I tried to run project on tomcat 7.0.52 and initialize to DB through context.xml file.
But it throws bunch of exceptions, I couldn't figure out what is wrong there.
Here is console output:
java.sql..
I am looking for solution to pick number randomly from an integer array.
For example I have an array new int[]{1,2,3}, how can I pick a number randomly?..
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..
My application makes several calls to an Action method (ASP .NET MVC) which returns a Json object. When the application is waiting for this method to return its data I want to display a loading animat..
I need to be able to load the entire contents of a text file and load it into a variable for further processing.
How can I do that?
Here's what I did thanks to Roman Odaisky's answer.
SetLocal ..
I'm learning Apigility (Apigility docu -> REST Service Tutorial) and trying to send a POST request with basic authentication via cURL:
$ curl -X POST -i -H "Content-Type: application/hal+json" -H "Au..
I am trying to get my JavaFX program to run but am having some difficulty. I keep getting an error of 'java.lang.NullPointerException: Location is required.' The fxml file is in the same package as Ap..
I cannot find the htdocs directory anywhere on XAMPP for Mac.
Many videos on YouTube show people just clicking a button that says "Go to application folder" but on my user interface, it reads: "Go to..
I've got a C# program with values in a config file. What I want is to store ampersands for an url value like...
<appSettings>
<add key="myurl" value="http://www.myurl.com?&cid=&si..
I need an easy way to take a tar file and convert it into a string (and vice versa). Is there a way to do this in Ruby? My best attempt was this:
file = File.open("path-to-file.tar.gz")
contents = ""..
I have a string that looks like this:
GenFiltEff=7.092200e-01
Using bash, I would like to just get the number after the = character. Is there a way to do this?..
I've been working with a React project using create-react-app and I have two options to start the project:
First way:
npm run start with the definition at the package.json like this:
"start"..
I would like to enable ScrollView and disable it by a Button Click.
Disable means like if the ScrollView wasn't there.. and enable it returns the ScrollView.
I want that because I have a gallery wi..
Does anyone know how to get ahold of windbg without having to download the entire 620MB WDK ISO?
All I can find on the net to download the debugger is this link, which says you have to get the whole ..
Are there any compelling performance reasons to choose static linking over dynamic linking or vice versa in certain situations? I've heard or read the following, but I don't know enough on the subject..
I want to change the class of a td tag given the td tag's id:
<td id="td_id" class="change_me"> ...
I want to be able to do this while inside the click event of some other dom object. How do..
I have a page with tens or hundreds of posts, each one with social buttons.
I just can't generate all the buttons for each url: it is too slow (facebook, g+, twitter, pinterest... for hundreds of link..
I tried to delete a ReplicationController with 12 pods and I could see that some of the pods are stuck in Terminating status.
My Kubernetes cluster consists of one control plane node and three worke..
I updated android studio 2.3 and there is a bug, gradle doesn't build and it keeps giving me the same error for all projects.
Error:Failed to open zip file.
Gradle's dependency cache may be corrupt ..
I am in the process of moving all my private an public repo's over to github. One of the decisions I have made is to only use the console as it means a smaller tooling footprint if I ever need to chan..
I have a LocalDate which needs to get the first and last day of the month.
How do I do that?
eg. 13/2/2014
I need to get 1/2/2014 and 28/2/2014 in LocalDate formats.
Using threeten LocalDate class...
I'm working on a very basic shopping cart system.
I have a table items that has a column price of type integer.
I'm having trouble displaying the price value in my views for prices that include bo..
I'm making a responsive layout with a top fixed navbar. Underneath I have two columns, one for a sidebar (3), and one for content (9). Which on desktop looks like this
navbar
[3][9]
When I resize ..
Sheet.getRange(1,1,1,12)
I cannot understand the arguments 1,1,1,12 . What is this - the sheet id or row or what?
method getRange(row, column, optNumRows, optNumColumns)
here what does optNumRows..
My Express app is receiving a base64-encoded PNG from the browser (generated from canvas with toDataURL() ) and writing it to a file. But the file isn't a valid image file, and the "file" utility simp..
I need to filter an array to remove the elements that are lower than a certain threshold. My current code is like this:
threshold = 5
a = numpy.array(range(10)) # testing data
b = numpy.array(filter(..
I'm using an image carousel script that is quite heavy on the browser. It works great in Opera and Chrome, half decent in FF and absolutely breaks my balls in IE. So i'd like to give IE users an alter..
Is it possible to list information about the files (MDF/LDF) of all databases on an SQL Server?
I'd like to get a list showing which database is using what files on the local disk.
What I tried:
..
What is the best way to generate a random float in C#?
Update: I want random floating point numbers from float.Minvalue to float.Maxvalue. I am using these numbers in unit testing of some mathematica..
I'm currently building a HTML5 web app/Phonegap native app and I can't seem to figure out how to save my canvas as an image with canvas.toDataURL(). Can somebody help me out?
Here's the code, what's ..
I'm using jQuery tools for an overlay. Inside the overlay I have an HTML5 video. However, when I close the overlay, the video keeps playing. Any idea how I might get the video to stop when I close the..
SET @v1 := SELECT COUNT(*) FROM user_rating;
SELECT @v1
When I execute this query with set variable this error is shown.
Error Code : 1064
You have an error in your SQL syntax; check the manual tha..
In "Programming Python", Mark Lutz mentions "mixins". I'm from a C/C++/C# background and I have not heard the term before. What is a mixin?
Reading between the lines of this example (which I've link..
Is there a simple way to do something along these lines:
JavaScript:
if(document.getElementById('button').clicked == true)
{
alert("button was clicked");
}
HTML:
<input id="button" type="su..
How to get BOLD Text and change color of text in Alert or Confirm box?
var conFrm = confirm("Following List(s) already Sent...!\n<strong>List Name: </strong>"+ss.replace(",","\n<b>..
I have searched high and low for an answer and have found similar examples of the problem but the answers do not apply to my scenario. The reality is I am new to this and therefore I don't have the sk..
I am trying to find the most recent record based on a date field. When I set latest = 1 in the where clause, I get an error. Please help if possible. DATE is a the field I'm sorting by. I have tried..
i wan to retrive all the value of this code using class name ..is it possible in jquery . i want to retrive only the text within a div or number of div may be change the next form
<span class="..
I use this handy equation to search for a term inside of a cell in excel.
=IF(ISNUMBER(SEARCH("*Gingrich*",C1)),"1","")
This equation searches for the presence of Gingrich in C1, if it exists, it d..
I have a file with three columns. I would like to delete the 3rd column(in-place editing). How can I do this with awk or sed?
123 abc 22.3
453 abg 56.7
1236 hjg 2.3
Desired output
123 abc..
I've to detect if two time periods are overlapping.
Every period has a start date and an end date.
I need to detect if my first time period (A) is overlapping with another one(B/C).
In my case, if th..
In a web application that makes use of AJAX calls, I need to submit a request but add a parameter to the end of the URL, for example:
Original URL:
http://server/myapp.php?id=10
Resulting URL:..
I have been trying to get all rows from the SQLite database. But I got only last row from the following codes.
FileChooser class:
public ArrayList<String> readFileFromSQLite() {
fileName =..
I have an iframe that loads a third party website which is extremely slow to load.
Is there a way I can display a loading message while that iframe loads the user doesn't see a large blank space?
PS..
I'm currently using regular expressions to search through RSS feeds to find if certain words and phrases are mentioned, and would then like to extract the text on either side of the match as well. For..
How can I get the nth character of a string? I tried bracket([]) accessor with no luck.
var string = "Hello, world!"
var firstChar = string[0] // Throws error
ERROR: 'subscript' is unavailable..
When I build XML up from scratch with XmlDocument, the OuterXml property already has everything nicely indented with line breaks. However, if I call LoadXml on some very "compressed" XML (no line bre..
I'm looking for a way to automatically format the date in a VBA text box to a MM/DD/YYYY format, and I want it to format as the user is typing it in. For instance, once the user types in the second nu..
Suppose you have a character vector:
char <- c("one", "two", "three")
When you make reference to an index value, you get the following:
> char[1]
[1] "one"
How can you strip off the quote ..
In C# I have an integer value which need to be convereted to string but it needs to add zeros before:
For Example:
int i = 1;
When I convert it to string it needs to become 0001
I need to know t..
Recently I was using GitExtension 2.46, but the Git version that has the same is 1.9.4.msysgit.2. Willing to use only Git commands, I uninstalled GitExtension and install the latest version available ..
We have a REST API where clients can supply parameters representing values defined on the server in Java Enums.
So we can provide a descriptive error, we add this lookup method to each Enum. Seems l..
I need to make a copy of a fairly large 2 dimensional array for a project I am working on. I have two 2D arrays:
int[][]current;
int[][]old;
I also have two methods to do the copying. I need to cop..
My select list is called dropListBuilding. The following code does not seem to work:
for (var i = 0; i < buildings.length; i++) {
var val = buildings[i];
var text = buildings[i];
a..
I would like to know how can I query an array of objects. For example I have an array object like CarList. So CarList[0] would return me the object Car. Car has properties Model and Make. Now, I want ..
I want to check when my object @objectname is not equal to null to show the values of the @objectname else to show that no values found.
I tried this:
<% if (@objectname != null) then %>
bu..
I added over 9000 photos by accident to my project folder. And committed them. Then deleted them from disk. Committed.
Now I try to push changes to git server. But it takes too long and tries to se..
Platform: IntelliJ Community Edition 10.0.3
SDK: jdk1.6.0_21
OS: Windows 7
So I have a strange situation with IntelliJ that has me completely stumped. I setup a Maven project and add log4j as a depe..
After the installation of my ant in my windows 7 . In cmd i typed ant -v it's given the ant version but it says the following also.
Buildfile: build.xml does not exist!
Build failed
What's the pro..
UPDATE 2:
I have now removed the following from the .php file:
<?php error_reporting( E_ALL ); ?>
I have set display_erros in php.ini as follows:
display_errors = On
Error reporting is..
I want to put a left arrow over letter in math mode. I am looking for exactly the reverse of the vector symbol in \vec{x}. I tried to put it with \stackrel{\leftarrow}{x}, but it doesn't look good.
T..
I recently downloaded Xcode 5 DP to test my apps in iOS 7. The first thing I noticed and confirmed is that my view's bounds is not always resized to account for the status bar and navigation bar.
In ..
I was looking into Valgrind to help improve my C coding/debugging when I discovered it is only for Linux - I have no other need or interest in moving my OS to Linux so I was wondering if there is a eq..
Can anyone give me a headstart on the topic of threading? I think I know how to do a few things but I need to know how to do the following:
Setup a main thread that will stay active until I signal it..
I'm learning Angular Material and I'm getting this error when importing { MatButtonModule } from "@angular/material/button".
From what I read in other answers, it looks like package compatibility iss..
I can't get my Spring-boot project to serve static content.
I've placed a folder named static under src/main/resources. Inside it I have a folder named images. When I package the app and run it, it c..
How to change the background color of only selected view in my recycle view example?only the background color of clicked itemview needs to be changed.
Only one selected item must be displayed with bac..
I've read every other google source and SO thread, with nothing working.
Python 2.7.3 32bit installed on Windows 7 64bit. Download, extracting, and then trying to install PyCrypto results in "Unable ..
I believe the issue I am having now should be much easier in MS Excel. However, since my company uses Google Spreadsheet so I have to figure out a way.
Basically, I have a cell that contains a date v..
NUnit has a feature called Values, like below:
[Test]
public void MyTest(
[Values(1,2,3)] int x,
[Values("A","B")] string s)
{
// ...
}
This means that the test method..
export CLASSPATH=.;../somejar.jar;../mysql-connector-java-5.1.6-bin.jar
java -Xmx500m folder.subfolder../dit1/some.xml
cd ..
is the above statement for setting the classpath to already existing clas..
I have a class with a private static final field that, unfortunately, I need to change it at run-time.
Using reflection I get this error: java.lang.IllegalAccessException: Can not set static final bo..
Possible Duplicate:
Java: Reading integers from a file into an array
I want to read integer values from a text file say contactids.txt. in the file i have values like
12345
3456778
2342342..
I'm trying to get the exact JSON that is being sent in the request. Here is my code:
OkHttpClient client = new OkHttpClient();
client.interceptors().add(new Interceptor(){
@Override public com.squ..
I am binding a click event with a button:
$('#myButton').bind('click', onButtonClicked);
In one scenario, this is getting called multiple times, so when I do a trigger I see multiple ajax calls wh..
I am trying to import my project.
but when I run the application I am getting the following error:
Error: Execution failed for task ':app:processDebugResources'.
> com.android.ide.common.process...
I have a certificate in der format, from it with this command I generate a public key:
openssl x509 -inform der -in ejbcacert.cer -noout -pubkey > pub1key.pub
Which results in this:
-----BEGIN ..
I am creating an application using ASP.Net, in which I have a HTML button on an aspx page.
<input type="submit" id="btnSubmit" runat="server"
style="background-image:url(App_Themes/default/Im..
I know that I've seen some example somewhere before but for the life of me I cannot find it when googling around.
I have some rows of data:
data = [[1,2,3],
[4,5,6],
[7,8,9],
..
I have such html:
<legend class="green-color"><a name="section1">Section</a></legend>
legend.green-color{
color:green;
}
In my case Section looking green, but when i pu..
In one of my interviews, I have been asked to explain the difference between an Interface and an Abstract class.
Here's my response:
Methods of a Java interface are implicitly abstract
and can..
I am trying to compile a Pro*C file on gcc and I am getting this error :
make: *** [MedLib_x.o] Error 1
This is the command printed by make:
/usr/bin/gcc -g -fPIC -m64 -DSS_64BIT_SERVER -I/hom..
I get this error "uncaught syntaxerror unexpected token U" when I run my page in chrome. And in firefox I get, "JSON.parse: unexpected character". I'm returning the json data from a php file and the r..
Let's say that I need to format the output of an array to display a fixed number of elements per line. How do I go about doing that using modulus operation?
Using C++, the code below works for displa..
I would like my JSON output in Ruby on Rails to be "pretty" or nicely formatted.
Right now, I call to_json and my JSON is all on one line. At times this can be difficult to see if there is a proble..
I've seen a few questions (namely this one) here on SO about adding a default boolean value to an existing column. So I tried the change_column suggestion but I mustn't be doing it right.
I tried:
$..
I have an image that doesn't match the aspect ratio of my device's screen. I want to stretch the image so that it fully fills the screen, and I don't want to crop any part of the image.
CSS has the c..
I'd like to read the values of URL query parameters using AngularJS. I'm accessing the HTML with the following URL:
http://127.0.0.1:8080/test.html?target=bob
As expected, location.search is "?targ..
My Eclipse (Indigo) was running just fine. I created a simple class Hello. It is placed in package cont in the folder ch13. However, when I try to run it from Eclipse I get info from Java Virtual M..
I have a Java Project in NetBeans 7.0.
I want to add some image to some label dynamically. The image will differ depending on the state of the program.
I put one such image, 'filling.jpg', in the 'r..
I have an array int arr[5] that is passed to a function fillarr(int arr[]):
int fillarr(int arr[])
{
for(...);
return arr;
}
How can I return that array?
How will I use it, say I returned ..
I've spent maybe the last two hours browsing and reading up on these methods and the Graphics class, and maybe I'm stupid, haha, but I'm just not understanding them. What are they for? I understand th..
I'm trying to merge two images together with PHP.
For example... how would I go about placing image one on top of image two or merge, with basic PHP?
I have tried something such as watermarking, but ..
Using Xubuntu.
I'd like to have terminator replace the default terminal. For instance, when right-clicking inside a folder then selecting open terminal, I'd like Terminator to open instead of the de..
If the free source code editor Notepad++ has the feature "Find in files...", that is without the files being opened in the editor, does it also have the feature "Replace in files..."?
Notepad++ is ba..
Say I have 4 div elements with class .navlink, which, when clicked, use .data() to set a key called 'selected', to a value of true:
$('.navlink')click(function() { $(this).data('selected', true); })
..
So I have a cell with 7/6/2012 10:26:42 inputted, I want to show the date difference from today in another cell.
I tried to extract 7/6/2012 with =LEFT(A1, Find(" ", A1, 1) -1) but turned out theres..
Like everyone else, I need to test my code on Internet Explorer 6 and Internet Explorer 7. Now Internet Explorer 8 has some great tools for developer, which I'd like to use. I'd also like to start tes..
I am updating a quantity in my cart, but it is throwing a Sequence has no elements' exception.
And I don't know what that even means. At first I thought that maybe there was a null value being passed..
I'm having issue with running my Eclipse with the following config:
eclipse.ini
-startup
plugins/org.eclipse.equinox.launcher_1.2.0.v20110502.jar
--launcher.library
plugins/org.eclipse.equinox.launc..
fp = open("a.txt")
#do many things with fp
c = fp.read()
if c is None:
print 'fp is at the eof'
Besides the above method, any other way to find out whether is fp is already at the eof?..
I have float numbers like 3.2 and 1.6.
I need to separate the number into the integer and decimal part. For example, a value of 3.2 would be split into two numbers, i.e. 3 and 0.2
Getting the integer ..
Being a self-taught newbie, I created a large problem for myself. Before inserting data in to my database, I've been converting apostrophes (') in a string, to double quotes (""), instead of the requi..