What does this segment of code in python mean?

I'm trying to understand what is going on here, specifically how curids is getting set: for idx in xrange(0, int(math.ceil(float(len(mids))/chunk))): curids = mids[int(idx*chunk):int((idx*chunk)+chunk)] I'm not sure what the syntax for mids[int(idx*c

Evaluate my design code - Snippet Simple

protected void Page_Load(object sender, EventArgs e) { if (!Page.IsPostBack) { loadCountries(); loadRegions(); loadCities(); } } private void loadCountries() { Country country = new Country(); ddlCountry.DataSource = country.GetDataTable(); ddlCountr

How do I do my test and save the job?

I cannot figure why my try and except is not working for decimals. I am trying to get someone to enter a number between 1 - 0 and make a try and except that will catch out if someone enters a number over 1 or below 0 and then it will return the funct

Check if NSDictionary is empty

I want to check if an NSDictionary is empty. I am doing it like this. mutDictValues = [[[NSUserDefaults standardUserDefaults] objectForKey:@"dicValues"]mutableCopy]; NSLog(@"dictValues are %@",mutDictValues); if(mutDictValues == NULL){

I'm having trouble doing my code

I don't get my expected output. Let lista_preguntasyrespuestas = ((("1+1"),("2")),(("2+2"),("4"))) for i in lista_preguntasyrespuestas: for j in range(len(lista_preguntasyrespuestas)): print("Pregunta {}: {}&qu

PHP Substring of a regex replacement

I have the following regex : $string = preg_replace("/([\w]+:\/\/[\w-?&;#~=\.\/\@]+[\w\/])/i","<a target=\"_blank\" href=\"$1\">$1</A>",$string); Using it to parse this string : http://www.ttt.com.ar

Print beans data into another page (RequestScope)

Edit 4 What I wanted to do is implement forgotPassword page. For example purpose I have taken below example and it is not real user related question where I will keep username in session scope. index.xhtml would be forgotPassword page where I would b

Qt moves from LGPL to market halfway

I've never understood this bit about licensing on the Qt website. Qt Commercial Developer License The Qt Commercial Developer License is the correct license to use for the development of proprietary and/or commercial software with Qt where you do not

DataFrame filling with a specific value

Setup Consider df = pd.DataFrame(index=pd.date_range('2016-03-01', '2016-03-08'), columns=list('ABC')) df.iloc[2, 1] = 2. df.iloc[5, 1] = 3. df.iloc[7, 2] = 4. print df A B C 2016-03-01 NaN NaN NaN 2016-03-02 NaN NaN NaN 2016-03-03 NaN 2 NaN 2016-03-

Errno :: EACCESS: Permission Denied @ dir_s_mkdir

I am pretty new to Ruby.. was following the instructions on TeamTreehouse installing Ruby Development Environment on OSX (Yosemite). When I got to the step to create my test app. It's failing at the end. With Permission Denied. :( Not sure what I am

Get ArraylistObject getParcelableExtra - NullPointerException

I cannot figure out how to send and receive and arraylist-object between two categories in android. I get A NullPointerException in activity B. Activity A private ArrayList <String[][]> stringObjects2D = new ArrayList <String[][]> () ; Intent

WPF Style DataTrigger based on DependencyProperty binding

I'm working on a WPF form designer where you can drag and drop controls like Labels, TextBox, ComboBox to a design surface, then through a Property Grid user can set data bindings for each control. I have a requirement to show a red background for th

I can not edit my TextView text in Visual Studio 2015 (Android)

I am very new to Visual Studio. I'm required to create an android app with Visual Studio. I'm using Visual Studio 2015 Community. Currently I have an android project with 2 activities (details and confirmation). In the details page, there are EditTex

Manipulate cron jobs without using crontab on OS X 10.7?

Not even sure it's possible but I was trying to find a way to add/remove/edit cron jobs in BASH without using crontab. I'm trying to build a UI front-end to interact with cron but, to my knowledge, crontab requires user input since any change must be

BlackBerry Enterprise Distribution

Is there any enterprise distribution program for blackberry applications? Is there any method similar to Apple's enterprise distribution of iphone applications? While going through their documentation, they are talking about using a deployment server

How to switch the operator to a function in Powershell

I have some Powershell code that looks like the following: if($item_1 -lt 2000000){ ... } if($item_2 -lt 10000){ ... } if($item_3 -gt 10){ ... } if($item_4 -gt 100){ ... } I'd like to refactor it into a function like function doComparison( $item, $op

Given a CGPath, how to bend it?

In the following screen shot: when you drag the tail of the word balloon (the thing that connects from the balloon to the persons mouth), the shape curves (as illustrated by the difference between the two balloon tails in the picture). I'm wondering,

get the first 5 characters of each line in a shell script

Here is my sample.txt file it contains following 31113 70:54:D2 - a-31003 31114 70:54:D2 - b-31304 31111 4C:72:B9 - c-31303 31112 4C:72:B9 - d-31302 I have to write the shell script in that I am passing first 5 characters (eg 31113) as input id to ot

Advantages of interface metadata in a database

I'm working on an application where the interface metadata is stored in a database. Basically the C# .NET application reads the positions, size and text of buttons, labels, radiobuttons, etc.. from SQL Server tables. As far as I can tell, who ever wr