The Best Cyprus Community

Skip to content


What programming language would you suggest me??

Feel free to talk about anything that you want.

Re: What programming language would you suggest me??

Postby Get Real! » Wed Apr 01, 2015 2:33 pm

Sotos wrote:ok ... I see what is all this about now. It is your "save designs" thing. What I don't understand is how those unwanted characters end up in your files to begin with. Are they entered by the user? If that's the case then you should be doing the validation and any conversion before you write the file, not when you read it. You should also make sure you use the same encoding everywhere. In the head of your HTML (<meta charset="utf-8">), in the fs read/write functions (sync or async shouldn't make a difference), maybe there is a setting in Chromium/node-webkit for setting character encoding? (never used those myself). If everything is set correctly then maybe there is bug in that stack you are using... a quick search turned this: http://stackoverflow.com/questions/2329 ... ode-webkit So maybe try utf16le for the read/write functions.

The offending file-opening function I posted belongs to a new generator I’ve created. This one reads in a text file and converts it into a hypertext HTML5. (Image below)

In theory it sounds relatively easy to do but it turned out to be a very challenging generator to create.

All the research and exhaustive tests I’ve done since the last time we spoke points to a node-webkit bug like you found on SO, although I'm using v0.10.4… man I’m gonna kill that little chink who wrote it! :lol:

txt2html.PNG
User avatar
Get Real!
Forum Addict
Forum Addict
 
Posts: 48333
Joined: Mon Feb 26, 2007 12:25 am
Location: Nicosia

Re: What programming language would you suggest me??

Postby Get Real! » Wed Apr 01, 2015 2:52 pm

Pyro, sorry we’ve neglected you with our own issues.

Look, I’m gonna give it to you straight…times have changed and programming is no longer what it used to be.

In the past it was all about data structures but now it’s all about “elements”.

In the past it was all about a single 3GL language and maybe some assembly language included for that extra optimization of time-consuming routines, but now you need to know multiple script languages that specialize in different things to come together for a good result.

So to cut a long story short, if you want to get back into the programming scene of 2015 be prepared to spend 1-2 years of learning new things and lots of frustration.

It’s like they’ve moved the car’s steering wheel somewhere else and the pedals are no longer pedals but switches, and the rear view mirror is now a kaleidoscope!

So have fun driving this new car! :lol:

PS: Of course, if you *DO* decide to go ahead I'm sure Sotos and I are here to help you and that's a lot more than (I for one) had and can make all the difference!

As for which direction to take… tell us what kind of things do you envisage yourself writing/creating (one or two years from now) and we’ll tell you which direction to take to accomplish that.

Btw, don’t tell us “I want to open other people’s file headers” because then I’ll just tell you to forget about modern programming as it’s not used for file headers.
User avatar
Get Real!
Forum Addict
Forum Addict
 
Posts: 48333
Joined: Mon Feb 26, 2007 12:25 am
Location: Nicosia

Re: What programming language would you suggest me??

Postby Sotos » Wed Apr 01, 2015 4:23 pm

This one reads in a text file and converts it into a hypertext HTML5.


I see. But you if the user can open a text file in any encoding then you first need to detect what encoding the file is before you can process it in any way. If your code for dealing with UTF8 it will not work for ASCII and vice versa... and of course there are several other encoding to worry about. Maybe you can use https://www.npmjs.com/package/detect-encoding to detect the encoding, then use https://www.npmjs.com/package/encoding to turn it to UTF8 if it is something else, and then do what you need. But why you want to do that anyway? Plain text file has no markup whatsoever so it would be impossible to format it in any interesting way. For the few things that you can reliably understand (like that an empty line between text means another paragraph) there is a a Node package: https://www.npmjs.com/package/text_to_html. Better scrap that whole idea of reading any text file, and have something that uses Markdown:

#This is an H1 title

##This is an H2

* List item
* List item
* List item

etc etc... there are many parsers that can turn the above to html with 100% reliability.
User avatar
Sotos
Leading Contributor
Leading Contributor
 
Posts: 11357
Joined: Wed Aug 17, 2005 2:50 am

Re: What programming language would you suggest me??

Postby Pyrpolizer » Wed Apr 01, 2015 6:44 pm

Get Real! wrote:Pyro, sorry we’ve neglected you with our own issues.

That's alright man, I really enjoyed the day the Chorokitians met the Greeks and they kept quarreling the merits of Souvla Vs Souvlaki.Until they both realized it was just a trick women invented to assign men the boring task of cooking on top of providing the food. :wink:

Look, I’m gonna give it to you straight…times have changed and programming is no longer what it used to be.

In the past it was all about data structures but now it’s all about “elements”.

In the past it was all about a single 3GL language and maybe some assembly language included for that extra optimization of time-consuming routines, but now you need to know multiple script languages that specialize in different things to come together for a good result.

So to cut a long story short, if you want to get back into the programming scene of 2015 be prepared to spend 1-2 years of learning new things and lots of frustration.

Hmm, scaring.. But I will try learning a couple of them to see what I can do.

It’s like they’ve moved the car’s steering wheel somewhere else and the pedals are no longer pedals but switches, and the rear view mirror is now a kaleidoscope!

So have fun driving this new car! :lol:

PS: Of course, if you *DO* decide to go ahead I'm sure Sotos and I are here to help you and that's a lot more than (I for one) had and can make all the difference!

Thank you both

As for which direction to take… tell us what kind of things do you envisage yourself writing/creating (one or two years from now) and we’ll tell you which direction to take to accomplish that.

Btw, don’t tell us “I want to open other people’s file headers” because then I’ll just tell you to forget about modern programming as it’s not used for file headers.
User avatar
Pyrpolizer
Leading Contributor
Leading Contributor
 
Posts: 12892
Joined: Wed Mar 29, 2006 11:33 pm

Re: What programming language would you suggest me??

Postby Sotos » Thu Apr 30, 2015 2:49 am

Check this out.. it is a bit biased but you will get an idea.

http://cdn2.carlcheo.com/wp-content/upl ... raphic.png
User avatar
Sotos
Leading Contributor
Leading Contributor
 
Posts: 11357
Joined: Wed Aug 17, 2005 2:50 am

Re: What programming language would you suggest me??

Postby Melan » Mon May 04, 2015 6:10 pm

If you don't wanna go deep into programming with Java and C++, my opinion is C# is very useful.
Also, you can learn some bits of JavaScript which is used by many other languages at times.
User avatar
Melan
Member
Member
 
Posts: 133
Joined: Fri Sep 04, 2009 8:02 pm
Location: In Cyprus OFC ;p

Re: What programming language would you suggest me??

Postby Pyrpolizer » Mon May 04, 2015 9:02 pm

Melan wrote:If you don't wanna go deep into programming with Java and C++, my opinion is C# is very useful.
Also, you can learn some bits of JavaScript which is used by many other languages at times.


I don't want to hear anything about those monstrosities starting with C.
I already started on visual basic, totally relaxed, no pressure on myself, and todate I can already do 100 things more than C++, while having spent 100 times less effort and time. :D :D
User avatar
Pyrpolizer
Leading Contributor
Leading Contributor
 
Posts: 12892
Joined: Wed Mar 29, 2006 11:33 pm

Re: What programming language would you suggest me??

Postby Get Real! » Mon May 04, 2015 9:17 pm

Pyrpolizer wrote:I already started on visual basic, totally relaxed, no pressure on myself, and todate I can already do 100 things more than C++, while having spent 100 times less effort and time. :D :D

VBS (the script version that can be used in web programming) of VB, is excellent… I use it often because it gives you access to the OS. You can’t go wrong with the MS product and yes it’s pretty easy syntax.

You can do many handy things with VBS on your system. For example you can easily create macros like this...

---8X------------------------------------------------------
Set WshShell = WScript.CreateObject("WScript.Shell")
WshShell.SendKeys "John Citizen"
WScript.Sleep 50
WshShell.SendKeys "{ENTER}"
---8X------------------------------------------------------

Save this text file on your desktop as myname.vbs and then create a shortcut for it… next to it on the desktop and assign any key you want like F10 to trigger the shortcut.

Voila! Easy macros. Good luck with VB you’ll love it. :wink:

I use to play Age of Empires a lot and I'd use VBS to cheat all the time!

I had a little script like the one below, and I'd just press the shortcut key and get 50 thousand gold each time! :lol:

Set WshShell = WScript.CreateObject("WScript.Shell")
For i = 0 To 50
WshShell.SendKeys "{ENTER}"
WshShell.SendKeys "robin hood"
WScript.Sleep 50
WshShell.SendKeys "{ENTER}"
Next
User avatar
Get Real!
Forum Addict
Forum Addict
 
Posts: 48333
Joined: Mon Feb 26, 2007 12:25 am
Location: Nicosia

Previous

Return to General Chat

Who is online

Users browsing this forum: No registered users and 1 guest