texasman1979

  • Posts: 99
Texasmans Programming Blog
« on April 7th, 2011, 12:22 AM »Last edited on May 29th, 2011, 10:44 AM by Nao/Gilles
First, please do not respond if it is not from a positive state of mind.

Second, i have no other place for this. My GF is studying for mechanical engineering. My son is 6. My best programming friend is at university of california.

Third, the things in this thread are about any type of programming, and any type of program. If anything here is found useful to wedge or its community, id love to see it incorporated somewhere.

More to come folks, stay tuned. :)

name: Joel Edward Mason
profession: Truck driver/owner of http://www.myfewclicks.com (work in progress)
education: 2.5 years(summers to  :P) - Computer Science, Telecommunications, Networking
LOGIC is a FOUR letter word! :)


Asgard

  • So Many Searches, Why Have So Many Searches, One Search Is Enough
  • Posts: 56

texasman1979

  • Posts: 99
Re: Texasmans Programming Blog
« Reply #2, on April 7th, 2011, 03:49 AM »
I was just playing ball with my GF and son. We were playing "think fast" and "hot potato". :)

Which makes me think of a chat program. What is it essentially doing?

Well there is a "server" that accepts connections from multiple "clients" and acts as a liaison between the clients.

Lets pose a question. Does the server have to actively liaison the clients, or does it have to appear to do so?

Well, what if the clients "fooled" each other into thinking that it was the server (securely of course) and a way made for the clients to "after authentication was established" communicate with the other clients themselves?

Seeing that it is a chat program, the main thing to fight is hacking/viruses from other peoples computers. It isnt a high tech government spy network. lol

In what way does a client interact with a server? well the server or client sends a communication to the other and some action takes place according to the stimuli.

Well if a client was to send a message to another client, it stands to reason that it would do the same thing.

Most host providers do not allow services to run, but they cant say squat about clients talking to each other.

In the client/server chat program that im going to work on sooner or later for my webiste, the server will simply be a slave to do something when called upon to do something. No reason at all this cant be a single php file with some specific stuff in there to authenticate users and establish the link between a number of clients, therefore forgoing the need to stay running.

The clients would be configured in such a way to send encrypted packets to all clients except itself. And then all the clients would then send back a response to the client that sent the message.

The entire program would not even use server resources except upon new connections and and possibly another php file for saving the conversation to a specialized topic in the forum. Potentially meetings, minutes, just a record of the conversation for legal purposes. whichever.

The means that these clients would operate, would be dependent upon the device its being operated on. A wap2 version would just simply be user refreshed regular, and probably a good few of upper end fones.

How this would work is upon refresh, is that the refreshing client would send a braodcast message to the other clients and a snapshot of the conversation would then be sent back. Now even the specifics of this would require some creativity. Each client has a tag, computer, fone, wap2, etc. well first, the chatroom cant operate without at least one computer, and each client has a list of the "computers" where each computer would share the load of acting as the server.

The point is, to get away from having to use the server as the server, cause most providers wont let you do it.

So the one or more computers in the chat list can then send an updated set of messages based on the span of time that has passed since the requesting "fone" had received its last update. one of these days this wont be a problem, but it is now, so we work around it.

Typically the person with the computer to start the chatroom, would be the main client/server, with the other "computers" to step up if the main one becomes unreachable.

The client/server would simply be the liaison between the other clients and the server/server. sort of. It would kind of be a leaderless pack, like an ant hill. There is no "active" leader, but the whole hill works together to accomplish something.

the clients would be written in a number of different languages according to what is best for the platform it is running on. A computer can run any language, so you can do anything you want. But on fones of different types, it would range from plain html, to jquery.

And basically, the same way wedge and smf detect browsers, the server/server would assign the appropriate interface. (or it could potentially be a downloadable app) And then the server/server would assign all the clients to recognize the client/server as the server to talk to when wanting to do something with a list of potential backup server ready to pick up seamlessly. Even including the ability to choose to neglect, and pass the server responsibilities to a different computer client, or kill the connection if there isnt one.

This is a basic structure of how it would work, actual implementation would of course require some trial and error to make this type of complex server client relationship work the way one would want it to. Its just a matter of looking at issues from a perspective that has no limits. Its a matter of utilizing the tools of programming languages to their fullest extent.

More to come in the future when i dive into how the server and clients would actually work.

chilly

  • cookies?
  • Posts: 31

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Texasmans Programming Blog
« Reply #5, on April 7th, 2011, 09:32 AM »
Quote
LOGIC is a FOUR letter word!
Logic has five letters.


So, in essence you're talking about a mostly peer to peer networking chat with centralised authentication... which is basically what Skype is. I'd comment more but I don't have a positive attitude.
When we unite against a common enemy that attacks our ethos, it nurtures group solidarity. Trolls are sensational, yes, but we keep everyone honest. | Game Memorial

CJ Jackson

  • I got myself a new iPad, a different world to the iPhone!
  • Posts: 241
Re: Texasmans Programming Blog
« Reply #6, on April 7th, 2011, 11:06 AM »Last edited on April 7th, 2011, 10:35 PM by Nao/Gilles
Quote from Arantor on April 7th, 2011, 09:32 AM
Quote
LOGIC is a FOUR letter word!
Logic has five letters.
Unless he counted from zero, it is four if counted from zero rather than one.

<?php
$logic = "LOGIC"; //String, array of char with a terminator (\0) at the end, really.

echo $logic; //Output "LOGIC"
echo $logic[4]; //Output fifth letter "C"
?>

:eheh:

Whatever 410 (1002) in Computer Logic, it's +110 (510) in Real World Logic, so you and texasman are both right in different respects.  :lol:

DoctorMalboro

  • I like rounded borders.
  • Posts: 316
Re: Texasmans Programming Blog
« Reply #7, on April 7th, 2011, 02:17 PM »
He never said in PHP or in math... so He's actually wrong for not giving the proper details (details rule, bi***!)

CJ Jackson

  • I got myself a new iPad, a different world to the iPhone!
  • Posts: 241
Re: Texasmans Programming Blog
« Reply #8, on April 7th, 2011, 02:24 PM »
true, but the thread title does state "Programming," texasman also stated Computer Science and Networking in education. :lol:

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Texasmans Programming Blog
« Reply #9, on April 7th, 2011, 02:27 PM »
Quote from CJ Jackson on April 7th, 2011, 02:24 PM
true, but the thread title does state "Programming," texasman also stated Computer Science and Networking in education. :lol:
There are systems that start counting at 2. It's all about the context ;)

texasman1979

  • Posts: 99
Re: Texasmans Programming Blog
« Reply #10, on April 8th, 2011, 12:39 AM »
LOGIC = array(
    'shit' => 'Shit',
    'damn' => 'Damn',
    'hell' => 'Hell',
    'fuck' => 'Fuck',
    'piss' => 'Piss',
    'crap' => 'Crap',
    'dang' => 'Dang',
    'heck' => 'Heck',
    );

this concludes the lesson on synonyms.  :D

Re: Texasmans Programming Blog
« Reply #11, on April 8th, 2011, 01:01 AM »
yes it is essentially similar to skype, except for i didn't mention anything about streaming audio. lol

just tossing a few text strings around is really pretty easy, but in a chat prog, or something similar, normally you still have to have some type of server.

what i would use is sort of a variation of the udp protocol. the way that works is that the packet gets sent in a broadcast sort of way, and the udp receiver if it wishes to grab it, does so. similar to downloading programs that where outlawed for the most part several years ago.

and just like any other type of program that uses sockets for things, firewalls would have to be made aware of the traffic. and it is simple enough to establish a pseudo system of public and private keys to keep it pretty well buttoned up.

like i said, i havent started writing it, and i havent researched to see what new types of things are possibly available in current programming languages.

but i know it is more than doable without the need of there being a "server" running on the web host.

it would definitely blow a shout box out of the water. :)

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Texasmans Programming Blog
« Reply #12, on April 8th, 2011, 01:13 AM »
Quote
yes it is essentially similar to skype, except for i didn't mention anything about streaming audio. lol
You do know that Skype does text conversation as well though...
Quote
just tossing a few text strings around is really pretty easy, but in a chat prog, or something similar, normally you still have to have some type of server.
Not in real time when there's authentication involved, at least not over a connection protocol specifically designed to be stateless.
Quote
what i would use is sort of a variation of the udp protocol
So, custom server, custom clients on every platform and cue support question after support question about firewalls and the unrestricting of firewalled ports.
Quote
and it is simple enough to establish a pseudo system of public and private keys to keep it pretty well buttoned up.
If you're implementing a pseudo system, odds are it's insecure. There's a reason why mathematicians much smarter than anyone here are paid vast amounts of money to attempt to break codes or certify their cryptographic security. Use one of the already established, proven key pair algorithms, and don't try and implement something of your own unless you are a mathematical genius because I've seen what happens with "OMG it's my own custom secure algorithm".
Quote
but i know it is more than doable without the need of there being a "server" running on the web host.
Wait a minute. First you were talking about a centralised but ultimately peer to peer system (like Napster used to run), now you're talking about a totally peer to peer system... how do you intend to have discovery attached to it? User authentication/identification?

I won't be abandoning the shoutbox I wrote yet, oh wait, I won't be abandoning it at all, it works just great for the site I wrote it for, which is often what people actually want: the ability to have a chat localised to the members/regulars of a given community rather than being able to chat to anyone and everyone.

You want to see what a centralised chat with variable clients looks like... it's called IRC, been around for years. Failing that, it's called AIM, Y!M, MSN/Live Messenger, or if you're going more exotic, Jabber, which overall basically fulfils your criteria. Good luck implementing though, especially if you're planning on making it available over HTTP because it's just not designed for that, and using UDP/TCP brings a whole new level of technical fun with it.

I'd be more positive, except that I see nothing new here, nothing worth learning multiple new languages and development environments for and nothing to give myself stress headaches over when the support issues come in. For a single site it might be feasible to create such, but for creating tools that others can use to deploy such, they already exist.

CJ Jackson

  • I got myself a new iPad, a different world to the iPhone!
  • Posts: 241
Re: Texasmans Programming Blog
« Reply #13, on April 8th, 2011, 01:21 AM »
Quote from texasman1979 on April 8th, 2011, 12:39 AM
LOGIC = array(
    'shit' => 'Shit',
    'damn' => 'Damn',
    'hell' => 'Hell',
    'fuck' => 'Fuck',
    'piss' => 'Piss',
    'crap' => 'Crap',
    'dang' => 'Dang',
    'heck' => 'Heck',
    );

this concludes the lesson on synonyms.  :D
You forgot to place a wildcard ($) before logic and is not to be confused with dollar, yes I have noticed that all the curse word contain four letters each or should I say three or six. :lol:

It's 3 characters in PHP, after all Arantor said it all about context. :D

Arantor

  • As powerful as possible, as complex as necessary.
  • Posts: 14,278
Re: Texasmans Programming Blog
« Reply #14, on April 8th, 2011, 01:29 AM »
Quote
You forgot to place a wildcard ($) before logic
Which would imply it's a constant rather than a variable, but you can't define a non-scalar constant, and not one whose result is the consequence of an expression rather than a literal constant. ;)