• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 10:02
CEST 16:02
KST 23:02
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
RSL Season 1 - Final Week6[ASL19] Finals Recap: Standing Tall12HomeStory Cup 27 - Info & Preview18Classic wins Code S Season 2 (2025)16Code S RO4 & Finals Preview: herO, Rogue, Classic, GuMiho0
Community News
Esports World Cup 2025 - Brackets Revealed10Weekly Cups (July 7-13): Classic continues to roll4Team TLMC #5 - Submission extension3Firefly given lifetime ban by ESIC following match-fixing investigation17$25,000 Streamerzone StarCraft Pro Series announced7
StarCraft 2
General
The GOAT ranking of GOAT rankings RSL Revival patreon money discussion thread Who will win EWC 2025? Weekly Cups (July 7-13): Classic continues to roll Esports World Cup 2025 - Brackets Revealed
Tourneys
RSL: Revival, a new crowdfunded tournament series FEL Cracov 2025 (July 27) - $8000 live event $5,100+ SEL Season 2 Championship (SC: Evo) WardiTV Mondays Sparkling Tuna Cup - Weekly Open Tournament
Strategy
How did i lose this ZvP, whats the proper response Simple Questions Simple Answers
Custom Maps
External Content
Mutation # 482 Wheel of Misfortune Mutation # 481 Fear and Lava Mutation # 480 Moths to the Flame Mutation # 479 Worn Out Welcome
Brood War
General
Flash Announces (and Retracts) Hiatus From ASL BW General Discussion BGH Auto Balance -> http://bghmmr.eu/ Starcraft in widescreen A cwal.gg Extension - Easily keep track of anyone
Tourneys
[Megathread] Daily Proleagues Cosmonarchy Pro Showmatches CSL Xiamen International Invitational [BSL20] Non-Korean Championship 4x BSL + 4x China
Strategy
Simple Questions, Simple Answers I am doing this better than progamers do.
Other Games
General Games
Path of Exile Nintendo Switch Thread Stormgate/Frost Giant Megathread CCLP - Command & Conquer League Project The PlayStation 5
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Heroes of StarCraft mini-set
TL Mafia
TL Mafia Community Thread Vanilla Mini Mafia
Community
General
US Politics Mega-thread Future of Porn Russo-Ukrainian War Thread Stop Killing Games - European Citizens Initiative Summer Games Done Quick 2025!
Fan Clubs
SKT1 Classic Fan Club! Maru Fan Club
Media & Entertainment
[Manga] One Piece Movie Discussion! Anime Discussion Thread [\m/] Heavy Metal Thread
Sports
Formula 1 Discussion TeamLiquid Health and Fitness Initiative For 2023 2024 - 2025 Football Thread NBA General Discussion NHL Playoffs 2024
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread
TL Community
The Automated Ban List
Blogs
Men Take Risks, Women Win Ga…
TrAiDoS
momentary artworks from des…
tankgirl
from making sc maps to makin…
Husyelt
StarCraft improvement
iopq
Trip to the Zoo
micronesia
Customize Sidebar...

Website Feedback

Closed Threads



Active: 623 users

The Big Programming Thread - Page 579

Forum Index > General Forum
Post a Reply
Prev 1 577 578 579 580 581 1031 Next
Thread Rules
1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution.
2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20)
3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible.
4. Use [code] tags to format code blocks.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
February 05 2015 22:23 GMT
#11561
On February 06 2015 07:02 obesechicken13 wrote:
Setting:
I had an interview question yesterday in C#, for .net

The guy asked me to fill in pseudocode for a login.

My Answer:
I just verified the password, then you had to make an update and an insert. At first I didn't get what was so special about the question, but he hinted that maybe one of the queries would fail. So like with a banking transfer, you'd want to make sure either both queries (withdrawl from your account, deposit to another account) worked or that neither did.
How would I handle that?

I eventually answered rollbacks, but I had never used transactions with sql querieis so I didn't mention anything about transactions but he still seemed to be like "alright, at least he knows to use rollbacks".

Is there a better way?
Do you need try catch exception handling or is there a better way to check if queries don't work properly?

The database type would be MSSQL but I doubt it'd matter.


This property is called "atomicity" and is part of ACID: http://en.wikipedia.org/wiki/ACID#Atomicity

Here is a good example: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction.commit(v=vs.110).aspx

You commit a transaction when no error occurs.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2015-02-05 22:27:52
February 05 2015 22:25 GMT
#11562
On February 06 2015 07:15 bangsholt wrote:
First query... Well, that's binary, in the sense that you're comparing a username and a hash to a username and a hash. If that fails, you don't log the user in.

Second and third query you wrap in a transaction, which you would do with the SqlTransaction class in C# + MSSQL - then when you commit - i.e. you've reached the point where you want to know if everything is consistent or not, then you do a try catch on that - and if the commits fails, you rollback and tell the user it didn't go as expected.

Thanks.

Followup question:
A transaction cannot be rolled back after a COMMIT TRANSACTION statement is executed, except when the COMMIT TRANSACTION is associated with a nested transaction that is contained within the transaction being rolled back. In this instance, the nested transaction will also be rolled back, even if you have issued a COMMIT TRANSACTION for it.

https://msdn.microsoft.com/en-us/library/ms181299.aspx

I understand there's all this theory as to what changes can be rolled back based on atomicity.
But why does microsoft say that the rollback can't be done if the commit is executed? Does a failed commit not execute?
edit: nvm

On February 06 2015 07:23 darkness wrote:
Show nested quote +
On February 06 2015 07:02 obesechicken13 wrote:
Setting:
I had an interview question yesterday in C#, for .net

The guy asked me to fill in pseudocode for a login.

My Answer:
I just verified the password, then you had to make an update and an insert. At first I didn't get what was so special about the question, but he hinted that maybe one of the queries would fail. So like with a banking transfer, you'd want to make sure either both queries (withdrawl from your account, deposit to another account) worked or that neither did.
How would I handle that?

I eventually answered rollbacks, but I had never used transactions with sql querieis so I didn't mention anything about transactions but he still seemed to be like "alright, at least he knows to use rollbacks".

Is there a better way?
Do you need try catch exception handling or is there a better way to check if queries don't work properly?

The database type would be MSSQL but I doubt it'd matter.


This property is called "atomicity" and is part of ACID: http://en.wikipedia.org/wiki/ACID#Atomicity

Here is a good example: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction.commit(v=vs.110).aspx

You commit a transaction when no error occurs

Thanks
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
February 05 2015 22:28 GMT
#11563
On February 06 2015 07:25 obesechicken13 wrote:
Show nested quote +
On February 06 2015 07:15 bangsholt wrote:
First query... Well, that's binary, in the sense that you're comparing a username and a hash to a username and a hash. If that fails, you don't log the user in.

Second and third query you wrap in a transaction, which you would do with the SqlTransaction class in C# + MSSQL - then when you commit - i.e. you've reached the point where you want to know if everything is consistent or not, then you do a try catch on that - and if the commits fails, you rollback and tell the user it didn't go as expected.

Thanks.

Followup question:
Show nested quote +
A transaction cannot be rolled back after a COMMIT TRANSACTION statement is executed, except when the COMMIT TRANSACTION is associated with a nested transaction that is contained within the transaction being rolled back. In this instance, the nested transaction will also be rolled back, even if you have issued a COMMIT TRANSACTION for it.

https://msdn.microsoft.com/en-us/library/ms181299.aspx

I understand there's all this theory as to what changes can be rolled back based on atomicity.
But why does microsoft say that the rollback can't be done if the commit is executed? Does a failed commit not execute?


And that's the D from ACID I guess:


Durability
Main article: Durability (database systems)

Durability means that once a transaction has been committed, it will remain so, even in the event of power loss, crashes, or errors. In a relational database, for instance, once a group of SQL statements execute, the results need to be stored permanently (even if the database crashes immediately thereafter). To defend against power loss, transactions (or their effects) must be recorded in a non-volatile memory.
Manit0u
Profile Blog Joined August 2004
Poland17249 Posts
Last Edited: 2015-02-06 07:39:47
February 05 2015 22:49 GMT
#11564
And to answer your other question about using try-catch for that: It's pretty widely used. You try-catch the query and use finally for rollbacks and other cleanup, just to make sure you didn't leave any mess in the DB.

Edit: Just make sure you don't call the same methods in the catch and finally blocks. Not sure about C# but in Java you really need to be careful.

Guess what will be returned here?


public class ExceptionTest {
public int returnValue(int x) {
System.out.println("Returning value: " + x);

return x;
}

public int testException() {
try {
throw new Exception();
}
catch (Exception e) {
return returnValue(1);
}
finally {
return returnValue(2);
}
}

public static void main(String args[]) {
System.out.println("Returned value: " + new ExceptionTest().testException());
}
}


+ Show Spoiler [return] +


Returning value: 1
Returning value: 2
Returned value: 2


Note to self: Do not modify anything as a in catch if you have finally in there too because they'll both go off.
Time is precious. Waste it wisely.
nunez
Profile Blog Joined February 2011
Norway4003 Posts
Last Edited: 2015-02-06 00:30:50
February 06 2015 00:30 GMT
#11565
On February 06 2015 05:59 spinesheath wrote:
Show nested quote +
On February 06 2015 05:14 Cynry wrote:
That namespace discussion and the recent one about i++ or ++i makes me wonder if noobs should really bother learning this kind of optimisation, considering we probably still write suboptimal programs anyway. Like today at school, some guy was telling how setting a variable to 0 is slower than using a xor or something. Does any of this really matter, be it right or not, when we still go through any set of variable 3 times more than is needed ? I don't think so, but maybe I'm wrong..

Performance optimizations like that not only don't matter, they are outright bad unless you profiled your application's performance and determined that doing these things actually improves your performance significantly. Hint: typically you'll find some awful algorithm that hogs all the processing power and can't be improved by more than .00001% by using an xor instead of an assignment.

In the case of ++i over i++ it's just a straight up potential improvement with no downsides unless you specifically need the semantics of i++. Both are equally readable.
Whether you should use either of them is another question, but if you use one of them, use ++i.

Performance optimizations at instuction level will usually be done by a moderately intelligent comiler anyways, no need to bother with them.


Let me be clear: Do not attempt to optimize your code for performance unless you actually have a performance problem AND profiled it.


yes, ++i and i++ is a question of semantics. ++i is a reasonable default if that is not a factor.
and for namespaces, they have little to do with performance, you use it for code structure and symbol visibility.
conspired against by a confederacy of dunces.
Ropid
Profile Joined March 2009
Germany3557 Posts
February 06 2015 09:43 GMT
#11566
On February 06 2015 05:09 RoyGBiv_13 wrote:
[...]

Many people use f.lux to dim the screen after sundown, which is an option for helping to avoid high energy light. It takes about an hour after seeing a moderately bright blue or purple light to fully adjust back to clear night vision, so avoid doing anything that requires eyesight immediately after computer usage, such as driving.


Note that f.lux isn't really supposed to dim the screen. Its idea is to shift the color temperature. This technically still dims the screen somewhat, but only because there's no way to do the color change other than cutting something off from the range of the color channels. For example when white (255,255,255) turns into (255,237,217), that change obviously loses some brightness.

The difference in the brightness in a room in the middle of the day compared to the lighting at home at night can be a lot bigger than the brightness that's lost through f.lux. It's currently 10 in the morning where I am. I have a colorimeter here and it can measure ambient light. It measures around 600 lux on the table in front of me. When I close the blinds, it's measuring 80 lux in the same spot, but you can still do everything normally in the room, can still read fine etc.

I have no good idea where I'm going with this train of thought here. Perhaps, when you have a monitor that's set up in a certain way to be good to work at in the middle of the day, and you notice you don't have any problems with your eyes when using it in daytime, the big change you could do to try to fix issues in the evening and night is reducing the monitor's brightness by a serious amount, something that feels ridiculous at first look? The room should probably also never be completely dark so that there's no big difference between the monitor's picture and your surroundings, just like it is in daytime?
"My goal is to replace my soul with coffee and become immortal."
supereddie
Profile Joined March 2011
Netherlands151 Posts
February 06 2015 10:42 GMT
#11567
On February 06 2015 07:23 darkness wrote:
Show nested quote +
On February 06 2015 07:02 obesechicken13 wrote:
Setting:
I had an interview question yesterday in C#, for .net

The guy asked me to fill in pseudocode for a login.

My Answer:
I just verified the password, then you had to make an update and an insert. At first I didn't get what was so special about the question, but he hinted that maybe one of the queries would fail. So like with a banking transfer, you'd want to make sure either both queries (withdrawl from your account, deposit to another account) worked or that neither did.
How would I handle that?

I eventually answered rollbacks, but I had never used transactions with sql querieis so I didn't mention anything about transactions but he still seemed to be like "alright, at least he knows to use rollbacks".

Is there a better way?
Do you need try catch exception handling or is there a better way to check if queries don't work properly?

The database type would be MSSQL but I doubt it'd matter.


This property is called "atomicity" and is part of ACID: http://en.wikipedia.org/wiki/ACID#Atomicity

Here is a good example: https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqltransaction.commit(v=vs.110).aspx

You commit a transaction when no error occurs.

It's better if you wrap stuff in a TransactionScope instead of manually handling it via SqlTransaction. TransactionScope has a lot of improvements and is the recommended way for using transactions in .NET.

Unless you call the .Complete() method, the transaction will be rolled back automatically when the TransactionScope instance is disposed (otherwise it will be completed when disposing) - no need for complex try/catch blocks.

Unfortunately, the default settings for TransactionScope are not the best for SQL Server, and it is recommended to create a small utils to properly create the TransactionScope for use with SQL Server (though this was written in 2010; the default behaviour may have changed by now).

+ Show Spoiler +


private void BlahSomething()
{
using(TransactionScope scope = TransactionUtils.CreateTransactionScope())
{
// do database work, maybe use entity framework
scope.Complete();
}
}

"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
Artesimo
Profile Joined February 2015
Germany546 Posts
February 06 2015 13:45 GMT
#11568
Wooow nailed my programming exam, most likely a 1.0 incoming. Thanks to all you kind people that helped me with my newbie-questions.

On the other hand: may our prof have a edgy stone in his shoe for the rest of his life. He deliberately tried to set us up with the exercise required to get an 4.0. He wanted us to make some sort of ticker that displays a sentence. We did that in one of his lectures, but as always when he shows something/explain something, it got terrible confusing since he always makes lots of errors, typos and so on. Lucky me remembered the system("cls")-command, but a lot got burned by it, especially those who wherent in that exact lecture. "Ticker" might be kind of familiar, but he used the german word "Laufschrift" and I can tell you, most of us will look at you in confusion if you ask them what a "laufschrift" is. You could also tell by the format of the exampaper that it got smushed in there and what usually would be the part for a 4.0 got merged with the 3.0 part. We are now coordinating a complaint. I bet he is "verbeamtet"(which means its effectively impossible to fire him), but at least he shouldnt teach in first semester. Another professor is giving programming lectures for our semester and does a way better job (unfortunately I was unable to attend his lectures because they colided with other lectures of mine), next semester we will have a lot less students and guess who is losing and whos keeping his draft? Yep, shitty old prof that doesnt really care get to keep his and good prof that really teaches stuff loses his draft and they get merged with us.
obesechicken13
Profile Blog Joined July 2008
United States10467 Posts
Last Edited: 2015-02-06 16:08:05
February 06 2015 16:07 GMT
#11569
Happy Korean birthday darkness
I think in our modern age technology has evolved to become more addictive. The things that don't give us pleasure aren't used as much. Work was never meant to be fun, but doing it makes us happier in the long run.
Zocat
Profile Joined April 2010
Germany2229 Posts
February 06 2015 17:42 GMT
#11570
On February 06 2015 22:45 Artesimo wrote:
Wooow nailed my programming exam, most likely a 1.0 incoming. Thanks to all you kind people that helped me with my newbie-questions.


Congrats to that.

Lauftext/Laufschrift is a word you should know as a German. A ticker is something different. A ticker can be implemented as a Lauftext, but it can also just update as a whole. Think Bundesliga-Ticker, where you can always read the whole match and nothing is scrolling.
Overall you should be able to clarify such definitions during an exam.

And if he discussed it in one of his lectures, yes he did try to set you up. For passing.
If it's on a slide it can be part of the exam, if a whole lecture is spent on it, it _will_ be in the exam.
"a lot got burned by it, especially those who wherent in that exact lecture." If people are not in the lecture / don't bother to learn the missed stuff, then it's their fault, not the professor's one.

You have the freedom to miss lectures, you have the responsibility to still know the material.
Cyx.
Profile Joined November 2010
Canada806 Posts
February 06 2015 18:17 GMT
#11571
On February 06 2015 22:45 Artesimo wrote:I bet he is "verbeamtet"(which means its effectively impossible to fire him)


I'm guessing this is the same as English 'tenure'?
Shield
Profile Blog Joined August 2009
Bulgaria4824 Posts
February 06 2015 18:23 GMT
#11572
On February 07 2015 01:07 obesechicken13 wrote:
Happy Korean birthday darkness


Haha, thank you. I didn't expect that!
Artesimo
Profile Joined February 2015
Germany546 Posts
Last Edited: 2015-02-06 19:18:15
February 06 2015 19:11 GMT
#11573
On February 07 2015 02:42 Zocat wrote:
Show nested quote +
On February 06 2015 22:45 Artesimo wrote:
Wooow nailed my programming exam, most likely a 1.0 incoming. Thanks to all you kind people that helped me with my newbie-questions.


Congrats to that.

Lauftext/Laufschrift is a word you should know as a German. A ticker is something different. A ticker can be implemented as a Lauftext, but it can also just update as a whole. Think Bundesliga-Ticker, where you can always read the whole match and nothing is scrolling.
Overall you should be able to clarify such definitions during an exam.

And if he discussed it in one of his lectures, yes he did try to set you up. For passing.
If it's on a slide it can be part of the exam, if a whole lecture is spent on it, it _will_ be in the exam.
"a lot got burned by it, especially those who wherent in that exact lecture." If people are not in the lecture / don't bother to learn the missed stuff, then it's their fault, not the professor's one.

You have the freedom to miss lectures, you have the responsibility to still know the material.


Maybe, ticker is the direct translation, BUT he did not set us up for passing. This laufschrift-thing we did in one of the very early lectures and if you seen him presenting something one time, you realize how small effort he puts into his lectures. Whiel every other part of the test checked some sort of principle/general knowledge like classes, call by value/call by refference etc. this one was just something you can play around with, nothing more and it was totally out of context since the rest of the test belonged together. Also, it didnt really fit into his usal examstyle. I know that I am not a skilled programmer, but a newb and still, that seems pretty clear to me. 2 guys who easilie made the exam are coordinating this complaint about the prof and they showed us the video from a few lectures of the other prof. He writes stuff on the board/explains, his presentation isnt just a straight copy of "c++ primer". Amongst the students our prof is a known problem and we will try to take care that he has to change something.

To be precise, his exams are usually:
4.0 implement a class, its attributes and methods.
3.0 read in a file/implement some inheritage
2.0 let the different values of the classes interact/use static
1.0 overload an operator

This exam:
4.0 the ticker thing
3.0 implement classes (a club with leader and member), read in file with memberlist
2.0 interaction of values/changing values
1.0 overload operator

even if he didnt set us up, he does a pretty poor job in his lectures and its not frustration that is speaking out of me it is the sad truth, especially now that I have seen the lectures of the other prof.
BlueRoyaL
Profile Blog Joined February 2006
United States2493 Posts
February 06 2015 20:36 GMT
#11574
Hey guys, I have a general question about classes.

I've been working on an ASP.NET MVC project and a thought came up while designing my controller. For those of you that don't know, a controller is simply an object that handles incoming HTTP requests via URLs and returns a response.

One of my particular controller actions takes several query parameters, and returns a collection of items that are sorted based off of these parameters. As you could expect, the logic to check all of these and order the collection was pretty lengthy at around 25-30 lines.

I didn't want to bloat my controller class with a bunch of business logic, so I created a separate class called ControllerUtilities that would execute the logic, and return the ordered collection. End result was I was able to get my controller to be much slimmer, replacing the 25-30 lines with 2.

Is this an acceptable use for classes? Is it okay to create a separate "helper/utility" class if the only reason for its existence is to take some chunk of code out of another class to make it slimmer?

Just wanted to get input from you guys as still relatively new to oop best practices. This is something I've done a lot on clientside javascript using modules, but just wasn't sure how it should be handled here.

And also related, do I get any non-trivial performance hits from doing the above? I would assume it would take more memory, and possibly more processing time, to create a new object to perform some logic, as opposed to piling on all the logic into one huge monolithic class.

Thanks!
WHAT'S HAPPENIN
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2015-02-06 21:28:59
February 06 2015 20:51 GMT
#11575
Just make the helper class a private method inside the original class unless you expect that business logic to be used repeatedly by other classes. It's not monolithic if that's all that is required. I would even be hesitant to move it to another function unless it made sense to move it to another function, unlike a "if (x) { doWork; doMoreWork(); }" kinda deal where the benefit is essentially just fewer lines to read and not necessarily much more clarity of intent.
There is no one like you in the universe.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
Last Edited: 2015-02-06 21:16:02
February 06 2015 21:14 GMT
#11576
I'm not a fan of "helper" or "utility" classes, especially if they contain business logic. I consider them ok for things like validation (throw if null or not in range and so on) or other pieces of 2-4 line of code that would otherwise be repeated all over the place.

In your case there probably is a better approach that uses generic sorting functionality, but you'd probably need to transform your current algorithm in a not-trivial way. For example you could try to create a custom comparer (initialized with the query parameters) for your items and sort the collection using that comparer. Ideally that comparer would be completely independent from the original problem. Maybe there are completely different, better approaches.

In general, I only like classes that have a name that describes the class well. "Helper" or "utility" really doesn't say much. Neither does "data" or "information".

In any case, if all you achieved by creating that new class is that you moved the code from one place to another without making the code itself any better, you might as well keep it in its original location. You don't improve anything by clumsily hiding code like that.
If you have a good reason to disagree with the above, please tell me. Thank you.
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
Last Edited: 2015-02-07 00:10:17
February 07 2015 00:10 GMT
#11577
Your controller methods should be very slim. Their only purpose is to connect your view action to your model, and nothing more. While I would agree with spinesheath that simply moving the code from one place to another doesn't really add any value, in this case that's exactly what you want to do since you're using an MVC architecture.

Where then should it go? That depends on how much of it is business logic. Your every day list sort is certainly not business logic, but if you're sorting based on specific constraints it might be. I would try to separate what is pertinent to business logic from what isn't, and put both pieces in places they can be reused.
Manit0u
Profile Blog Joined August 2004
Poland17249 Posts
February 07 2015 02:04 GMT
#11578
There are some basic guidelines when it comes to this stuff (assuming you're using some form of ORM).

If you need a method (no matter how complex) that only needs to do stuff with a single entity (table), you can put this method in the entity class. In case of methods that need to do stuff on multiple tables/rows you can create repositories in your model (you would have say 'User' entity and you could create 'UserRepository') and put your code in there as public methods. If you need more than 5 methods per repository you should think about creating a service though.

Here's a nice article on repositories: http://www.whitewashing.de/2013/03/04/doctrine_repositories.html
Time is precious. Waste it wisely.
sabas123
Profile Blog Joined December 2010
Netherlands3122 Posts
February 07 2015 15:35 GMT
#11579
For next semester I like a 90% chance I pick my own project.

So far I only decided that I want to do something in C. any suggestions?
The harder it becomes, the more you should focus on the basics.
Incognoto
Profile Blog Joined May 2010
France10239 Posts
February 07 2015 16:05 GMT
#11580
so i'm kind of bored and decided to dick around with some c++. careful, i'm like the noobiest person to ever enter the url to this thread

i downloaded visual c++ 2010 express and started dicking around in that program. just adding integers and showing the result in a window

we did a little programming in VBA at university (that's what we'll mostly due) and i decided to mess around with c++ since i have very, very basic understanding of how to write very, very basic programs

my question is, what good is c++ for? could i write a program, which i would execute, and have it ask me for 3 numbers, which would then be assigned to a ax² + bx + c = 0 style equation, which the program would then solve? i'm guessing that yes, i would. i would call it "polynomialesforidiots.exe" for example

what else could i do?



tl;dr, what real world applications does c++ have?
maru lover forever
Prev 1 577 578 579 580 581 1031 Next
Please log in or register to reply.
Live Events Refresh
Next event in 1h 58m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Vindicta 226
StarCraft: Brood War
Britney 43700
Rain 6184
EffOrt 1564
BeSt 1244
Larva 604
firebathero 471
Stork 404
Mini 318
PianO 247
Rush 216
[ Show more ]
Light 205
Mind 155
Pusan 72
Aegong 67
GoRush 67
sSak 54
JulyZerg 54
Movie 53
sas.Sziky 45
Noble 37
Shinee 36
yabsab 26
scan(afreeca) 16
SilentControl 10
Shine 8
Bale 5
ivOry 3
Dota 2
qojqva3798
XcaliburYe294
Fuzer 210
canceldota121
League of Legends
Dendi1494
Counter-Strike
sgares646
byalli359
Super Smash Bros
Mew2King96
amsayoshi42
Other Games
B2W.Neo2479
singsing2029
DeMusliM464
crisheroes404
Lowko401
ArmadaUGS78
markeloff59
Pyrionflax49
QueenE46
Trikslyr29
ToD12
Organizations
Other Games
gamesdonequick3822
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 13 non-featured ]
StarCraft 2
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• C_a_k_e 1021
League of Legends
• Nemesis2381
• Jankos1295
Upcoming Events
WardiTV European League
1h 58m
ShoWTimE vs sebesdes
Percival vs NightPhoenix
Shameless vs Nicoract
Krystianer vs Scarlett
ByuN vs uThermal
Harstem vs HeRoMaRinE
PiGosaur Monday
9h 58m
uThermal 2v2 Circuit
1d 1h
Replay Cast
1d 9h
The PondCast
1d 19h
WardiTV European League
2 days
Replay Cast
2 days
Epic.LAN
2 days
CranKy Ducklings
3 days
Epic.LAN
3 days
[ Show More ]
CSO Contender
4 days
BSL20 Non-Korean Champi…
4 days
Bonyth vs Sziky
Dewalt vs Hawk
Hawk vs QiaoGege
Sziky vs Dewalt
Mihu vs Bonyth
Zhanhun vs QiaoGege
QiaoGege vs Fengzi
Sparkling Tuna Cup
4 days
Online Event
5 days
BSL20 Non-Korean Champi…
5 days
Bonyth vs Zhanhun
Dewalt vs Mihu
Hawk vs Sziky
Sziky vs QiaoGege
Mihu vs Hawk
Zhanhun vs Dewalt
Fengzi vs Bonyth
Esports World Cup
6 days
ByuN vs Astrea
Lambo vs HeRoMaRinE
Clem vs TBD
Solar vs Zoun
SHIN vs Reynor
Maru vs TriGGeR
herO vs Lancer
Cure vs ShoWTimE
Liquipedia Results

Completed

2025 ACS Season 2: Qualifier
RSL Revival: Season 1
Murky Cup #2

Ongoing

JPL Season 2
BSL 2v2 Season 3
CSL 17: 2025 SUMMER
Copa Latinoamericana 4
Jiahua Invitational
BSL20 Non-Korean Championship
Championship of Russia 2025
FISSURE Playground #1
BLAST.tv Austin Major 2025
ESL Impact League Season 7
IEM Dallas 2025
PGL Astana 2025
Asian Champions League '25
BLAST Rivals Spring 2025
MESA Nomadic Masters

Upcoming

CSL Xiamen Invitational
CSL Xiamen Invitational: ShowMatche
2025 ACS Season 2
CSLPRO Last Chance 2025
CSLPRO Chat StarLAN 3
BSL Season 21
K-Championship
RSL Revival: Season 2
SEL Season 2 Championship
uThermal 2v2 Main Event
FEL Cracov 2025
Esports World Cup 2025
Underdog Cup #2
ESL Pro League S22
StarSeries Fall 2025
FISSURE Playground #2
BLAST Open Fall 2025
BLAST Open Fall Qual
Esports World Cup 2025
BLAST Bounty Fall 2025
BLAST Bounty Fall Qual
IEM Cologne 2025
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2025 TLnet. All Rights Reserved.