How do I iterate over a range of numbers defined by variables in Bash?

How do I iterate over a range of numbers defined by variables in Bash?

How do I iterate over a range of numbers in Bash when the range is given by a variable?I know I can do this (called "sequence expression" in the Bash documentation): for i in {1..5}; do echo $i; doneWhich gives: 1 2 3 4 5Yet, how c

How to deal with SettingWithCopyWarning in Pandas?

How to deal with SettingWithCopyWarning in Pandas?

BackgroundI just upgraded my Pandas from 0.11 to 0.13.0rc1. Now, the application is popping out many new warnings. One of them like this:E:\FinReporter\FM_EXT.py:449: SettingWithCopyWarning: A value is trying to be set on a copy of a slice

Python dictionary, how to keep keys/values in same order as declared?

Python dictionary, how to keep keys/values in same order as declared?

I have a dictionary that I declared in a particular order and want to keep it in that order all the time. The keys/values can't really be kept in order based on their value, I just want it in the order that I declared it.So if I have the di

How do I create a transparent Activity on Android?

How do I create a transparent Activity on Android?

I want to create a transparent Activity on top of another activity.How can I achieve this? 1:Add the following style in your res/values/styles.xml file (if you don’t have one, create it.) Here’s a complete file:<?xml version="1.0" encodi

Why does comparing strings in Python using either '==' or 'is' sometimes produce

Why does comparing strings in Python using either '==' or 'is' sometimes produce

I've got a Python program where two variables are set to the value 'public'. In a conditional expression I have the comparison var1 is var2 which fails, but if I change it to var1 == var2 it returns True.Now if I open my Python interpreter

How do I properly clean up Excel interop objects?

How do I properly clean up Excel interop objects?

I'm using the Excel interop in C# (ApplicationClass) and have placed the following code in my finally clause:while (System.Runtime.InteropServices.Marshal.ReleaseComObject(excelSheet) != 0) { }excelSheet = null;GC.Collect();GC.WaitForPendin

Using std::unique_ptr for Windows HANDLEs

Using std::unique_ptr for Windows HANDLEs

I am attempting to use std::unique_ptrs to manage Windows HANDLEs in an exception-safe manner.First I tried:struct HandleDeleter{ void operator()( HANDLE handle ) { if( handle ) { FindVolumeClose( handle )

How do you define a PHP include as a string?

How do you define a PHP include as a string?

I tried:$test = include 'test.php';But that just included the file normally 1:You'll want to look at the output buffering functions.//get anything that's in the output buffer, and empty the buffer$oldContent = ob_get_clean();//start buff

Better way to filter a data frame with dplyr using OR?

Better way to filter a data frame with dplyr using OR?

I have a data frame in R with columns subject1 and subject2 (which contain Library of Congress subject headings). I'd like to filter the data frame by testing whether the subjects match an approved list. Say, for example, that I have this d

Xcode 9.1 iOS simulator: Pixel Accurate option disabled and grayed out

Xcode 9.1 iOS simulator: Pixel Accurate option disabled and grayed out

On Xcode 9.1 the Pixel Accurate option is disabled and grayed out under the Window menu.How can you re-enable this option? 1:The original answer is wrong!Russ from the Apple Simulator team says: To take app store screenshots uncheck the

What is meant by the term “dirty object”?

What is meant by the term “dirty object”?

I see the term "dirty" or "dirty objects" a lot in programming. What does this mean? 1:A dirty object is an object that has changed in its content, but this content has not been synchronized back into the database/disk. It's a typical si

Two or more data types in declaration specifiers error [closed]

Two or more data types in declaration specifiers error [closed]

I am pretty new to C.I am getting this error: incompatible implicit declaration of built-in function ‘malloc’Even when I fix the code based on the answers to include , I still get: two or more data types in declaration specifiersWhen tryi

Download images from website

Download images from website

I want to have a local copy of a gallery on a website. The gallery shows the pictures at domain.com/id/1 (id increases in increments of 1) and then the image is stored at pics.domain.com/pics/original/image.format. The exact line that the i

Replacing values in one column with another based on a 3rd column matching a 4th

Replacing values in one column with another based on a 3rd column matching a 4th

I'm working with the following example:Original Modified New_Orig New1 2 1 02 4 1 03 6 4 04 8 5

Add Text to the Image

Add Text to the Image

HIIm currently developing an application where i have to add the text over the image at any position in the image(not subview) and the output should be the single image file with the original image and the text embedded in it,any help will

object (Car) Detection and segmentation

object (Car) Detection and segmentation

I am trying to segment cars from image that consist of only one car and an easy background like but what I get from my implementation is thisandrespectivelybut it works very easily on almost already segmented images like.giving results like

QtQuick 2 Transparent Window Background

QtQuick 2 Transparent Window Background

I've been searching how to make the background of my QtQuick 2.0 application transparent.Most answers I've found use QtDeclarative which is ok for QtQuick 1.0 but not version 2.Finally I found an answer that I will post but I would like to

How to map RuntimeExceptions in Java streams to “recover” from invalid stream elements

How to map RuntimeExceptions in Java streams to “recover” from invalid stream elements

Imagine I'm building a library, that will receive a Stream of Integers, and all the library code needs to do is return a stream of Strings with the string representation of the number.public Stream convertToString(Stream input) { return in

Converting 2d mask to 1d in Gaussian blur

Converting 2d mask to 1d in Gaussian blur

I am trying to implement the Gaussian blur. I have already computed the mask using the 2d function provided on wikipedia. I currently have a 2d matrix. I understand that in order to improve the running time, one can avoid using standard con

Insert text before and after selection in a contenteditable

Insert text before and after selection in a contenteditable

Is there a way to insert text similar to bbcode before and after the selected text in a contenteditable div? I've seen many answers for textarea, but the code does not work with a contenteditable div. IE support is not needed. 1:The appr

Equal Height Rows for Fluid Width Elements

Equal Height Rows for Fluid Width Elements

I've used Chris Coyiers Equal Height Blocks in Rows jQuery script many times before, and it's always worked great. That being said, I've always developed websites built for a specific resolution. This time around I'm developing a responsive

Compiling mexopencv in OS X 10.9 with Xcode 5 and Matlab R2013b

Compiling mexopencv in OS X 10.9 with Xcode 5 and Matlab R2013b

I'm interested in using Kota Yamaguchi's mexopencv library on my system with the following specifications:OS X 10.9 (Mavericks)Xcode 5Matlab 2013bOpenCV installed via macports to /opt/local/include/{opencv,opencv2} and /opt/local/libI git c

Storing dynamic fields in Django forms

Storing dynamic fields in Django forms

Django's form library has a feature of form sets that allow you to process dynamically added forms. For example you would use form sets if your application has a list of bookmarks you could use form sets to process multiple forms that each

Using std::function and std::bind to store callback and handle object deletion.

Using std::function and std::bind to store callback and handle object deletion.

I want to implement a manager that stores callbacks to member functions of polymorphic classes using C++11. The issue is that I am not sure how to handle the case where the object that the member belongs to gets deleted or should be deleted

SQL Server 2005:charindex starting from the end

SQL Server 2005:charindex starting from the end

I have a string 'some.file.name',I want to grab 'some.file'.To do that,I need to find the last occurrence of '.' in a string.My solution is : declare @someStr varchar(20) declare @reversedStr varchar(20) declare @index int set @someStr = '0