Search Results

Search found 53 results on 3 pages for 'nir gavish'.

Page 3/3 | < Previous Page | 1 2 3 

  • set timeout to http response read method in python

    - by nirtayeb
    Hi, I'm building a download manager in python for fun, and sometimes the connection to the server is still on but the server doesn't send me data, so read method (of HTTPResponse) block me forever. This happens, for example, when I download from a server, which located outside of my country, that limit the bandwidth to other countries. How can I set a timeout for the read method (2 minutes for example)? Thanks, Nir.

    Read the article

  • Entity Framework - Condition on one to many join (Lambda)

    - by nirpi
    Hi, I have 2 entities: Customer & Account, where a customer can have multiple accounts. On the account, I have a "PlatformTypeId" field, which I need to condition on (multiple values), among other criterions. I'm using Lambda expressions, to build the query. Here's a snippet: var customerQuery = (from c in context.CustomerSet.Include("Accounts") select c); if (criterions.UserTypes != null && criterions.UserTypes.Count() > 0) { List<short> searchCriterionsUserTypes = criterions.UserTypes.Select(i => (short)i).ToList(); customerQuery = customerQuery.Where(CommonDataObjects.LinqTools.BuildContainsExpression<Customer, short>(c => c.UserTypeId, searchCriterionsUserTypes)); } // Other criterions, including the problematic platforms condition (below) var customers = customerQuery.ToList(); I can't figure out how to build the accounts' platforms condition: if (criterions.Platforms != null && criterions.Platforms.Count() > 0) { List<short> searchCriterionsPlatforms = criterions.Platforms.Select(i => (short)i).ToList(); customerQuery = customerQuery.Where(c => c.Accounts.Where(LinqTools.BuildContainsExpression<Account, short>(a => a.PlatformTypeId, searchCriterionsPlatforms))); } (The BuildContainsExpression is a method we use to build the expression for the multi-select) I'm getting a compilation error: The type arguments for method 'System.Linq.Enumerable.Where(System.Collections.Generic.IEnumerable, System.Func)' cannot be inferred from the usage. Try specifying the type arguments explicitly. Any idea how to fix this? Thanks, Nir.

    Read the article

  • Display problem after deletion in linked list in C

    - by LuckySlevin
    Hi, actually this was another problem but it changed so I decided to open a new question. My code is typedef struct inner_list { int count; char word[100]; inner_list*next; } inner_list; typedef struct outer_list { char word [100]; inner_list * head; int count; outer_list * next; } outer_list; void delnode(outer_list **head,char num[100])//thanks to both Nir Levy and Jeremy P. { outer_list *temp, *m; m=temp=*head; /*FIX #1*/ while(temp!=NULL) { if(strcmp(temp->word,num)==0) { if(temp==*head) { delinner(temp->head); /* FIX#2 */ *head=temp->next; free(temp); return; } else { delinner(temp->head); /* FIX#2 */ m->next=temp->next; free(temp); return; } } else { m=temp; temp= temp->next; } } printf(" ELEMENT %s NOT FOUND ", num); } void delinner(inner_list *head) { /* FIX#2 */ inner_list *temp; temp=head; while(temp!=NULL) { head=temp->next; free(temp); temp=head; } } void delnode2(outer_list *up,inner_list **head,char num[100]) { inner_list *temp2,*temp, *m; outer_list *p; p = up; while(p!=NULL){m=temp=temp2=p->head; while(temp!=NULL) { if(strcmp(temp->word,num)==0) { if(temp==(*head)) { *head=temp->next; free(temp); return; } else { m->next=temp->next; free(temp); return; } } else { m=temp; temp= temp->next; } } p=p->next; } printf(" ELEMENT %s NOT FOUND ", num); } void print_node(outer_list *parent_node) { while(parent_node!=NULL){ printf("%s\t%d\t", parent_node->word, parent_node->count); inner_list *child_node = parent_node->head; printf("list: "); if(child_node ==NULL){printf("BUARADA");} while (child_node != NULL) { printf("%s-%d", child_node->word,child_node->count); child_node = child_node->next; if (child_node != NULL) { printf("->"); } } printf("\n"); parent_node = parent_node->next; } } While deleting an element from outer list I am also trying the delete the same element from inner_list too. For example: - Let's say aaa is an element of outer_list linked list and let's point it with outer_list *p - This aaa can also be in an inner_list linked list too. (it can be in p-head or another innerlist.) Now, the tricky part again. I tried to apply the same rules with outer_list deletion but whenever i delete the head element of inner_list it gives an error. Where is the wrong thing in print_node or delnode2?

    Read the article

< Previous Page | 1 2 3