In Docker, apt-get install fails with “Failed to fetch http://archive.ubuntu.com/ … 404 Not Found” e

In Docker, apt-get install fails with “Failed to fetch http://archive.ubuntu.com/ … 404 Not Found” e

My team uses Docker (with ubuntu:14.04 base image) for local development and we often have to rebuild some or all of our images. But we often get failures downloading packages with apt-get install, even immediately after running apt-get -y

Multiple commits cherry-picking

Multiple commits cherry-picking

I have 33 commits in the main branch that are meshed up. Now I need to maintain the record neatly. So now I have created feature branches and I'm trying to classify those 33 commits in different feature branches. So can it be possible to pi

std::cout to print character N times

std::cout to print character N times

How can I print a character N number of times using std::cout without looping?Is there a way to move the text cursor back to nullify the effect of std::cout ? i.e. to move up a line (say we never printed anything after doing the std::cout

Return value from a VBScript function

Return value from a VBScript function

I have two functions, and I am trying to use the result of one function in the second one. It's going to the else part, but it's not printing anything for "cus_number".How do I get the "cus_number" printed?Function getNumber number = "42

how to read file with space separated values

how to read file with space separated values

I try to read the file into pandas.The file has values separated by space, but with different number of spacesI tried:pd.read_csv('file.csv', delimiter=' ')but it doesn't work 1:add delim_whitespace=True argument, it's faster than regex.

How does the compiler benefit from C++'s new final keyword?

How does the compiler benefit from C++'s new final keyword?

C++11 will allow to mark classes and virtual method to be final to prohibit deriving from them or overriding them.class Driver { virtual void print() const;};class KeyboardDriver : public Driver { void print(int) const final;};class Mouse

jQuery if Element has an ID?

jQuery if Element has an ID?

How would I select elements that have any ID? For example:if ($(".parent a").hasId()) { /* then do something here */}I, by no means, am a master at jQuery. 1:Like this:var $aWithId = $('.parent a[id]');Following OP's comment, test it

How to add hours to current date in SQL Server?

How to add hours to current date in SQL Server?

I am trying to add hours to current time like -- NOT A VALID STATEMENT-- SELECT GetDate(DATEADD (Day, 5, GETDATE()))How can I get hours ahead time in SQL Server? 1:DATEADD (datepart , number , date ) declare @num_hours int; set @num_

JSON integers: limit on size

JSON integers: limit on size

Is it specified anywhere how big JSON integers can be? I'm guessing that they're limited to normal (32 bit) ints, but I can't find anywhere that that's written down. I need to encode identifiers that are longs in Java, so I presume I need t

Getting total number of enum items

Getting total number of enum items

Is it possible to get the total number of items defined by an enum at runtime?While it's pretty much the same question as this one, that question relates to C#, and as far as I can tell, the method provided there won't work in Objective-C.

Why are two different numbers equal in JavaScript?

Why are two different numbers equal in JavaScript?

I've been messing around with a JavaScript console, when I suddenly decided to try this:0x100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 == 0xFFFFFFFFFFFFFFF

Android: Display digits in Arabic format

Android: Display digits in Arabic format

How can I show the digits in Arabic format?So, if I have integers: 1,2,3 they become '١', '٢', '٣' 1:set the locale to Arabic, EgyptNumberFormat nf=NumberFormat.getInstance(new Locale("ar","EG"));nf.format(i); 2:int i = 1;NumberFormat

How to asynchronously copy memory from the host to the device using thrust and CUDA streams

How to asynchronously copy memory from the host to the device using thrust and CUDA streams

I would like to copy memory from the host to the device using thrust as inthrust::host_vector h_vec(1 d_vec(1 using CUDA streams analogously to how you would copy memory from the device to the device using streams:cudaStream_t s;cudaStream

Binary search of a C# list using delegate condition

Binary search of a C# list using delegate condition

I have a List that I want to search not for a given item but for an item satisfying a given condition. Given an item in the list I can test which of 4 conditions is true:the desired item must be to the leftthe desired item must be to the ri

How to add a Marker/Pin on an ImageView Android?

How to add a Marker/Pin on an ImageView Android?

I would like to ask on how to implement or add a marker on an imageView.I rendered an SVG using svglib and used a customImageView so that I can zoom and pan around the image.here is my code on how i used my customImageView @Override

Drawing 3D lines in WPF

Drawing 3D lines in WPF

I am working on a CAD application and thinking of using WPF for rendering my entities.But it seems like WPF doesnt support drawing 3D lines. Is there any ways for drawing 3D lines in WPF? I dont like to create a mesh for each line entity I

Implementing Dynamic Routing in Angular2 (Typescript) [duplicate]

Implementing Dynamic Routing in Angular2 (Typescript) [duplicate]

This question already has an answer here: Async load routes data and build route instruction for Angular 2 4 answers RouteConfig class which can be use

How to get date from week number & day number and year?

How to get date from week number & day number and year?

I'm trying to get the date from the week number, day number and year.For eg:week number = 52 day number = 4 (of week 52) year = 2013 In this case, the date should be 26-12-2013.How can I do it using PHP? I've already tried with strtotim

ORA-12170: TNS:Connect timeout occurred

ORA-12170: TNS:Connect timeout occurred

I was trying to connect to the database here in my laptop using Oracle Toad but I kept on having this error: ORA-12170: TNS:Connect timeout occurredWhat are the possible reasons why I kept on having this error? I accessed the same database

Merge/join lists of dictionaries based on a common value in Python

Merge/join lists of dictionaries based on a common value in Python

I have two lists of dictionaries (returned as Django querysets). Each dictionary has an ID value. I'd like to merge the two into a single list of dictionaries, based on the ID value.For example:list_a = [{'user__name': u'Joe', 'user__id': 1

Loading additional cells at the bottom of UICollectionView

Loading additional cells at the bottom of UICollectionView

I am trying to automatically get and load the next page of cells when the user scrolls to the bottom of theUICollectionView. I am able to do so by adding a UIButton in UICollectoinView footer. When user scrolls to the footer and touches the

minimum sum subarray in O(N) by Kadane's algorithm

minimum sum subarray in O(N) by Kadane's algorithm

We all know about the maximum sum subarray and the famous Kadane's algorithm. But can we use the same algorithm to find minimum sum also?My take is: change the sign and find the max sum in that, same as the way we calculate the maximum su

Table Creation DDL from Microsoft Access

Table Creation DDL from Microsoft Access

Is there any easy way to retrieve table creation DDL from Microsoft Access (2007) or do I have to code it myself using VBA to read the table structure? I have about 30 tables that we are porting to Oracle and it would make life easier if we

What's so different about OpenGL 3.x?

What's so different about OpenGL 3.x?

I've been looking for an OpenGL book lately and noticed that the OpenGL programming guide (2010) is deprecated. What's so different about OpenGL 3.x from 2.x? 1:Edit: Major changes, and some better arguments which has eluded many, inclu

Which CSS selector is stronger? [duplicate]

Which CSS selector is stronger? [duplicate]

This question already has an answer here: Points in CSS specificity 7 answers Which selector is stronger?#nav li.currentor div #nav liand seconda.testo