Questions tagged [except]

Used for the MS .NET LINQ Except() method and the Python except keyword for exception handling. Use the tag sql-except for questions related to the SQL operator EXCEPT

This tag is used for two different things:

  1. The Microsoft [.NET] Framework [LINQ] Except() method which produces set differences of two sequences.

  2. The [Python] keyword except used for exception handling.

Please use the tag for questions related to the SQL operator EXCEPT

598 questions
6
votes
2 answers

Using Linq Except with two lists of int arrays

Is it possible to use except with two lists of int arrays, like so: List a = new List(){ new int[]{3,4,5}, new int[]{7,8,9}, new int[]{10,11,12} }; List b = new List(){ new int[]{6,7,9}, new int[]{3,4,5}, new…
Albertino
  • 63
  • 1
  • 5
6
votes
1 answer

LINQ "Except" Operator

i have a list of event Ids that i want to be excluded from my select statement, but no sure how to implement this: this is what stores my list of event Ids List ExcludedEvents; and this is my select statement (from an XML feed) var allEvents =…
kb.
  • 1,010
  • 3
  • 17
  • 34
5
votes
0 answers

How does the "ThrowHelper" .Net Framework class help lessen the generated IL code?

I was looking at this and it its starting comments it says it exists because throw new ArgumentNullException("key", Environment.GetResourceString("ArgumentNull_Key")); generates more IL code…
user14092802
  • 105
  • 10
5
votes
3 answers

Bigquery: STRUCT (*) syntax

How can I automatically apply STRUCT to all fields in a table without specifying them by name? Example that does not work: WITH data as ( SELECT 'Alex' as name, 14 as age, 'something else 1' other_field UNION ALL SELECT 'Bert' as name, 14 as age,…
Ilja
  • 993
  • 2
  • 17
  • 36
5
votes
3 answers

python try except yield combination

I use function f to create generator but sometimes it can raise error. I would like two things to happen for the main code The for loop in the main block continues after catching the error In the except, print out the index that generates the error…
nos
  • 19,875
  • 27
  • 98
  • 134
5
votes
3 answers

django objects.get() does not find result

quick question. I run the following code with a try except statement (as it is possible that there is no entry in the database). And for some entries I run into the except block although there is an entry in the database for sure! When using…
user2601983
  • 69
  • 1
  • 7
5
votes
1 answer

Using EXCEPT clause in PostgreSQL

I am trying to use the EXCEPT clause to retrieve data from table. I want to get all the rows from table1 except the one's that exist in table2. As far I understand, the following would not work: CREATE TABLE table1(pk_id int, fk_id_tbl2 int); CREATE…
jsp
  • 2,546
  • 5
  • 36
  • 63
5
votes
4 answers

Using IEnumerable.Except

I got 3 listViews 2 textbox and 2 buttons in WinForm. Program Description: The program adds numbers to the listview by typing in numbers in the textbox and clicking the add button Goal: I want to be able to use the IEnumerable.Except method to…
taji01
  • 2,527
  • 8
  • 36
  • 80
5
votes
4 answers

Keeping try block small when catching exceptions in generator

How can I keep the try block as small as possible when I have to catch an exception which can occur in a generator? A typical situation looks like this: for i in g(): process(i) If g() can raise an exception I need to catch, the first approach is…
Alfe
  • 56,346
  • 20
  • 107
  • 159
5
votes
2 answers

Python - How to print the message inside ValidationError

I would like to know how to print the string written when raising an exception. For example if I use raise ValidationError("RANDOM TEXT HERE"); How can I retreive "RANDOM TEXT HERE" from within the except section. try: ... except…
Rorchackh
  • 2,113
  • 5
  • 22
  • 38
4
votes
1 answer

Timers cannot be stopped from another thread (short example with nidaqmx-python and callbacks)

I have seen other questions on the topic on this forum, but none have helped me understand how to deal with this. Most of them also seem to me to be about quite intricated and long code. I believe I am doing something rather simple / would like to…
4
votes
3 answers

Prevent Python script to fail

I have a python script that will be running 24/7 on a raspberry for at least five month, without a way for me to access the thing to reboot it if anything goes wrong. It's using various libraries to connect to a sql database, wireless RFID readers…
mahotd
  • 53
  • 1
  • 5
4
votes
3 answers

How to remove all elements of a FormArray but one specific index?

Is there any built-in functionality in Angular, so that I can say: remove all FormArray elements except at index 2 maybe something like 'RemoveRange" as known from other libs?
user3025289
4
votes
2 answers

Using EXCEPT where 1=0

I saw the following posted on a basic way to de-dup entries, without explanation of how it works. I see that it works, but I want to know the workings of how it works and the process in which it evaluates. Below I will post the code, and my…
Nick A
  • 126
  • 7
4
votes
3 answers

Show complement results from statement sql

I have a twiter-like web, where users follow another users, I need to show them suggestions to follow new people TABLE USERS user id_user A 1 B 2 C 3 D 4 E 5 F 6 TABLE COMMUNITY id_follower id_followed 3 …
masterhoo
  • 89
  • 8
1 2
3
39 40