Two Plus Two Publishing LLC
Two Plus Two Publishing LLC
 

Go Back   Two Plus Two Poker Forums > >

Notices

Programming Discussions about computer programming

Reply
 
Thread Tools Display Modes
Old 08-24-2011, 12:02 PM   #1251
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by gaming_mouse View Post
Isn't that an argument in favor of it? Otherwise you are creating more and more static methods like the ones in question. One of the main points of OO is to keep data and the methods that operate on it together. Creating static methods like these is essentially doing procedural programming with global functions.

The refactoring I was referring to was creating a BasketList class, and then potentially changing other client code that uses the current static methods to use that class.
Ok, fair point.

Bigger picture, I'm not seeing the real need for the BasketList concept.

I'd rather that you construct a BasketItem from the parameters being passed in and use the already provided List contains function and BasketItem.equals function (whatever those are in this language). Then you don't need either of these functions anywhere.
jjshabado is offline   Reply With Quote
Old 08-24-2011, 12:02 PM   #1252
tyler_cracker
Carpal \'Tunnel
 
tyler_cracker's Avatar
 
Join Date: Apr 2005
Location: Shallow End OTKP
Posts: 15,824
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

gull, i think your "lambda" version is less readable than your first version and i don't understand your claim that there is "no repetition" when almost every character is repeated.

also i don't see how this is a lambda since there are no functions or function pointers anywhere. does 'linq' just mean 'treat objects like entries in a relational database'?
tyler_cracker is offline   Reply With Quote
Old 08-24-2011, 12:03 PM   #1253
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
The downside of wrapping List<BasketItem> in a class is that now you have to pass all of the List functionality to BasketItem as you need it.
How so? Your new class will have a List<BasketItem> as one of its members. You will be delegating your list functionality to that member....
gaming_mouse is offline   Reply With Quote
Old 08-24-2011, 12:06 PM   #1254
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
I'd rather that you construct a BasketItem from the parameters being passed in and use the already provided List contains function and BasketItem.equals function (whatever those are in this language). Then you don't need either of these functions anywhere.
Yeah this I like too. I'm not a C# guy so I wasn't aware what List facilities were available
gaming_mouse is offline   Reply With Quote
Old 08-24-2011, 12:06 PM   #1255
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

That's my point. You have a class full of

Code:
function x
    member.x

function y
   member.y

function bool z
   return member.z
Edit: Also a pain if you want to use functions that expect a list parameter.
jjshabado is offline   Reply With Quote
Old 08-24-2011, 12:10 PM   #1256
Gullanian
Carpal \'Tunnel
 
Gullanian's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 14,008
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by tyler_cracker View Post
gull, i think your "lambda" version is less readable than your first version and i don't understand how you can claim there is "no repetition" when almost every character is repeated.

also i don't see how this is a lambda since there are no functions or function pointers anywhere. does 'linq' just mean 'treat objects like entries in a relational database'?
I consider it non repetitive code because the repeating code are all things you would have to pass to a method anyway if you wanted to adopt another technique. I don't think it's possible this can be simplified, or broken up into a more simplified version any further:

Code:
return BasketItems.Where(c => c.GroupID == GroupID).SingleOrDefault() != null;
The c=> c.GroupID == GroupID is a lambda expression.

From Wikipedia:

Quote:
LINQ defines a set of method names (called standard query operators, or standard sequence operators), along with translation rules from so-called query expressions to expressions using these method names, lambda expressions and anonymous types. These can, for example, be used to project and filter data in arrays, enumerable classes, XML (LINQ to XML), relational databases, and third party data sources.
I've only really used linq/lambda for accessing data in my database, not applied it to objects like this before, although Jon Skeet someone I trust and read says once you get to grips with it it's exceptionally useful and powerful.
Gullanian is offline   Reply With Quote
Old 08-24-2011, 12:11 PM   #1257
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

yeah if List already implements a search, that is the way to go.

btw from the looks of it, C# is like microsoft saw java and said, "Sweet, let's copy this ****, rename it, and sell it to people!"
gaming_mouse is offline   Reply With Quote
Old 08-24-2011, 01:18 PM   #1258
myNameIsInga
adept
 
Join Date: Apr 2010
Location: Deep end of the player pool
Posts: 746
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

There seem to be alot of folks around here that knows all the ins and outs of databases. What would be a good place to start learning about databases? what books and stuff. Would really appreciate some advice.

Mvh
Inga
myNameIsInga is offline   Reply With Quote
Old 08-24-2011, 01:19 PM   #1259
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

The claim was made in the OOT LC thread that there are no comparable laptops to the Macbook Air significantly cheaper than it.

I believe this, but just wondering what you guys think.
jjshabado is offline   Reply With Quote
Old 08-24-2011, 01:26 PM   #1260
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by myNameIsInga View Post
There seem to be alot of folks around here that knows all the ins and outs of databases. What would be a good place to start learning about databases? what books and stuff. Would really appreciate some advice.

Mvh
Inga
Why do you want to learn about them and what do you already know? It's a pretty big topic so it would probably help to know more details about what you want to get out of this.
jjshabado is offline   Reply With Quote
Old 08-24-2011, 01:48 PM   #1261
myNameIsInga
adept
 
Join Date: Apr 2010
Location: Deep end of the player pool
Posts: 746
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
Why do you want to learn about them and what do you already know? It's a pretty big topic so it would probably help to know more details about what you want to get out of this.
Thank you for replying!

I was looking to begin a course on database systems but unfortunately I applied to the course to late..

The course represents about 5 weeks of full time study.

This is from the course web page:


Lärandemål (efter fullgjord kurs ska studenten kunna) (goals)
By the end of the course the student should know how to design and use databases as an end user, as an application programmer and as a database administrator.


Innehåll (contents)
The course covers the basic principles of database systems as seen by users, application programmers and database administrators. A laboratory assignment develops these topics as a running example throughout the course. These include programming in SQL, as seen by a user querying or modifying an existing database, by a database designer, and by an application programmer invoking SQL from a host language.
Course contents include:
* Entity-Relationship modelling
* Functional Dependencies and Normalisation
* Database querying and manipulation through SQL
* Interfacing to a database from a host language (Java/JDBC)
* The semi-structured model, XML


Unfortunatly there is no litterature referred to on the site.

So since i cant take the course I still want to learn the things mentioned above. The course was using java but thats not necessary Any "C" dialect will do as well. Allthough I prefer C#

Sorry for the long post.

Mvh
Inga
myNameIsInga is offline   Reply With Quote
Old 08-24-2011, 02:01 PM   #1262
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
The claim was made in the OOT LC thread that there are no comparable laptops to the Macbook Air significantly cheaper than it.

I believe this, but just wondering what you guys think.
i dunno, what are you comparing? if its just specs of some nature i am pretty sure i could find a PC for quite a bit less. usually mac users claim that battery life and "better UI" are the justification for the increased cost.
gaming_mouse is offline   Reply With Quote
Old 08-24-2011, 02:35 PM   #1263
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by gaming_mouse View Post
i dunno, what are you comparing? if its just specs of some nature i am pretty sure i could find a PC for quite a bit less. usually mac users claim that battery life and "better UI" are the justification for the increased cost.
Just specs. I haven't seen any notebooks with the basic air specs for significantly less than $1000.
jjshabado is offline   Reply With Quote
Old 08-24-2011, 02:43 PM   #1264
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
Just specs. I haven't seen any notebooks with the basic air specs for significantly less than $1000.
what are the specs?
gaming_mouse is offline   Reply With Quote
Old 08-24-2011, 02:50 PM   #1265
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

http://www.apple.com/ca/macbookair/specs.html

* 11.6 inches, 2.38 lbs
* 64 GB Flash Drive
* 1.6GHz dual-core Intel Core i5 with 3MB shared L3 cache
* 2 GB Memory
jjshabado is offline   Reply With Quote
Old 08-24-2011, 03:06 PM   #1266
gaming_mouse
Carpal \'Tunnel
 
gaming_mouse's Avatar
 
Join Date: Oct 2004
Location: taking notes on u (see profile)
Posts: 13,782
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
http://www.apple.com/ca/macbookair/specs.html

* 11.6 inches, 2.38 lbs
* 64 GB Flash Drive
* 1.6GHz dual-core Intel Core i5 with 3MB shared L3 cache
* 2 GB Memory
yeah just spent 5 mins looking around.... seems like you can reduce the cost and even gain RAM, but you give up the flash. asus is coming out with a direct competitor but looks like it will only save you $100 or so. and this is coming out soon:

http://www.slashgear.com/acer-aspire...eaks-09170469/

but again it doesnt look like you'll be getting a massive discount...
gaming_mouse is offline   Reply With Quote
Old 08-24-2011, 04:34 PM   #1267
tyler_cracker
Carpal \'Tunnel
 
tyler_cracker's Avatar
 
Join Date: Apr 2005
Location: Shallow End OTKP
Posts: 15,824
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

afaik most of what you're paying for when you buy an air is this:

Quote:
Originally Posted by lol apple.canadia
# Height: 0.3-1.7 cm (0.11-0.68 inch)
# Width: 32.5 cm (12.8 inches)
# Depth: 22.7 cm (8.94 inches)
# Weight: 1.35 kg (2.96 pounds)
fwiw, my bf had one of the older airs and loved it for browsing in bed and stuff like that but then he got an ipad so he sold the air.
tyler_cracker is offline   Reply With Quote
Old 08-24-2011, 05:07 PM   #1268
jjshabado
Carpal Tunnel
 
jjshabado's Avatar
 
Join Date: Jul 2006
Posts: 22,105
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

@tyler_cracker - That's what most people claim (buying air for size/weight/name) - but looking at the specs the air is a pretty powerful machine and I don't think there are any laptops that beat the air's performance and price (at least not by very much).

I had a first generation Air and I loved it for the same things - but my understanding is that as of last year's update they became a solid laptop on top of being light.
jjshabado is offline   Reply With Quote
Old 08-24-2011, 06:45 PM   #1269
DeathAndTaxes
old hand
 
Join Date: Jun 2011
Posts: 1,456
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by jjshabado View Post
Just specs. I haven't seen any notebooks with the basic air specs for significantly less than $1000.
Think outside the box. Most PC manufacturers mark up SSD about 200%-300%.

So take something like this:
http://www.newegg.com/Product/Produc...82E16834246147
6GB of ram vs 2GB of ram
more powerful GPU vs two generation old GPU.
2.3Ghz CPU vs 1.6Ghz CPU
Bluray optical vs no optical

Plus drop in a nice SSD from Intel
http://www.newegg.com/Product/Produc...82E16820167050
120GB vs 64GB
roughly double the capacity, double the throughput and an amazing 5 year warranty.

Combined price ~ $1000.

If you don't need bluray, can deal with smaller SSD, or live with a less powerful GPU you can easily shave $200 - $300 off the cost and still outspec the air.

For example if you wanted a larger (17") screen.
This http://www.newegg.com/Product/Produc...82E16834200306
plus this http://www.newegg.com/Product/Produc...82E16834215122 is under $850 shipped.


The air has one advantage and one advantage only. It is light, and thin, and small. Well I guess that is three advantages. However there is a $200 - $400 premium for those specs.

Last edited by DeathAndTaxes; 08-24-2011 at 06:56 PM.
DeathAndTaxes is offline   Reply With Quote
Old 08-24-2011, 06:53 PM   #1270
_dave_
_Pooh_Bah_
 
Join Date: Feb 2005
Location: UK (or what remains of it)
Posts: 12,634
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by DeathAndTaxes View Post
Think outside the box. Most PC manufacturers mark up SSD about 200%-300%.
Yeah I've been meaning to post this. also not to be worried if you haven't done it before, swapping out the HDD in a modern laptop (non-apple) is usually similar to changing games on a NES.
_dave_ is offline   Reply With Quote
Old 08-24-2011, 06:55 PM   #1271
DeathAndTaxes
old hand
 
Join Date: Jun 2011
Posts: 1,456
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Quote:
Originally Posted by gaming_mouse View Post
btw from the looks of it, C# is like microsoft saw java and said, "Sweet, let's copy this ****, rename it, and sell it to people!"
More like Microsoft said "wow Java is a great idea but Sun made some horrible horrible performance decisions (like everything but built-in types are reference types, can anyone say heap fragmentation and GC churn) and then lets Java fall behind other OOP languages".

C# takes the best of Java (just like Java took the best of OOP languages before it) and improves on it so much to say C# copied Java is silly and misses the point. C# language makes it "easy" to write solid, self documenting code without lots of excess boilerplate code. Properties, operating overloading, null operator, delegates, lambdas, (and likely I am forgetting a half dozen more) all make is easier to produce reusable code. Just my 2 cents and maybe it is because I am coming from a solid C++ background but I find C# takes the best of both Java and C++, leaves behind the things I hate the most with both, throws in a massive framework (stop reinventing the wheel) and some completely new stuff.

Last edited by DeathAndTaxes; 08-24-2011 at 07:04 PM.
DeathAndTaxes is offline   Reply With Quote
Old 08-24-2011, 07:10 PM   #1272
Gullanian
Carpal \'Tunnel
 
Gullanian's Avatar
 
Join Date: Dec 2006
Location: London
Posts: 14,008
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

Inga,

It's good you want to learn! A great thing to start on, and this is crucial to learning things like this is Normalisation. It's a concept which I think is good to start on. I'd spend a lot of time studying this single concept if I was serious about learning this sort of thing.

Tom
Gullanian is offline   Reply With Quote
Old 08-24-2011, 11:18 PM   #1273
greg nice
Carpal \'Tunnel
 
greg nice's Avatar
 
Join Date: Aug 2004
Posts: 9,356
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

how are you comparing a 17" laptop with the Air?
greg nice is offline   Reply With Quote
Old 08-25-2011, 03:15 AM   #1274
Ankimo
old hand
 
Join Date: Dec 2010
Location: Somewhere over the rainbow
Posts: 1,953
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

The weight and form factor IS a spec. So please don't be comparing the MBA to some +5lb notebook that's cheaper and more powerful.

It maybe not be suitable for your needs but for many road warriors, it's a god send and well worth the money.
Ankimo is offline   Reply With Quote
Old 08-25-2011, 04:13 AM   #1275
goofyballer
 
goofyballer's Avatar
 
Join Date: Jun 2005
Posts: 62,498
Re: ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

I have a behemoth of a 17" Dell laptop from like 2005 (posting on it right now!) and I would trade it for a MacBook over my dead body
goofyballer is offline   Reply With Quote

Reply
      

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off


Forum Jump


All times are GMT -4. The time now is 11:55 PM.


Powered by vBulletin®
Copyright ©2000 - 2018, Jelsoft Enterprises Ltd.
Copyright © 2008-2017, Two Plus Two Interactive
 
 
Poker Players - Streaming Live Online