BASICs, programming and off topics

For discussion of non-Wonderland topics - please read rules!

Moderators: ~xpr'd~, tyteen4a03, Stinky, Emerald141, Qloof234, jdl

Post Reply
User avatar
VirtLands
Rainbow Master
Posts: 756
Joined: Thu Dec 29, 2005 1:49 am

BASICs, programming and off topics

Post by VirtLands » Sun Jan 06, 2013 6:48 am

For those of you that love programming or tinkering with code,
I think you'll love to know about the following topics::


DarkBasic Pro is now free:
---> http://www.thegamecreators.com/?id=2000 ... &page=free
"This version contains all of the features that the paid for version includes,
the only difference is that this version is supported by advertisements.
"
Though I have rarely used DarkBasic, I thought I'd mention it, just in case.
-----------------------------------------------------------------------------------------------------------------------------------------

A much more intriguing programming language is
PUREBASIC, ... It has lots of possibilities; I've been studying it for the last month:

There's a nice demo of PureBasic 5.0 available:

http://www.purebasic.com/download.php
http://www.softpedia.com/get/Programmin ... asic.shtml
http://purebasic-demo-32-bit.software.informer.com/


The limitations of the PureBasic demo are:

· No Win32 API support
· No DLL creation
· Code size limitation (about 800 lines)
· Nag screen

{ It's expensive, so just stick to the demo if you can't get the full version. }

There is so much to discuss with PureBasic, that I'll only start with this 1 post for tonight since it's getting late.

I discovered that it has an enormous amount of built in functions,

and this one set of Cipher FUnctions really caught my eye.

Image

The cipher library is a varied collection of ways to compress,
encrypt as well as encode data.

The data can either be a file, or it can also just be a simple memory array, (of any reasonable size).

This topic can be so much fun, and I can see it has lots of possibilities.

There are lots of free addons and free codes by various forums
and authors:

COnsider the following 3 links:

http://bluez.home.xs4all.nl/purebasic/p ... c%2005.htm
http://purearea.net/pb/english/index.htm
http://gnozal.ucoz.com/

The following is a free program called PureUPX;
It is a self-contained program, ready to run that can
compress as well as scramble any (EXE) program that you have
already created. If you have any questions, I'll describe it some more later.

http://www.purebasic.fr/english/viewtopic.php?t=9030
-------------------------------------------------------------------
Last edited by VirtLands on Mon Jan 07, 2013 4:01 am, edited 1 time in total.
User avatar
L'Carpetron Dookmarriot 3
Rainbow Keeper
Posts: 389
Joined: Sat Oct 20, 2012 10:22 pm

Post by L'Carpetron Dookmarriot 3 » Sun Jan 06, 2013 3:26 pm

I am going to use R for statistics in the future, but I'm not sure how "coding" it is.

Oh well.
User avatar
tyteen4a03
Rainbow AllStar
Posts: 4382
Joined: Wed Jul 12, 2006 7:16 am
Contact:

Post by tyteen4a03 » Sun Jan 06, 2013 9:21 pm

As I've mentioned several times, my main working languages are Python and PHP. I also work with HTML/CSS/SQL, and is actively (failing at) picking up C/C++/D.
and the duck went moo

Beep bloop
User avatar
VirtLands
Rainbow Master
Posts: 756
Joined: Thu Dec 29, 2005 1:49 am

PureBasic & replies continued

Post by VirtLands » Tue Jan 08, 2013 3:41 am

L'Carpetron Dookmarriot 3 wrote:I am going to use R for statistics in the future,...

There he goes with his 'R'. Image

I'm sure that statistics is a very involved subject


Wikipedia definition:
"Statistics is the study of the collection, organization, analysis, interpretation and presentation of data.
There is also a discipline called mathematical statistics that studies statistics mathematically."

------------------------------------------------------------------

No doubt, some elementary statistics can be used for this very forum,
for many interesting purposes, such as

(a) counting the most used playable character in RTW levels.
Is it Stinky, Loof, Qookie, Peegue

[ Why Patrick decided to spell it "Qookie", I shall never know. ]

Later, rank each of the 4 playables by total usage, and rank the usage per each forum member.
Optionally, calculate the statistics of which combinations are also most
used, Is the 4-pack (of all playables) used most often?

(b) count the most used non-playable characters in RTW.
The results may be surprising. Which of the baddies would it be?
Probably the coilies are near the top in usage, that's my guess.

(c) count the most used CustomTexture, CustomModel, etc.
This would generate a media popularity chart -- sort of.
(List also counts of levels where NO custom media is used.)

(d) Make a general usage chart showing the total usage of every
single tile and object that exists, per total usage,
and optionally per forum member user usage.

(e) .... Or in other words create a statistical profile of every single
user that creates levels, (and this would only be possible where
levels can be traced back to their owners).

Some of you don't put your name on your levels, and some
give your levels numeric names, such as "1002111...", and

level name duplications occur in rare cases. :lol:
------------------------------------------------------------

These statistics are very doable.
One would first need to create a program that reads every single
user level ever created,
(and it would have to be smart enough to avoid duplicate files).

For a start, a simple algorithm for gathering Tile and Object
counts [statistics] would be done kind of like this:

;; create arrays
DIM Tile[65535] ; create an array of 65535 possible Tile identities.

DIM Obj[255] ; create an array of 256 possible Object identities.

;; (pseudo-code)
;; read through each level file (*.LV6 or *.LV5 or *.LEV)
;; and read all the Tile and Object codes

;; Every time an Object is encountered, then increment its counter
Obj[ Identity ] = Obj[ Identity ] + 1

;; Every time a Tile is encountered, then increment its counter
Tile[ Identity ] = Tile[ Identity ] + 1

;; You can also create counts of combinations of playables
(4 playables = Stinky, Loof, Qookie, Peegue)

;; .. for each player, record some variable called ComboCount

;; create a summable (boolean) value,
;; where Stinky=1, Loof=2, Qookie=4, Peegue=8
;; The unique combos of these add up to unique sums.

for z = 1 to 4
ComboCount = ComboCount OR 2^( Tile[z]-1 )
next

;; Or, perhaps there's a better way to record combos, (?).

The equation for getting the number of combinations without repetition
is:
Image

...where you have n objects taken k at a time.

In the case of 4 playables, where k is 1..4 :

Then the number of unique combinations without repetition
= 4 + 6 + 4 + 1 = 15

So, the entire combo info for 4 playables can be stored in a nibble (4-bits)
But how to correspond the combos to the nibble value should also
be easy,.... I suppose it can be done like this: (in binary)

0001 = Stinky
0010 = Loof
0011 = Stinky and Loof
..
1000 = Peegue


[for reference: Online Combinations and Permutations Calculator }
http://www.mathsisfun.com/combinatorics ... lator.html
http://www.calculatorsoup.com/calculato ... ations.php


I only know a little on statistics; Have not ever studied it,
but it looks like a great topic.
---------------------------------------------------------

Somewhere I saw a backwards 'R'.
I think they use it in Russian for something.

Here it is: :shock:

Я

There is also an upside-down 'R' somewhere but I've misplaced it.
----------------------------------

tyteen4a03 wrote:As I've mentioned several times, my main working languages are Python and PHP. I also work with HTML/CSS/SQL, and is actively (failing at) picking up C/C++/D.

I have a fear of HTML/CSS, can't understand it :!: I suppose CSS means cascading style sheets, [?] and SQL. :shock:

what you did here was scary:
Image
ALTER TABLE `phpbb_attachments` CHANGE `attach_id` `attach_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
CHANGE `post_id` `post_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
CHANGE `privmsgs_id` `privmsgs_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
CHANGE `user_id_1` `user_id_1` BIGINT NOT NULL ,
CHANGE `user_id_2` `user_id_2` BIGINT NOT NULL;

ALTER TABLE `phpbb_attachments_desc` CHANGE `attach_id` `attach_id` BIGINT UNSIGNED NOT NULL AUTO_INCREMENT ,
CHANGE `download_count` `download_count` BIGINT UNSIGNED NOT NULL DEFAULT '0',
CHANGE `filesize` `filesize` BIGINT NOT NULL;

ALTER TABLE `phpbb_attach_quota` CHANGE `user_id` `user_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
CHANGE `group_id` `group_id` BIGINT UNSIGNED NOT NULL DEFAULT '0',
CHANGE `quota_limit_id` `quota_limit_id` BIGINT UNSIGNED NOT NULL DEFAULT '0';

ALTER TABLE `phpbb_forums` CHANGE `forum_id` `forum_id` BIGINT UNSIGNED NOT NULL ,
CHANGE `cat_id` `cat_id` BIGINT UNSIGNED NOT NULL ,
CHANGE `forum_name` `forum_name` VARCHAR( 255 ) CHARACTER SET latin1 COLLATE latin1_swedish_ci NULL DEFAULT NULL;
Image
User avatar
tyteen4a03
Rainbow AllStar
Posts: 4382
Joined: Wed Jul 12, 2006 7:16 am
Contact:

Post by tyteen4a03 » Tue Jan 08, 2013 8:53 am

If you read it carefully, it isn't that scary. For example:

Code: Select all

ALTER TABLE `phpbb_attach_quota` CHANGE `user_id` `user_id` BIGINT UNSIGNED NOT NULL DEFAULT '0'; 
In this query I'm altering the php_attach_quota table, and I'm changing how the column works.
The user_id column will now be able to hold unsigned BIGINTs (0 to 1.84467441e19 - 1), cannot be null (nothing), and defaults to 0.

If you want to talk about scary codes, I suggest heading to my wlf_scrapy project on github and see how hacky it was at ripping data apart.
and the duck went moo

Beep bloop
User avatar
VirtLands
Rainbow Master
Posts: 756
Joined: Thu Dec 29, 2005 1:49 am

GitHub, and member name lengths

Post by VirtLands » Tue Jan 08, 2013 9:52 pm

Image
Well Mr T., thanks for the link,

It looks like GitHub is the best versioning software I've seen.
So I installed the GitHub.

I created a GitHub account named VitHub,
though I haven't added any files yet (repositories, that is.).

So, I subscribed to your 'scrapy' Hub, (though it seems to be a dead topic, I guess).

https://github.com/tyteen4a03/wlf_scrapy { <-- Tyteen's scrapy GitHub }

https://github.com/VitHub { <-- my own GitHub }

If you guys want to git it too, here's the download link to create your own Hub:

http://windows.github.com/ { <-- GitHub for Windows }
-------------------------------------------------------------------------------
I received an email from GitHub like this:

The following public SSH key was added to your account:

GitHub for Windows - VirtLands-PC
**:**:**:**:**:**:18:84:6c:ef:f7:9d:29:e2:37:7d


I'm not sure what that is, maybe I'll figure it out later. :shock:
----------------------------------------------------------------------------------

Image
We have a new 'short-name' person that joined the forum recently, [tb]
so this got me thinking about it, and wondering how many of them are out there. ;)

I computed forum username-length statistics, by reading
old saved forum membership HTMLs, (about 1 year old).

Some statistics on name lengths in this forum: (results are approximate, since it's based on data that's a year old. )

·····2 users have name len =1
···24 users have name len =2
···91 users have name len =3
·194 users have name len =4
·347 users have name len =5
·629 users have name len =6
·986 users have name len =7
1582 users have name len =8
2297 users have name len =9
1195 users have name len=10
1770 users have name len=11
··620 users have name len=12
1291 users have name len=13
··357 users have name len=14
··251 users have name len=15
··128 users have name len=16
····80 users have name len=17
····50 users have name len=18
····35 users have name len=19
····17 users have name len=20
····17 users have name len=21
····12 users have name len=22
······9 users have name len=23
······7 users have name len=24
····27 users have name len=25
······2 users have name len=26

The data shows that most users have a len of 9, as indeed I do. "Virtlands" has 9 bytes.
Many of the users that have long names of around 20 bytes or
longer are often spam.

Also, no one has a name length greater than 26...
or less than 1. :lol:

It's true, there are 2 users with names of len=1: :)
t : joined Feb 2005 : 0 posts : Profile Link = http://www.pcpuzzle.com/forum/profile.p ... file&u=770
8 : joined Jan 2007 : 0 posts : Profile Link = http://www.pcpuzzle.com/forum/profile.p ... ile&u=2449

Of those, with len=2, here's a partial list: (There are 24 members).

PO : joined Feb 2004 : 0 posts
vk : joined March 2004 : 17 posts
ab : joined Dec 2004 : 1 posts
SM : joined Aug 2005 : 74 posts
gg : joined 2005 : 1 post
xk : joined 2006 : 3 posts
md : joined Oct 2007 : 358 posts
VM : joined Dec 2007 : 2 posts
tm : joined Oct 2010 : 1 post

----------------------------------------------
I'll be back with some more interesting PureBasic info later, ...
got to take a short break from typing. ...
User avatar
L'Carpetron Dookmarriot 3
Rainbow Keeper
Posts: 389
Joined: Sat Oct 20, 2012 10:22 pm

Post by L'Carpetron Dookmarriot 3 » Tue Jan 08, 2013 10:27 pm

What I found really scary was how many people had a name of 25 characters. I mean, 7 people have name lengths of 24 characters, 2 people have name lengths of 26 characters, but 27 people have 25 characters!

I also just checked my name, and yes, it is 25 characters. :shock:
User avatar
VirtLands
Rainbow Master
Posts: 756
Joined: Thu Dec 29, 2005 1:49 am

25 character names

Post by VirtLands » Wed Jan 09, 2013 12:45 am

L'Carpetron Dookmarriot 3 wrote:What I found really scary was how many people had a name of 25 characters....
Yes, basically there are only two non-spam members with 25-character names. They are:

L'Carpetron Dookmarriot 3
New Wonderland Adventurer


The rest in the list (below) are spambots; They are easy to spot because they
have 0 posts, and their names are 'obvious'.

Patrick apparently put a stop to the spamming mechanism long ago,
so spammer names are relics from the past. ;)

[ screenshot from my searcher program, where name len=25 ]
Image
Some of the names I censored out because they are not suitable for the forum. :lol:


Of the thousands of registrants with this forum, only about
10% are real people. They rest are machines. (spambots)
Image

The ID number is also an interesting peice of information. We all have
ID numbers.

When you go to your profile link, your id number is what's attached at the end :

&#104;ttp://www.pcpuzzle.com/forum/profile.php?mode=viewprofile&u=1484

In my case, my VirtLands ID = 1484..
It's chronological, which means that people that join later have higher ID numbers

One thing that is weird is that in the "ID" database there are gaps
where numbers are skipped, where certain IDs just don't exist.
(Sometimes the gaps are wide and lots of numbers are skipped.)

Small example: There is no ID=0, or ID=1

Some Famous IDs:

Midnight Synergy : ID=2
Stinky :ID=3
Loof : ID=4
Don: ID=5 ( Who is Don? :shock:)

Qookie : ID=525
Peegue : ID=526
User avatar
VirtLands
Rainbow Master
Posts: 756
Joined: Thu Dec 29, 2005 1:49 am

pure accidental randomness

Post by VirtLands » Wed Jan 09, 2013 3:02 am

Addendum:

The following list of forum IDs DO NOT EXIST:

Is there a pattern here, or is it pure randomness?

[ Note: anywhere where a "..." is shown denotes a range of numbers,
such as 467...469 means all those inclusive. ]

Evidently, these are the spammer IDs that were deleted by Patrick.

Image
Last edited by VirtLands on Wed Jan 09, 2013 9:56 pm, edited 1 time in total.
User avatar
tyteen4a03
Rainbow AllStar
Posts: 4382
Joined: Wed Jul 12, 2006 7:16 am
Contact:

Post by tyteen4a03 » Wed Jan 09, 2013 3:43 am

Your SSH public key is used to "sign" your commits (so that others know it's you). You should also have a private key on hand.

GitHub is a website that allows you to host git repos (hence the name GitHub). Git was originally designed by Linus Torvalds (also designed Linux) to solve problems in Subversion, another Versioning Control Software.

phpBB2's original database setting only allowed 25 characters in your username (the 26th character onwards are removed). This limit might have been removed as Patrick applied my patch, but I'm not sure if phpBB checks in the php code too.

The nonexistent forum IDs are all deleted users (possibly spammers) with the exception of forum ID 0, which never existed (forum IDs start with 1). Patrick probably forgot to change his username from admin to his current name while he setup phpBB.
and the duck went moo

Beep bloop
User avatar
Blazeknight
Rainbow Master
Posts: 797
Joined: Sun Nov 04, 2012 5:50 am

Post by Blazeknight » Wed Jan 09, 2013 10:50 am

Sounds good to me. Do you think, we can edit MOFI editor with this stuff? :D
Happy to Help!

Check out my works @ http://quaziiquce.webs.com
User avatar
tyteen4a03
Rainbow AllStar
Posts: 4382
Joined: Wed Jul 12, 2006 7:16 am
Contact:

Post by tyteen4a03 » Wed Jan 09, 2013 3:48 pm

Blazeknight wrote:Sounds good to me. Do you think, we can edit MOFI editor with this stuff? :D
Surely we can remake a MOFI editor, but it 1. wouldn't be worth the time, and 2. would be a pain in the butt (imagine all the assembly)
and the duck went moo

Beep bloop
User avatar
VirtLands
Rainbow Master
Posts: 756
Joined: Thu Dec 29, 2005 1:49 am

Editing this & that...

Post by VirtLands » Wed Jan 09, 2013 9:54 pm

tyteen4a03 wrote:Your SSH public key is used to "sign" your commits (so that others know it's you).
You should also have a private key on hand...Image
I have a hunch that "git repos" are mostly for programmers wishing to share their code.

For ordinary file sharing, people can just use the regular sites like
MediaFire, DropBox, HotFile, UploadingIt, SendIt, 4Shared, 2Shared, and stuff like that.

But sometime, I'll get around to understanding gitHub.
------------------------------------------------------------------------------------
tyteen4a03 wrote:Surely we can remake a MOFI editor, but it
1. wouldn't be worth the time, and 2. would be a pain in the butt (imagine all the assembly) Image

I didn't know the MOFI editor was done in assembly language. [acckk!]

Is re-making the RTW editor hard too? Image

I can imagine some improvements for it. Image It just takes time.
User avatar
tyteen4a03
Rainbow AllStar
Posts: 4382
Joined: Wed Jul 12, 2006 7:16 am
Contact:

Post by tyteen4a03 » Thu Jan 10, 2013 9:35 am

MoFI editor was made in Blitz3D. However, the compiled file is in Assembly.
and the duck went moo

Beep bloop
Post Reply