When I tried to relate an attribute with another one which has an M to M relation I received this error:
get() returned more than one topic -- it returned 2!
Can you guys tell me what that means..
How does one convert a Django Model object to a dict with all of its fields? All ideally includes foreign keys and fields with editable=False.
Let me elaborate. Let's say I have a Django model like t..
I have models in Django set up as below.
class Pupil(models.Model):
forename = models.CharField(max_length=30)
surname = models.CharField(max_length=30)
dateofbirth = models.DateField()
..
When we add a database field in django we generally write:
models.CharField(max_length=100, null=True, blank=True)
The same is done with ForeignKey, DecimalField etc. What is the basic difference i..
I'm having some trouble trying to understand how to create a dynamic choice field in django. I have a model set up something like:
class rider(models.Model):
user = models.ForeignKey(User)
..
What is the related_name argument useful for on ManyToManyField and ForeignKey fields? For example, given the following code, what is the effect of related_name='maps'?
class Map(db.Model):
membe..
I have a model:
class Zone(models.Model):
name = models.CharField(max_length=128)
users = models.ManyToManyField(User, related_name='zones', null=True, blank=True)
And I need to contruct a ..
I can't find it anywhere, so your help will be nice for me :) Here is that field:
categories = models.ManyToManyField(fragmentCategory)
FragmentCategory:
class fragmentCategory(models.Model):
..
I want to send a specific key (e.g. k) to another program named notepad, and below is the code that I used:
private void SendKey()
{
[DllImport ("User32.dll")]
static extern int SetForeground..
I want a div to be always at the right of its parent div, so I use float:right. It works.
But I also want it to not affect other content when inserted, so I use position:absolute.
Now float:right do..
I can't compile/debug our Android app, because the localization files are not perfect yet.
My IDE's validation tool Lint create errors saying:
newCardsOrderVals is not translated in ar, bg, ca, c..
I want to understand the AJAX call below, in terms of the complete() method;
When I replace complete() with success(), I get an empty responseText just as with the AJAX error() method.
On the other..
My steps:
got SHA1 code from debug.keystore
create app in google apis console
enabled google map api v2
input SHA1;my.package.name
get API key
created AndroidManifest file:
..
I am having difficulty executing a MS SQL Server stored procedure from Java/jsp. I wish to return a table set of data; the last line of the stored procedure is a regular select statement from a table..
Suppose you have an .EXE and you want to check if it has Command-Line Options. How can one know if the .EXE has this ability. In my case I know that Nir Sofers WebBrowserPassView.exe has the ability t..
So I know how to name a textbox, or a like object in PowerPoint with VB, but I was wondering if there was a way to name objects through the Ribbon (PowerPoint 2007). For instance, if I add a text box ..
I'd like to upload a few files to a HTTP server. Basically what I need is some sort of a POST request to the server with a few parameters and the files. I've seen examples of just uploading files, but..
I need to load an animated Gif image from a URL in UIImageview.
When I used the normal code, the image didn't load.
Is there any other way to load animated Gif images?..
Is it possible to detect when someone presses Enter while typing in a JTextField in java? Without having to create a button and set it as the default...
I have a JSON object with the following content:
[
{
"_id":"5078c3a803ff4197dc81fbfb",
"email":"[email protected]",
"image":"some_image_url",
"name":"Name 1"
},
{
"_id":"5078c..
What's the simplest (and hopefully not too slow) way to calculate the median with MySQL? I've used AVG(x) for finding the mean, but I'm having a hard time finding a simple way of calculating the media..
I have the output of a command in tabular form. I'm parsing this output from a result file and storing it in a string. Each element in one row is separated by one or more whitespace characters, thus I..
I'm creating a table in HTML and I'd like to have my top cell be the width of two. Here's a rough drawing:
__________________________________________
| HEADER |
| ..
I'm trying to iterate over the words of a string.
The string can be assumed to be composed of words separated by whitespace.
Note that I'm not interested in C string functions or that kind of charac..
I am getting the error:
Object of class mysqli_result could not be converted to string
This is my code:
$result = mysqli_query($con, "SELECT classtype FROM learn_users WHERE username='abcde'&qu..
I was trying to go to another page using button, but it always fail.
Here is my First Class with its XML:
public class FindPeopleFragment extends Fragment {
public FindPeopleFragment(){}
@..
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 am currently building a sales module for a clients website. So far I have got the sale price to calculate perfectly but where I have come stuck is formatting the output to 2 decimal places.
I am cu..
I am running the following command to get the number of processors/cores in Linux:
cat /proc/cpuinfo | grep processor | wc -l
It works but it does not look elegant. How would you suggest improve it..
I have this code:
>>> for i in xrange(20):
... print 'a',
...
a a a a a a a a a a a a a a a a a a a a
I want to output 'a', without ' ' like this:
aaaaaaaaaaaaaaaaaaaa
Is it possib..
I am trying to create a checkbox dynamically using following HTML/JavaScript. Any ideas why it doesn't work?
<div id="cb"></div>
<script type="text/javascript">
var cbh = docume..
I have the following errors (and more) in all my views (*.cshtml) when opening my project in Visual Studio 2015 Professional.
Error CS0246 The type or namespace name 'System' could not be found ..
Sorry for my english please.
I'm new in open xml sdk.
My program have ability to export some data and DataTable to Excel file (template)
In the template I insert the data to some placeholders. It's wo..
How can I change the bullet points in an HTML list and use the glyphicons that come with Bootstrap 3?
So that:
<ul>
<li>...</li>
<li>...</li>
</ul>
Disp..
I want to parse my XML document. So I have stored my XML document as below
class XMLdocs(db.Expando):
id = db.IntegerProperty()
name=db.StringProperty()
content=db.BlobProperty()
..
Here is the Format for RESTful call:
HEADERS:
Content-Type: application/json;charset=UTF-8
Authorization: Bearer Rc7JE8P7XUgSCPogjhdsVLMfITqQQrjg
REQUEST:
GET https://api.example.com/1/r..
I realized a software application management invoicing after having tested my program I noticed the following error:
my table in sqlserver contains: price numeric (6,2)
the user of my program enter pr..
I'm new to objective-c and I'm starting to put a great deal of effort into request/response as of recent. I have a working example that can call a url (via http GET) and parse the json returned.
The..
What are the differences between the assignment operators = and <- in R?
I know that operators are slightly different, as this example shows
x <- y <- 5
x = y = 5
x = y <- 5
x <- y =..
I would like to store a mapping of string -> string in a Typescript object, and enforce that all of the keys map to strings. For example:
var stuff = {};
stuff["a"] = "foo"; // okay
stuff["b"] = "..
As silly as it may sound, I still haven't found an appropriate answer.
Let's say I want to dynamically create a new DOM element and fill up its textContent/innerText
with a JS string literal.
The str..
I'm creating a new web design in Photoshop at the moment, but I'd like to know if it's possible to blur the content beneath a div?
I'd like to create a half transparent nav bar on my page that's fixe..
I am working with Spring 4.0.7
About Spring MVC, for research purposes, I have the following:
@RequestMapping(value="/getjsonperson",
method=RequestMethod.GET,
pro..
I am working on an iOS project.
In this application, I am downloading images from the server.
Problem:
While downloading images I am getting Request Timeout. According to documentation HTTP ..
I installed Eclipse and Android SDK already. Everything is running fine.
I want to install an .apk file so I follow the instruction already. But the problem is, when I start the emulator, it doesn't ..
I'm apparently terrible at using git, despite my best attempts to understand it.
From kernel.org for git push:
-u
--set-upstream
For every branch that is up to date or successfully pus..
I'm doing some file I/O with multiple files (writing to 19 files, it so happens). After writing to them a few hundred times I get the Java IOException: Too many open files. But I actually have only ..
I want to represent model data as different images using Angular but having some trouble finding the "right" way to do it. The Angular API docs on expressions say that conditional expressions are not..
How can we get the difference between two git repositories?
The scenario:
We have a repo_a and repo_b. The latter was created as a copy of repo_a. There have been parallel development in both the rep..
I have a simple method that at the end of it I want to redirect to another component:
export class AddDisplay{
display: any;
addPairTo(name: string, pairTo: string){
this.display = {};
t..
How can I change the document root of the Apache server? I basically want localhost to come from /users/spencer/projects directory instead of /var/www.
I ended up figuring it out. Some suggested I ch..
This is my script :
<%
if (TempData["Resultat"] != null){
%>
<script type="text/javascript">
alert('<%: TempData["Resultat"]%>');
</script>
<%
}
%>
In this..
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 ra..
I have a timestamp field and I just want to compare the date part of it in my query in Oracle
How do I do that,
SELECT *
FROM Table1
WHERE date(field1) = '2012-01-01'
..
I'm trying to open all appropriate PDFs found in the same directory as my Excel workbook using VBA. I've added the Adobe Acrobat xx.x Type Library reference to the project. But when I try to create ..
I need to serialize some objects to a JSON and send to a WebService. How can I do it using the org.json library? Or I'll have to use another one? Here is the class I need to serialize:
public class P..
What is the difference between screenX/Y, clientX/Y and pageX/Y?
Also for iPad Safari, are the calculations similar as on desktop—OR there is some difference because of viewport?
It would be great..
My understanding is that string is a member of the std namespace, so why does the following occur?
#include <iostream>
int main()
{
using namespace std;
string myString = "Press ENTER..
What is the difference between List<? super T> and List<? extends T> ?
I used to use List<? extends T>, but it does not allow me to add elements to it list.add(e), whereas the List&..
Design an OO parking lot. What classes and functions will it have. It should say, full, empty and also be able to find spot for Valet parking. The lot has 3 different types of parking: regular, handic..
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 discu..
Typing svn log spits out an incredibly long, useless list on a command line. I have no idea why that is the default. If I wanted to read (or even could read) 300 entries on the terminal, I wouldn't mi..
I'm a little confused about the python in operator for sets.
If I have a set s and some instance b, is it true that b in s means "is there some element x in s such that b == x is true"?..
What's the exact difference between Unicode and ASCII?
ASCII has a total of 128 characters (256 in the extended set).
Is there any size specification for Unicode characters?..
I know how to redirect stdout to a file:
exec > foo.log
echo test
this will put the 'test' into the foo.log file.
Now I want to redirect the output into the log file AND keep it on stdout
i.e...
I am using MongoDB 2.2.2 for 32-bit Windows7 machine. I have a complex aggregation query in a .js file. I need to execute this file on the shell and direct the output to a CSV file. I ensure that the ..
Is it possible to send an email from my Java application using a GMail account? I have configured my company mail server with Java app to send email, but that's not going to cut it when I distribute ..
I'm wondering if there is a "best" choice for collation in MySQL for a general website where you aren't 100% sure of what will be entered? I understand that all the encodings should be the same, such ..
I don't have much experience working with C++. Rather I have worked more in C# and so, I wanted to ask my question by relating to what I would have done in there. I have to generate a specific format ..
When do you use which in general? Examples are highly encouraged!
I am referring so MySql, but can't imagine the concept being different on another DBMS..
I moved from my old apache to nginx and php 5.3.10. And when I tried to modify php.ini to suit my needs, I found there are 3 of them:
$ locate php.ini
/etc/php5/cgi/php.ini
/etc/php5/cli/php.ini
/et..
I have a dictionary which represents a book shop. The keys represent the book title and values represent the number of copies of the book present. When books are sold from the shop,the number of copie..
I am getting the error in the below sql:
ORA-01858: a non-numeric character was found where a numeric was expected
SELECT c.contract_num,
CASE
WHEN ( MAX (TO_CHAR (TO_D..
I met the share library not found on the head node of a cluster with torch. I have built the library as well as specify the correct path of the library while compiling my own program "absurdity" by g+..
Today I was browsing through some questions on this site and I found a mention of an enum being used in singleton pattern about purported thread safety benefits to such solution.
I have never used enu..
I'd like to write a T-SQL query where I encode a string as a Base64 string. Surprisingly, I can't find any native T-SQL functions for doing Base64 encoding. Does a native function exist? If not, wh..
I have some code as follows:
int i=0;
char a[7]={0x00,0xdc,0x01,0x04};
int len=0;
len = sizeof(a);
printf("The Length is : %d", len);
Here I want to find the length of the array a in c?
How can thi..
The following code:
Class.forName("com.mysql.jdbc.Driver");
Connection m_connection = DriverManager.getConnection("jdbc:mysql://localhost","root","root");
Throws this exception on getConnection():
..
I have an ad in my header and a fixed ad at the bottom of my page that is always there. I want the fixed ad to appear only if the user has scrolled under the header ad. I looked into the JQuery docume..
I am looking for some VPS/ Virtual machine which should be available all the time and I must be able to access it from any computer having internet.
I know a few paid services but just wondering If I..
I want to send a simple string data such as 'a' from an android device to other one via bluetooth. I looked sample bluetooth code in android sdk but it is so complex for me. I cannot understand how I ..
Does an Integer variable in C occupy 2 bytes or 4 bytes? What are the factors that it depends on?
Most of the textbooks say integer variables occupy 2 bytes.
But when I run a program printing the suc..
I want to do mouseover function over a drop down menu. When we hover over the menu, it will show the new options.
I tried to click the new options using the xpath. But cannot click the menus directly...
I've installed NetBeans 6.9.1 and installed few updates for it.
Then I've created a new project from existing sources. After a few changes I've closed it. And now I am having an error, when trying to..
Is there a good object-relational-mapping library for PHP?
I know of PDO/ADO, but they seem to only provide abstraction of differences between database vendors not an actual mapping between the doma..
I'm designing an algorithm to do the following: Given array A[1... n], for every i < j, find all inversion pairs such that A[i] > A[j]. I'm using merge sort and copying array A to array B and th..
I just want to convert a FileInputStream to an InputStream, how can I do that?
e.g
FileInputStream fis = new FileInputStream("c://filename");
InputStream is = ?;
fis.close();
..
Building a multi-language application in Java. Getting an error when inserting String value from R.string resource XML file:
public static final String TTT = (String) getText(R.string.TTT);
This i..
Apparently I do not need a 'Maps API key' to use the 'Google Geocoding API' according to:
http://code.google.com/apis/maps/documentation/geocoding/index.html
However, I obtain this:
{
"status": "..
I have wrote this query to get some results, if I want to save the results in an array what I have to do?
I want to use the values which are in col1 and col2 in an IF statement, that's why I am think..
Given a URL like the following, how can I parse the value of the query parameters? For example, in this case I want the value of def.
/abc?def='ghi'
I am using Django in my environment; is there a ..
I have a bash function that produces some output:
function scan {
echo "output"
}
How can I assign this output to a variable?
ie. VAR=scan (of course this doesn't work - it makes VAR equal the s..
What are the best practices to consider when catching exceptions and re-throwing them? I want to make sure that the Exception object's InnerException and stack trace are preserved. Is there a differen..
I'm rewriting a project to use Node.js. I'd like to keep using MySQL as the DB (even though I don't mind rewriting the schema).
I'm looking for a simple-to-use, reasonable-performance ORM, which suppo..
I have a dependency for SLF4J. I am getting this error:
SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http:..
I'm trying to create a circle with CSS, which looks exactly like on the following picture:
...with only one div:
<div class="myCircle"></div>
and by using only CSS definitions. No SV..
I created an attribute in HTML data-select-content-val and it is stuffed with information dynamically.
Is there a way to detect when the attribute's value has changed?
$(document).on("change", "div[..
Can you help me refactor this code:
public void keyPressed(KeyEvent e)
{
if (e.getKeyCode()==39)
{
//Right arrow key code
}
else if (e.getKeyCode()==37)
{
..
I want to know how much time a procedure/function/order takes to finish, for testing purposes.
This is what I did but my method is wrong 'cause if the difference of seconds is 0 can't return the elap..
I want to execute gradle build without executing the unit tests. I tried:
$ gradle -Dskip.tests build
That doesn't seem to do anything. Is there some other command I could use?..
I have this common issue, as it appears to be. My table view wont refresh my items after I reset them. I have checked the data and it's the new one.
I tried multiple solution from internet but no su..
Go's range can iterate over maps and slices, but I was wondering if there is a way to iterate over a range of numbers, something like this:
for i := range [1..10] {
fmt.Println(i)
}
Or is there..
I want to control the layout with CSS. How can I regulate the spaces between <input> elements(I hope they are on two lines) using CSS?
_x000D_
_x000D_
<form name="publish" id="publish" actio..
Due to weird domain/subdomain cookie issues that I'm getting, I'd like to know how browsers handle cookies. If they do it in different ways, it would also be nice to know the differences.
In other wo..
I am trying to hide a button (not inside form tags) after it has been clicked. Below is the existing code. All solutions I have tried either break the functionality or interfere with the form on the p..
I have two websites, let's say they're example.com and anotherexample.net.
On anotherexample.net/page.html, I have an IFRAME SRC="http://example.com/someform.asp". That IFRAME displays a form for the ..
I need to pass CSRFToken with Ajax based post request but not sure how this can done in a best way.
Using a platform which internally checking CSRFToken in request (POST request only)
initially I was..
How would you convert a string to ASCII values?
For example, "hi" would return 104105.
I can individually do ord('h') and ord('i'), but it's going to be troublesome when there are a lot of letters...
My problem is fairly simple. I have table sets that store product sets (more products looking like one on the outside - computer, mouse and keyboard for ex.) it's connected M:N using sets_products tab..
So I am working on something that wasn't well thought out in the build from the backend team. That leaves me with a document full of divs.
What I am doing is rolling back from the element I need to ..
I am trying to stop a Amazon EC2 instance and get the warning message
Warning: Please note that any data on the ephemeral storage of your instance will be lost when it is stopped.
My Question
..
I have used sqlite in c++, python and now (perhaps) in C#. In all of these I have no idea how to insert a blob into a table. How do I store and retrieve a blob in sqlite?..
I am working on a site that has a ton of embedded youtube videos, the client wants to show a popup whenever a video stops splaying.
I looked at the youtube api and there seems to be a way to detect w..
I am trying to develop a website using Django framework and launched using DigitalOcean.com and deployed the necessary files into django-project.
I had to include static files into Django-project and..
I have some MATLAB functions defined in .m files and I'd like to import them into MATLAB (as in I'd like to be able to call them as I do a built-in function). How can I do this?..
I'm trying to create an alias that opens google chrome to localhost. Port 80 in this case.
I'd also really like to be able to be in any git directory and have it open that specific project in the br..
I know that in JavaScript the syntax is as follows:
function myfunction(param){
//some code
}
Is there a way to declare a function in jQuery that can be added to an element? For example:
$('#my_..
Is there an easy way to have css3 text-shadow's working in IE9? At least a single text shadow would be great. I guess ideally IE8 is supported as well. I'm hoping there's a simple jquery plugin or ..
I am new to oracle. I need to get the scheduled jobs in my database.
I queried
DBA_SCHEDULER_JOBS,
DBA_SCHEDULER_SCHEDULES, DBA_SCHEDULER_PROGRAMS,
DBA_SCHEDULER_JOB_CLASSES, DBA_JOBS.
But Ora..
I need to create two date objects. If the current date and time is March 9th 2012 11:30 AM then
date object d1 should be 9th March 2012 12:00 AM
date object d2 should contain the current dat..
Suppose I have the following snippet:
$assoc = New-Object PSObject -Property @{
Id = 42
Name = "Slim Shady"
Owner = "Eminem"
}
Write-Host $assoc.Id + " - "..
How do I select data between a date range in MySQL. My datetime column is in 24-hour zulu time format.
select * from hockey_stats
where game_date between '11/3/2012 00:00:00' and '11/5/2012 23:59:0..
I have :
Apache (v2.4) on port 80 of my server for www.domain1.com, with mod_proxy and mod_proxy_wstunnel enabled
node.js + socket.io on port 3001 of the same server.
Accessing www.domain2.com (wi..
Sometimes I will be at a breakpoint in my code and I want to view the contents of a DataTable variable (or a DataTable in a DataSet). The quick watch doesn't give you a very clear view of the contents..
I'm running Ruby on Windows though I don't know if that should make a difference. All I want to do is get the current working directory's absolute path. Is this possible from irb? Apparently from a..
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.Amazo..
When I type uname -a, it gives the following output.
Linux mars 2.6.9-67.0.15.ELsmp #1 SMP Tue Apr 22 13:50:33 EDT 2008 i686 i686 i386 GNU/Linux
How can I know from this that the given OS is 32 or ..
When it comes to developing applications for Android, what is the difference between Min and Target SDK version? Eclipse won't let me create a new project unless Min and Target versions are the same!..
I am trying to iterate through a list of keys from a hash table using enumeration however I keep getting a NoSuchElementException at the last key in list?
Hashtable<String, String> vars = new ..
I have an ASP.net application where Users aren't able to successfully complete certain actions, for reasons, I'm assuming, can only be related to losing their session (which is where I maintain their ..
I have an Oracle tnsnames.ora file from my previous workplace. I want to pick it up with my newly installed PL SQL Developer on another computer. I have copied the file into ..ORACLE/product/11.2.0/cl..
I tried to use cURL but it seems that by default (Debian) is not compiled with HTTPS support and I dont want to build it myself.
wget seems to have SSL support but I found no information on how to ge..
I'm developing user control in C# Visual Studio 2010 - a kind of "quick find" textbox for filtering datagridview. It should work for 3 types of datagridview datasources: DataTable, DataBinding and Dat..
Once the button is clicked I want it to stay with the active style instead of going back to normal style. Can this be done with CSS please? Im using blurb button from DIVI Theme (WordPress). Please h..
I tried to cut the video using the start and end time of the video by using the following command
ffmpeg -ss 00:00:03 -t 00:00:08 -i movie.mp4 -acodec copy -vcodec copy -async 1 cut.mp4
By using t..
I have an input that I want to validate:
<input type="text" id="input" />
And here's the JS:
jQuery("#input").live('change', function() {
if("#input:not(:empty)") {
..
I want to use currentTimeMillis twice so I can calculate a duration but I also want to display Time and Date in user readable format. I'm having trouble as currentTimeMillis is good for the calculatio..
I have android translate Animation. I have an ImageView with random generated position (next1, next2). I am calling void every 3 seconds. It generates new position of the View and then make animation ..
How do you perform a logical OR using make's ifeq operator?
e.g., I have (simplified):
ifeq ($(GCC_MINOR), 4)
CFLAGS += -fno-strict-overflow
endif
ifeq ($(GCC_MINOR), 5)
CFLAGS += -fno-stric..
Is it possible for me to convert a String to an equivalent value in an Enumeration, using Java.
I can of course do this with a large if-else statement, but I would like to avoid this if possible.
Gi..
Is it possible to pass parameters with an HTTP get request? If so, how should I then do it? I have found an HTTP post requst (link). In that example the string postData is sent to a webserver. I would..
I'm running SQL that needs rounding up the value to the nearest whole number.
What I need is 45.01 rounds up to 46. Also 45.49 rounds to 46. And 45.99 rounds up to 46, too. I want everything up one w..
I am using spring data and my DAO looks like
public interface StudentDAO extends JpaRepository<StudentEntity, Integer> {
public findAllOrderByIdAsc(); // I want to use some thing like thi..
I have the a json file whose contents is {"67790": {"1": {"kwh": 319.4}}}. Now I create a dictionary a_dict which I need to append it into the json file. I tried the following but was not able to do i..
Suppose I have this table:
id | name | city
------------------
1 | n1 | c1
2 | n2 | c2
3 | n3 | c3
4 | n4 | c4
I want to check if the value c7 exists under the variable city or not.
..
I'm a C++ guy learning Java. I'm reading Effective Java and something confused me. It says never to write code like this:
String s = new String("silly");
Because it creates unnecessary String objec..
In a comment on this question, I saw a statement that recommended using
result is not None
vs
result != None
I was wondering what the difference is, and why one might be recommended over the oth..
I need a regex that will accept only digits from 0-9 and nothing else. No letters, no characters.
I thought this would work:
^[0-9]
or even
\d+
but these are accepting the characters : ^,$,(,)..
I need to check if a specific login already exists on the SQL Server, and if it doesn't, then I need to add it.
I have found the following code to actually add the login to the database, but I want t..
I'm fairly new to coding in HTML. After hours of searching the internet for a way to do this, I failed and so I'm here. I was setting up a CSRF Proof of concept page here, I want it to redirect to ano..
This iTunes URL will open The Hitchhiker's Guide to the Galaxy in your iTunes:
itmss://itunes.apple.com/us/audiobook/hitchhikers-guide-to-galaxy/id315596797
This Spotify URL will open ALL by the..
I'm trying to dynamically add and remove Fragments from a ViewPager, adding works without any problems, but removing doesn't work as expected.
Everytime I want to remove the current item, the last on..
How can I download a NuGet package? I don't have the NuGet Visual Studio extension or the command line program nuget.exe. How can I download the .nupack file from the web? As I understand I will be ab..
Is there a way in MySQL to print debugging messages to stdout, temptable or logfile? Something like:
print in SQLServer
DBMS_OUTPUT.PUT_LINE in Oracle
..
If I change the background color of my EditText using the below code, it looks like the box is shrunken and it doesn't maintain the ICS theme of a blue bottom border that exists for a default EditText..
Is it this, which people seem to recommend most often:
$ sudo apt-get install python-setuptools
$ sudo easy_install pip
$ sudo pip install virtualenv
Or this, which I got from http://www.pip-instal..
We were using a build script to automate our publishing process and it was working with SVN but now we are using Git and need to do some command line operations to pull from our remote repository.
I ..
I'm trying to make one of my containers 100% of the width of the screen.
Here is my SASS
body, html {
width: 100%;
height: 100%;
padding: 0;
margin: 0;
}
#neo_wrapper {
width..
I have imported maven project in STS, when I run update update project I receive:
"Updating Maven Project". Unsupported IClasspathEntry kind=4
Is there a workaround for this?..
I currently have an old SSH key uploaded on a server. The problem is I lost my ~/.ssh directory (with the original id_rsa and id_rsa.pub files).
Consequently, I want to remove the old SSH key directly..
This question comes up occasionally, but I haven't seen a satisfactory answer.
A typical pattern is (row is a DataRow):
if (row["value"] != DBNull.Value)
{
someObject.Member = row["value"];
..
I need to find the first blank row in a workbook and write information to (row, 1) and (row, 2). I think I'm currently pretty stuck...
Function WriteToMaster(num, path) As Boolean
'Declare variables..
My little brother is just getting into programming, and for his Science Fair project, he's doing a simulation of a flock of birds in the sky. He's gotten most of his code written, and it works nicely,..
I want to initialize a String in Java, but that string needs to include quotes; for example: "ROM". I tried doing:
String value = " "ROM" ";
but that doesn't work. How can I include "s within a str..
I know in javascript Objects double as hashes but i have been unable to find a built in function to get the keys
var h = {a:'b',c:'d'};
I want something like
var k = h.keys() ; // k = ['a','c'];..
I have a series of links which are using an anchor mechanism:
<div class="header">
<p class="menu"><a href="#S1">Section1</a></p>
<p class="menu"><a hre..
I have a small problem with list. So i have a list called l:
l = ['Facebook;Google+;MySpace', 'Apple;Android']
And as you can see I have only 2 strings in my list. I want to separate my list l by '..
I am trying to understand what this error actually means. So far a search of similar help requests for this error range from missing parameters, missing pipes, use of single or multi-lines, and also c..
I am creating a chat using Ajax requests and I'm trying to get messages div to scroll to the bottom without much luck.
I am wrapping everything in this div:
#scroll {
height:400px;
overflow:sc..
I have two repositories, and I need to copy whole of one onto the other empty one which has different access levels from the first one. The copy and the mother repository should not be linked together..
Anyone knows some good SQL builder library for Java like Squiggle (not maintained anymore it seems). Preferably, a project in active development.
Preferably with syntax like Zend_Db_Select, something..
I'm trying to integrate Tomcat with Apache. My aim is to redirect all the requests with
http://localhost/myapp to http://localhost:8080
I followed this guide: http://tomcat.apache.org/tomcat-8.0-doc/..
I am trying to plot information against dates. I have a list of dates in the format "01/02/1991".
I converted them by doing the following:
x = parser.parse(date).strftime('%Y%m%d'))
which gives 19..
I have the following code to test some of most popular ML algorithms of sklearn python library:
import numpy as np
from sklearn import metrics, svm
from sklearn.linear_model ..
I have the code below that hides and shows the navigational bar. It is hidden when the first view loads and then hidden when the "children" get called. Trouble is that I cannot find the event/action..
I have a FrameLayout in which I have 2 controls:
- a custom view which draws a image and some text on it
- a textview with a text
I want to center both in the FrameLayout but I can't manage to do it..
I would like to set up a table in PostgreSQL such that two columns together must be unique. There can be multiple values of either value, so long as there are not two that share both.
For instance:
..
I'm experimenting with using the command pattern to allow my web layer to work with Hibernate entities within the context of a single transaction (thus avoiding lazy loading exceptions). I am, however..
I just ran across the following error (and found the solution online, but it's not present in Stack Overflow):
(.gnu.linkonce.[stuff]): undefined
reference to [method] [object
file]:(.gnu.link..
Long story short, one of my entities has a GeometryCollection that throws an exception when you call "getBoundary" (the why of this is another book, for now let's say this is the way it works).
Is t..
I have the following HTML:
<button name="btnG" class="gbqfb" aria-label="Google Search" id="gbqfb"><span class="gbqfi"></span></button>
My following code for clicking "Googl..
I want to use the HTML agility pack to parse tables from complex web pages, but I am somehow lost in the object model.
I looked at the link example, but did not find any table data this way.
Can I us..
I am currently trying to put a UITableView in a different location rather than at the top of my view controller. With this said, it is trying to add the header in the top to account for the navigation..
I have a branch 'firstproject' with 2 commits. I want to get rid of these commits and make them appear as a single commit.
The command git merge --squash sounds promising, but when I run git merge -..
I have a JSON output like the following:
["City1","City2","City3"]
I want to get each of the city names, how can i do this?
$.getJSON("url_with_json_here",function(json){
});
EDIT:
$.getJSON('..
I have searched on the web for over two days now, and probably have looked through most of the online documented scenarios and workarounds, but nothing worked for me so far.
I am on AWS SDK for PHP V..
I'm trying to use async, await from scratch on Babel 6, but I'm getting regeneratorRuntime is not defined.
.babelrc file
{
"presets": [ "es2015", "stage-0" ]
}
package.json file
"devDependenc..
I want to define table which will have 2 TIMESTAMP fields, someting like this:
CREATE TABLE `msgs` (
`id` INT PRIMARY KEY AUTO_INCREMENT,
`msg` VARCHAR(256),
`ts_create` TIMESTAMP DEFAULT..
Take a look at this code:
$GET = array();
$key = 'one=1';
$rule = explode('=', $key);
/* array_push($GET, $rule[0] => $rule[1]); */
I'm looking for something like this so that:
print_r($GET..
I am using UITextfied while clicking on textfied keyboard appear but when i pressed the return key, keyboard is not disappearing. I used the following code:
func textFieldShouldReturn(textField: UITe..
I have searched a lot of tutorials with POST methods and saw answered questions here too but my POST still doesn't work...I thought i should post it here if you guys see something that i don't!
My js..
I am new to system administration. After installing nginx via puppet on Ubuntu I get the following output:
[alert] could not open error log file: open() "/var/log/nginx/error.log" failed (13: Permiss..
In this particular case, I'd like to add a confirm in Bash for
Are you sure? [Y/n]
for Mercurial's hg push ssh://[email protected]//somepath/morepath, which is actually an alias. Is there ..