I am having this issue in my Mac system 10.11.6
system3:postgres saurabh-gupta2$ docker build -t postgres .
Sending build context to Docker daemon 38.91kB
Step 1/51 : FROM registry.access.redhat.com..
I have a directory apkmirror-scraper-compose with the following structure:
.
+-- docker-compose.yml
+-- privoxy
¦ +-- config
¦ +-- Dockerfile
+-- scraper
¦ +-- Dockerfile
¦ +-- ne..
Why am I getting a "401 Unauthorized" error in Maven?
Here's the error I'm getting when calling mvn deploy (full logs at the bottom):
[INFO] BUILD FAILURE
[ERROR] Failed to execute goal org.apache.m..
I got the following error message when I tried to create a Maven project in eclipse. Many have posted about proxies in settings.xml file and also flush the .m2 folder forcing it to download a new one...
I have a strange error. I'm experimenting with a .NET 4.5 Web API, Entity Framework and MS SQL Server. I've already created the database and set up the correct primary and foreign keys and relationshi..
I am developing a WCF service, running IIS6 on Window server 2003. I have built a test client to talk to the WCF service and I am getting the error below. I have been looking at this error for days an..
I am totally a newbie with Maven.
I want to create a Maven project with Eclipse Juno EE with archetype "webapp". I installed "Maven Integration for Eclipse WTP (incubation)" and I also have installed ..
I trying to consume a WCF web service using stand alone application. I am able to view this service using Internet Explorer also able to view in Visual studio service references.
This is the error I..
I have created a new maven project in SpringSource Tool Suite. I am getting this error in my new maven project.
Failure to transfer
org.apache.maven.plugins:maven-surefire-plugin:pom:2.7.1 from
..
Entity Model
public partial class Categoies
{
public Categoies()
{
this.Posts = new HashSet<Posts>();
}
public int Id { get; set; }
public string Name { get; set; }
..
I'm on Ubuntu 12.10 with OpenSSL 1.0.1c, python 2.7.3, Requests 1.0.3 and 1.0.4 (tried both), and when attempting to connect to the website in the url variable with the following code.
def SendInitia..
I have a controller action that works fine on Firefox both locally and in production, and IE locally, but not IE in production. Here is my controller action:
public ActionResult MNPurchase()
{
C..
So far I've tried the following commands:
sudo apt-get remove mysql-server mysql-client mysql-common
sudo apt-get purge mysql-server mysql-client mysql-common
sudo apt-get autoremove
But whenever I..
I don't completely understand how I should get a remote user IP address.
Let's say I have a simple request route such as:
app.get(/, function (req, res){
var forwardedIpsStr = req.header('x-forwa..
The service API I am consuming has a given GET method that requires the data be sent in the body of the request.
The data required in the body is a list of id's separated by hypen and could potenti..
I would like to allow only one country access, but exclude proxies within this country.
This is what I have (shortened version for convenience)
<Limit GET POST>
order deny,allow
deny from all
..
My computer is running windows behind a proxy on a windows server (using active directory), and I can't figure out how to get through it with pip (in python3). I have tried using --proxy, but it stil..
Just a short, simple one about the excellent Requests module for Python.
I can't seem to find in the documentation what the variable 'proxies' should contain. When I send it a dict with a standard "I..
I am using springsource tool suite 2.7.2, based on Eclipse 3.7. The Maven plugin comes now out of the box with Eclipse which is great, and this problem occurred even with previous version of Eclipse.
..
I managed to configure and schedule a Quartz job using JobStoreTX persistent store in Spring. I do not use Spring's Quartz jobs, because I need to schedule them dynamically, at run time, and all exam..
I was trying to use Thin app server and had one issue.
When nginx proxies the request to Thin (or Unicorn) using proxy_pass http://my_app_upstream; the application receives the modified URL sent by n..
Jackson is throwing a weird exception that I don't know how to fix. I'm using Spring, Hibernate and Jackson.
I have already considered that lazy-loading is causing the problem, but I have taken measu..
Any ideas why on some links that I try to access using HttpWebRequest I am getting "The remote server returned an error: (304) Not Modified." in the code?
The code I'm using is from Jeff's post here ..
During a Hibernate Session, I am loading some objects and some of them are loaded as proxies due to lazy loading. It's all OK and I don't want to turn lazy loading off.
But later I need to send some ..
I know there are a plethora of $_SERVER variables headers available for IP address retrieval. I was wondering if there is a general consensus as to how to most accurately retrieve a user's real IP add..
I really don't know what's going on with Eclipse 3.5 (3.5.0 or 3.5.1, same issues), but it's been now 2 days that I'm struggling with Eclipse to find a way to make the plugins installation work via th..
I open urls with:
site = urllib2.urlopen('http://google.com')
And what I want to do is connect the same way with a proxy
I got somewhere telling me:
site = urllib2.urlopen('http://google.com', prox..
I want to know what actually happens when you annotate a method with @Transactional?
Of course, I know that Spring will wrap that method in a Transaction.
But, I have the following doubts:
I heard ..
I have a web service that is working fine in one environment but not in another.
The web service gets document meta data from SharePoint, it running on a server where I cant debug but with logging I ..
Most OO languages prefix their interface names with a capital I, why does Java not do this? What was the rationale for not following this convention?
To demonstrate what I mean, if I wanted to have ..
I am getting this exception:
The communication object,
System.ServiceModel.Channels.ServiceChannel,
cannot be used for communication
because it is in the Faulted state.
The WCF service us..
Could somebody give me a brief overview of the differences between HTTP 1.0 and HTTP 1.1? I've spent some time with both of the RFCs, but haven't been able to pull out a lot of difference between the..
Is there a command like cat in linux which can return a specified quantity of characters from a file?
e.g., I have a text file like:
Hello world
this is the second line
this is the third line
And ..
Let's say that I have a class Suit and four subclasses of suit: Heart, Spade, Diamond, Club.
class Suit:
...
class Heart(Suit):
...
class Spade(Suit):
...
class Diamond(Suit):
...
class C..
I have a maven-spring project in Eclipse and I have this annoying error message in one of my spring contexts:
Referenced file contains errors (jar:file:/M2_HOME/repository/org/springframework/spri..
As far as I can see there are 3 ways to use booleans in c
with the bool type, from then using true and false
defining using preprocessor #define FALSE 0 ... #define TRUE !(FALSE)
Just to use consta..
The Python requests module is simple and elegant but one thing bugs me.
It is possible to get a requests.exception.ConnectionError with a message like:
Max retries exceeded with url: ...
This impli..
I'm working with C#, Framework 3.5 (VS 2008).
I'm using the ConfigurationManager to load a config (not the default app.config file) into a Configuration object.
Using the Configuration class, I was ..
According to:
http://developer.android.com/sdk/android-2.0-highlights.html
Android 2.0 should support the HTML5 video element. I haven't been able to get this to work using a Motorola Droid, and hav..
I am having a multiselect dropdown using the Boostrap Multiselect plugin (http://davidstutz.de/bootstrap-multiselect/) as below
<select id="data" name="data" class="data" multiple="multiple">
..
I need to delete some objects from an ArrayList if they meet a condition and I'm wondering which way could be more efficient.
Here's the situation: I have a class that contains an ArrayList containin..
The definition says:
When SET ANSI_NULLS is ON, a SELECT statement that uses WHERE column_name = NULL returns zero rows even if there are null values in column_name. A SELECT statement that uses W..
I was surprised to learn that R doesn't come with a handy function to check if the number is integer.
is.integer(66) # FALSE
The help files warns:
is.integer(x) does not test if x
contains in..
I have a simple text area in a form like this:
<textarea style="width:350px; height:80px;" cols="42" rows="5" name="sitelink">
<?php if($siteLink_val) echo $siteLink_val; ?>
</tex..
I converted a String to BigInteger as follows:
Scanner sc=new Scanner(System.in);
System.out.println("enter the message");
String msg=sc.next();
byte[] bytemsg=msg.getBytes();
BigInteger m=new BigInt..
To filter a dataframe (df) by a single column, if we consider data with male and females we might:
males = df[df[Gender]=='Male']
Question 1 - But what if the data spanned multiple years and i want..
I want to change the image from normal to brighter when it's on hover, My code:
<div class="nkhome">
<a href="Home.html"><img src="Images/btnhome.png" /></a>
&..
Is there any way to determine a string's encoding in C#?
Say, I have a filename string, but I don't know if it is encoded in Unicode UTF-16 or the system-default encoding, how do I find out?..
I have wriiten as following
$name="Kumkum";
$email="[email protected]";
$phone="3456734567";
$country="India";
$course="Database";
$message="hello i want to read db";
$now = new DateTime();
$datesent..
I thought this would be really simple but it's presenting some difficulties. If I have
std::string name = "John";
int age = 21;
How do I combine them to get a single string "John21"?..
I have a problem when try to select data from a table filtering by date.
For example:
SELECT * FROM MYTABLE WHERE MYTABLE.DATEIN = '23/04/49';
The Oracle Error is:
Informe de error:
Error SQ..
I am learning Python and creating a database connection.
While trying to add to the DB, I am thinking of creating tuples out of information and then add them to the DB.
What I am Doing:
I am taking ..
I've been using Git for a while now and have recently downloaded an update only to find this warning message come up when I try to push.
warning: push.default is unset; its implicit value is changing..
I have a table in SQL Server. I would like to delete the top 1000 rows from it. However, I tried this, but I instead of just deleting the top 1000 rows it deleted all the rows in the table.
Here is..
Does anybody know of a simple way of taking a date (e.g. Today) and going back X days, X months and X years?
I have tried that:
var date = new Date();
$("#searchDateFrom").val((date.getMonth() -1 ) ..
I know people have asked similar questions, but I believe the causes of their problems to be different. I did a hard reset because I had messed up my code pretty bad
git reset --hard 41651df8fc9
..
How can I create a folder under a bucket using boto library for Amazon s3?
I followed the manual, and created the keys with permission, metadata etc, but no where in the boto's documentation it des..
I am trying to compile a hello world program in Qt Using Qt Creator.
I am getting 'cl' is not recognized as an internal or external command.
I am using Windows 7 and Both Vs 2008 and 2010 installed ..
How to check if a file exists in the Documents directory in Swift?
I am using [ .writeFilePath ] method to save an image into the Documents directory and I want to load it every time the app is launc..
I am installing SQL Server 2008. I have installed .NET framework 3.5.
Then I got folder SQL Server 2008 and performed following steps-
I clicked configuration Tools.
Then I clicked SQL Server Inst..
I'm wondering what is the best practice for moving a website to another server (along with all settings, etc.)
Manually recreate the site on the new server (not maintainable for obvious reasons)
Cop..
Can @Component, @Repository and @Service annotations be used interchangeably in Spring or do they provide any particular functionality besides acting as a notation device?
In other words, if I have a..
I have a WPF 4 application that contains a TextBlock which has a one-way binding to an integer value (in this case, a temperature in degrees Celsius). The XAML looks like this:
<TextBlock x:Name=..
With React 16.8.6 (it was good on previous version 16.8.3), I get this error when I attempt to prevent an infinite loop on a fetch request
./src/components/BusinessesList.js
Line 51: React Hook useEf..
I'm trying to format the current time using this format yyyyMMddHHmmss.
t := time.Now()
fmt.Println(t.Format("yyyyMMddHHmmss"))
That is outputting:
yyyyMMddHHmmss
Any suggestions?..
SQL Server 2008 is not doing what I expected with DateTime. It doesn't let me set DateTime variables, no matter what date format I use.
When I execute:
DECLARE @Test AS DATETIME
SET @Test = 2011-02-..
I am wondering what is the best way to extract the first item of each sublist in a list of lists and append it to a new list. So if I have:
lst = [[a,b,c], [1,2,3], [x,y,z]]
and I want to pull out ..
prior swift 3 i was adding shadow in my UIView like this :
//toolbar is an UIToolbar (UIView)
toolbar.layer.masksToBounds = false
toolbar.layer.shadowOffset = CGSize(width: -1, height: 1)
toolbar.lay..
Reproducing the problem
I'm running into an issue when trying to pass error messages around using web sockets. I can replicate the issue I am facing using JSON.stringify to cater to a wider audience:..
This must either be really simple or really complex, but I couldn't find anything about it... I am trying to open a new bash instance, then run a few commands inside it, and give the control back to t..
I'm trying to figure out how to do the following grid with Bootstrap.
I'm not sure how I'd create the box (number 1) that spans two rows. The boxes are generated programmatically in the order they a..
I'm not a 3D or HPC guy, but I've been tasked with doing some research into those fields for a possible HPC application. Reading benchmarks, comparisons and specs between nVidia Quadro and Geforce car..
How can one reliably determine if an object has a numpy type?
I realize that this question goes against the philosophy of duck typing, but idea is to make sure a function (which uses scipy and numpy)..
Let's say that I have a class:
class obj
{
int a;
int b;
}
and then I have this code:
obj myobj = new obj(){ a=1, b=2}
obj myobj2 = myobj;
Now the above code makes a reference to the first o..
How do I display a spinning "busy" indicator at a specific point in a web page?
I want to start/stop the indicator when an Ajax request commences/completes.
Is it really just a matter of showing/hid..
Q - I installed git to get the latest version of Angular. When I tried to run
git clone https://github.com/angular/angular-phonecat.git
I got failed to connect to github 443 error
I even tried
g..
It's been a while since I used the Apache httpd web server. I'm firing up a local server for a project and when I try to request localhost/index.html, I get a 500 error and I see this in the error lo..
I've started using vimdiff today, and wanted to do some of the things that I've taken for granted on Windows based diff editors (like expand/collapse a diff section, have full file expansion/only diff..
What is the difference between an object, instance, and reference? They say that they have to create an instance to their application? What does that mean?..
Is it possible to render HTML from another file in a React component?
I have tried the following, but it does not work:
var React = require('react');
/* Template html */
var template = require('./t..
I need to extract everything after the last '=' (http://www.domain.com?query=blablabla - > blablabla) but this query returns the entire strings. Where did I go wrong in here:
SELECT RIGHT(supplier_re..
I have an example of a neural network with two layers. The first layer takes two arguments and has one output. The second should take one argument as result of the first layer and one additional argum..
I want to populate a form with some dynamic questions (fiddle here):
<div ng-app ng-controller="QuestionController">
<ul ng-repeat="question in Questions">
<li>
..
Is there an easier way to break out of nested loops than throwing an exception? (In Perl, you can give labels to each loop and at least continue an outer loop.)
for x in range(10):
for y in ran..
I'd like to format a string for Qt label, I'm programming in C++ on Qt.
In ObjC I would write something like:
NSString *format=[NSString stringWithFormat: ... ];
How to do something like that in ..
I am trying to find the best way to remove an element from an array in the state of a component. Since I should not modify the this.state variable directly, is there a better way (more concise) to re..
I've a few websites like google-docs and map-quest that have custom drop down menus when you right-click. Somehow they override the browser's behavior of drop-down menu, and I'm now sure exactly how t..
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..
In our product we ship some linux binaries that dynamically link to system libraries like "libpam". On some customer systems we get the following error on stderr when the program runs:
./authpam: /l..
I have an Excel worksheet that has the following macro. I'd like to loop it every second but danged if I can find the function to do that. Isn't it possible?
Sub Macro1()
'
' Macro1 Macro
'
Do
..
I'm new to php and I have executed below code.
<?php
class my_class{
var $my_value = array();
function my_class ($value){
$this->my_value[] = $value;
}
function set_va..
I'm trying to figure out what i am doing wrong with action listeners. I'm following multiple tutorials and yet netbeans and eclipse are giving me errors when im trying to use an action listener.
Bel..
When I try downloading a file from my server onto my computer, it actually downloads the file onto the server.
(Note I am already SSH'd into my server before typing this command. I've watched tutoria..
I am trying to implement the following behaviour:
On a form there is a tabcontrol. On that tabcontrol there is a treeview. To prevent scrollbars appearing, I would like the form to change its size ac..
I can't set the title of UIButton using IB as center. My title is multi line.It is giving like this one
But I want like this one
I have given space in this but I don't want to do that. As it is no..
My VPS provider recommends that I leave my SSH port to the custom port number they assign it by default (not 22). The thing is the while I know I can give the port number when create a remote config,..
I have been trying to make a DIV box appear in front of the text/tables that I have on a webpage.
The DIV is made visible via a button press; but when visible it automatically moves the text/table do..
I am trying to understand ZooKeeper, how it works and what it does. Is there any application which is comparable to ZooKeeper?
If you know, then how would you describe ZooKeeper to a layman?
I have..
I'm afraid of varargs. I don't know what to use them for.
Plus, it feels dangerous to let people pass as many arguments as they want.
What's an example of a context that would be a good place to u..
How do I handle exceptions thrown in a controller when jquery ajax calls an action?
For example, I would like a global javascript code that gets executed on any kind of server exception during an aja..
I have two dates:
toDate (user input in MM/dd/yyyy format)
currentDate (obtained by new Date())
I need to compare the currentDate with toDate. I have to display a report only when the toDate is e..
I have a "button" that I wish to use all throughout my site, but depending on where in the site the button is, I want it to display at different sizes.
In my HTML I have tried (but its not working):..
I would like to have a bidirectional JSON to Java serialization
I'm using successfully the Java to JSON to JQuery path... (@ResponseBody)
e.g.
@RequestMapping(value={"/fooBar/{id}"}, method=Request..
I want to add two images to single image view (i.e for landscape one image and for portrait another image)but i don't know how to detect orientation changes using swift languages.
I tried this answer..
I have a custom cell class with a couple of IBOutlets. I have added the class to the storyboard. I have connected all my outlets. my cellForRowAtIndexPath function looks like this:
override func tabl..
I'm using win8 previously I had been running Eclipse Juno on my pc but from now on I wanted to start using STS, I am getting the below error as soon as I create a new project. I deleted my .m2 folder ..
How would one change this input (with the sequence: time, in, out, files):
Time In Out Files
1 2 3 4
2 3 4 5
To this output (with the sequence: time, out, in, files)?
..
Is it possible to do something like this in Java for Android (this is a pseudo code)
IF (some_string.equals("john" OR "mary" OR "peter" OR "etc."){
THEN do something
}
?
At the moment this is d..
I've got a log file directory that has 82000 files and directories in it (about half and half).
I need to delete all the file and directories which are older than 3 days.
In a directory that has 370..
I need to read the Manifest file, which delivered my class, but when I use:
getClass().getClassLoader().getResources(...)
I get the MANIFEST from the first .jar loaded into the Java Runtime.
My app..
I want to get the first letter of a string and I've noticed that $str[0] works great. I am just not sure whether this is 'good practice', as that notation is generally used with arrays. This feature d..
I want a simple TextView to behave the way simple_list_item_1 in a ListView does. Here's the XML:
<TextView xmlns:android="http://schemas.android.com/apk/res/android"
android:layout_height="wr..
I want to pass a password to ssh using a bash script (Yes, I know that there are ssh keys that I could use, but this is not what I intend).
I found some solutions that were using expect but since it ..
I'm doing the following in order to import some txt tables and keep them as list:
# set working directory - the folder where all selection tables are stored
hypo_selections<-list.files() # change ..
I have one html div on my jsp page, on that i have put one anchor tag, please find code below for that,
<div class="expandable-panel-heading">
<h2>
<a id="ancherComplaint..
Today, while working through some basic AngularJS Intro, I ran into a problem.
I opened PowerShell to get going on the project. NPM worked.
I was able to install the Angular using:
npm install -g ..
Is there an equivalent command in GDB to that of WinDbg's "!process 0 7"?
I want to extract all the threads in a dump file along with their backtraces in GDB. "info threads" doesn't output the stack ..
I have installed MySQL server enterprise 5.1 on my local machine and now I want to install phpMyAdmin, but it does not work.
I have unrared phpMyAdmin to my server root directory and browsed to "loca..
I have a question about an intent...
I try to launch the sms app...
Intent intent = new Intent(Intent.ACTION_MAIN);
intent.setType("vnd.android-dir/mms-sms");
int flags = Intent.FLAG_ACTIVITY_NEW_TAS..
I am trying to use Wget to download a page, but I cannot get past the login screen.
How do I send the username/password using post data on the login page and then download the actual page as an authe..
I know there is a ton of these threads but all of them are for very simple cases like 3x3 matrices and things of that sort and the solutions do not even begin to apply to my situation. So I'm trying ..
I have an array of objects.
I want to find by some field, and then to change it:
var item = {...}
var items = [{id:2}, {id:2}, {id:2}];
var foundItem = items.find(x => x.id == item.id);
foundItem..
When I try to use a data attribute in my template, like this:
<ol class="viewer-nav">
<li *ngFor="#section of sections" data-value="{{ section.value }}">
..
I want to checkout a specific revision of a folder in Subversion using the command line.
I don't see an option for specifying the revision number in TortoiseProc.exe,
TortoiseProc.exe /command:check..
Is there a (portable) way to rotate text in a HTML table cell by 90°?
(I have a table with many columns and much text for the headings, so I'd like to write it vertically to save space.)..
I downloaded and installed:
JDK (jdk-9.0.1_osx-x64_bin.dmg) from Oracle here
Android SDK (sdk-tools-darwin-3859397.zip) from Google here.
After configuring the PATH variable, I tried running sdkma..
if I set
<property name="show_sql">true</property>
in my hibernate.cfg.xml configuration file in the console I can see the SQL.
But it's not real SQL... Can I see the SQL code that wil..
How can I, using Javascript, make a function that will trim string passed as argument, to a specified length, also passed as argument. For example:
var string = "this is a string";
var length = 6;
va..
How to install SignTool.exe in Visual Studio 2015 for Windown 10?
I tried to build my project but the program threw an error :
Error An error occurred while signing: SignTool.exe not found.
..
Having this string 30/11/2011. I want to convert it to date object.
Do I need to use :
Date d = new Date(2011,11,30); /* months 1..12? */
or
Date d = new Date(2011,10,30); /* months 0..11..
What is the preferred method for returning null values in JSON? Is there a different preference for primitives?
For example, if my object on the server has an Integer called "myCount" with n..
I have downloaded and installed SQL Server 2014 Express
(from this site: http://www.microsoft.com/en-us/server-cloud/products/sql-server-editions/sql-server-express.aspx#Installation_Options).
The pr..
Just started learning python and I am sure its a stupid question but I am trying something like this:
def setavalue(self):
self.myname = "harry"
def printaname():
print "Name..
I am sending data from view to controller with AJAXand I got this error:
WARNING: Can't verify CSRF token authenticity
I think I have to send this token with data.
Does anyone know how can I do..
I received a git checkout from someone else and am trying to commit the unstaged changes to the local repository. However, a lot (if not every) file appears as modified even though the contents are ex..
I am working with a asp.net core application with angular2 and my routing is working fine.
<a target="target" routerLink="/page1" routerLinkActive="active">Associates</a>
<a routerLin..
How can I call a stored procedure from command line?
I have a procedure:
CREATE DEFINER=`root`@`localhost` PROCEDURE `insertEvent`(IN `dateTimeIN` DATETIME)
NO SQL
BEGIN
SET @eventIDOut = NU..
I'm trying to install mysql inside a docker container,Tried various images from github, it seems they all manage to successfully install the mysql but when I try to run the mysql it gives an error:
..
This is my code:
<a href="http://www.google.com" onClick="window.location.href='http://www.yahoo.com';return false;" target="_blank">test</a>
When you click it, it takes you to Yahoo bu..
I'm following this tutorial to make this ML prediction:
import numpy as np
import matplotlib.pyplot as plt
from matplotlib import style
style.use("ggplot")
from sklearn import svm
x = [1, 5, 1.5, 8..
I was using a NSMutableArray and realized that using a dictionary is a lot simpler for what I am trying to achieve.
I want to save a key as a NSString and a value as an int in the dictionary. How is ..
In HTML5, the search input type appears with a little X on the right that will clear the textbox (at least in Chrome, maybe others). Is there a way to detect when this X is clicked in Javascript or jQ..
Is the following shorthand for $(document).ready?
(function($){
//some code
})(jQuery);
I see this pattern used a lot, but I'm unable to find any reference to it. If it is shorthand for $(documen..
Hey I am building a web page with angular. The problem is that there are somethings already build without angular and I have to include them as well
The problem is this.
I have something like this i..
I'm looking to create a base table of images and then compare any new images against that to determine if the new image is an exact (or close) duplicate of the base.
For example: if you want to reduc..
I need to determine the number of pages in a specified PDF file using C# code (.NET 2.0). The PDF file will be read from the file system, and not from an URL. Does anyone have any idea on how this c..
I have a shell script that I am executing in Cygwin (maybe this is the problem). For this bit of code, I simply want to write the first line, and append a line break:
echo "`date` User `whoami` start..
In my current program one method asks the user to enter the description of a product as a String input. However, when I later attempt to print out this information, only the first word of the String s..
I want to look at the source code for a function to see how it works. I know I can print a function by typing its name at the prompt:
> t
function (x)
UseMethod("t")
<bytecode: 0x2332948>
&..
If I've got an array of strings, can I check to see if a string is in the array without doing a for loop? Specifically, I'm looking for a way to do it within an if statement, so something like this:
..
I have one query that returns multiple rows, and another query in which I want to set criteria to be either one of values from those multiple rows , so basicly I want the subquery to look something li..
Currently I have to test app and set the different fake GPS locations on real IOS 7 devices. On Android I use 'My Fake Location'. Unfortunately, I didn't find the same app for IOS 7.
Any ideas to sol..
I want to split each line of a pipe on spaces, and then print each token on its own line.
I realise that I can get this result using:
(cat someFileInsteadOfAPipe).split(" ")
But I want more flexib..
I am using Jekyll and Vagrant on my mac. I found that Jekyll server will bind to 0.0.0.0:4000 instead of 127.0.0.1:4000. Also gem server will bind to this address by default. I can still visit it via ..
If I had the following code:
for x in range(10):
print x
I would get the output of
1
2
etc..
What I would like to do is instead of printing a newline, I want to replace the previous value a..
I have designed a page where four div tags are there in the page. If I test the page in mobile phone (5 inch) it fits the page perfectly, If I test the same page in tablet the page fits with in 30% of..
I'm trying to get a similar effect to the one described in the pictures. The white area on the left isn't on the original photo, it pushes the pixels away. I've tried using Core Image (which offered a..
How do I supply credential so that I can connect to a network drive in .NET?
I’m trying to retrieve files from a network drive and need to supply user credentials to access the drive...
I want to make a custom keyboard. I don't know how to do it using XML and Java. The following picture is a model of the keyboard I want to make. It only needs numbers.
..
In straight up javascript (i.e., no extensions such as jQuery, etc.), is there a way to determine a child node's index inside of its parent node without iterating over and comparing all children nodes..
I trying to do a left join with where IN clause search. But I couldn't able to bind the array to the query. $query = DB::table('offers'); $query->select('id', 'business_id', 'address_id',..
http://jsfiddle.net/kn5sH/
What do I need to add in order to stick the button to the right side of the div on the same line as the header?
HTML:
<div>
<h1> Ok </h1>
<bu..
Why does the slice a remain the same? Does append() generate a new slice?
package main
import (
"fmt"
)
var a = make([]int, 7, 8)
func Test(slice []int) {
slice = append(slice, 100)
fm..
With unixODBC you can use a simple command line utility called "isql" to test your connection and permissions of some queries. Without having to write extra code or install libs or bloated programs, i..
I have a Java method in which I'm summing a set of numbers. However, I want any negatives numbers to be treated as positives. So (1)+(2)+(1)+(-1) should equal 5.
I'm sure there is very easy way of d..
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?
myda..
I have a notification component, and I have a timeout setting for it. After timeout I call this.setState({isTimeout:true}).
What I want to do is if already timeout, I want just render nothing:
render(..
i have an app with a gallery of images and i want that the user can save it into his own gallery.
I've created an option menu with a single voice "save" to allow that but the problem is...how can i sa..
how I can rewrite this:
for (int i = 0; i < numberOfSpaces; i++) {
System.out.print(" ");
}
using String.format()?
PS
I'm pretty sure that this is possible but the javadoc is a bit confusi..
I'm running a LINQ query on a datatable in c#.
I want to select specific columns rather than the whole row and enter the result into a datatable. How can i do that??
My Code:
public DataTable getCo..
At the risk of stepping into holy war territory, What are the strengths and weaknesses of these popular DI/IoC frameworks, and could one easily be considered the best? ..:
Ninject
Unity
Castle.Wind..
I have a layout hidden from the view. On a button click I want it to slide up from the bottom pushing the entire screen contents upwards, very similar to how whatsapp shows emoticons panel in chat scr..
How do I compile and run a program in Java on my mac?
I'm new.
Also I downloaded a program that was suggested to me on here called text wrangler if that has any bearing on the situation. ..
I have just found that in react this.setState() function in any component is asynchronous or is called after the completion of the function that it was called in.
Now I searched and found this blog (..
I have many "can't encode" and "can't decode" problems with Python when I run my applications from the console. But in the Eclipse PyDev IDE, the default character encoding is set to UTF-8, and I'm fi..
I'm trying to add Google Analytics to an iOS app written in Swift. I've followed the guide that adds the frameworks via CocoaPods and added a bridging header but I'm still getting:
Linker command fai..
I have a page with a section to sketch a drawing in. But the touchmove events, at least the vertical ones, are also scrolling the page (which degrades the sketching experience) when using it on a mob..
I have two numbers, the first, is the original price, the second, is the discounted price.
I need to work out what percentage a user saves if they purchase at the second price.
example
25, 10 = 60%..
In several Tasks, I reference jars in my home folder.
Is there a better way to get Environment Variables than
ENV = System.getenv()
HOME = ENV['HOME']
task copyToServer(dependsOn: 'jar', type: Copy..
Any ideas how to fix this?
UserService.UserServiceClient userServiceClient = new UserServiceClient();
userServiceClient.GetUsersCompleted += new EventHandler<GetUsersCompletedEventArgs..
I've never used commands in terminal like this before but I know its possible. How would I for instance write:
for (int i = 0; i <=1000; i++) {
echo "http://example.com/%i.jpg",i
}
..
Our previous programmer set the wrong collation in a table (Mysql). He set it up with Latin collation, when it should be UTF8, and now I have issues. Every record with Chinese and Japan character turn..
Let's say I have a log of user activity and I want to generate a report of total duration and the number of unique users per day.
import numpy as np
import pandas as pd
df = pd.DataFrame({'date': ['2..
I decided to create simple isEven and isOdd function with a very simple algorithm:
function isEven(n) {
n = Number(n);
return n === 0 || !!(n && !(n%2));
}
function isOdd(n) {
return i..
pip install -r requirements.txt fails with the exception below OSError: [Errno 13] Permission denied: '/usr/local/lib/.... What's wrong and how do I fix this? (I am trying to setup Django)
Installing..
I run scripts against my database like this...
psql -d myDataBase -a -f myInsertFile.sql
The only problem is I want to be able to specify in this command what schema to run the script against. I c..
I'd like to use the new San Francisco font on a site. I've tried:
font: 'San Francisco', Helvetica, Arial, san-serif;
to no avail. I have tried the answers to this question, but @font-face is not t..
I'm looking for any alternatives to the below for creating a JavaScript array containing 1 through to N where N is only known at runtime.
var foo = [];
for (var i = 1; i <= N; i++) {
foo.push(i..
I have a program that uses XML formatted rules to create executable code for run-time. I have to define some actions and logical constructs using my own dialect. I have OR, AND, and NOT constructs and..
I need to create a File object from URL object
My requirement is
I need to create a file object of a web image (say googles logo)
URL url = new URL("http://google.com/pathtoaimage.jpg");
File f = c..
I have a table that has 20 integer columns and 1 text column named 'foo'
If I run query:
SELECT * from table_name where foo is NULL
I get error:
ERROR: column "foo" does not exist
I have check..
How do I check if my C# Windows application is running ?
I know that I can check the process name but the name can be changed if the exe changes.
Is there any way to have a hash key or something to..
In Oracle SQL Developer, if I'm viewing the information on a table, I can view the constraints, which let me see the foreign keys (and thus which tables are referenced by this table), and I can view t..
I need to add a shake feature that will refresh my Android application.
All I find of documentation involves implementing the SensorListener, but Eclipse tells me it's deprecated and suggest SensorEv..
I have some pages with forms in my application.
How can I secure the form in such a way that if someone navigates away or closes the browser tab, they should be prompted to to confirm they really wa..
In the markup shown below, I'm trying to get the content div to stretch all the way to the bottom of the page but it's only stretching if there's content to display. The reason I want to do this is so..
I am just learning XML and how to use XSL files.
In an XSL file I found the following term:
xsl:template match="/"
What does this stand for?
And what could I use instead of the /?
Could I write tab..
By using python, how can I check if a website is up? From what I read, I need to check the "HTTP HEAD" and see status code "200 OK", but how to do so ?
Cheers
Related
How do you s..
I'm having a problem with sourcing an image with angular 4. It keeps telling me that the image is not found.
Folder structure:
app_folder/
app_component/
- my_componenet
- image_folder/
- ..
I've been struggling with this question for quite some months now, but I haven't been in a situation that I needed to explore all possible options before. Right now, I feel like it's time to get to kn..
I'm trying to create get and set method for a property:
private _name: string;
Name() {
get:
{
return this._name;
}
set:
{
this._name = ???;
}
}
What's the ..
I once had the task of determining the following performance parameters from inside a running application:
Total virtual memory available
Virtual memory currently used
Virtual memory currently used ..
I know of some people who use git pull --rebase by default and others who insist never to use it. I believe I understand the difference between merging and rebasing, but I'm trying to put this in the..
I've been experimenting with the new android build system and I've run into a small issue. I've compiled my own aar package of ActionBarSherlock which I've called 'actionbarsherlock.aar'. What I'm t..
I have to two tables namely employees_ce and employees_sn under the database employees.
They both have their respective unique primary key columns.
I have another table called deductions, whose fo..
hi I have taking flatfile source name dynamically I.e. filename like "source 2011-08-11"
I'm creating expression builder for taking most recent file as per filename.
I did like
Created one variable wh..
I have a file comprising two columns, i.e.,
1 a
2 b
3 c
I wish to read this file to a dictionary such that column 1 is the key and column 2 is the value, i.e.,
d = {1:'a', 2:'b', 3:'c'}
The f..
despite many tries I can't get the result that I would like to see - text centered within the JLabel and the JLabel somewhat centered in the BorderLayout. I said "somewhat" because there should be als..