Go Back   StrafeRight Forums > Off-Topic > General Chit-Chat

General Chit-Chat Home of the StrafeRight Enrichment Center, cake and grief counseling found inside.

Reply
 
LinkBack Thread Tools
  #491 (permalink)  
Old 01-09-2009, 03:47 AM
Dopefish's Avatar
ALTMAN BE PRAISED
 
Join Date: Apr 2006
Location: Ohio
Posts: 4,921
Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!
Send a message via AIM to Dopefish Send a message via MSN to Dopefish
Quote:
Originally Posted by VincentVega View Post
The great firewall of China
They still get around that. I was talking with some Chinese people from China (?!) and I brought up their firewall and his reply was simply "Yeah, but anyone with a little bit of computer knowledge can get around it." (Corrected English).

So even though they think they're censoring their people, their people are still getting around it and seeing any content they want.

If they were to try to set up something similar here, it just wouldn't work.

The infrastructure of the current internet is just not set up to be handled that way.

In order for something like this to work, they would have to do any of the following:
  1. Set up a very restricting firewall on just about every broadband, DSL, fiber, etc. provider.
  2. Have each individual provider route all traffic to a central location that does the filtering
  3. Filter traffic at the provider based on the service port or by packet inspection

None of these are plausible.

In the case of 1, it would make maintaining such content a pain. There are too many places that provide internet access and too many places to deal with. Then who's to say that those providers won't modify, tweak, or mess with that firewall? It would require introducing new protocols to do checksumming and other methods that would verify it hasn't been tampered with.

In the case of 2, we do not have the bandwidth or infrastructure to pipe all internet traffic in the US through a central location. Imagine if you were trying to VNC to your neighbors computer or connect to your home computer from work, and you had to go all the way across the US to have your content scanned/filtered before being send back to your home computer. If providers were just to redirect their local traffic to other local systems without filtering it, then the whole idea is shot down because people will just start hosting and delivering their own content.

In the case of 3, most providers aren't equipped with enough hardware to do deep packet inspection. If they simply filter by port, then people will just start running servers on other ports. Or they might start making protocols that behave similar to FTP or torrents where random ports are assigned and used. Deep packet inspecting all traffic would require obtaining a ton of new systems just to handle it.



In any of these cases, everyone will just start encrypting traffic by default. There are plenty of perfect forward encryption schemes that prevent man-in-the-middle attacks. This would make it impossible for them to scan previous traffic, as well as being impossible to scan active traffic without being detected.
__________________
Reply With Quote
  #492 (permalink)  
Old 01-09-2009, 03:56 AM
Teck's Avatar
The Tux
 
Join Date: Nov 2004
Location: Inside The StrafeRight.com Webserver.
Posts: 11,135
Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.
I dont like the idea of anyone even _trying_ to filter or inspect my traffic... Still, as you outlined those methods are not practical.

On a side note: I started using Smarty the templating engine tonight and I am really digging this... It does a really good job of separating the html & php. Plus i am only having to modify 1-4 lines for every 150-200 lines of code...

It took me about an hour to learn and about another half-hour to get into the groove of coding with it.... I really like it.
__________________

"Teck will be working on God's forum" -VincentVega

"...and I like killing zombies and Cap'n Crunch. you put those two together and you've got one LETHAL-ASS good time combo" -DanFortH

"An SQL query walks into a full bar and sees two tables in the corner, so he walks up to them and says... `Mind if I join you?`" -Evill

"teck is the noobest leet guy I've ever met" -CoffeeShark
Reply With Quote
  #493 (permalink)  
Old 01-09-2009, 04:17 AM
Dopefish's Avatar
ALTMAN BE PRAISED
 
Join Date: Apr 2006
Location: Ohio
Posts: 4,921
Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!
Send a message via AIM to Dopefish Send a message via MSN to Dopefish
In general, I try to avoid template systems because they all seem to be lacking somehow or require you to do things in weird ways. I haven't tried Smarty yet so I don't know how good or bad it really is. I'll have to look into it.



One of things I want to mess with is Tntnet. It's a webserver, but it uses C++ for writing pages. You write your code/pages and then you compile them into a binary that it runs.

They have a calculator example online so you can see the syntax. The fact that it gets compiled into a binary is already sounding good. PHP pages are interpreted every single time you load one. You can use caching to have it serve static, already-interpreted content, but that's not changing the fact that the pages still have to be interpreted.
__________________
Reply With Quote
  #494 (permalink)  
Old 01-09-2009, 04:19 AM
Dopefish's Avatar
ALTMAN BE PRAISED
 
Join Date: Apr 2006
Location: Ohio
Posts: 4,921
Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!
Send a message via AIM to Dopefish Send a message via MSN to Dopefish
It also lets you specify variables in better ways. One of the things I'd really like PHP to support is typecasting.

float var
double var
char var
int var
__________________
Reply With Quote
  #495 (permalink)  
Old 01-09-2009, 04:27 AM
Teck's Avatar
The Tux
 
Join Date: Nov 2004
Location: Inside The StrafeRight.com Webserver.
Posts: 11,135
Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.
Thats neat...

For me the most important part of smarty is the fact that it makes multi-lingual sites easier to code and manage. True, there are a dozen or more ways to make a multi-lingual site, but now many of them are really efficient?
EX:
  • Loading .lang files into php and using $var's for words is a pain in the ass and has issues when translating things...
  • Using a flat file database is no good because of the same reason
  • Using XML is a little better, but you still have to parse it
  • Ehh SQL wouldnt be too bad, but could become hard to manage...
  • Having multiple versions of the code, PHP/HTML could become a pain to manage...
  • And so on...

It's a problem I've been thinking about for awhile now... I asked Wojjie how he was planning to do it, I liked the idea of using smarty and having it compile/cache the templates... So...

As far as i am concerned, the separation of PHP/HTML simply makes things look nicer and makes the site easier to restyle.
__________________

"Teck will be working on God's forum" -VincentVega

"...and I like killing zombies and Cap'n Crunch. you put those two together and you've got one LETHAL-ASS good time combo" -DanFortH

"An SQL query walks into a full bar and sees two tables in the corner, so he walks up to them and says... `Mind if I join you?`" -Evill

"teck is the noobest leet guy I've ever met" -CoffeeShark
Reply With Quote
  #496 (permalink)  
Old 01-09-2009, 04:41 AM
Dopefish's Avatar
ALTMAN BE PRAISED
 
Join Date: Apr 2006
Location: Ohio
Posts: 4,921
Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!
Send a message via AIM to Dopefish Send a message via MSN to Dopefish
How does Smarty handle localization then?
__________________
Reply With Quote
  #497 (permalink)  
Old 01-09-2009, 01:32 PM
Teck's Avatar
The Tux
 
Join Date: Nov 2004
Location: Inside The StrafeRight.com Webserver.
Posts: 11,135
Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.Teck is Pro.
Well there are several ways i have considered...
  • I could make a template for each language... This is possible, it wouldn't be too bad to manage, though it could become a pain..
  • I could use lang files that are loaded into the template for each language... However with this i would either need to write something to cache the templates by language... Otherwise it would have to recompile the templates every time a page is requested with a different language...

I will probably go with option #2... I dont think it will be a problem to cache each template (w/ certain lang files) by language...

There is also a sticky on the Smarty Forums: Smarty :: View topic - best way to build a multi-language site with smarty

Which basically has about 5 years of peoples ideas related to the question.
__________________

"Teck will be working on God's forum" -VincentVega

"...and I like killing zombies and Cap'n Crunch. you put those two together and you've got one LETHAL-ASS good time combo" -DanFortH

"An SQL query walks into a full bar and sees two tables in the corner, so he walks up to them and says... `Mind if I join you?`" -Evill

"teck is the noobest leet guy I've ever met" -CoffeeShark
Reply With Quote
  #498 (permalink)  
Old 01-09-2009, 01:56 PM
Dopefish's Avatar
ALTMAN BE PRAISED
 
Join Date: Apr 2006
Location: Ohio
Posts: 4,921
Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!
Send a message via AIM to Dopefish Send a message via MSN to Dopefish
I haven't read through all of that yet, but the way I typically work with multi-lingual sites is simple and easy to manage.

I have a PHP file for each language.

en.php
sv.php
etc.

Each one simply defines a variable:

en.php
$YES = "Yes";
$NO = "No";

sv.php
$YES = "Ja";
$NO = "Nej";


In the PHP files, I simply specify $YES or $NO.

As for the language, I just pull that from the header or user-selectable. Caching works on a path-based layout, so I have the pages at blah.com/en/ and blah.com/sv/. Even though it still uses the same PHP file, the cached result is stored as /en/ and /sv/ so it doesn't have to regenerate each time.

This is also where using something like Tntnet would greatly benefit. Having precompiled pages is great.



However, I need to look into lighttpd more. The current release is v1.4.20, which has fcgi. In the latest development versions, they dropped fcgi. You can still use PHP, but it's handled through some proxy module instead of fcgi. I'm not sure how the interface works with it, but it might be easy to just write my site in C and have lighttpd call that binary through fcgi or something.

There's just too many useful things you can do with C/C++ that PHP can only dream of.
__________________
Reply With Quote
  #499 (permalink)  
Old 01-09-2009, 01:59 PM
Dopefish's Avatar
ALTMAN BE PRAISED
 
Join Date: Apr 2006
Location: Ohio
Posts: 4,921
Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!Dopefish pwns more than FPS Doug!
Send a message via AIM to Dopefish Send a message via MSN to Dopefish
That forum page is scary. That's like 5 years of PHP-retards discussing how to do things. They haven't kept up with the times or object-orientation.

A lot of what they're trying to be done is simple with classes and autoloading. With the code above (I left out all the class junk), everything is autoloaded and handled pretty much by PHP itself.

Everyone who uses PHP, go read everything here:
PHP: Classes and Objects (PHP 5) - Manual
__________________
Reply With Quote
  #500 (permalink)  
Old 01-09-2009, 02:00 PM
VincentVega's Avatar
Note: Huge Success
 
Join Date: Mar 2006
Location: New England
Posts: 25,202
VincentVega has disabled reputation
Send a message via AIM to VincentVega
Quote:
Originally Posted by Teck View Post
I dont like the idea of anyone even _trying_ to filter or inspect my traffic... Still, as you outlined those methods are not practical.

On a side note: I started using Smarty the templating engine tonight and I am really digging this... It does a really good job of separating the html & php. Plus i am only having to modify 1-4 lines for every 150-200 lines of code...

It took me about an hour to learn and about another half-hour to get into the groove of coding with it.... I really like it.
I have extensive experience with smarty from my last job. I find your opinion of interesting.. I hated it with a passion. all it does is substitute PHP syntax for their own syntax. Yes, it's a little more refined than that, but it just adds another layer for you to create and maintain. I hope your experiences with it are far better than mine.

if you get stuck, you can use their PHP tag to run any php code inside the smarty template. it breaks the model, but it still lets you get around their insane way of doing certain things (or lack thereof)
__________________
Reply With Quote
Reply

Thread Tools

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
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
When your bank fails at technology VincentVega General Chit-Chat 51 10-05-2009 02:35 AM
Valve To Nerf Team-Fortress 2 Idle Cheaters Craig Shooters 71 09-08-2009 09:40 PM
The Coffee House: Idle Chat CoffeeShark General Chit-Chat 10003 12-11-2008 02:47 AM
tight technology Pinpoint General Chit-Chat 26 11-29-2007 04:40 PM
8800 idle and load temps? Relly PC Hardware 19 11-08-2007 02:34 PM