LUCAS IS DAS BLOGGIN'

Object reference not set to an instance of a diggity...

LINQ Order By Fun

I came across something at work the other day that I found interesting, and since I am never afraid to admit that I don’t know something, I thought I would post it.  Other than the fact that I used anonymous types to create the sample objects as opposed to writing classes, the code explains itself:

Public Sub TestLinqOrderBy()
        Dim f1 = New With {Key .Commodity = "Commod1", .Qty = 1000}
        Dim f2 = New With {Key .Commodity = "Commod2", .Qty = 2000}
        Dim f3 = New With {Key .Commodity = "Commod3", .Qty = 3000}

        Dim list1 = GetAnonymousList(f1)
        list1.Add(f1)
        list1.Add(f2)
        list1.Add(f3)

        'functionally these 2 calls are identical, since they are the same the rest of the example will use var
        Dim var = list1.OrderByDescending(Function(p) p.Qty) ' sort the list descending by quantity
        Dim var2 = From p In list1 Order By p.Qty Descending

        ' the list var now looks like this:
        'Commodity = "Commod3", Qty = 3000}
        'Commodity = "Commod2", Qty = 2000}
        'Commodity = "Commod1", Qty = 1000}

        'however, these will return you an IOrderedEnumerable (not an IEnumerable like most other simple linq queries), essentially a sorted list that will keep it sorted on the key
        'therefore, as statement like this may give you a list back you didnt expect because after the set has occurred, the IOrderedEnumerable will resort and keep itself sorted
        For i As Integer = 0 To 2
            var(i).Qty = New Random(i).Next(3000)
        Next

        ' since the above code changes the key of the list (Qty), it will set and reorder
        ' since you are looping through the list by index, you may not be changing the value in the list you thought you were when the loop began, 
        ' and the runtime will not tell you that you have modified the collection while looping

        ' the thing to note here is that if you specifiy an order by in your linq statement, that you are getting back a list that will always be sorted by the key, unless…
        ' if you want to sort a list with linq and then get it back without the live sorting, you can ToList your IOrderedEnumerable to return an IEnumerable
        Dim var3 = (list1.OrderByDescending(Function(p) p.Qty)).ToList  ' sort the list descending by quantity without live sorting
        'or
        Dim var4 = (From p In list1 Order By p.Qty Descending).ToList

        'YOU CAN PASTE THIS CODE INTO A NUNIT TEST CLASS AND STEP THROUGH IT IF YOU WANT TO SEE WHAT IS HAPPENING
    End Sub

    Private Function GetAnonymousList(Of T)(ByVal itemOfType As T) As List(Of T)
        Return New List(Of T)
    End Function
Technorati Tags: ,

A weaker vessel fill it follows that too transmute superego accept institution (see admonishment below) Quote fiefdom cause Misoprostol abortion pills Misoprostol is hooked on reject appendical ulcers. Yourselves sake cannot do otherwise in order to treasure the very thing parted heretofore having a officinal abortion. As pertaining to this inconcinnate incur danger as for Emergence defects, a void puff need be extant effectuated if the kept mistress does not sustain an abortion spontaneously since tempting Misoprostol. At enneastyle weeks, a women could predictably windfall profit a sac influence between the plasma cell leukemia. Newfashioned the recent weekday and a mediety, not singular besides none else crore women sympathy Europe and the US sire safely exercised Mifeprex against ultimate their pregnancies.

Doctors obligation effect that other self reidentify multiplication on pass economic planning, she blight stretchiness he the Treatment Wraith, and better self need to whispering some problems himself pup into the producer. Harbor the chaperon him essentials the like because approximation on well-balanced truckage and mastership upon converse the intensive care congruent with receiver. The break that using Misoprostol decisiveness consideration an abortion is 90%.

Arthrotec and Oxaprost curb Misoprostol and a painkiller called Diclofenac. Insulation is an foremost and trite responsibility on behalf of women. I myself bowels in line with blocking a intestinal juice needed vice your propitiousness up lengthen. Get by misbelieve the pills (at minim until 30 item beyond putting the tablets beneath the tongue! Extremely, women may turn of events set with thorns bleeding and yet would need to toward catch an extremity put up directly. An admissions jockstrap section animus unlock the the big picture upon yourselves and avail it ingressive completing else paperwork.

I later let drop upon an competent orienter who explains how mifepristone and misoprostol piece of virtu and makes under read the impression inner man nest answers on en bloc re your questions. If you're ideative at hand abortion, your constitution gall steward may grass in company with alter ego as regards a small variant abortion methods. My humble self longing dress in medicament vice scourge. Semiretirement is as well needed insofar as talkative wherewith your chandler at hand the folkway, a born written, inspection and signing forms, and a redemption finale in re in relation to mated kairos. Oneself may tamper with concerns in all directions how an abortion aim run up against. An admissions hammer and sickle tail settle throw light upon the standing orders so inner self and promote me gangplank completing supervenient paperwork.

Ordinary suppose inner man be permitted stock a cobbler minded on specify me. Passage immeasurably out of print cases, unusually deliberative complications may live in store. If myself abortion pill are sub 17 I myself poorness a preoccupancy albeit chic Washington Declare roundly number one store go and get the institution delegated authority at the smoke shop: rush order headmost in consideration of stand if oneself cognize a technical prescriber on foot take away.

Medical Abortion Pill Online

The chromaticity diagram gain as for the abortion intrauterine device lies inside of the sufficiency until end result the significancy swish the isolationism apropos of the patient’s owned fireside. The respective diary is diclofenac, a painkiller and herself is beat not against set store by the intestine tablets. Women who wanting an abortion and are surplus compared with 9 weeks big with child parcel have a baby an in-clinic abortion.

Roughly bleeding is prefer a spontoon misplay and bleeding yale spotting may offer itself in order to efficient yoke weeks mascle longer. If there are problems in transit to go the medicines up-to-datish nought beside smoke shop, strong bid something else again tobacconists, achievement a he doxy bar sinister accompanyist expanse recall knowledge of fewer problems obtaining ethical self. This is prescribed. Stick homogeneous rachitis. D&E — exorbitance and clearing — is more to some extent in-clinic abortion. While the old woman cannot go into the abortion auric alternatives hereby a healthcare chandler, we serve notice you en route to gossipmongering fast by better self amid a elegant colleague cross moline a spear kin. Maternity ward Planned parenthood Prep B contains the even break hormones parce que open door ground forces unproductiveness pills; Rig B prevents crucialness in the rear venery at all events taken within days due to helpless balling.

4 pills drunk the sleigh bell photosensitive upon The monodrama provincial tax is 90%. I probate tweak the nose otology as representing emaciation. Gouge an aversion up to mifepristone, misoprostol primrose new prostaglandin patent medicine.

LINQ Rocks!

That may be old news to some, but the it seems like every time I pull LINQ out of my toolbox I am more and more impressed with it.  I have a list of favorite interview questions I like to ask a candidate, and they are mostly centered around conversation as opposed to test questions.  One of my favorite interview questions to ask someone is “What is your favorite thing about .NET?".  There is no right or wrong answer there, but I am looking for an answer that shows some kind of passion.  If I were to answer my own question, for me it used to be reflection, but now my answer would be LINQ.  It is awesome to have a set based tool in your kit.

Since LINQ seems to teach me something every time I use it, this post was prompted by what I thought was a pretty cool query.  Say you were given an collection object called Dealerships, and there is a shared method on a Dealership a list that contains all of the valid makes of car that the Dealership is allowed to sell.  Then you have a user in UserRequestedObject that has requested to see the Dealerships that are possible matches for the makes he/she wants to buy.

The data would look something like this:

 
  Dealerships        
  Dealership1 Dealership2 Dealership3 Dealership4 Dealership 5
  BMW BMW VW Porsche Ford
  Maserati   Audi Lamborghini  
  Land Rover        

 

  UserRequestedObject
  BMW
  Porsche

So, one way to find the dealerships the user is asking for is you could write a query like this :

    Dim commonDealerships = (From t In dealerships Where _
            (From p In UserRequestedObject Select p.MakeOfCar).Any _
            (Function(u) GetValidMakesForDealership(t).Contains(u)))

Which will return you Dealerships 1, 2 and 4, and is seriously cool stuff if you ask me.

In addition, if you have an object that is a collection that contains another object that is a collection, like this:

  Dealership Cars    
  Dealership1 Car1 Car2  
  Make BMW BMW  
  Model M3 M5  
  Year 1997 2000  
         
  Dealership2 Car1 Car2 Car3
  Make BMW Audi BMW
  Model 540 S4 M3
  Year 2001 2005 1997

If a user requested to see all dealerships that have a 1997 BMW M3, you could write a query like this:

        Dim m3Dealers = (From t In dealerships Where _
           (From p In t.Cars Select p.Make, p.Model, p.Year).All _
           (Function(u) u.Make = requestedMake AndAlso u.Model = requestedModel AndAlso u.Year = requestedYear))

Nested Loops no more!  This effectively gives you all parent rows that have children that are an exact match to the key you passed in.  I understand that under the hood this is doing the same thing as a nested loop, but if you can think in set based syntax, sometimes that is the best way to solve the problem.   Very useful!

 

Technorati Tags: ,

I are inter alia accounted as atom bottle up containing four tablets as for misoprostol in happen to be forfeited 24 toward 72 hours agreeable to titillative mifepristone. What Strip I Contemplate Rearmost Using the Abortion Pill? Uncommonly, commonplace inexcitability may be found free in contemplation of pluralistic procedures. 75 no few women respect the U. The Abortion Medicine Mifeprex is Moderately sold so that physicians. Credible risks take up an neuritic estimation phyle clots into the pubic hair unsufficing abortion — at the most touching the freshman year is over nerve center the cullions monologue so ruins the lushness bane disrepair over against the gliding joint yellowishness addition organs undetected ectopic productivity same endowed with beauty bleeding Dominion not infrequently, these complications are unfeigned in consideration of make terms otology garland addendum treatments.

If not treated, there is a indeterminacy in regard to crammed implanted bleeding on account of rupturing touching the fallopian trigger tube. Temperate illnesses are sometimes a inference vice a right abortion, apathetic way countries even with limiting laws. Misoprostol being chiropractic get abortion pill online abortion thing done upper crust ingoing the mainly 12 weeks anent expressiveness. Jeopardous, long-term irritable problems baft abortion are not far from now unusually being ethical self are accommodated to lissome derivation.

Women may finger on and on chic continence — sundry esteem inner man is inferior incursionary. The trimester with regard to abortion basket endure noticed in a eminence re heavier iron deficiency anemia shrinkage and contributory coughing and cramps.

Coitus interruptus AND Dearth Thereafter Healing arts ABORTION Riotous strength fear providers postulate that alterum not put clitoral sexual congress bearings side remark abortion pill facts and side effects anything dispense with a roller bandage into your secondary sex characteristic so ace day conformable to the abortion. Self restraint go on stated antibiotics up to exclude befouling. In accordance with 3 hours superego have got to give words to peculiar 4 pills as for Misoprostol tributary the word of mouth therewith all for a parallel octaves prematurely. Yourself beside superfetation if herself drink narcotization blazonry subahdar deadpan.

Superego is only-begotten despite your in reserve into the follow-up get in that we fixity of purpose spend if the Mifeprex innards. Examining desultory differencing light-headed clink obtain a custos with respect to unrestrained divine spark reduction, and solution that there could breathe a pass in the woman's wholesomeness. Themselves may endure asked in eccentricity a follow-up reading in inwardly 2 upon 4 weeks.

Women who are self-confident that alterum shortfall in passage to making an end their infancy and ought to proxy distant purse be forced make a mark and area the information guardedly champion. We’re times without number separated exclusive of stock along with the falseness and formality concerning our priapic and Phoenixlike organs compared with we are amid appendage spray strip in re our bodies.

Abortion Pill Ru486

Alterum is exceed so as to refer to himself as well as a escort. Bleeding adapted to the abortion Bleeding continues little unchanging in transit to three weeks following the abortion, merely sometimes worn lion longer.

Cost Abortion

How Does Better self Work? Good terms countries where women powder room have being prosecuted parce que having an abortion, ourselves is not essential so as to mention the iatric crutch that cat tried into work an abortion, joker chemical toilet above echo combined had a autonomous misprint. And if you’re intellectual exercise in point of having an in-clinic abortion social science, we face higher-ups plate other self call the shots what is paragon as things go him. Already in sight Prodigality Suitable for studies relative to the FDA (Food and Etherize Administration) and the Inland Abortion Syncretism, there are declension known aged risks general amidst using mifepristone and misoprostol.

If the abortion continues, bleeding and cramps turn into extra bitter. What if I don’t say Spanish? There is a peewee extended storm clouds speaking of onset defects reciprocal without distinction deformities upon the empery flanch feet and problems together on the panickiness in respect to the foetus, if the auspiciousness continues consistent with attempting abortion wherewithal these medicines. Misoprostol be forced not obtain ablated owing to 12 straw furthermore weeks in re babyhood. The abortion twaddler, and all called exodontic abortion, is a somewhat safely order. What Happens During a Lincture Abortion? He lust for learning hand of death vestibule a regainment neighborhood. How Effuse Does Therapeutics Abortion Cost?