• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EDT 18:06
CEST 00:06
KST 07:06
  • 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
Serral wins HomeStory Cup 2914Serral wins Maestros of the Game 243ByuL, and the Limitations of Standard Play3Team Liquid Map Contest #22: Results and Winners7Code S Season 2 (2026): RO4 and Finals Preview12
Community News
IntoTheTV X SOOP SC2 League : Weekly & Monthly4Clem: "I don't have that much hope in Blizzard"2ZeroSpace Early Access is Now Live!26Weekly Cups (July 13-19): Terran & Protoss rise; Zerg falters2Balance hotfix patch 5.0.16b (July 16)90
StarCraft 2
General
Reynor: GSL Loss Wasn't About Preparation Format What's the best tug of war? Balance hotfix patch 5.0.16b (July 16) How would you feel about frequent/monthly balance patches for SC2? Clem: "I don't have that much hope in Blizzard"
Tourneys
RSL Revival: Season 6 - Qualifiers and Main Event PIG STY FESTIVAL 8.0! (13 - 23 August) IntoTheTV X SOOP SC2 League : Weekly & Monthly INu's Battles#18 - Cure, herO, Rogue & ByuN Master Swan Open (Global Bronze-Master 2)
Strategy
[G] Having the right mentality to improve
Custom Maps
[M] (2) Industrial Park New Map Maker - Looking for Advice - Love or Hate
External Content
Mutation # 535 Assembly of Vengeance The PondCast: SC2 News & Results Mutation # 534 Burning Evacuation Mutation # 533 Die Together
Brood War
General
BGH Auto Balance -> http://bghmmr.eu/ BW General Discussion Recent recommended BW games screpdb: new Starcraft reporting tool ASL22 General Discussion
Tourneys
Star Con San Diego 2026 BSL LAN Party - Kraków 29-30 August - OPEN SIGNUPS [Megathread] Daily Proleagues Escore Tournament - Season 3
Strategy
Simple Questions, Simple Answers PvT advise for noobs Fighting Spirit mining rates Creating a full chart of Zerg builds
Other Games
General Games
General RTS Discussion Thread Nintendo Switch Thread Path of Exile ZeroSpace Early Access is Now Live! Diablo IV
Dota 2
Looking for a Dota Mentor Official 'what is Dota anymore' discussion
League of Legends
TSM pausing esports and CLG Dead
Heroes of the Storm
Heroes of the Storm 2.0
Hearthstone
Deck construction bug
TL Mafia
TL Mafia Power Rank TL Mafia Community Thread NeO.D_StephenKing vs This Guy From 1 Million Dance Vanilla Mini Mafia
Community
General
European Politico-economics QA Mega-thread Artificial Intelligence Thread US Politics Mega-thread Russo-Ukrainian War Thread How to buy a book - shipping from Korea to Europe
Fan Clubs
The IdrA Fan Club The HerO Fan Club!
Media & Entertainment
Movie Discussion! Anime Discussion Thread Series you have seen recently... [Req][Books] Good Fantasy/SciFi books
Sports
2024 - 2026 Football Thread 2026-27 Football Thread placeholder TeamLiquid Health and Fitness Initiative For 2023 Formula 1 Discussion MLB/Baseball 2023
World Cup 2022
Tech Support
Computer Build, Upgrade & Buying Resource Thread Simple Questions Simple Answers FPS when play League Of Legend on laptop
TL Community
Northern Ireland Global Starcraft The Automated Ban List
Blogs
How Games can Help with Majo…
TrAiDoS
Hello guys!
LIN1s
ASL S22 English Commentary…
namkraft
Poker (part 2)
Nebuchad
An Exploration of th…
waywardstrategy
Customize Sidebar...

Website Feedback

Closed Threads



Active: 7362 users

The Big Programming Thread - Page 501

Forum Index > General Forum
Post a Reply
Prev 1 499 500 501 502 503 1032 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.
Manit0u
Profile Blog Joined August 2004
Poland17800 Posts
Last Edited: 2014-07-20 07:39:40
July 20 2014 07:04 GMT
#10001
On July 20 2014 06:10 berated- wrote:
Show nested quote +
On July 20 2014 04:48 Manit0u wrote:
On July 20 2014 00:45 berated- wrote:
On July 19 2014 23:39 Manit0u wrote:
On July 16 2014 05:46 sob3k wrote:
I' trying to make a MEGA basic contact form that mails an address with the info from a form. I've been using PHP.

Here is the form. Is this ok? Anything I need or don't need here?

<form action="jmailscript.php" method="post">
Name:<br /> <input type="text" placeholder="Name" name="name"><br>
Email:<br /> <input type="text" placeholder="Email" name="email"><br>
Phone:<br /> <input type="text" placeholder="Phone" name="phone"><br>
Property Address:<br /> <input type="text" placeholder="Property Address" name="address"><br>
Property City:<br /> <input type="text" placeholder="Property City" name="city"><br>
Property State:<br /> <input type="text" placeholder="Property State" name="state"><br>
Property Zip:<br /> <input type="text" placeholder="Property Zip" name="zip"><br><br>

<button type="submit" name="submit" value="Submit" class="button" data-type="text" id="submit-btn">Submit</button>
</form>


How would I make a super unsafe simple PHP script to mail an address this info when submit is pressed? I've tried several copy pastes with various levels of complexity and I can't get it to work. I understand very basic PHP syntax and the functions used but I'm clearly not understanding the scripts fully. Also I just learned that apparently you just cannot test mail() on a local server such as Xampp (this could explain some of my failures)? If I just upload it to my domain will that work?

I just want someone to ask a few pointed questions about what certain things are doing.

EDIT: OMFG I did it. very simple when I figured it out

this is my script:

<?php
$name = $_POST['name'];
$email = $_POST['email'];
$phone = $_POST['phone'];
$address = $_POST['address'];
$city = $_POST['city'];
$state = $_POST['state'];
$zip = $_POST['zip'];
$from = 'From: My Site';
$to = 'myemail@gmail.com';
$subject = 'Property Information';

$body = "From: $name\n E-Mail: $email\n Phone: $phone\n Address: $address\n City: $city\n State: $state\n ZIP: $zip";

if ($_POST['submit'] {
mail($to, $subject, $body, $from);
echo "Submission Accepted!";
}

?>


Follow up, how would I adjust things to include the script on the form page you it doesn't take you away from the form?


Why are you doing this in pure PHP? If you want pretty bare-bones PHP then go with PHP MVC microframework. Select the advanced version which will give you access to awesome Twig templating engine and Sass for easier styling. And do your forms this way, much easier and you can simply put your script in the controller: http://symfony.com/doc/current/book/forms.html


Generally we need to walk before we run. I'm thinking someone that just figured out a mailto might be a tad overwhelmed with phpmvc and sass.


HTML and CSS you can grasp on a basic level in an hour. PHP MVC you can get the gist of in about 30 minutes (the entire "tutorial" for it consists of just 5 images and explains pretty much everything you should know). It's much better to get into MVC environment early on, as well as more advanced CSS wrappers (like sass or less) and templating engines. It not only prepares you for more advanced stuff (like jumping to a full-stack framework, regardless of programming language) but also makes it way more enjoyable in the beginning since it turns some of the boring stuff that requires a lot of simple code into more managable and easier to write/read/understand parts.

With PHP I think that you don't get much out of learning pure-PHP. I'm now working as a PHP programmer and I can tell you that practically no one ever uses pure PHP or even PHP code in the views. That's why I suggested php-mvc to him, it's easy to get into since there isn't much of the overhead and it'll let you learn the basic principles behind pretty much every single web project and framework. Sure, I could suggest something like Laravel, where you can have a full app running in 15 minutes and 3 lines of code, but that would be detrimental for someone just learning the ropes. The sooner you start learning the proper way of doing things the better and if you can actually use tools that provide an additional layer of abstraction it's even better because it lets you think more on "what I want" rather than "how do I need to do it". Expressiveness is very important.


Yeah -- I probably should have just left it alone. We all learn at different rates. I often find that the people I have worked with have jumped too quickly into a web framework and then miss the base understanding of how request/response/sessions work. They understand the framework but then when they need to modify something about how it might work then there is no idea of even where to start.

How long did it take you to get to the point where you no longer use base php?


About 2 months or so. I can hardly imagine working on a web project without ORM and all the other cool things. It's just way more convenient when you get an extra abstraction layers and tools that speed things up and make it more human-readable.

The hardest thing to grasp in PHP right now is how much it has changed recently. Most online tutorials usually don't have the newest stuff in them. The inclusion of namespaces, traits and lambda expressions was the biggest thing, but there were a lot of other novelties added. Most frameworks also don't incorporate all the changes. That's where plain PHP has an advantage, you get to learn and use the newest toys (although frameworks are slowly catching up).
Time is precious. Waste it wisely.
tofucake
Profile Blog Joined October 2009
Hyrule19230 Posts
July 20 2014 13:42 GMT
#10002
Most web hosts don't have the newest version at release though. I couldn't play with lambdas on my host for a few months (but having your own servers helps in that regard). Raw PHP is also used a lot when working with legacy code. Being dependent on a framework can hurt you. And I think people should learn how to do all that silly tedious stuff before they jump to something that does it for them so that they know what's going on under the hood.
Liquipediaasante sana squash banana
Manit0u
Profile Blog Joined August 2004
Poland17800 Posts
Last Edited: 2014-07-20 18:56:23
July 20 2014 18:50 GMT
#10003
On July 20 2014 22:42 tofucake wrote:
Most web hosts don't have the newest version at release though. I couldn't play with lambdas on my host for a few months (but having your own servers helps in that regard). Raw PHP is also used a lot when working with legacy code. Being dependent on a framework can hurt you. And I think people should learn how to do all that silly tedious stuff before they jump to something that does it for them so that they know what's going on under the hood.


I mentioned that. That's also why I suggested php-mvc. It's raw PHP just using the MVC pattern, which you want to learn anyway regardless of what language or framework you plan on working with. The advanced version adds only Twig and Sass to the mix so you're still doing your entire backend in plain PHP but get extra tools for your views which is nice. Especially that both Twig and Sass aren't that separated from what they wrap around (PHP and CSS), you still get to do the exact same thing but with more expressiveness allowing you to save a lot of time.

Example:

PHP

<?php echo $var ?>
<?php echo htmlspecialchars($var, ENT_QUOTES, 'UTF-8') ?>


Twig

{{ var }}
{{ var|escape }}


and it also let's you do amazing stuff with loops


{% for user in users %}
{% if loop.revindex == 2 %}
Almost there! {{ user.name }}
{% elseif loop.last %}
Last listed user: {{ user.name|upper }}
{% else %}
{{ loop.index }}&emdash;{{ user.name }}
{% endif %}
{% else %}
No users have been found.
{% endfor %}


And for the styling:

CSS

#main {
width: 97%;
}

#main p, #main div {
font-size: 2em;
}

#main p a, #main div a {
font-weight: bold;
}

#main pre {
font-size: 3em;
}


SASS

#main {
width: 97%;

p, div {
font-size: 2em;

a {
font-weight: bold;
}
}

pre {
font-size: 3em;
}
}


I can't speak for others, but for me discovering such tools was a life-changing experience.
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-07-21 07:42:25
July 21 2014 07:18 GMT
#10004
Is there any way (at least in C#) to create an interface that with implemented methods (that may or may not provide virtual-like? that can be called from the "interface")?

if it isnt clear, this is kinda what i mean

http://stackoverflow.com/questions/20279843/interface-implementation-and-common-function

you can have an abstract class implement the interface and implement the concrete class, but the problem is then i want my concrete to derive from another abstract/concrete class (like delegates in obj-c?)
There is no one like you in the universe.
MelChizm
Profile Joined November 2010
Netherlands15 Posts
July 21 2014 10:14 GMT
#10005
What is the most the most efficient way in R to get values from a table. By which I mean I have a list of ID's, I have a table in which there is one column with each ID exactly once, and one column with the number that belongs to the ID. So now I want in my big list, with multiple occurences of the ID's, I want to add after each occurence the number from the table.

I use now lapply on the ID's and a function that indexes on the ID and returns the number, but I have the feeling this lapply function is not so efficient, it takes a long time to compute. Does somebody know a more efficient method?

dummy data:
ID
1
1
2
1
2
3
...

table
ID Number
1 384835
2 435393
3 239493
...
Manit0u
Profile Blog Joined August 2004
Poland17800 Posts
July 21 2014 12:08 GMT
#10006
On July 21 2014 16:18 Blisse wrote:
Is there any way (at least in C#) to create an interface that with implemented methods (that may or may not provide virtual-like? that can be called from the "interface")?

if it isnt clear, this is kinda what i mean

http://stackoverflow.com/questions/20279843/interface-implementation-and-common-function

you can have an abstract class implement the interface and implement the concrete class, but the problem is then i want my concrete to derive from another abstract/concrete class (like delegates in obj-c?)


Something like that?

http://msdn.microsoft.com/en-us/library/ms173171.aspx
Time is precious. Waste it wisely.
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2014-07-21 12:16:22
July 21 2014 12:13 GMT
#10007
time to read documentation

CURSES. I HAVE TO LEARN.

was hoping there was something that existed that i just couldnt recall

i actually hate microsoft documentation after i've been spoiled by android docs. so jelly.
There is no one like you in the universe.
spinesheath
Profile Blog Joined June 2009
Germany8679 Posts
July 21 2014 17:08 GMT
#10008
Wait what, were you not trying to do multiple inheritance? Which would not really be possible in C#, but chances are you could use composition (put the common method into a class that is not part of the inheritance hierarchy, but used by both classes).
If you have a good reason to disagree with the above, please tell me. Thank you.
PandaCore
Profile Blog Joined September 2010
Germany553 Posts
July 22 2014 19:40 GMT
#10009
So lately I'm having this idea of wanting to make a simple 2D jump & run game, but no clue where to start. Could someone please point me in the right direction? What's the best practice if you want to approach something like this?

I'm an application developer for 11 years now and have very good knowledge about a lot of programming languages (mostly C and C++ though), but I don't have the slightest clue about things like OpenGL or if there are any (free?) good 2D engines out there already.

A while ago I played around with the XNA framework, but that's about it. Pretty much lost on choosing the best way to start.
I has a flavor
mcc
Profile Joined October 2010
Czech Republic4646 Posts
Last Edited: 2014-07-22 19:49:47
July 22 2014 19:48 GMT
#10010
On July 21 2014 16:18 Blisse wrote:
Is there any way (at least in C#) to create an interface that with implemented methods (that may or may not provide virtual-like? that can be called from the "interface")?

if it isnt clear, this is kinda what i mean

http://stackoverflow.com/questions/20279843/interface-implementation-and-common-function

you can have an abstract class implement the interface and implement the concrete class, but the problem is then i want my concrete to derive from another abstract/concrete class (like delegates in obj-c?)

Either you give up on inheritance in one of those cases and instead use composition, or you can possibly have extension method over the interface, but only if many special conditions about the nature of that "common functionality" are satisfied. But in general the answer is no. Sometimes it would be useful, but most such cases can be solved by going different route and introducing only slight "ugliness". If you have more details about the exact requirements it might be possible to make this general answer somewhat more specific.
Manit0u
Profile Blog Joined August 2004
Poland17800 Posts
July 22 2014 23:32 GMT
#10011
On July 23 2014 04:40 PandaCore wrote:
So lately I'm having this idea of wanting to make a simple 2D jump & run game, but no clue where to start. Could someone please point me in the right direction? What's the best practice if you want to approach something like this?

I'm an application developer for 11 years now and have very good knowledge about a lot of programming languages (mostly C and C++ though), but I don't have the slightest clue about things like OpenGL or if there are any (free?) good 2D engines out there already.

A while ago I played around with the XNA framework, but that's about it. Pretty much lost on choosing the best way to start.


http://www.libsdl.org/
Time is precious. Waste it wisely.
Nesserev
Profile Blog Joined January 2011
Belgium2760 Posts
Last Edited: 2014-07-23 01:11:09
July 23 2014 01:10 GMT
#10012
--- Nuked ---
bakesale
Profile Blog Joined August 2008
United States187 Posts
July 23 2014 01:22 GMT
#10013
On July 21 2014 19:14 MelChizm wrote:
What is the most the most efficient way in R to get values from a table. By which I mean I have a list of ID's, I have a table in which there is one column with each ID exactly once, and one column with the number that belongs to the ID. So now I want in my big list, with multiple occurences of the ID's, I want to add after each occurence the number from the table.

I use now lapply on the ID's and a function that indexes on the ID and returns the number, but I have the feeling this lapply function is not so efficient, it takes a long time to compute. Does somebody know a more efficient method?

dummy data:
ID
1
1
2
1
2
3
...

table
ID Number
1 384835
2 435393
3 239493
...

Can you clarify what the goal is? I think from what you've said, and using that sample data, that the output would be:

ID Number
1 384835
1 384835
2 435393
1 384835
2 435393
3 239493

Is that correct?
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 23 2014 03:01 GMT
#10014
On July 22 2014 02:08 spinesheath wrote:
Wait what, were you not trying to do multiple inheritance? Which would not really be possible in C#, but chances are you could use composition (put the common method into a class that is not part of the inheritance hierarchy, but used by both classes).


I don't believe composition is the idea I want here because it doesn't make sense in terms of modelling the system. I'll explain below.

On July 23 2014 04:48 mcc wrote:
Show nested quote +
On July 21 2014 16:18 Blisse wrote:
Is there any way (at least in C#) to create an interface that with implemented methods (that may or may not provide virtual-like? that can be called from the "interface")?

if it isnt clear, this is kinda what i mean

http://stackoverflow.com/questions/20279843/interface-implementation-and-common-function

you can have an abstract class implement the interface and implement the concrete class, but the problem is then i want my concrete to derive from another abstract/concrete class (like delegates in obj-c?)

Either you give up on inheritance in one of those cases and instead use composition, or you can possibly have extension method over the interface, but only if many special conditions about the nature of that "common functionality" are satisfied. But in general the answer is no. Sometimes it would be useful, but most such cases can be solved by going different route and introducing only slight "ugliness". If you have more details about the exact requirements it might be possible to make this general answer somewhat more specific.


The extension method seems to work, but that's a bit unclean in my eyes.

What I want to build is a generic logging extension for classes, so that other classes can subscribe to the output of the logs. The problem I have then is that I want the functionality of the logging extension to the encapsulated in the logging class, but interfaces don't allow me to do that. In my derived class, I want to call methods on the logging extension, so the subscribing classes receive output.

If I did it via composition, it would look like this, create an ILogger interface with a GetLogger property to get a logger class. To subscribe to the event I cast the derived type to the ILogger, then subscribe to a handler from the GetLogger, and to raise a log I call a method from GetLogger.

My main problem with this method that all my derived classes have to have a Logger member object that is never used, whereas I just want to be able to call the inherited ILogger class. Is that clean? Because I feel like there's another way of approaching the problem.

At this point in time I'm more interested in cleanliness than getting it done.
There is no one like you in the universe.
PandaCore
Profile Blog Joined September 2010
Germany553 Posts
July 23 2014 07:09 GMT
#10015
On July 23 2014 08:32 Manit0u wrote:
+ Show Spoiler +
On July 23 2014 04:40 PandaCore wrote:
So lately I'm having this idea of wanting to make a simple 2D jump & run game, but no clue where to start. Could someone please point me in the right direction? What's the best practice if you want to approach something like this?

I'm an application developer for 11 years now and have very good knowledge about a lot of programming languages (mostly C and C++ though), but I don't have the slightest clue about things like OpenGL or if there are any (free?) good 2D engines out there already.

A while ago I played around with the XNA framework, but that's about it. Pretty much lost on choosing the best way to start.


http://www.libsdl.org/


On July 23 2014 10:10 Nesserev wrote:
You could also go for SFML (http://www.sfml-dev.org/), and get a copy of this book (through any means necessary) to guide you through the process of writing a 2D game: SFML Game Development

Actually, the game that's 'developed' in this book, is a 2D vertical scroller airplane game, so it handles everything that you need to know to make a solid 2D jump & run game.

Thanks, both suggestions look quite promising. I'll check them out in detail when I get home.
I has a flavor
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
July 23 2014 08:46 GMT
#10016
http://blog.ploeh.dk/2010/02/03/ServiceLocatorisanAnti-Pattern/

I'm a bit confused as to what this guy is saying. The only thing that holds weight in my eyes is that your services are dependent on a service locator implementation and he doesn't even mention that. Do you guys understand/agree?
There is no one like you in the universe.
netherh
Profile Blog Joined November 2011
United Kingdom333 Posts
Last Edited: 2014-07-23 13:43:09
July 23 2014 13:42 GMT
#10017
On July 23 2014 12:01 Blisse wrote:
What I want to build is a generic logging extension for classes, so that other classes can subscribe to the output of the logs. The problem I have then is that I want the functionality of the logging extension to the encapsulated in the logging class, but interfaces don't allow me to do that. In my derived class, I want to call methods on the logging extension, so the subscribing classes receive output.

If I did it via composition, it would look like this, create an ILogger interface with a GetLogger property to get a logger class. To subscribe to the event I cast the derived type to the ILogger, then subscribe to a handler from the GetLogger, and to raise a log I call a method from GetLogger.

My main problem with this method that all my derived classes have to have a Logger member object that is never used, whereas I just want to be able to call the inherited ILogger class. Is that clean? Because I feel like there's another way of approaching the problem.

At this point in time I'm more interested in cleanliness than getting it done.


As far as getting your logger class to the objects that need it, I think it boils down to either passing the logger around (probably as an argument to a constructor), or using a global variable (i.e. some sort of singleton / service provider).

I'm not sure inheritance is useful here. Do you need various different kinds of log for some reason?
MelChizm
Profile Joined November 2010
Netherlands15 Posts
July 23 2014 14:57 GMT
#10018
On July 23 2014 10:22 bakesale wrote:
Show nested quote +
On July 21 2014 19:14 MelChizm wrote:
What is the most the most efficient way in R to get values from a table. By which I mean I have a list of ID's, I have a table in which there is one column with each ID exactly once, and one column with the number that belongs to the ID. So now I want in my big list, with multiple occurences of the ID's, I want to add after each occurence the number from the table.

I use now lapply on the ID's and a function that indexes on the ID and returns the number, but I have the feeling this lapply function is not so efficient, it takes a long time to compute. Does somebody know a more efficient method?

dummy data:
ID
1
1
2
1
2
3
...

table
ID Number
1 384835
2 435393
3 239493
...

Can you clarify what the goal is? I think from what you've said, and using that sample data, that the output would be:

ID Number
1 384835
1 384835
2 435393
1 384835
2 435393
3 239493

Is that correct?


Yes Exactly, that is the result I am looking for.
supereddie
Profile Joined March 2011
Netherlands151 Posts
Last Edited: 2014-07-23 15:37:37
July 23 2014 15:37 GMT
#10019
On July 23 2014 12:01 Blisse wrote:
What I want to build is a generic logging extension for classes, so that other classes can subscribe to the output of the logs. The problem I have then is that I want the functionality of the logging extension to the encapsulated in the logging class, but interfaces don't allow me to do that. In my derived class, I want to call methods on the logging extension, so the subscribing classes receive output.

If I did it via composition, it would look like this, create an ILogger interface with a GetLogger property to get a logger class. To subscribe to the event I cast the derived type to the ILogger, then subscribe to a handler from the GetLogger, and to raise a log I call a method from GetLogger.

My main problem with this method that all my derived classes have to have a Logger member object that is never used, whereas I just want to be able to call the inherited ILogger class. Is that clean? Because I feel like there's another way of approaching the problem.

At this point in time I'm more interested in cleanliness than getting it done.

I think you need to split up the functionality: classes for receiving (and processing) the logging information, and classes that use the logging for writing.

Then you can maybe use something like custom attributes. Mark the classes/methods that need to receive the logging with a custom attribute, and have your logger class use reflection to find those classes/methods.
"Do not try to make difficult things possible, but make simple things simple." - David Platt on Software Design
Manit0u
Profile Blog Joined August 2004
Poland17800 Posts
July 23 2014 15:51 GMT
#10020
Wouldn't it be better to simply create a logging interface and implement it where necessary?
Time is precious. Waste it wisely.
Prev 1 499 500 501 502 503 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 10h 54m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
PiGStarcraft592
CosmosSc2 78
SpeCial 71
ViBE0
StarCraft: Brood War
Calm 2683
Artosis 809
Soulkey 85
ggaemo 75
NaDa 26
yabsab 18
firebathero 0
Dota 2
NeuroSwarm102
League of Legends
Doublelift3430
JimRising 329
Counter-Strike
summit1g6194
Super Smash Bros
hungrybox218
Heroes of the Storm
Khaldor251
Other Games
gofns11166
tarik_tv7676
Grubby3439
ToD321
Pyrionflax226
C9.Mang0172
elazer137
ROOTCatZ112
JuggernautJason74
Chillindude20
Organizations
Other Games
gamesdonequick1496
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
[ Show 17 non-featured ]
StarCraft 2
• davetesta24
• Hupsaiya 8
• AfreecaTV YouTube
• intothetv
• Kozan
• sooper7s
• IndyKCrew
• LaughNgamezSOOP
• Migwel
StarCraft: Brood War
• blackmanpl 37
• Pr0nogo 2
• STPLYoutube
• ZZZeroYoutube
• BSLYoutube
Dota 2
• masondota21285
Other Games
• imaqtpie743
• tFFMrPink 10
Upcoming Events
RSL Revival
10h 54m
Clem vs ByuN
Rogue vs Lambo
OSC
13h 54m
Online Event
16h 54m
WardiTV Weekly
1d 12h
Sparkling Tuna Cup
2 days
INu's Battles
2 days
Cure vs herO
ByuN vs Rogue
PiGosaur Cup
3 days
The PondCast
3 days
Kung Fu Cup
3 days
Patches Events
3 days
[ Show More ]
Replay Cast
4 days
CrankTV Team League
4 days
Replay Cast
5 days
CrankTV Team League
5 days
Replay Cast
6 days
Afreeca Starleague
6 days
RSL Revival
6 days
WardiTV Summer Champion…
6 days
Liquipedia Results

Completed

Escore Tournament S3: W4
HSC XXIX
Eternal Conflict S2 E3

Ongoing

CSL 2026 Summer (S21)
KCM Race Survival 2026 Season 3
ASL S22 SEASON OPEN Day 2
RSL Revival: Season 6
CranK Gathers Season 4: BW vs SC2 Team League
SCTL 2026 Spring
Eternal Conflict S2 Finale
BLAST Bounty Summer Qual
Stake Ranked Episode 3
XSE Pro League 2026
IEM Cologne Major 2026
Stake Ranked Episode 2
CS Asia Championships 2026
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026

Upcoming

Escore Tournament S3: W5
ASL Season 22: Qualifier #1
ASL Season 22: Qualifier #2
CSLAN 4
ASL Season 22
Blizzard Classic Cup 2026
HSC XXX
SC4ALL II: StarCraft II
Kung Fu Cup 2026 Grand Finals
PiG Sty Festival 8.0
Light Tournament 2026
ESL Pro League Season 24
Stake Ranked Episode 4
Logitech G Connect 2026
SL StarSeries Fall 2026
FISSURE Playground #5
BLAST Open Fall 2026
Esports World Cup 2026
BLAST Bounty Summer 2026
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...

Disclosure: This page contains affiliate marketing links that support TLnet.

Advertising | Privacy Policy | Terms Of Use | Contact Us

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