I have a .net windows application that needs to run in full screen. When the application starts however the taskbar is shown on top of the main form and it only disappears when activating the form by clicking on it or using ALT-TAB. The form's curren...
Is it possible to export a simple function from a typescript module?
This isn't compiling for me.
module SayHi {
export function() {
console.log("Hi");
}
}
new SayHi();
This workitem seems to imply that you cannot but doesn't flat out s...
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
{
public function launchAction()
{ ...
I am trying to write a code in python to fetch twitter data i am not getting error for twython. But i am getting error for pandas.
I have installed pandas using
pip install pandas. But i still get this error . Please help
F:\>pip install pandas...
I'm looking for an implementation of CRC32 in C or C++ that is explicitly licensed as being no cost or public domain. The implementation here seems nice, but the only thing it says about the license is "source code", which isn't good enough. I'd pr...
I have this simple statement in excel. I compare two dates. If the date 2 is greater than or equal to date 1, then I show 1. If not, then I show 0.
However, I would like to apply this function only when the cells contains text:
IF(NOT(ISBLANK((Q2&l...
I recently installed Microsoft SQL Server 2012 on a fresh Windows 7 installation, but whenever I want to run the server, I get the following error:
Error 1069: The service did not start due to a logon failure.
The following user is configured t...
I'm having some problems with the tag (Spring 3.0.5).
I want to add images to my web application, but it doesnt work.
Here is part of my beans config:
<mvc:annotation-driven/>
<mvc:default-servlet-handler default-servlet-name="ideafactory...
I see an error while executing hibernate sql query.
java.sql.SQLException: ORA-00904: "table_name"."column_name": invalid identifier
When I open up the table in sqldeveloper, the column is present.
The error is only happening in PROD, not i...
After screwing up entirely my PHP configuration on MAC trying to get the SOAP module working (-bash: /usr/bin/php: No such file or directory
....) I now have to use MAMP but each time I have to type the path
Applications/MAMP/bin/php5.3/bin/php to ...
In my app, I write to an excel file. After writing, the user is able to view the file by opening it. But if the user forgets to close the file before any further writing, a warning message should appear. So I need a way to check this file is open bef...
I've a repository moodle on my Github account which I forked from the official repository.
I then cloned it on my local machine. It worked fine. I created several branches (under the master branch). I made several commits and it worked fine.
I don...
How do I limit or restrict the user to only enter a maximum of five characters in the textbox?
Below is the input field as part of my form:
<input type="text" id="sessionNo" name="sessionNum" />
Is it using something like maxSize or somethi...
I want to navigate from the root directory to all other directories within and print the same.
Here's my code:
#!/usr/bin/python
import os
import fnmatch
for root, dir, files in os.walk("."):
print root
print ""
for items ...
I'm new to Github and Generating SSH Keys look a neccessity. And was informed by my boss about this, so I need to comply.
I successfully created SSH Key but when I'm going to add it to the ssh-agent
this is what happens
What seems to be the proble...
I want to disable an input field, but when I submit the form it should still pass the value.
Use case: I am trying to get latitude and longitude from Google Maps and wanna display it, but I don't want the user to edit it.
Is this possible?...
Tried the following command:
git commit path/to/my/file.ext -m 'my notes'
Receive an error in git version 1.5.2.1:
error: pathspec '-m' did not match any file(s) known to git.
error: pathspec 'MY MESSAGE' did not match any file(s) known to git.
...
In MySQL you can insert multiple rows like this:
INSERT INTO 'tablename' ('column1', 'column2') VALUES
('data1', 'data2'),
('data1', 'data2'),
('data1', 'data2'),
('data1', 'data2');
However, I am getting an error when I try to do ...
I'm on a mac, doing:
rails server
I get:
2010-12-17 12:35:15] INFO WEBrick 1.3.1
[2010-12-17 12:35:15] INFO ruby 1.8.7 (2010-08-16) [i686-darwin10.4.0]
[2010-12-17 12:35:15] WARN TCPServer Error: Address already in use - bind(2)
Exiting
I kn...
I have a stack of divs inside of each other, all of which have an ID which specifies CSS only.
But for some reason the surrounding DIV tag only expands to it's anointed height value, and not it's default auto, meaning that although the content is in...
I am writing a script for customising a configuration file. I want to replace multiple instances of strings within this file, and I tried using PowerShell to do the job.
It works fine for a single replace, but doing multiple replaces is very slow be...
[(1,2), (2,3), (4,5), (3,4), (6,7), (6,7), (3,8)]
How do I return the 2nd value from each tuple inside this list?
Desired output:
[2, 3, 5, 4, 7, 7, 8]
...
Does Python have a function that I can use to escape special characters in a regular expression?
For example, I'm "stuck" :\ should become I\'m \"stuck\" :\\....
I have a string that has two single quotes in it, the ' character. In between the single quotes is the data I want.
How can I write a regex to extract "the data i want" from the following text?
mydata = "some string with 'the data i want' inside";
...
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 capable of storing date, time information.
Still Wh...
Can I call javascript function from MVC controller action (not from view page) and get return value? How?
I need to make request to server from code (.cs) using javascript like here (but this is aspx page)
function getInitData() {
var code; code...
Working with a data frame similar to this:
set.seed(100)
df <- data.frame(cat = c(rep("aaa", 5), rep("bbb", 5), rep("ccc", 5)), val = runif(15))
df <- df[order(df$cat, df$val), ]
df
cat val
1 aaa 0.05638315 ...
I have a set of div elements. In jQuery, I would like to be able to find out the div with the maximum height and also the height of that div. For instance:
<div>
<div class="panel">
Line 1
Line 2
</div>
<div class...
I'm doing some React right now and I was wondering if there is a "correct" way to do conditional styling. In the tutorial they use
style={{
textDecoration: completed ? 'line-through' : 'none'
}}
I prefer not to use inline styling so I want to in...
Is it possible to modify the JavaScript of a page and then reload the page without reloading the modified JavaScript file (and thus losing modifications)?...
I am using the following code to update a listbox, this recieving a list from a Web service:
client.userKeywordsCompleted += new EventHandler<userKeywordsCompletedEventArgs>(client_userKeywordsCompleted);
client.userKeywordsAsync();
Using:
...
You can set the initial size for an ArrayList by doing
ArrayList<Integer> arr=new ArrayList<Integer>(10);
However, you can't do
arr.add(5, 10);
because it causes an out of bounds exception.
What is the use of setting an initial siz...
I am getting an error ./test.sh: line 13: [: missing `]' in the file test.sh
I tried using brackets and other options such as -a or by checking the size of the file p1 but the error is always there and the else statement is always executed irrespecti...
I'm trying to convert some date/times to UTC, which I thought would be dead simple in Python - batteries included, right? Well, it would be simple except that Python (2.6) doesn't include any tzinfo classes. No problem, a quick search turns up python...
I am trying to call a sub on a different worksheet but I got a run time error message.
Specifically, I have two worksheets and multiple VBA sub s in those worksheets. In one of the VBA Project (say workbook1.xlsm), I have the following code:
Sub A...
Trying to create a sequence in Oracle that starts with the max value from a specific table. Why does this not work?
CREATE SEQUENCE transaction_sequence
MINVALUE 0
START WITH (SELECT MAX(trans_seq_no)
FROM TRANSACTION_LOG)
INCREMENT BY 1...
This is my function and it should change the onClick attribute of the HTML input, but if I use
document.getElementById('buttonLED'+id).onclick = "writeLED(1,1)";
it does not work at all, but if I use
document.getElementById('buttonLED'+id).oncli...
I need to perform some actions when the back button(return to previous screen, return to parent-view) button is pressed on a Navbar.
Is there some method I can implement to catch the event and fire off some actions to pause and save data before the ...
I'm currently working on a form which includes some file inputs to upload pictures. There is an onchange() event for those inputs that submits the pictures to an iframe, then dynamically loads the uploaded pictures into the form, with fields to be mo...
I have a pre-populated array list. And I have multiple threads which will remove elements from the array list. Each thread calls the remove method below and removes one item from the list. Does the following code give me consistent behavior ?
ArrayL...
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 = [random.randrange(90,140) for _ in range(500)]
tempera...
I have the following function in jQuery code:
btnLogin.on('click', function(e,errorMessage){
console.log('my message' + errorMessage);
e.preventDefault();
return $.ajax({
type: 'POST',
url: 'loginCheck',
data: $(...
Twitter's bootstrap uses Icons by Glyphicons. They are "available in dark gray and white" by default:
Is it possible to use some CSS trickery to change the colors of the icons? I was hoping for some other css3 brilliance that would prevent having ...
Is there a concise, built-in way to do equals assertions on two like-typed arrays in JUnit? By default (at least in JUnit 4) it seems to do an instance compare on the array object itself.
EG, doesn't work:
int[] expectedResult = new int[] { 116800...
How can I configure JPA/Hibernate to store a date/time in the database as UTC (GMT) time zone? Consider this annotated JPA entity:
public class Event {
@Id
public int id;
@Temporal(TemporalType.TIMESTAMP)
public java.util.Date date;...
I'm developing application based on Spring Boot and AngularJS using JHipster.
My question is how to set max size of uploading files?
If I'm trying to upload to big file I'm getting this information in console:
DEBUG 11768 --- [io-8080-exec-10] c....
How could I convert from float to string or string to float?
In my case I need to make the assertion between 2 values string (value that I have got from table) and float value that I have calculated.
String valueFromTable = "25";
Float valueCalcula...
I have been seeing the aria attribute all over while working with Angular Material. Can someone explain to me, what the aria prefix means? but most importantly what I'm trying to understand is the difference between aria-hidden and hidden attribute....
I am trying to make a restful controller to upload files. I have seen this
and made this controller:
@RestController
public class MaterialController {
@RequestMapping(value="/upload", method= RequestMethod.POST)
public String handleFileUpl...
I have been reading a LOT of google posts and StackOverflow questions about how to restore a database in SQL Server from a .bak file.
But none of them states how to just READ the tables in the database-backup.
(None that I could find anyway?)
I jus...
I have a string variable in java having value:
String result="34.1 -118.33\n<!--ABCDEFG-->";
I want my final string to contain the value:
String result="34.1 -118.33";
How can I do this? I'm new to java programming language.
Thanks,...
I have a list and I want to remove a single element from it. How can I do this?
I've tried looking up what I think the obvious names for this function would be in the reference manual and I haven't found anything appropriate....
How to increase request timeout in IIS 7.0? The same is done under application tab in ASP configuration settngs in IIS 6.0. I am not able to find the asp.net configuration section in IIS 7.0...
i have some pb. I want to cast a List to Collection in java
Collection<T> collection = new Collection<T>(mylList);
but i have this error
Can not instantiate the type Collection
...
if( (A) && (B) )
{
//do something
}
else
//do something else
The question is, would the statement immediately break to else if A was FALSE. Would B even get evaluated?
I ask this in the case that B checking the validity of an array ...
I created a C# application and installed it on my test box. My app works perfect on my dev box, but when I install in on a different machine it crashes in the Main(). I get the EventType: CLR20r3
here is the Event Message
Problem signature:
...
I am using Android studio 1.0.1. I have a java module referred by other modules in my project. I have checked it out from SVN But now every
Unsupported Modules Detected: Compilation is not supported for following modules: . Unfortunately you can't ...
I was under the assumption that if I disabled a div, all content got disabled too.
However, the content is grayed but I can still interact with it.
Is there a way to do that? (disable a div and get all content disabled also)...
I've looked through a ton of SO articles, and even other sites, but can't seem to get this service working. I have a SOAP service I'm trying to hit and it's configured like this:
<system.serviceModel>
<bindings>
<basicHttp...
In an attempt to fully understand how to solve Java's multiple inheritance problems I have a classic question that I need clarified.
Lets say I have class Animal this has sub classes Bird and Horse and I need to make a class Pegasus that extends fro...
How to convert an integer number into its binary representation?
I'm using this code:
String input = "8";
String output = Convert.ToInt32(input, 2).ToString();
But it throws an exception:
Could not find any parsable digits
...
I try to check a radio button with jQuery. Here's my code:
<form>
<div id='type'>
<input type='radio' id='radio_1' name='type' value='1' />
<input type='radio' id='radio_2' name='type' value='2' />
...
How do I get a path to the desktop for current user in C#?
The only thing I could find was the VB.NET-only class SpecialDirectories, which has this property:
My.Computer.FileSystem.SpecialDirectories.Desktop
How can I do this in C#?...
Guava provides us with great factory methods for Java types, such as Maps.newHashMap().
But are there also builders for java Maps?
HashMap<String,Integer> m = Maps.BuildHashMap.
put("a",1).
put("b",2).
build();
...
I have seen various versions of the dex erros before, but this one is new. clean/restart etc won't help. Library projects seems intact and dependency seems to be linked correctly.
Unable to execute dex: method ID not in [0, 0xffff]: 65536
Conversio...
I'm coding a p2p implementation that I would like to make decentralized however I'm having some trouble grasping how DHT in protocols like bittorrent work. How does the client know where the peers are if there is no tracker? Are peers stored in the a...
How would I tell Python to check the below for the letter x and then print "Yes"? The below is what I have so far...
dog = "xdasds"
if "x" is in dog:
print "Yes!"
...
In postgres, how do I change an existing user to be a superuser? I don't want to delete the existing user, for various reasons.
# alter user myuser ...?
...
Imagine that I have a dynamic variable:
dynamic d = *something*
Now, I create properties for d which I have on the other hand from a string array:
string[] strarray = { 'property1','property2',..... }
I don't know the property names in advance....
When you limit the number of rows to be returned by a SQL query, usually used in paging, there are two methods to determine the total number of records:
Method 1
Include the SQL_CALC_FOUND_ROWS option in the original SELECT, and then get the total ...
I am using the AmazonS3Client in an Android app using a getObject request to download an image from my Amazon S3 bucket.
Currently, I am getting this exception:
com.amazonaws.services.s3.model.AmazonS3Exception:
The specified key does not exist.
...
I'd like to write an extension method to the String class so that if the input string to is longer than the provided length N, only the first N characters are to be displayed.
Here's how it looks like:
public static string TruncateLongString(this s...
I'm adding continuous integration to an EC2 project at work using Jenkins. The Jenkins machine itself is kept on an EC2 machine - one that might need to be taken offline and brought back on an entirely different EC2 instance at any point. We have a b...
I have an application where on the home page I have buttons for navigation through the application.
On that page I have a button "EXIT" which when clicked should take the user to the home screen on the phone where the application icon is.
How can I...
I am trying to use Kafka.
All configurations are done properly but when I try to produce message from console I keep getting the following error
WARN Error while fetching metadata with correlation id 39 :
{4-3-16-topic1=LEADER_NOT_AVAILABLE} (...
I have a small chunk of code I can't seem to get working. I am building a website and using JavaScript for the first time. I have my JavaScript code in an external file 'Marq_Msg.js' which looks like this:
var Messages = new Array();
Messages[0] = "...
To send something to all clients, you use:
io.sockets.emit('response', data);
To receive from clients, you use:
socket.on('cursor', function(data) {
...
});
How can I combine the two so that when recieving a message on the server from a clien...
I'm currently doing an assignment for one of my classes, and in it, I have to give examples, using Java syntax, of static and dynamic binding.
I understand the basic concept, that static binding happens at compile time and dynamic binding happens at...
According to the HTTP/1.1 Spec:
The POST method is used to request that the origin server accept the entity enclosed in the request as a new subordinate of the resource identified by the Request-URI in the Request-Line
In other words, POST is ...
I'm trying to retrieve a server control in JavaScript. For testing purposes I am calling the JavaScript function from the page load event.
protected void Page_Load(object sender, EventArgs e){
ClientScript.RegisterClientScriptBlock(GetType(), "j...
Does anyone know if there is an equivalent to .htaccess and .htpassword for IIS ? I am being asked to migrate an app to IIS that uses .htaccess to control access to sets of files in various URLs based on the contents of .htaccess files.
I did a goo...
I have an error message on django 1.4:
dictionary update sequence element #0 has length 1; 2 is required
[EDIT]
It happened when I tried using a template tag like: `{% for v in values %}:
dictionary update sequence element #0 has length 1; 2 ...
This is probably going to be a stupid question but I'm having one of those nights. In an application I am developing RESTful API and we want the client to send data as JSON. Part of this application requires the client to upload a file (usually an im...
I have a checkbox on a form which is unchecked by default as usual. now I want to perform two separated actions on checked and unchecked state of this checkbox.
this is my checkbox:
<form>
syn<input type="checkbox" name="checkfield" id...
How do I open a file that is an Excel file for reading in Python?
I've opened text files, for example, sometextfile.txt with the reading command. How do I do that for an Excel file?...
What is the maximum number of threads you can create in a C# application? And what happens when you reach this limit? Is an exception of some kind thrown?...
I have a non-negative int and I would like to efficiently convert it to a big-endian string containing the same data. For example, the int 1245427 (which is 0x1300F3) should result in a string of length 3 containing three characters whose byte value...
I'm trying to show a comparison between two photos in my README.md which is why I want to display them side-by-side. Here is how the two images are placed currently. I want to show the two Solarized color schemes side by side instead of top and botto...
I'm trying to find a plugin or simple script to open a file in a popup window by clicking on a button. This used to work, but with all the jQuery updates (even with the migration file), this no longer works.
I found this, but this opens the popup an...
I have a problem while connecting to github from my PC, using git. System Win 7.
I have connection through proxy, so i specified it in git config files (both in general git folder, and in git repo folder). To do this i entered next line to my git bu...
I try to install app via adb and get a error:
$ ./adb -d install /Users/dimon/Projects/one-place/myprogram/platforms/android/build/outputs/apk/android-debug.apk -r -g
3704 KB/s (4595985 bytes in 1.211s)
pkg: /data/local/tmp/android-debug.apk
Fai...
Is there any way to debug a stored procedure on SQL Server 2008?
I have access to use SQL Server Management Studio 2008 and Visual Studio 2008 (not sure whether either provides this functionality).
Generally I use the SQL profiler to find the para...
I am working on an worksheet generator in Excel 2007. I have a certain layout I have to follow and I often have to format cells based on input. Since the generator is dynamic I have to calculate all kinds of ranges, merge cells, etc.
How can I conve...
Even though I manually configured JDK project structure file/Project structure it still shows this error
FAILURE: Build failed with an exception.
`What went wrong:
Execution failed for task ':sample:compileReleaseJavaWithJavac'.
Could not find ...
I have a problem with multiple ajax functions where the beforeSend of the second ajax post is executed before the complete function of the first ajax.
The loading class I am adding to the placeholder before sending is working for the first ajax call...
I have an ASP.NET application which runs fine on my local development machine.
When I run this application online, it shows the following error:
Format of the initialization string does not conform to specification starting at index 0
Why is this a...
I am running R on Windows, not as an administrator. When I install a package, the following command doesn't work:
> install.packages("zoo")
Installing package(s) into ‘C:/Program Files/R/R-2.15.2/library’
(as ‘lib’ is unspecified)
Warning...
I have a page and I want simply to make a header. This header is an <h1> text aligned to the left, and an <h2> aligned to the right, in the same line, and after them, an <hr>. My code so far look as follows (if you test it, you'll s...
I was wondering if it's possible to determine what kind of iPhone (for example) the currentdevice is? I know it's possible to get the model through
NSString *deviceType = [[UIDevice currentDevice] model];
which will just return whether I have an ...
Is there a way to use ng-if to test if a variable is defined, not just if it's truthy?
In the example below (live demo), the HTML displays a shipping cost for the red item only, because item.shipping is both defined and nonzero. I'd like to also dis...
I am trying to filter a noisy heart rate signal with python. Because heart rates should never be above about 220 beats per minute, I want to filter out all noise above 220 bpm. I converted 220/minute into 3.66666666 Hertz and then converted that Hert...
I want to compare 2 iterables and print the items which appear in both iterables.
>>> a = ('q', 'r')
>>> b = ('q')
# Iterate over a. If y not in b, print y.
# I want to see ['r'] printed.
>>> print([ y if y not in b for ...
I use huge data files, sometimes I only need to know the number of lines in these files, usually I open them up and read them line by line until I reach the end of the file
I was wondering if there is a smarter way to do that...
When I build my c++ solution in Visual Studio it complains that the xxxxx.pch file is missing. Is there a setting I am missing to get the pre-compiled headers back?
here is the exact error for completeness:
Error 1 fatal error C1083: Cannot ope...
I am trying to make a simple library database. I list the search results in a gridview, then i have a textbox and a button, user enters the isbn and clicks loan button. Then, if there is enough number of items (itemNumber>0) it is loaned by user. Her...
The hashCode value of a Java String is computed as (String.hashCode()):
s[0]*31^(n-1) + s[1]*31^(n-2) + ... + s[n-1]
Are there any circumstances (say JVM version, vendor, etc.) under which the following expression will evaluate to false?
boolean ...
I wanted to set a CSS class in my master page, which depends on the current controller and action. I can get to the current controller via ViewContext.Controller.GetType().Name, but how do I get the current action (e.g. Index, Show etc.)?...
I am using the itoa() function to convert an int into string, but it is giving an error:
undefined reference to `itoa'
collect2: ld returned 1 exit status
What is the reason? Is there some other way to perform this conversion?...
I'd like to convert a float to a whole number in JavaScript. Actually, I'd like to know how to do BOTH of the standard conversions: by truncating and by rounding. And efficiently, not via converting to a string and parsing....
I am trying to run a block if a directory exists in my jenkins workspace and the pipeline step "fileExists: Verify file exists" in workspace doesn't seem to work correctly.
I'm using Jenkins v 1.642 and Pipeline v 2.1. and trying to have a condition...
Just installed Ubuntu 13.10 (Saucy) and anything I try to install via sudo apt-get install is failing and throwing a series of 404 erros.
Example - installing tmux
[jeeves@HAL] hadoop > sudo apt-get install tmux
[sudo] password for jeeves:
Read...
I have a HTML form and I need to display the form field values below the form after user clicks the submit button. How can I do this using HTML and JavaScript Ajax?...
What do I need to do to make a Windows Forms application to be able to run in the System Tray?
Not an application that can be minimized to the tray, but an application that will be only exist in the tray, with nothing more than
an icon
a tool tip, a...
I would like to cut a Java String when this String length is > 50, and add "..." at the end of the string.
Example :
I have the following Java String :
String str = "abcdefghijklmnopqrtuvwxyz";
I would like to cut the String at length = 8 :
Res...
How to set the default value of an attribute on a Laravel model?
Should I set the default when creating a migration or should I set it in the model class?...
Problem :
Error:Could not find com.android.support.constraint:constraint-layout:1.0.0-alpha2.
Required by:
myapp:app:unspecified
Background :
Android Studio 2.2 P 1...
Here is my problem,
In Windows I am making a zip file in which there is a text .sh file which is supposed to be executed in Linux.
The user on the other end opens the zip file in Linux and tries to execute the .sh file but the execute permission is ...
Possible Duplicate:
What is the use of making constructor private in a class?
Where do we need private constructor? How can we instantiate a class having private constructor? ...
I was asked to build a site , and one of the co-developer told me That I would need to include the keep-alive header.
Well I read alot about it and still I have questions.
msdn ->
The open connection improves performance when a client makes mult...
My assignment asks me to access a test.txt document, so the file name has to be hard coded to my C drive. I have no idea what hardcoding means. Can somebody please help me with this?...
I started to write a terminal text editor, something like the first text editors for UNIX, such as vi. My only goal is to have a good time, but I want to be able to show text in color, so I can have syntax highlighting for editing source code.
How ...
I have two Python scripts. One uses the Urllib2 library and one uses the Requests library.
I have found Requests easier to implement, but I can't find an equivalent for urlib2's read() function. For example:
...
response = url.urlopen(req)
print re...
The new Bootstrap 3 grid system is great. It's more powerful for responsive design at all screen sizes, and much easier for nested.
But I have one issue I could not figure out. How do I add precise gap between the columns? Say I have container 960px...
I'm trying to handle authentication popup using the code below:
FirefoxProfile profile = new FirefoxProfile();
profile.setPreference("network.http.phishy-userpass-length", 255);
profile.setPreference("network.automatic-ntlm-auth.trusted-uris", "x.x....
Problem
I have a CSS file with some paths in it (for images, fonts, etc.. url(..)).
My path structure is like this:
...
+-src/
| +-MyCompany/
| +-MyBundle/
| +-Resources/
| +-assets/
| +-css/
| +-stylesheets...
+-web/
| ...
I have an Excel file which has a column formatted as date in the format dd-mm-YYYY.
I need to convert that field to text. If I change the field type excel converts it to a strange value (like 40603).
I tried the text function but it gives me Error ...
Possible Duplicate:
Difference between OnClick() event and OnClickListener?
I'm semi-new to Android development and when I first started I tried to avoid using the xml layout by any means necessary so some of my earlier projects involve bu...
I have a Silverlight application (using MVC) and when i'm building in visual studio, using Visual Studio Development center, there's no problem, the HttpContext.Current.User.Identity.Name has a Value
But when i'm using the same project with IIS 7.5 ...
How can ^\d+$ be improved to disallow 0?
EDIT (Make it more concrete):
Examples to allow:
1
30
111
Examples to disallow:
0
00
-22
It doesn't matter if positive numbers with a leading zero are allowed or not (e.g. 022).
This is for Java JDK Rege...
This question has been asked in a few different formats but I can't get any of the answers to work in my scenario.
I am using jQuery to implement command history when user hits up/down arrows. When up arrow is hit, I replace the input value with pre...
I have used the "Hex Editor to modify DPB to DPx" many times in the past to bypass VBA project security on my old Excel VBA projects (.xls), so I definitely know how to do it and know that I can do it.
However I have just tried to do it yesterday an...
I am working with Fragments which implements an interface.
public class SigninFragment extends Fragment implements SigninInterface
The interface's method implementation in the fragment class is as follows.
@Override
public void afterSubmitClicked(S...
I have the following menu items generated by a template generator, artisteer:
<ul class="art-vmenu">
<li><a href="#" ><span class="l"></span><span class="r"></span>
<span class="t">Home</sp...
I've been using Bootstrap's carousel class and it has been straightforward so far, however one problem I've had is that images of different heights cause the arrows to bounce up and down to adjust to the new height..
This is the code I'm using for m...
I have the following code:
UIWebView.loadRequest(NSURLRequest(URL: NSURL(string: "google.ca")))
I am getting the following error:
'NSURLRequest' is not convertible to UIWebView.
Any idea what the problem is? ...
As title reads, how to locate the git config file in Mac? Not sure how to find it. Need to set
git config --global http.postBuffer 524288000
Need some guidance on finding it.....
Possible Duplicate:
How to generate a vector containing a numeric sequence?
In R, how can I get the list of numbers from 1 to 100? Other languages have a function 'range' to do this. R's range does something else entirely.
> range(1,10...
My website renders well on the iPhone/Safari browser, with one exception: My text input fields have a weird rounded style which doesn't look good at all with the rest of my website.
Is there a way to instruct Safari (via CSS or metadata) not to roun...
On my WAMP box, I did the following:
Added a file called /application/libraries/Foo.php
Foo.php is a class, and it's name is Foo
In /application/config/autoload.php, I added $autoload['libraries'] = array('foo');
Everything works fine. When I upl...
I am working on Vista, and using Python 2.6.4. I am using a software that utilizes a Python script, but bumped into the message:
cannot find vcvarsall.bat
So, I installed visual c++ 2010. Still the file is not found - though, it is there. My guess...
I'm trying to search a whole table in mySQL for a string.
I want to search all fields and all entrees of a table, returning each full entry that contains the specified text.
I can't figure out how to search multiple fields easily; here are the det...
With a trigger like a check box I want to protect my work book. I tried Excel 2003:
thisworkbook.protect("password",true,true)
thisworkbook.unprotect("password")
It's not working. Any suggestions?...
How can I modify the size of the output image of the function pandas.DataFrame.plot?
I tried:
plt.figure (figsize=(10,5))
and
%matplotlib notebook
but none of them work....
Can I set any variable in CSS like I want my div height to always be half of width my div scales with the screen size width for div is in percent
<div class="ss"></div>
CSS:
.ss {
width:30%;
height: half of the width;
}
This...
To recognize better the start and the end of output on a commandline, I want to change the color of my prompt, so that it is visibly different from the programs output. As I use zsh, can anyone give me a hint?...
I was wondering what is the best way to search keys in an array and return it's value. Something like array_search but for keys. Would a loop be the best way?
Array:
Array([20120425] => 409 [20120426] => 610 [20120427] => 277
[2012...
I am using Selenium in Java to test the checking of a checkbox in a webapp. Here's the code:
private boolean isChecked;
private WebElement e;
I declare e and assign it to the area where the checkbox is.
isChecked = e.findElement(By.tagName("inp...
I'm trying to display a price of a product in Woocommerce, on a custom page.
There is a short code for that, but it gives product price and also adds an "Add to cart button", I don't want the button, i just want to get the price of a specific product...
Can I convert iso date to milliseconds?
for example I want to convert this iso
2012-02-10T13:19:11+0000
to milliseconds.
Because I want to compare current date from the created date. And created date is an iso date....
I have created a simple unit test but IntelliJ is incorrectly highlighting it red. marking it as an error
No beans?
As you can see below it passes the test? So it must be Autowired?
...
Below is the query that I am using to backup (create a .bak) my database.
However, whenever I run it, I always get this error message:
Msg 3201, Level 16, State 1, Line 1
Cannot open backup device 'C:\Users\Me\Desktop\Backup\MyDB.Bak'. Operat...
It seems like the mailto links we're embedding in our website fail to do anything in Chrome, though they work in Firefox.
Simple example here: http://jsfiddle.net/wAPNH/
<a href='mailto:[email protected]'>hi this is a test</a>
Do we need ...
How to select all rows in one table that do not appear on another?
Table1:
+-----------+----------+------------+
| FirstName | LastName | BirthDate |
+-----------+----------+------------+
| Tia | Carrera | 1975-09-18 |
| Nikki | Taylor ...
Say I have an ID row (int) in a database set as the primary key. If I query off the ID often do I also need to index it? Or does it being a primary key mean it's already indexed?
Reason I ask is because in MS SQL Server I can create an index on this...
I want to increase the screen real estate for my Chrome app. The Address Bar is useless in a Chrome App and I was wondering if there was a way to disable it....
Is there a way to install the win32api module for python 3.6 or do I have to change my version of python?
Everytime I try to install it using pip I get the following error:
Could not find a version that satisfies the requirement win32api (from vers...
This question is related to the following questions:
Can't connect to MySQL server error 111
Trying to connect to remote MySQL host (error 2003)
I am configuring a new MySQL (5.1) server on my local machine. I need to provide remote access to...
I'm trying to read a csv-file from given URL, using Python 3.x:
import pandas as pd
import requests
url = "https://github.com/cs109/2014_data/blob/master/countries.csv"
s = requests.get(url).content
c = pd.read_csv(s)
I have the following...
Here's the scenario.
My Java web application has following path
https://www.mywebsite.com:9443/MyWebApp
Let's say there is a JSP file
https://www.mywebsite.com:9443/MyWebApp/protected/index.jsp
and I need to retrieve
https://www.mywebsite.co...
What is the proper, universal format for creating a clickable hyperlink for users on mobile devices to call a phone number?
Area code with dashes
<a href="tel:555-555-1212">555-555-1212</a>
Area code with no dashes
<a href="tel:55...
I am trying to set up maven for my project and I am getting this error
"JAVA_HOME should point to a JDK not a JRE"
I know there are already similar question but it did not work. How can I point JAVA_HOME to JDK in windows. I am using IntelliJ ID...
I have a project in which I have to add a registration form and I want to to validate that the password and confirm fields are equal without clicking the register button.
If password and confirm password field will not match, then I also want to put...
How come I'm getting this error?
My code:
def cat_n_times(s, n):
while s != 0:
print(n)
s = s - 1
text = input("What would you like the computer to repeat back to you: ")
num = input("How many times: ")
cat_n...
I have this code, and I want to know, if I can replace only groups (not all pattern) in Java regex.
Code:
//...
Pattern p = Pattern.compile("(\\d).*(\\d)");
String input = "6 example input 4";
Matcher m = p.matcher(input);
if (m.find()...
Possible Duplicate:
How to format a JSON date?
I have the following result from a $getJSON call from JavaScript. How do I convert the start property to a proper date in JavaScript?
[
{"id":1,"start":"/Date(1238540400000)/"},
{"id"...
I'm currently learning C++ and I've learned about the incrementation a while ago.
I know that you can use "++x" to make the incrementation before and "x++" to do it after.
Still, I really don't know when to use either of the two... I've never really...
How to restrict DateTimePicker to select the time only? I don't know how to disable calendar control which drops when you press the button at the right of DateTimePicker....
Is there a way I can simulate various connection speeds from within Chrome?
I need to be able to check http://localhost with varying speeds.
I know there are standalone applications that can do this, but I'd rather do this inside Chrome....
How can i center the form called form_login horizontally and vertically in my page ?
Here is the HTML I'm using right now:
<body>
<form id="form_login">
<p>
<input type="text" id="username" placeholder="...
When deploying the application to the device, the program will quit after a few cycles with the following error:
Program received signal: "EXC_BAD_ACCESS".
The program runs without any issue on the iPhone simulator, it will also debug and run as l...
What MySQL query will do a text search and replace in one particular field in a table?
I.e. search for foo and replace with bar so a record with a field with the value hello foo becomes hello bar....
How do I change the content of the cell containing the 'c' letter in the HTML sample using jQuery?
<table id="table_header">
<tr>
<td>a</td>
<td>b</td>
<td>c</td>
</tr>
</table>
...
I have some trouble to convert my data.frame from a wide table to a long table.
At the moment it looks like this:
Code Country 1950 1951 1952 1953 1954
AFG Afghanistan 20,249 21,352 22,532 23,557 24,555
ALB Albania ...
I want to compare values from two different files.
In Notepad++ version 5.0.3 we had shortcut button Alt+d but in version 6.6.8 I cannot find any option to compare.
Also let me know which version is most stable....
I get the following error when running make, and I have no idea what it means or what to do about it. Can anyone illuminate me or point me in the right direction?
(cd libdvdnav-git && patch -p1) < ../../contrib/src/dvdnav/dvdnav.patch
pat...
I see the error collect2: error: ld returned 1 exit status very often. For example, I was executing the following snippet of code:
void main() {
char i;
printf("ENTER i");
scanf("%c",&i);
clrscr();
switch(i) {
default:
pri...
I have a website that every time a user logs in or logs out I save it to a text file.
My code doesn't work in appending data or creating a text file if it does not exist.. Here is the sample code
$myfile = fopen("logs.txt", "wr") or die("Unable to ...
New to bootstrap 3.... In my layout I have:
<div class="row">
<div class="col-lg-6 col-md-6">elements 1</div>
<div class="col-lg-6 col-md-6">
<div class="pull-right">
elements 2
<...
Here is my simple User POCO class:
/// <summary>
/// The User class represents a Coderwall User.
/// </summary>
public class User
{
/// <summary>
/// A User's username. eg: "sergiotapia, mrkibbles, matumbo"
/// </sum...
Selecting constants without referring to a table is perfectly legal in an SQL statement:
SELECT 1, 2, 3
The result set that the latter returns is a single row containing the values. I was wondering if there is a way to select multiple rows at once...
I want to slice a NumPy nxn array. I want to extract an arbitrary selection of m rows and columns of that array (i.e. without any pattern in the numbers of rows/columns), making it a new, mxm array. For this example let us say the array is 4x4 and I ...
In Angular 1.x, UI-Router was my primary tool for this. By returning a promise for "resolve" values, the router would simply wait for the promise to complete before rendering directives.
Alternately, in Angular 1.x, a null object will not crash a te...
I'm using geom_smooth() from ggplot2.
In Hadley Wickham's book ("ggplot2 - Elegant Graphics for Data Analysis") there is an example (page 51), where method="lm" is used. In the online manual there is no talk of the method argument. I see other Googl...
I have been trying to load the skeleton of express with npm install express. It outputs the following line:
npm notice created a lockfile as package-lock.json. You should commit this file.
What should I do in order to load the template ejs an...
I want to retrieve the index of an array but I know only a part of the actual value in the array.
For example, I am storing an author name in the array dynamically say "author = 'xyz'".
Now I want to find the index of the array item contai...
A coworker asked me today how to add a range to a collection. He has a class that inherits from Collection<T>. There's a get-only property of that type that already contains some items. He wants to add the items in another collection to the pro...
ls -la /dev/tty shows the output:
crw-rw-rw- 1 root tty 5, 0 Dec 14 22:21 /dev/tty
What does c at the beginning mean? When I do something like pwd > /dev/tty it prints to the stdout. What does the file /dev/tty contain?...
I am trying to create a set of nested directories from a Go executable such as 'dir1/dir2/dir3'. I have succeeded in creating a single directory with this line:
os.Mkdir("." + string(filepath.Separator) + c.Args().First(),0777);
However, I have no...
I have a table with the following columns:
id - INT UNSIGNED AUTO_INCREMENT
name - VARCHAR(20)
group - VARCHAR(20)
I know that I can add a row like this:
INSERT INTO table_name (name, group) VALUES ('my name', 'my group')
I wonder if there is ...
This is my first time working with Node.js and I ran into this problem:
I have started a Node server through the plugin of an IDE. Unfortunately, I cannot use the IDE's terminal. So I tried to run the script from the command line.
This is the probl...
Is it possible to only merge some columns? I have a DataFrame df1 with columns x, y, z, and df2 with columns x, a ,b, c, d, e, f, etc.
I want to merge the two DataFrames on x, but I only want to merge columns df2.a, df2.b - not the entire DataFrame....
I'm trying to make a layout as per below with React Native.
How do I specify the position of B relative to A?
With iOS Interface Builder and autoconstraints, this can very explicitly be done and is a breeze. It's not so obvious how one might achi...
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 to Pandas date format?...
Using the CSS flex box model, how can I force an image to maintain its aspect ratio?
JS Fiddle: http://jsfiddle.net/xLc2Le0k/2/
Notice that the images stretch or shrink in order to fill the width of the container. That's fine, but can we also have ...
I tried to install composer via brew per:
In usr/local/bin (which was not on Mavricks and I had to make personally) I did.
brew tap josegonzalez/homebrew-php
brew install josegonzalez/php/composer
I can run php composer.phar, but when I do php c...
I am debugging some JavaScript, and can't explain what this || does?
function (title, msg) {
var title = title || 'Error';
var msg = msg || 'Error on Request';
}
Can someone give me an hint, why this guy is using var title = title || 'ERROR'...
I would like to perform some tasks based on the window re-size event (on load and dynamically).
Currently I have my DOM as follows:
<div id="Harbour">
<div id="Port" (window:resize)="onResize($event)" >
<router-outlet>...
How do I edit an item in the list in the code below:
List<Class1> list = new List<Class1>();
int count = 0 , index = -1;
foreach (Class1 s in list)
{
if (s.Number == textBox6.Text)
index = count; // I found a match and I wan...
I am trying to start my nginx server.
When I type "$> /etc/init.d/nginx start", I have a message appearing "Starting nginx:", and then nothing happens. There is no error message, and when I check the status of nginx I see that it is not running.
Her...
I have made a php script inside localhost and I am connecting that with httpClient but I am getting a problem.
Please tell me how can I connect to a php file at localhost from the emulator?...
What is the difference between HAVING and WHERE in an SQL SELECT statement?
EDIT: I have marked Steven's answer as the correct one as it contained the key bit of information on the link:
When GROUP BY is not used, HAVING behaves like a WHERE clause
...
I'm having a play with SVG and am having a few problems with positioning. I have a series of shapes which are contained in the g group tag. I was hoping to use it like a container, so I could set its x position and then all the elements in that group...
I am having problems compiling my app with Android Studio (0.1.5).
The app uses 2 libraries which I have included as follows:
settings.gradle
include ':myapp',':library',':android-ColorPickerPreference'
build.gradle
buildscript {
reposito...
I have a problem with getting text from EditText field to insert it in Email composer with intent. I've declared EditText field in layout file (@+id/vnosEmaila):
<?xml version="1.0" encoding="utf-8"?>
<RelativeLayout
xmlns:android="http...
I am trying to get all rows from a table.
In controller I have:
meta.Session.query(User).all()
The result is [, ], but I have 2 rows in this table.
I use this model for the table:
import hashlib
import sqlalchemy as sa
from sqlalchemy import o...
I want to add a custom right-click menu to my web application. Can this be done without using any pre-built libraries? If so, how to display a simple custom right-click menu which does not use a 3rd party JavaScript library?
I'm aiming for something...
I have an app that uses external storage to store photographs. As required, in its manifest, the following permissions are requested
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permiss...
true.ToString()
false.toString();
Output:
True
False
Is there a valid reason for it being "True" and not "true"? It breaks when writing XML as XML's boolean type is lower case, and also isn't compatible with C#'s true/false (not sure about CLS th...
I know there are many questions like this, but i didn't find any solution in it.
Things i tried:-
checked firewall
restarted my PC and Apache server
restarted MYSQL
checked my code
Tried everything i know and found on internet
here's my code:-
...
I have a C# application which emails out Excel spreadsheet reports via an Exchange 2007 server using SMTP. These arrive fine for Outlook users, but for Thunderbird and Blackberry users the attachments have been renamed as "Part 1.2".
I found this ar...
I need to implement my own attributes like in com.android.R.attr
Found nothing in official documentation so I need information about how to define these attrs and how to use them from my code....
Any idea how to get the DatePicker to appear at the end of the associated text box instead of directly below it? What tends to happen is that the text box is towards the bottom of the page and the DatePicker shifts up to account for it and totally co...
What would be the best way to implement a customizable tree data structure (meaning, a tree structure with an unknown number of level) in a database?
I've done this once before using a table with a foreign key to itself.
What other implementations c...
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 class
path resource [root-context.xml]: Invocatio...
I Have two generic list filled with CustomsObjects.
I need to retrieve the difference between those two lists(Items who are in the first without the items in the second one) in a third one.
I was thinking using .Except() was a good idea but I don'...
According to this java.sun page == is the equality comparison operator for floating point numbers in Java.
However, when I type this code:
if(sectionID == currentSectionID)
into my editor and run static analysis, I get: "JAVA0078 Floating point v...
Is there any way to open a view from a controller action in a new window?
public ActionResult NewWindow()
{
// some code
return View();
}
How would I get the NewWindow.cshtml view to open in a new browser tab?
I know how to do it from a l...
I have Date in this format (2012-11-17T00:00:00.000-05:00). I need to convert the date into this format mm/yyyy.
I tried this way, but I am getting this Exception.
Exception in thread "main" java.lang.IllegalArgumentException: Cannot format given ...
Since the latest Rails 3 release is not auto-loading modules and classes from lib anymore,
what would be the best way to load them?
From github:
A few changes were done in this commit:
Do not autoload code in *lib* for applications (now you need ...
Created a stored procedure in SQL 9 (2005) and have since upgraded to SQL 10 (2008). Since then, the following stored procedure has stopped working and thrown up the above error:
ALTER PROCEDURE [dbo].[GetModifiedPages]
@vPortalUID nvar...
I need to know if a Date is between a DateRange. I have three dates:
// The date range
DateTime startDate;
DateTime endDate;
DateTime dateToCheck;
The easy solution is doing a comparison, but is there a smarter way to do this?...
Given a 3 times 3 numpy array
a = numpy.arange(0,27,3).reshape(3,3)
# array([[ 0, 3, 6],
# [ 9, 12, 15],
# [18, 21, 24]])
To normalize the rows of the 2-dimensional array I thought of
row_sums = a.sum(axis=1) # array([ 9, 36, 63]...
I am wondering if JavaScript supports writing a function within another function, or nested functions (I read it in a blog). Is this really possible?. In fact, I have used these but am unsure of this concept. I am really unclear on this -- please hel...
Is there any query available to list all tables in my Postgres DB.
I tried out one query like:
SELECT table_name FROM information_schema.tables
WHERE table_schema='public'
But this query returns views also.
How can i get o...
I have seen this many a times that the prospect of a negative padding might help the development of CSS of certain page elements become better and easier. Yet, there is no provision for a negative padding in the W3C CSS. What is the reason behind thi...
I have a code sample that gets a SEL from the current object,
SEL callback = @selector(mymethod:parameter2);
And I have a method like
-(void)mymethod:(id)v1 parameter2;(NSString*)v2 {
}
Now I need to move mymethod to another object, say myDe...
Via VBA how can I check if a cell is empty from another with specific information?
For example:
If A:A = "product special" And B:B is null Then
C1 = "product special"
Additionally, how can I use a For Each loop on theRange and ...
Say I have a variable named choice it is equal to 2. How would I access the name of the variable? Something equivalent to
In [53]: namestr(choice)
Out[53]: 'choice'
for use in making a dictionary. There's a good way to do this and I'm just missing...
I want to make body have 100% of the browser height. Can I do that using CSS?
I tried setting height: 100%, but it doesn't work.
I want to set a background color for a page to fill the entire browser window, but if the page has little content I get...
App Dies On Startup (connection to the server was unsuccessful)
I have an Android application that I'm writing using PhoneGap BUILD. The app was working fine earlier, but now it seems I am getting this error after refining my app (some UI changes o...
I feel this is an awfully obtuse question to ask, but strangely, this problem is poorly documented.
I would like to upgrade PHP, but there are several problems:
There is no built-in package manager. MacPorts doesn't recognize php as an installed...
I want to show progress of calculations, which are performing in external library.
For example if I have some calculate method, and I want to use it for 100000 values in my Form class I can write:
public partial class Form1 : Form
{
public Fo...
I have a version of phpMyAdmin located on my local Apache server.
I am trying to login without a password however phpMyAdmin keeps throwing the warning:
Login without a password is forbidden by configuration (see AllowNoPassword)
However in my...
I'm using MS Excel to get data from a MySQL database through ODBC.
I successfully get data using an SQL query. But now I want that query to be parameterized.
So I wonder If it is possible to use a cell value (a spreadsheet cell) as a parameter for su...
I have code and I have used list to store data.
I want to sort data of it, then is there any way to sort data or shall I have to sort it manually by comparing all data?
import java.util.ArrayList;
import java.util.List;
public class tes
{
publ...
This has probably been asked before, but a quick search only brought up the same question asked for C#. See here.
What I basically want to do is to check wether a given object implements a given interface.
I kind of figured out a solution but this ...
Am getting the below error when trying to do a select through a stored procedure in MySQL.
Illegal mix of collations (latin1_general_cs,IMPLICIT) and (latin1_general_ci,IMPLICIT) for operation '='
Any idea on what might be going wrong here?
Th...
With jQuery, we all know the wonderful .ready() function:
$('document').ready(function(){});
However, let's say I want to run a function that is written in standard JavaScript with no library backing it, and that I want to launch a function as soo...
What's the difference between print, NSLog and println and when should I use each?
For example, in Python if I wanted to print a dictionary, I'd just print myDict, but now I have 2 other options. How and when should I use each?...
I am developing an android application where I am using RecyclerView. I need to add a divider in RecyclerView.
I tried to add -
recyclerView.addItemDecoration(new
DividerItemDecoration(getActivity(),
DividerItemDecoration.VERTICAL_LIST)...
Is there any chance to detect every file selection the user made for an HTML input of type file element?
This was asked many times before, but the usually proposed onchange event doesn't fire if the user select the same file again. ...
So I've got a list:
list<Object> myList;
myList.push_back(Object myObject);
I'm not sure but I'm confident that this would be the "0th" element in the array.
Is there any function I can use that will return "myObject"?
Object copy = myList....
I may well be looking at this problem backwards but I am curious none the less. Is there a way to build a DataTable from what is currently displayed in the DataGridView?
To be clear, I know you can do this DataTable data = (DataTable)(dgvMyMembers...
I have the follow setup and when I loop through using for...of and get an error of :
Property "country" doesn't exist on type "object".
Is this a correct way to loop through each object in array and compare the object property v...
Which is the simplest way to update a Label from another Thread?
I have a Form running on thread1, and from that I'm starting another thread (thread2).
While thread2 is processing some files I would like to update a Label on the Form with the curr...
Which one of these lines is correct?
git checkout 'another_branch'
Or
git checkout origin 'another_branch'
Or
git checkout origin/'another_branch'
And what is the difference between them?
...
I have an entity that has an NON-ID field that must be set from a sequence.
Currently, I fetch for the first value of the sequence, store it on the client's side, and compute from that value.
However, I'm looking for a "better" way of doing this. I...
I have a string = "name";
I want to convert into a string array.
How do I do it?
Is there any java built in function? Manually I can do it but I'm searching for a java built in function.
I want an array where each character of the string will be a s...
I have a large CSV with the results of a medical survey from different locations (the location is a factor present in the data). As some analyses are specific to a location and for convenience, I'd like to extract subframes with the rows only from th...
Given a time_t:
? date -ur 1312603983
Sat 6 Aug 2011 04:13:03 UTC
I'm looking for a bash one-liner that lists all files newer. The comparison should take the timezone into account.
Something like
find . --newer 1312603983
But with a time_t in...
I am a computer science student learning Java, so I do some work at home and at college on a mixture of Linux and Windows. I have a problem after copying a new project into the Eclipse workspace. The project shows up, but with a red exclamation mark ...
If I do this...
conn = new URL(urlString).openConnection();
System.out.println("Proxy? " + conn.usingProxy());
it prints
Proxy? false
The problem is, I am behind a proxy. Where does the JVM get its proxy information from on Windows? How do I se...
I have a Java project in Eclipse perfectly running smoothly until this afternoon, when I updated some files (including a ant build.xml file). When I build the project, the following error appears:
java.lang.NoClassDefFoundError: proj/absa/FrontEnd/A...
I am writing some JavaScript code that uses a string rendered with PHP. How can I escape single quotes (and only single quotes) in my PHP string?
<script type="text/javascript">
$('#myElement').html('say hello to <?php echo $mystringWit...
Is there any way to determine (programatically, of course) if a given pointer is "valid"? Checking for NULL is easy, but what about things like 0x00001234? When trying to dereference this kind of pointer an exception/crash occurs.
A cross-platform m...
I need a batch file which will do the following:
1. Open CMD and navigate to a location C:/Users/...../program.exe
2. Run the program.exe with an additional command to point it to a config file:
e.g. "program.exe C:/Users/..../configFile.bgi"
How ...
I use the following function to post a form to via jQuery AJAX:
$('form#add_systemgoal .error').remove();
var formdata = $('form#add_systemgoal').serialize();
$.ajaxSetup({async: false});
$.ajax({
type: "POST",
url: '/admin...
How do I find the type of an object in Go? In Python, I just use typeof to fetch the type of object. Similarly in Go, is there a way to implement the same ?
Here is the container from which I am iterating:
for e := dlist.Front(); e != nil; e = e.Ne...
I have a stupid java logging problem: I'm loading the logging configuration from my app configuration file - but it just doesn't log anything after reading the file (which looks pretty much like the examples you will find on the net except for the ad...
I am looking to SSH out via PHP. What is the best/most secure way to go about this? I know I can do:
shell_exec("SSH [email protected] mkdir /testing");
Anything better? That feels so 'naughty' :)....
I need a regular expression for a password. The password has to contain at least 8 characters. At least one character must be a number or a special character (not a letter).
[StringLength(100, ErrorMessage = "The {0} must be at least {2} characters ...
I'd like to know which libraries are used by executables on my system. More specifically, I'd like to rank which libraries are used the most, along with the binaries that use them. How can I do this?...
I am trying to develop for android and I want to add the adb to my PATH so that I can launch it really easily. I have added directories before by for some reason adb does not want to be found. This is very frustrating. Has anyone else had this proble...
I'm new to reactjs, I want to fetch data in server, so that it will send page with data to client.
It is OK when the function getDefaultProps return dummy data like this {data: {books: [{..}, {..}]}}.
However not work with code below. The code exec...
Trying out node.js for the first time. Set up node, set up the example app from the nodejs.org site. Can start the server fine, but console.log() isn't actually logging anything. Tried the Javascript console in Chrome, Firefox, and Safari - nothing a...
When I am running a query in web application, I'm getting a null value. Same query directly in SQL Management Studio returns results.
I think that the problem is a timeout. How can I increase the time for execution of query in web application? In m...
How can I create a larger space between each link on my navbar, so they are further apart?
Is it something I change the CSS or HTML?
Here's how I've implemented my navbar in the html:
<div class="navbar-wrapper">
<div class="container">
...
I recently upgraded iOS in my iPhone device to 12.2 (to provide support of latest versions for my app "Match4app"), and this does not appear to be compatible with Xcode 10.1. Should I update Xcode to 10.2 ?
In my Mac with High Sierra, when I click "...
So I'm using an app that stores images heavily in the DB. What's your outlook on this? I'm more of a type to store the location in the filesystem, than store it directly in the DB.
What do you think are the pros/cons? ...
In a nutshell the exception is thrown during POSTing wrapper model and changing the state of one entry to 'Modified'. Before changing the state, the state is set to 'Detached' but calling Attach() does throw the same error. I'm using EF6.
Please fin...
How do you extract form data (form[method="post"]) and file uploads sent from the HTTP POST method in Node.js?
I've read the documentation, googled and found nothing.
function (request, response) {
//request.post????
}
Is there a library or a...
I have a MySQL statement that inserts some variables into the database. I recently added 2 fields which are optional ($intLat, $intLng). Right now, if these values are not entered I pass along an empty string as a value. How do I pass an explicit N...
I am working out some tutorials in R. Each R code is contained in a specific folder. There are data files and other files in there. I want to open the .r file and source it such that I do not have to change the working directory in Rstudio as shown b...
I have a table which I want to get the latest entry for each group. Here's the table:
DocumentStatusLogs Table
|ID| DocumentID | Status | DateCreated |
| 2| 1 | S1 | 7/29/2011 |
| 3| 1 | S2 | 7/30/2011 |
| 6| 1 ...
I've just downloaded and installed XAMPP 5.6.11 and started all the tools from the control panel. I've seen that one of it's new features is that it has a Welcome/Dashboard page.
Previously, going to 127.0.0.1 would take me to a language selection p...
Given a Django model, I'm trying to list all of its fields. I've seen some examples of doing this using the _meta model attribute, but doesn't the underscore in front of meta indicate that the _meta attribute is a private attribute and shouldn't be ...
When I create and compile a "Hello, World!" application in C#, I get three files in the Debug folder apart from the main exe (e.g. HelloWorld.exe)
HelloWorld.vshost.exe
HelloWorld.pdb
HelloWorld.vshost.exe.manifest
What purpose do these files ser...
I have made a small demo site and on it I am storing images within a image column on the sql server. A few questions I have are...
Is this a bad idea?
Will it affect performance on my site when it grows?
The alternative would be to store the ima...
If I want to merge into a Git branch the changes made only to some of the files changed in a particular commit which includes changes to multiple files, how can this be achieved?
Suppose the Git commit called stuff has changes to files A, B, C, and ...
I'm in the process of updating an old inline-block-based grid model I have to a newer Flexbox one I created. Everything has worked fine, apart from one little snag, which has become a bit of a dealbreaker:
I have a bunch of CSS-controlled sliders; s...
Using jQuery, how do I toggle classA to classB on click going from:
<a class="switch" href="#">Switch</a>
<div class="classA"></div>
$('.switch').on('click', function(e){
$('.classA').removeClass('classA').addClass('cla...
We are new to git, and I want to set a tag at the beginning of our repository.
Our production code is the same as the beginning repository, but we've made commits since then.
A tag at the beginning would allow us to "roll back" production to a known...
I'm using TortoiseSVN against the SourceForge SVN repository. I'd like to move a file from one folder to another in order to maintain its revision history. Is this possible? If so, how do you do it?
(My current strategy has been to copy the file int...
I wrote a simple batch file as a PowerShell script, and I am getting errors when they run.
It's in a scripts directory in my path. This is the error I get:
Cannot be loaded because the execution of scripts is disabled on this system.
Please ...
I have two projects, ProjectA and ProjectB. ProjectB is a console application, which depends on ProjectA. Yesterday, everything was working fine, but suddenly today when I run ProjectB I get this:
BadImageFormatException was unhandled:
Could ...
This is a slightly different question from previous answers I have seen or I am not getting it. I have a parent class with a method named MyMethod() and a variable public Int32 CurrentRow;
public void MyMethod()
{
this.UpdateProgressBar(); ...
I want to send a few variables and a string with the POST method from JavaScript.
I get the string from the database, and then send it to a PHP page. I am using an XMLHttpRequest object.
The problem is that the string contains the character & ...
I have an app that is crashing with no error tracing. I can see part of what is going on if I debug, but can't figure out which object is "zombie-ing".
Does anybody know how to enable NSZombie in Xcode 4?...
Testing out someone elses code, I noticed a few JSP pages printing funky non-ASCII characters. Taking a dip into the source I found this tidbit:
// remove any periods from first name e.g. Mr. John --> Mr John
firstName = firstName.trim().replace(...
I have cloned a git repository and then checked out a tag:
# git checkout 2.4.33 -b my_branch
This is OK, but when I try to run git pull in my branch, git spits out this error:
There is no tracking information for the current branch. Please
...
I'm trying to use ng-animate to get a behavior similar to JQuery's slideUp() and slideDown(). Only I'd rather use ng-show
I'm looking at the ng-animate tutorial here - http://www.yearofmoo.com/2013/04/animation-in-angularjs.html,
and I can reproduc...
I'm incredibly new to programming, and I've been learning well enough so far, I think, but I still can't get a grasp around the idea of making a delay the way I want. What I'm working on is a sort of test "game" thingy using a Windows forms applicati...
Assume I have this:
[
{"name": "Tom", "age": 10},
{"name": "Mark", "age": 5},
{"name": "Pam", "age": 7}
]
and by searching "Pam" as name, I want to retrieve the related dictionary: {name: "Pam", age: 7}
How to achieve this ?...
When I try npm install new packages it shows me this error:
rollbackFailedOptional: verb npm-session 585aaecfe5f9a82
node --version
8.4.0
npm --version
5.3.0
...
I'm starting with the new Google service for the notifications, Firebase Cloud Messaging.
Thanks to this code https://github.com/firebase/quickstart-android/tree/master/messaging I was able to send notifications from my Firebase User Console to my ...
What should I do after developing a Vue app with vue-cli?
In Angular there was some command that bundle all the scripts into one single script.
Is there something the same in Vue?...
I'm using Mockito's @Mock and @InjectMocks annotations to inject dependencies into private fields which are annotated with Spring's @Autowired:
@RunWith(MockitoJUnitRunner.class)
public class DemoTest {
@Mock
private SomeService service;
...
What is the easiest and best way to trigger change event when setting the value of select element.
I've expected that executing the following code
$('select#some').val(10);
or
$('select#some').attr('value', 10);
would result in triggering the...
I am pretty new to python's urllib. What I need to do is set a custom header for the request being sent to the server. Specifically, I need to set the Content-type and Authorizations headers. I have looked into the python documentation, but I have...
Let's say I have an Array of numbers: [2,3,3,4,2,2,5,6,7,2]
What is the best way to find the minimum or maximum value in that Array?
Right now, to get the maximum, I am looping through the Array, and resetting a variable to the value if it is great...
Why is the jQuery script working in my jsfiddle but not in my page?
What I've done: Tried different versions of JQuery...made the script
So I have this test page:
Head Part
<!-- Scripts -->
<script src="//ajax.googleapis.com/...
I am learning Android. I have a problem and I can't solve it. I want to retrieve data from an existing database and display it in a TextView after click button.
My code DataBaseHelper looks like this:
public class DataBaseHelper extends SQLiteOpen...
The issue I believe is how CurrentDay is entered. It was previously created as:
Transaction <- function(PnL, Day)
results <- list(a = PnL, b = Day)
return(results)
Both PnL and Day are numeric values.
Day <- Transaction(PnL, Day)["b"...
The following code is inspired from PrimeFaces DataGrid + DataTable Tutorials and put into a <p:tab> of a <p:tabView> residing in a <p:layoutUnit> of a <p:layout>. Here is the inner part of the code (starting from p:tab compon...
I have a file named 5_1.txt in a directory named direct, how can I read that file using read?
I verified the path using :
import os
os.getcwd()
os.path.exists(direct)
the result was
True
x_file=open(direct,'r')
and I got this error :
...
In my GNUmakefile, I would like to have a rule that uses a temporary directory. For example:
out.tar: TMP := $(shell mktemp -d)
echo hi $(TMP)/hi.txt
tar -C $(TMP) cf $@ .
rm -rf $(TMP)
As written, the above rule creates t...
I have a very long activity with a scrollview. It is a form with various fields that the user must fill in. I have a checkbox half way down my form, and when the user checks it I want to scroll to a specific part of the view. Is there any way to scro...
I'm not familiar with this function to send mail in java. I'm getting an error while sending email to reset a password. Hope you can give me a solution.
Below is my code:
public synchronized static boolean sendMailAdvance(String emailTo, String sub...
Say, we have the following 2-dimensional array:
int camels[][] = new int[n][2];
How should Java Comparator class be declared to sort the arrays by their first elements in decreasing order using Arrays.sort(camels, comparator)? The compare function...
I want to replace "," with a ; in my string.
For example:
Change
"Text","Text","Text",
to this:
"Text;Text;Text",
I've been trying the line.replace( ... , ... ), but can't get anything working pro...
I have a problem to plot a subset of a data frame with ggplot2. My df is like:
df = data.frame(ID = c('P1', 'P1', 'P2', 'P2', 'P3', 'P3'),
Value1 = c(100, 120, 300, 400, 130, 140),
Value2 = c(12, 13, 11, 16, 15, 12))
...
I'm googling it and can't seem to find the syntax. My arraylist might be populated differently based on a user setting, so I've initialized it
ArrayList<Integer> arList = new ArrayList<Integer>();
And now I'd like to add hundred of int...
I have tried to use marquee and its not working
here is my code, please let me know where im going wrong
<TextView
android:text="lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 5000.00 | lunch 20.00 | Dinner 60.00 | Travel 60.00 | Doctor 50...
I am using Android Navigation bar in my project,
I want to change the top color in action bar to something red, How can i do that?
I have something like this,
and i want something like this,
how can i achieve that?...
Here is the error message -
log4j:WARN No appenders could be found for logger (SerialPortUtil).
log4j:WARN Please initialize the log4j system properly.
log4j:WARN See http://logging.apache.org/log4j/1.2/faq.html#noconfig for more info.
Here is the...
I'm having much trouble trying to understand just how the multiprocessing queue works on python and how to implement it. Lets say I have two python modules that access data from a shared file, let's call these two modules a writer and a reader. My pl...
I have subdomain.example.com that I use for development purposes. My web application solution contains a web API etc, that I need to call from external systems, hence I am not using localhost.
I now need to test for SSL and need a certificate for my...
In the traditional way to add event listener:
function getComboA(sel) {
var value = sel.options[sel.selectedIndex].value;
}
<select id="comboA" onchange="getComboA(this)">
<option value="">Select combo</option>
<option va...
I'm debugging an issue with the soft keyboard display not displaying when it should. However, I don't have a device handy for testing. The problem is that the emulator never shows the soft keyboard.
Some skins have a keyboard constantly displayed ...
I installed Android Studio yesterday, and I tried to use the LogCat to see the logs. But there is nothing to show in the logcat. I used the terminal to run ./adb logcat and it works.
Is there someone who can explain to me how to use logcat in Andr...
Is there a way to convert string to date using custom format using mongodb shell
I am trying to convert "21/May/2012:16:35:33 -0400" to date,
Is there a way to pass DateFormatter or something to
Date.parse(...) or ISODate(....) method?...
I'm trying to set an initial value in my jquery ui datepicker. I've tried several different ways, but nothing seems to display the date, it's empty.
var idag = new Date();
$("#txtFrom").datepicker("setDate", idag - 2);
$("#txtTom").datepicker("setDa...
I have 2 buttons side by side, and I would like to have some inbetween them.
Following code will have 2 buttons right next to each other. I have tried margin for the div, and just couldn't get some nice space between the two.
<div style="text-a...
I am still pretty new to C# and am having a difficult time getting used to it compared to C/CPP.
How do you exit a function on C# without exiting the program like this function would?
if (textBox1.Text == "" || textBox1.Text == String.Empty || tex...
How do you remove the "Showing 1 of N entries" line of text on a dataTable (that is when using the javascript library dataTables? I think I was looking for something along these lines...
$('#example').dataTable({
"showNEntries" : false
...
I have this function in SQL Server to replace single quotes.
But when I insert a single quote it throws an error on Replace(@strip,''','')):
Create Function [dbo].[fn_stripsingleQuote]
(@strStrip varchar(Max))
returns varchar
as
begin
d...
In my Githubs repos documentation I want to represent a directory tree structure like this:
Is there a way to do that with Github flavoured markdown, besides just creating it with ascii art?
So basically like this question, but I'm wondering if t...
I recently started using libCurl for my VC++ project. I've been wondering: what is the incentive for the curl creators to release the entire library for free?
Is it purely to help their fellow developers? This is one of the best open source librarie...
I created this plot using Matlab
Using matplotlib, the x-axies draws large numbers such as 100000, 200000, 300000. I would like to have something like 1, 2, 3 and a 10^5 to indicate that it's actually 100000, 200000, 300000.
Is there a simple wa...
I am trying to use an IF statement in a MySQL select query.
I am getting an error after the AND statement where the first IF.
SELECT J.JOB_ID,E.COMPANY_NAME,J.JOB_DESC,JT.JOBTYPE_NAME,J.COMPENSATION,ST.STATE_NAME,MC.METRO_CITY_NAME,I.INDUSTRY_NAM...
I stumbled into a delicate SQL problem when I needed to use a value from a field inside a LIKE %..% statement.
Example:
SELECT t1.Notes, t2.Name
FROM Table1 t1, Table2 t2
WHERE t1.Notes LIKE '%t2.Name%'
This is only an example from the top of my ...
I have a line of php code that looks like this:
echo "<script>$('#edit_errors').html('<h3><em>Please Correct Errors Before Proceeding</em></h3>')</script>";
I would like to know how to add a font color to the te...
I want to execute a function every time the value of a specific input box changes. It almost works with $('input').keyup(function), but nothing happens when pasting text into the box, for example. $input.change(function) only triggers when the input ...
Take this regular expression: /^[^abc]/. This will match any single character at the beginning of a string, except a, b, or c.
If you add a * after it – /^[^abc]*/ – the regular expression will continue to add each subsequent character to the re...
I'm sure there is a simple error I'm making, but I am simply alerting $(window).height() and it returns the same value as $(document).height().
I am on a 13" MBA and my window height of my browsers when maximised between 780px - 820px (roughly) but ...
If I try to compile a program with
#include <pthread.h>
in it, I get the error:
pthread.h: No such file or directory
Is it possible to get this to compile in a Windows environment?
I am using Vista with the latest MinGW.
I do not want t...
Does the .NET Framework have any methods for converting a path (e.g. "C:\whatever.txt") into a file URI (e.g. "file:///C:/whatever.txt")?
The System.Uri class has the reverse (from a file URI to absolute path), but nothing as far as I can find for c...
In JS if you would like to split user entry into an array what is the best way of going about it?
For example:
entry = prompt("Enter your name")
for (i=0; i<entry.length; i++)
{
entryArray[i] = entry.charAt([i]);
}
// entryArray=['j', 'e', 'a...
I am asking a quite simple question, but I am bit confused in this.
Suppose I have a class Parent:
public class Parent {
int name;
}
And have another class Child:
public class Child extends Parent{
int salary;
}
And finally my Main.java c...
I'm trying to figure out the proper Razor syntax to get a JavaScript file for a particular *.cshtml to be in the head tag along with all the other include files that are defined in _Layout.cshtml....
I can clear my development computer's NuGet package cache using Visual Studio menu Tools → Options → NuGet Package Manager → General: Clear Package Cache button.
I would like to do this on the command line. Unfortunately, I can n...
Django has various numeric fields available for use in models, e.g. DecimalField and PositiveIntegerField. Although the former can be restricted to the number of decimal places stored and the overall number of characters stored, is there any way to r...
I reset my local master to a commit by this command:
git reset --hard e3f1e37
when I enter $ git status command, terminal says:
# On branch master
# Your branch is behind 'origin/master' by 7 commits, and can be fast-forwarded.
# (use "git pul...
I need to store a multi-dimensional associative array of data in a flat file for caching purposes. I might occasionally come across the need to convert it to JSON for use in my web app but the vast majority of the time I will be using the array direc...
In Python, is there an analogue of the C preprocessor statement such as?:
#define MY_CONSTANT 50
Also, I have a large list of constants I'd like to import to several classes. Is there an analogue of declaring the constants as a long sequence of sta...
I'm writing a php program that pulls from a database source. Some of the varchars have quotes that are displaying as black diamonds with a question mark in them (?, REPLACEMENT CHARACTER, I assume from Microsoft Word text).
How can I use php to stri...
Is there a method in numpy for calculating the Mean Squared Error between two matrices?
I've tried searching but found none. Is it under a different name?
If there isn't, how do you overcome this? Do you write it yourself or use a different lib?...
My questions are:
What is exactly the function of the LayoutInflater?
Why do all the articles that I've read check if convertview is null or not first? What does it mean when it is null and what does it mean when it isn't?
What is the parent parame...
I have a list of numbers as below:
0, 16, 32, 48 ...
I need to output those numbers in hexadecimal as:
0000,0010,0020,0030,0040 ...
I have tried solution such as:
printf("%.4x",a); // where a is an integer
but the result that I got is:...
Is there a way to detect if the "display" css property of an element is changed (to whether none or block or inline-block...)? if not, any plugin? Thanks...
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.
Is it possible to make this work without specific ...
I have C code like this:
#include<stdio.h>
int main()
{
printf("Hey this is my first hello world \r");
return 0;
}
I have used the \r escape sequence as an experiment. When I run the code I get the output as:
o world
Why is that, ...
I was working on my Spring boot app project and noticed that, sometimes there is a connection time out error to my Database on another server(SQL Server).
This happens specially when I try to do some script migration with FlyWay but it works after s...
I want to be able to scroll through the whole page, but without the scrollbar being shown.
In Google Chrome it's:
::-webkit-scrollbar {
display: none;
}
But Mozilla Firefox and Internet Explorer don't seem to work like that.
I also tried thi...
The colors in this table is all not transparent. I guess the value for the A is set to FF.
What is the code for transparency?
For example this color FFF0F8FF (AliceBlue), to a transparent code such as ??F0F8FF ?...
So I have a Laravel controller:
class YeahMyController extends BaseController {
public function getSomething() {
Console::info('mymessage'); // <-- what do I put here?
return 'yeahoutputthistotheresponse';
}
}
Currently,...
What is the best way to move around on a given very long command line in the terminal?
Say I used the arrow key or Ctrl-R to get this long command line:
./cmd --option1 --option2 --option3 --option4 --option5 --option6 --option7 --option8 --option9...
I have the following tables (Primary key in bold. Foreign key in Italic)
Customer table
ID---Name---Balance---Account_Name---Account_Type
Account Category table
Account_Type----Balance
Customer Detail table
Account_Name---First_Name----Las...
How do I obtain a Certificate Signing Request? All I'm trying to do is get my app running on my ipod touch. This was easy as I could just go to the IOS development portal and just download one, no muss no fuss. But now they want me to create a CSR to...
What is the quickest way to HTTP GET in Python if I know the content will be a string? I am searching the documentation for a quick one-liner like:
contents = url.get("http://example.com/foo/bar")
But all I can find using Google are httplib and ur...
I am trying to fire click event (or any other event) on element programatically , In other word I want to know the similar features as offered by jQuery .trigger() method in angular2.
Is there any built in method to do this? ..... if not please su...
I have an Excel worksheet with two columns (name/ID) and then another list that is a subset of the names only from the larger aforementioned list. I want to go through the subset list and then pull the data from the larger list (name/ID) and put it s...
Is there a standard way to call dialog box with choose either to pick an image from the camera or to get from gallery (like in build-in phone book or Skype)?
I've taken a look at this but the code opens gallery without suggesting to pick it from cam...
I'm wondering how I would go about creating a layout with responsive squares. Each square would have vertically and horizontally aligned content. The specific example is displayed below...
...
I have a question about C concurrency programming.
In the pthread library, the prototype of pthread_join is
int pthread_join(pthread_t tid, void **ret);
and the prototype of pthread_exit is:
void pthread_exit(void *ret);
So I am confused that,...
I have looked at the documentation for building with Gradle, but I'm still not sure what the difference between compileSdkVersion and targetSdkVersion is.
All it says is:
The compileSdkVersion property specifies the compilation target.
Well, w...
I've looked around but haven't been able to figure out if I should use both an ETag and an Expires Header or one or the other.
What I'm trying to do is make sure that my flash files (and other images and what not only get updated when there is a cha...
Is there any way to select / show all current locks that have been taken out using the GET_LOCK function?
Note that GET_LOCK locks are different from table locks, like those acquired with LOCK TABLES - readers who want to know how to see those locks...
I'm trying to use this to create a image form upload for my website, the reason I'm using this is because it's more secure than doing everything myself (but if someone could point another working script I would be appreciated)
simon-eQ / ImageUpload...
I know this will work:
function Foo() {};
Foo.prototype.talk = function () {
alert('hello~\n');
};
var a = new Foo;
a.talk(); // 'hello~\n'
But if I want to call
Foo.talk() // this will not work
Foo.prototype.talk() // this works correctly
...
I am using Hibernate 3.5.6 with Oracle 10g. I am seeing the below exception during initialization but the application itself is working fine. What is the cause for this exception? and how it can be corrected?
Exception
Disabling contextual LOB creat...
I am sure the configuration of matplotlib for python is correct since I have used it to plot some figures.
But today it just stop working for some reason. I tested it with really simple code like:
import matplotlib.pyplot as plt
import numpy as np
...
I have a simple code that runs perfectly on every browser except for the Internet Explorer 11. How can I make it work on all browsers?
Codepen
Thanks in advance.
'use strict';
let promise = new Promise((resolve, reject) => {
setTimeout(() =...
I am just trying to add footnotes in my GitHub Gist, but it doesn't work:
Some long sentence. [^footnote]
[^footnote]: Test, [Link](https://google.com).
I am following this guide and I don't think I'm doing anything wrong. Can someone point out m...
How to select Boolean value from sub query with IF EXISTS statement (SQL Server)?
It should be something like :
SELECT
TABEL1.Id,
NewFiled = (IF EXISTS(SELECT Id FROM TABLE2 WHERE TABLE2.ID = TABEL1.ID)
SELECT 'TRUE'
...
In Angular 1 I could select the default option for a drop down box using the following:
<select
data-ng-model="carSelection"
data-ng-options = "x.make for x in cars" data-ng-selected="$first">
</select>
In Angular 2 I have:
...
How can I select the first 4 rows of a data.frame:
Weight Response
1 Control 59 0.0
2 Treatment 90 0.8
3 Treatment 47 0.1
4 Treamment 106 0.1
5 Control 85 0.7
6 Treatment 73 0.6
...
Am having the String of json array as follow
{"Compemployes":[
{
"id":1001,
"name":"jhon"
},
{
"id":1002,
"name":"jhon"
}
]}
i want to convert this this jsonarray to List<Empol...
I'm trying to filter logcat output from a real device (not an emulator) by tag name but I get all the messages which is quite a spam. I just want to read messages from browser which should be something like "browser:" or "webkit:" , but it doesn't wo...
What are the differences between #import and #include in Objective-C and are there times where you should use one over the other? Is one deprecated?
I was reading the following tutorial: http://www.otierney.net/objective-c.html#preamble and its para...
I have a Python program that uses YAML. I attempted to install it on a new server using pip install yaml and it returns the following:
$ sudo pip install yaml
Downloading/unpacking yaml
Could not find any downloads that satisfy the requirement ya...
I have a set of tabs inside of a FragmentActivity that each hold their own fragment. When I tried to start a new activity from within that fragment via an onClickListener, and using the startActivity(myIntent) method, my application force closes.
Af...
I have a table column that contains values such as abc_1_2_3_4.gif or zzz_12_3_3_45.gif etc.
I want to find the index of each underscore _ in the above values. There will only ever be four underscores but given that they can be in any position in th...
My question is super simple, but I'm transitioning from C# to C++, and I was wondering what command holds the console window open in C++?
I know in C#, the most basic way is:
Console.ReadLine();
Or if you want to let the user press any key, its:
...
I spent three hours but I did not find anything; I'm unable to connect to a SSL enabled server. I want to list what i did:
First checked my PHP extensions directory was in order; extension wasn't there, php_openssl.dll
Then I opened my php.ini file...
How to pass an array into a SQL Server stored procedure?
For example, I have a list of employees. I want to use this list as a table and join it with another table. But the list of employees should be passed as parameter from C#....
I plan on buying two domain names for the same site. Depending on which domain is used I plan on providing slightly different data on the page. Is there a way for me to detect the actual domain name that the page is loading from so that I know what...
I have this object :
IEnumerable<string> m_oEnum = null;
and I'd like to initialize it. Tried with
IEnumerable<string> m_oEnum = new IEnumerable<string>() { "1", "2", "3"};
but it say "IEnumerable doesnt contain a method for ...
I'm trying to convert req.params to Number because that is what I defined in my schema for year param.
I have tried
req.params.year = parseInt( req.params.year, 10 );
and
Number( req.params.year);
and
1*req.params.year;
but non of them wo...
I need to execute a button click event upon pressing key enter.
As it is at the moment the event is not firing.
Please Help me with the syntax if possible.
$(document).on("click", "input[name='butAssignProd']", function () {
//all the action
}...
I have installed PostgreSQL 9.6.2 on my Windows 8.1. But the pgadmin4 is not able to contact the local server. I have tried several solutions suggested here in stackoverflow, tried to uninstall and reinstall PostgreSQL 9.6.2 , tried to modify the con...
I am building a mobile web app with jQuery Mobile and I want to check if a checkbox is checked. Here is my code.
<script type=text/javascript>
function validate(){
if (remember.checked == 1){
alert("checked") ;
} else {
a...
I'm using Eclipse Helios on Ubuntu 10.04, and I'm trying to install CDT plugin on it. I download it from here here.
And then I go to Install New Software and select the zip file (I don't extract it, just select the zip file). And its ok, it install...
So I have a httpd server running which has links to a bunch of files. Lets say the user selects three files from a file list to download and they're located at:
mysite.com/file1
mysite.com/file2
mysite.com/file3
When they click the download butt...
I know this question has been asked many times but I can't find similarity with my issue. I'm getting this error only in Chrome, in every other browser everything is ok. I return data with JSON in several places but since my code works in other brows...
How do I create a link of this type:
<a href="#" onclick="document.getElementById('search').value=this.value">
using method link_to in Rails?
I couldn't figure it out from Rails docs....
In trying to obey the python style rules, I've set my editors to a max of 79 cols.
In the PEP, it recommends using python's implied continuation within brackets, parentheses and braces. However, when dealing with strings when I hit the col limit, i...
I would like to make several statements that give standard output without seeing newlines in between statements.
Specifically, suppose I have:
for item in range(1,100):
print item
The result is:
1
2
3
4
.
.
.
How get this to instead look l...
I have JSON Array object as shown below.
$scope.items =
[
{Name: "Soap", Price: "25", Quantity: "10"},
{Name: "Bag", Price: "100", Quantity: "15"},
{Name: "Pen", Price: "15", Quantity: "13"}
];
I want to get the keys and va...
I've been reading the official docs and I'm unable to find anything on environment variables. Apparently there are some community projects that support environment variables but this might be overkill for me. So I was wondering if there's something s...
Is there anyone who knows how to connect a picture with the cell that it is in at microsoft excel?
For example in the first column I put some brands of mobile phones and in the second one some pictures of them. Now when I sort the values of the firs...
Recently I started to get this error:
NSPhotoLibraryUsageDescription key must be present in Info.plist to
use camera roll.
I am using React Native to build my app (I am not familiar with ios native development) and I don't know how to add th...
This simple code that simply tries to replace semicolons (at i-specified postions) by colons does not work:
for i in range(0,len(line)):
if (line[i]==";" and i in rightindexarray):
line[i]=":"
It gives the error
line[i]=":"
TypeErr...
I have one String variable, str with possible values, val1, val2 and val3.
I want to compare (with equal case) str to all of these values using an if statement, for example:
if("val1".equalsIgnoreCase(str)||"val2".equalsIgnoreCase(str)||"val3.equal...
I am working with the dataset LearnBayes. For those that want to see the actual data:
install.packages('LearnBayes')
I am trying to filter out rows based on the value in the columns. For example, if the column value is "water", then I want that r...
I bought an Arduino Uno recently. After getting the necessary cables, I decided to upload an example to the chip.
Instead of seeing that Blink, I received an error like processing.app.SerialException: Serial port 'COM1' not found. Did you select th...
In Java, what is the maximum size a String object may have, referring to the length() method call?
I know that length() return the size of a String as a char [];...
I have this in an ActiveMQ config:
<sslContext>
<sslContext keyStore="file:/home/alex/work/amq/broker.ks"
keyStorePassword="password" trustStore="file:${activemq.base}/conf/broker.ts"
trustStorePassword="password"/>
</ssl...
How to compare times in PHP?
I want to say this:
$ThatTime ="14:08:10";
$todaydate = date('Y-m-d');
$time_now=mktime(date('G'),date('i'),date('s'));
$NowisTime=date('G:i:s',$time_now);
if($NowisTime >= $ThatTime) {
echo "ok";
}
The above c...
Consider the following HTML fragment with two style attributes:
<span style="color:blue" style="font-style:italic">Test</span>
In Opera 12.16 and Chrome 40, it shows up as blue non-italic text, while Internet Explorer 9 shows blue ital...
I'm triggering a HTTP request and I'm getting a valid response from it. The response also has a header X-Token that I wish to read. I'm trying the below code to read the headers, however, I get null as a result
this.currentlyExecuting.request = this...
Example strings
one thousand only
two hundred
twenty
seven
How do I change the first character of a string in capital letter and not change the case of any of the other letters?
After the change it should be:
One thousand only
Two hundred
Twenty...
I need to get data from the serial port of a Linux system and convert it to TCP/IP to send to a server. Is this difficult to do? I have some basic programming experience, but not much experience with Linux. Is there an open source application that do...
I want to create a function in order to programmatically add some elements on a page.
Lets say I want to add a drop-down list with four options:
<select name="drop1" id="Select1">
<option value="volvo">Volvo</option>
<opti...
First of all, what is it exactly? I guess it is a pointer (LPC means long pointer constant), but what does "W" mean? Is it a specific pointer to a string or a pointer to a specific string?
For example I want to close a Window named "TestWindow".
H...
I am trying to add a stylesheet to a master page in an asp.net web form. Basically trying to create an inline nav menu for the top of the page. I'm having issues with it. I've created the stylesheet (the same way I would create if this were an html s...
I'm writing a small API-connected application in C#.
I connect to a API which has a method that takes a long string, the contents of a calendar(ics) file.
I'm doing it like this:
HttpWebRequest request = (HttpWebRequest)HttpWebRequest.Create(URL);...
I've been doing iOS development for a couple of months now and just learned of the promising CocoaPods library for dependency management.
I tried it out on a personal project: added a dependency to Kiwi to my Podfile, ran pod install CocoaPodsTest.x...
In symfony 2 controllers, every time I want to get a value from post I need to run:
$this->getRequest()->get('value1');
$this->getRequest()->get('value2');
Is there any way to consolidate these into one statement that would return an a...
I have tried lots of solutions to convert a char to Ascii. And all of them have got a problem.
One solution was:
char A;
int ValeurASCII = static_cast<int>(A);
But VS mentions that static_cast is an invalid type conversion!!!
PS: my A is a...
I always think simply if(p != NULL){..} will do the job. But after reading this Stack Overflow question, it seems not.
So what's the canonical way to check for NULL pointers after absorbing all discussion in that question which says NULL pointers ca...
I have the following DIV
<div id="products">
</div>
#products
{
height: 102px; width: 84%;
padding:5px; margin-bottom:8px;
border: 1px solid #EFEFEF;
}
Now inside the DIV, I am dynamically generating 4 links. But sometime...
In a iPython notebook, I have a while loop that listens to a Serial port and print the received data in real time.
What I want to achieve to only show the latest received data (i.e only one line showing the most recent data. no scrolling in the cell...
Hi I was trying to add a row to a table using jQuery, but it is not working.
What might be the reason?
And, can I put in some value to the newly added row..?
Here is the code:
<html>
<head>
<script type="text/javascript" src="jq...
I was trying to identify the reason behind constants in Java
I have learned that Java allows us to declare constants by using final keyword.
My question is why didn't Java introduce a Constant (const) feature. Since many people say it has come from ...
I have a SQL query written by someone else and I'm trying to figure out what it does. Can someone please explain what the Partition By and Row_Number keywords does here and give a simple example of it in action, as well as why one would want to use i...
Possible Duplicate:
Making a standard normal distribution in R
Using R, draw a standard normal distribution. Label the mean and 3 standard deviations above and below the (10) mean. Include an informative title and labels on the x and y ...
Has anyone using RecyclerView found a way to set an onClickListener to items in the RecyclerView?
I thought of setting a listener to each of the layouts for each item but that seems a little too much hassle
I'm sure there is a way for the RecyclerVie...
I have few columns in my DataGridView, and there is data in my rows. I saw few solutions in here, but I can not combine them!
Simply a way to right-click on a row, it will select the whole row and show a menu with an option to delete the row and whe...
After entering data into all the textbox, and after clicking the submit button, it won't immediately show in the datagridview, I need to reopen the form in order to see the new inserted row. What code to put in for refresh?
Followed @user3222297 cod...
I have a request URI and a token. If I use:
curl -s "<MY_URI>" -H "Authorization: TOK:<MY_TOKEN>"
etc., I get a 200 and view the corresponding JSON data.
So, I installed requests and when I attempt to access this resource I get a 403 p...
How do I convert datetime to timestamp using C# .NET (ignoring the current timezone)?
I am using the below code:
private long ConvertToTimestamp(DateTime value)
{
long epoch = (value.ToUniversalTime().Ticks - 621355968000000000) / 10000000;
...
This belong to codes prior to select2 version 4
I have a simple code of select2 that get data from ajax
$("#programid").select2({
placeholder: "Select a Program",
allowClear: true,
minimumInputLength: 3,
ajax: {
url: "ajax.php",
dat...
What is the most efficient way to iterate through all DOM elements in Java?
Something like this but for every single DOM elements on current org.w3c.dom.Document?
for(Node childNode = node.getFirstChild(); childNode!=null;){
Node nextChild = ch...
How to select columns in Editors and IDEs to columnar delete, insert or replace some characters ?
Editors:
Atom
Notepad++
Kate
VIM
Sublime
Emacs
Textpad
Emerald Editor
UltraEdit
MCEdit
jEdit
Nedit
IDEs:
NetBeans
Eclipse
Visual Studio
IntelliJ ...
Is there an easy way of taking a olain JavaScript Date (e.g. today) and going back X days?
So, for example, if I want to calculate the date 5 days before today....
I'm running windows 7 and recently installed XAMPP to build a dev environment. I'm not great with the server side of things so I'm having some problems setting up an alias for a project.
So far XAMPP is running and if I go to localhost I get the XAM...
Ok. I have looked EVERYWHERE and my little brain just can't understand a better way to refresh an activity. Any suggestions that I can understand would be great. :)
Here is the java code:
package com.dge.dges;
import android.app.Activity;
import ...
I created SSIS will do task like get data from oracle to sql server.i run ssis package run in my local system.it is working fine but i deployed ssis package in remote system and trying access from sql procedure. I'm getting error like below.
Orac...
I need to change my column type from date to datetime for an app I am making. I don't care about the data as its still being developed.
How can I do this? ...
I'm trying to execute a SELECT statement that includes a column of a static string value. I've done this in Access, but never with raw SQL. Is this possible?
Example:
Name | Status
------+--------
John | Unpaid
Terry | Unpaid
Joe | Unpai...
I am making an android app, and I have a button which leads to a messaging place. On the activity with the button, I check if there is any unread messages, and if so I want to do something to the button to let the user know that there is something un...
In bash, calling foo would display any output from that command on the stdout.
Calling foo > output would redirect any output from that command to the file specified (in this case 'output').
Is there a way to redirect output to a file and have i...
I want to write a Django query equivalent to this SQL query:
SELECT * from user where income >= 5000 or income is NULL.
How to construct the Django queryset filter?
User.objects.filter(income__gte=5000, income=0)
This doesn't work, because i...
How to get the double value that is only two digit after decimal point.
for example
if
i=348842.
double i2=i/60000;
tv.setText(String.valueOf(i2));
this code generating 5.81403333.
But I want only 5.81.
So what shoud I do?...
How to load a nested xml file into database table ?
<?xml version="1.0" ?>
<person>
<row>
<name>Tom</name>
<Address>
<State>California</State>
<City>Los an...