Author Topic: Looking to become a programmer, insight appreciated!  (Read 5493 times)

0 Members and 1 Guest are viewing this topic.

Offline tsaishen

  • Full Member
  • ***
  • Posts: 55
    • View Profile
sounds like an interesting program.  I can wrap my mind around the logic, but I have absolutely no idea how to open an rpc channel with the bitshares wallet.  I'll see what I can do with this in the next few weeks.  Thanks for the suggestion tsaishen

Kinda wishing we had this right now, there are some interesting opportunities today between the decentralized exchange, meta exchange and shapeshift.io

Offline xh3

  • Full Member
  • ***
  • Posts: 90
    • View Profile
    • Bit-Cents
sounds like an interesting program.  I can wrap my mind around the logic, but I have absolutely no idea how to open an rpc channel with the bitshares wallet.  I'll see what I can do with this in the next few weeks.  Thanks for the suggestion tsaishen

Offline xeroc

  • Board Moderator
  • Hero Member
  • *****
  • Posts: 12922
  • ChainSquad GmbH
    • View Profile
    • ChainSquad GmbH
  • BitShares: xeroc
  • GitHub: xeroc
Heck ... this is a challenge worth accepting .. just don't have the time to do it now .. :(

Offline tsaishen

  • Full Member
  • ***
  • Posts: 55
    • View Profile
I think it would be cool to use crypto-style ledgers as the guts of a machine learning application. 
Multiple instances of an algorithm could share and update a database tracking it's success at a task.
 If the task was simple analysis or prediction, the program could automatically mutate and run the code looking for better solutions evolution-style.

The crypto ledger(or matrix) would form a sort of distributed memory database in which each instance and/or mutation would have it's own address to store it's feedback information. 

The database could be host to a whole ecosystem of programs built on top of it.  Programs that analyze the data, programs that spawn new mutations of itself, programs that interface with human beings, etc.

The program could even hire coders by putting on coding competitions where people submit code, the machine tries it out, and then releases tokens to whoever's code works the best. 

The program could then stack itself fractal-style, using smaller and smaller agents to process information on multiple levels.

I think a substantial analytic intelligence could be built in such a way, even though their 'mortality' rate might be high.

Thoughts?

You seem dedicated to this cause, you've put a lot of thought into this and that's very, very clear.
I can see you are missing some pretty basic understanding of how AI's actually work in practice, vs theory but I want to give you a chance to do something interesting that would benefit the whole community, while educating you.

For everyone who is waiting on an announce from me, this has nothing at all to do with the announce, but it does make for an interesting project and he seems sincere enough.

So here's the deal...

At the moment there are serious liquidity issues in the BitShares decentralized exchange.  The buy/sell spread on certain assets is getting huge.  If you want to do AI, you need to understand that AI is nothing other than a combination of analysis and action.  So let's try the simplest algorithm, buy low & sell high by walking assets.

Using the language of your choice, open an RPC connection to the bitshares wallet.
Code: [Select]
Step #1, determine ALL of your current balances, this is BTS, bitUSD, bitGOLD, whatever.
Step #2, pull down the entire order book for the entire exchange, buys and sells and track each portion as price @ volume
Step #3, determine the actual amount of BTS you would have if you liquidated all bitAssets into BTS.  You need to account for both depth and trading fees and the fact that orders here are limit, not market, so you will be doing a lot of trades.
Step #4, perform a graph search that finds the most profitable path from direct total liquidation, through at least 2 other assets and back to BTS.
Step #5, determine if this pathway would result in more BTS than you would have if you just went to straight liquidation, IF TRUE GOTO #6 ELSE GOTO #1
Step #6, execute the plan, liquidate all assets except those already along your path, perform buy & sell actions from highest to least profit until the plan is fully executed, GOTO #1 IF COMPLETE OR IF PROFIT ON ANY NODE WAS LESS THAN TARGET

This by itself will not result in a regular profit BTW, because everything passes both into and out of BTS directly.
But it will cause more churn & liquidity in the market, which helps everyone believe it or not.

If you want it to be profitable, once you have perfected that algorithm incorporate information sourced from this, https://metaexchange.info/apiDocs
And add BTC/BTS & BTC/bitAssets into the mix, since there are almost always arb ops there and frankly that exchange could really use the liquidity.

The bulk of this work can be done with a combination of a decent graph DB and a strong multithreaded concurrent language.
Once you are able to grok A* with fast failing exits and implement it against a graphdb, you will have the basis for your very first AI and the rest of the field should start clicking into place more clearly.  The best tutorial I ever saw on implementing A* was actually a C# tutorial from XNA, they were building a 3D pacman type game and needed an AI to control the ghosts/baddies.  Believe it or not, that algo actually directly applies here.  Wish I had the bookmark, but I don't recall having seen it since 2008.

My recommendation for this is Go, Java or NodeJS, in that order, but you can choose your own .  You can do it in C++ but you'll find yourself spending more time chasing memory leaks than chasing money. (not true if you use some of the really cool new features in the language, but those aren't all widely supported yet).

Build it step wise on github,
Post here to show your code as you complete each step,
I'll give you 100 BTS each step that compiles and runs, and I'm willing to bet that others here will as well. 
Once it's fully functional, launch it and let us toss you some coin to play with.  If it works well, maybe issue a bitasset on it and let us all benefit from your education ;)

Here is how I would rate the task as a hiring manager.
Assuming each step functions...

1 step per week, complete and total newbie but as long as he progresses, he has potential.
2 steps per week, new programmer, maybe unsure with the languages or tools used.
3 steps per week, mid level programmer, or perhaps being extra cautious probably a good hire in the $50-70k range.
4-6 steps per week, mid level programmer, if they are coding unit tests at the same time, then upper mid level.  probably $75k - $100k range.
7 steps per week, high level coder should probably clear about $120k per year.

>7 steps per week, pulled a wally (outsourced all or most of his work to elbonia for 25% of his pay, and is actually taking an in office vacation).  He's probably management material, $150k - $200k per year ;)

Let me know if you want to accept the challenge

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
I think it would be cool to use crypto-style ledgers as the guts of a machine learning application. 
Multiple instances of an algorithm could share and update a database tracking it's success at a task.
 If the task was simple analysis or prediction, the program could automatically mutate and run the code looking for better solutions evolution-style.

The crypto ledger(or matrix) would form a sort of distributed memory database in which each instance and/or mutation would have it's own address to store it's feedback information. 

The database could be host to a whole ecosystem of programs built on top of it.  Programs that analyze the data, programs that spawn new mutations of itself, programs that interface with human beings, etc.

The program could even hire coders by putting on coding competitions where people submit code, the machine tries it out, and then releases tokens to whoever's code works the best. 

The program could then stack itself fractal-style, using smaller and smaller agents to process information on multiple levels.

I think a substantial analytic intelligence could be built in such a way, even though their 'mortality' rate might be high.

Thoughts?

This is pretty much what neureal.net aims to do but there are many steps in the product.
I speak for myself and only myself.

Offline xh3

  • Full Member
  • ***
  • Posts: 90
    • View Profile
    • Bit-Cents
I think it would be cool to use crypto-style ledgers as the guts of a machine learning application. 
Multiple instances of an algorithm could share and update a database tracking it's success at a task.
 If the task was simple analysis or prediction, the program could automatically mutate and run the code looking for better solutions evolution-style.

The crypto ledger(or matrix) would form a sort of distributed memory database in which each instance and/or mutation would have it's own address to store it's feedback information. 

The database could be host to a whole ecosystem of programs built on top of it.  Programs that analyze the data, programs that spawn new mutations of itself, programs that interface with human beings, etc.

The program could even hire coders by putting on coding competitions where people submit code, the machine tries it out, and then releases tokens to whoever's code works the best. 

The program could then stack itself fractal-style, using smaller and smaller agents to process information on multiple levels.

I think a substantial analytic intelligence could be built in such a way, even though their 'mortality' rate might be high.

Thoughts?

Offline tsaishen

  • Full Member
  • ***
  • Posts: 55
    • View Profile
I was like you about a year ago, I had very little prior programming experience but a burning desire to learn and contribute. Looking back at the last year or so the main advice I can give you is to start building something and see where it takes you. Try out some different languages, read and educate yourself, but most important in my opinion: build something! :)

I had one programming class in university (I'm an aerospace engineer), a really basic C course with some elementary concepts. While I aced the course, C never resonated with me. I then had to use Fortran a little bit in the final year of my master, but once again it was something I was forced to do and never wanted to use again. Several years later I decided to play around with Java and build a couple Android apps. This was more fun but I was still not really hooked. I played around with Python a little for a Vertcoin / Monocle mining pool, and while Python is nice and all it still wasn't my thing.

When Bitshares finally launched we needed a block explorer, so I decided I'd try to build one. After struggling with node.js for a few weeks (yea really!) trying to get the RPC interface working, I finally cracked it and once I did I was hooked. Ever since I've been spending way too much time coding in javascript, doing frontend and backend stuff. While Javascript may be a poor man's language, it's the right language for me and I really love working with it and learning about it.

Moral of the story: experiment, build stuff, get your hands dirty, and hopefully you will stumble upon what's right for you!

There is nothing wrong with Javascript for client or server anymore.  It's a fast, and powerful language.  The problems are the same as PHP, makes it easy to do stuff you didn't intend.

Be careful using it for any number crunching unless you write test cases to verify that things always come out correctly and make sure you use the correct math libs for doing it.

As an aside, I've read a lot of Go vs Node stuff lately and I do like Go's lack of callback hell and easy concurrency model better, but the fact is that you will never use that stuff 90% of the time.  The 10% when you do need it, it's a godsend.

As for codeschool it looks nice, if you want to get into programming though you are probably WAY better off just finding some opensource project you like and volunteering to do some work on it.  e.g.  I don't know of a single open source project with AAA+ Grade docs.  No one wants to write the manual, they just want to code.  But if you read the code you can write the manual.  You can also tinker with the code and see what happens.

I still think direct contribution is best.
One of my best coders started his career by playing Planeshift and deciding that he wanted to contribute.  He had never wrote a line of C++ in his life, straight VB guy.  He hoped in IRC, asked for some low hanging fruit to cut his teeth on.  Ended up creating the chat command structure in the game (the game had chat but was missing crucial bits like /group or /yell).  Launched his entire career off that.

Offline svk

I was like you about a year ago, I had very little prior programming experience but a burning desire to learn and contribute. Looking back at the last year or so the main advice I can give you is to start building something and see where it takes you. Try out some different languages, read and educate yourself, but most important in my opinion: build something! :)

I had one programming class in university (I'm an aerospace engineer), a really basic C course with some elementary concepts. While I aced the course, C never resonated with me. I then had to use Fortran a little bit in the final year of my master, but once again it was something I was forced to do and never wanted to use again. Several years later I decided to play around with Java and build a couple Android apps. This was more fun but I was still not really hooked. I played around with Python a little for a Vertcoin / Monocle mining pool, and while Python is nice and all it still wasn't my thing.

When Bitshares finally launched we needed a block explorer, so I decided I'd try to build one. After struggling with node.js for a few weeks (yea really!) trying to get the RPC interface working, I finally cracked it and once I did I was hooked. Ever since I've been spending way too much time coding in javascript, doing frontend and backend stuff. While Javascript may be a poor man's language, it's the right language for me and I really love working with it and learning about it.

Moral of the story: experiment, build stuff, get your hands dirty, and hopefully you will stumble upon what's right for you!
Worker: dev.bitsharesblocks

Offline rgcrypto

  • Hero Member
  • *****
  • Posts: 557
    • View Profile
    • Cryptoctopus Blog

Offline tsaishen

  • Full Member
  • ***
  • Posts: 55
    • View Profile
What happened is that Thompson & Pike (creators of C) moved to google and decided to create a language...

Pls correct if I'm missing some elements of "prehistory", but the C programming language was the invention Bell Labs authored by Brian Kernighan & Dennis Ritchie in the early days of Unix development. The original, definitive standard was published in 1972 and became known as K & R C.

Go sounds interesting. Probably won't be long before you see Eclipse plugins to support it in that IDE, which althought not lightweight, is the Swiss army knife of IDEs.

I agree with tsaishen about choosing the right language for the task at hand, and that more often than not is based on the skill set of the dev staff, or, the costs involved to assemble a team for a project.

As for AI, I have a little exposure to that from the prime of my career. Smalltalk, lisp and Prolog were the most prominent AI languages in use then. All of those are hugely different from languages used for non-AI applications. IMO you are a very long way away from being able to handle AI programming, but who the hell am I to tell you that. If you have a desire, go for it! Just letting you know that's a heavy, deep area to master.

If you're really serious about AI (and after a couple of years of getting up to speed on basic CS concepts & practices) install the old school emacs editor, which includes a lisp interpreter. That will give you a rich environment from which to learn lisp, which as I said is quite different than the more mainstream languages of today.

IMO you would have much more opportunity in to make an impact and avenues to contribute in core crypto or UI programming. But I don't know what motivates you, so that opinion may not be very useful. Market demand is my primary basis for that opinion.

Sorry, you're right and I'm wrong.  I think they invented Unix.  Point was more or less they had used C a lot longer than most of us and had the benefit of hindsight in creating Go.

Go has an eclipse plugin.  Newest version isn't half bad, but I'm still in the LiteIDE camp, it just seems to work so much smoother.  Eclipse is like trying to pick grapes with an elephant.  You can probably use it, but it might not be the best choice ;)

AI in the crypto and finance world intersects at bot trading.  Build a bot that is correct 51% of the time and you have built your own private ATM.  Make one that is correct 75% of the time and you can retire tomorrow.  Problem is no matter how smart your bot is, someone else is looking to outsmart it.  Algo bots are the simplest and those are monstrously complex things.  A neural bot that "learns" from it's mistakes might be a better solution, but you need to have a nice stash of coins somewhere to let it ride that out.  Also crypto is unlike other finance.  The market is young and evolving.  The reasons for a rise or crash in price might never occur again because this whole field is in it's infancy.  Same might be said of other markets but it's more true with crypto because of the sheer lack of actual players.

Might be worth a shot though.  Wonder if someone could adapt Xchange to function with Mahout and then replay the BTS market for the last 6 months or so.

Offline gamey

  • Hero Member
  • *****
  • Posts: 2253
    • View Profile
Wow, this thread is incredible!  Thanks tsaishen for your reply, it is truly great stuff, and I was able to deduce invaluable insight from it.  :-)  Thank you Thom and Bytemaster for your advice as well.

I am interested in programming AI and will be pursuing that once I've gathered the more basic of skills.  I think C++ is probably the right tool for that application.  I'll check out css, html, and Java per your recommendation

neureal.net is an interesting blockchain application.  An alpha level testnet was just released but the point is that you can record your AI results on a blockchain in a contest/sponsorship.  A marketplace for AI agents.  So as a programmer you could be paid to write java AI if your results are the best. That sort of thing.  It is at very early stages though but perhaps could be of interest to you later on.  The first datafeed prediction is BTC price, so if writing AI that predicts the BTC price is appealing it might be worth considering as a starting point.
« Last Edit: April 13, 2015, 11:38:16 pm by gamey »
I speak for myself and only myself.

Offline xh3

  • Full Member
  • ***
  • Posts: 90
    • View Profile
    • Bit-Cents
Thanks Thom,

I find that my mind becomes more efficient if I focus on something that's on the edge of what I believe is possible for myself, it helps me calculate the entire tree of necessary steps. 

My motivation is pure artistic expression, followed lazily by utility and monetary gain. 

I love crypto.  I personally think it will prove to be the cornerstone of a whole host technologies in the not-so-distant future.

I would like to work on something at the intersection between crypto and AI.  I've got a full plate for now just looking up these languages, terms, histories, and usage cases. 

Thanks again everybody for your input, I've learned more than I thought I would from asking a few simple questions.


Offline Thom

What happened is that Thompson & Pike (creators of C) moved to google and decided to create a language...

Pls correct if I'm missing some elements of "prehistory", but the C programming language was the invention Bell Labs authored by Brian Kernighan & Dennis Ritchie in the early days of Unix development. The original, definitive standard was published in 1972 and became known as K & R C.

Go sounds interesting. Probably won't be long before you see Eclipse plugins to support it in that IDE, which althought not lightweight, is the Swiss army knife of IDEs.

I agree with tsaishen about choosing the right language for the task at hand, and that more often than not is based on the skill set of the dev staff, or, the costs involved to assemble a team for a project.

As for AI, I have a little exposure to that from the prime of my career. Smalltalk, lisp and Prolog were the most prominent AI languages in use then. All of those are hugely different from languages used for non-AI applications. IMO you are a very long way away from being able to handle AI programming, but who the hell am I to tell you that. If you have a desire, go for it! Just letting you know that's a heavy, deep area to master.

If you're really serious about AI (and after a couple of years of getting up to speed on basic CS concepts & practices) install the old school emacs editor, which includes a lisp interpreter. That will give you a rich environment from which to learn lisp, which as I said is quite different than the more mainstream languages of today.

IMO you would have much more opportunity in to make an impact and avenues to contribute in core crypto or UI programming. But I don't know what motivates you, so that opinion may not be very useful. Market demand is my primary basis for that opinion.
« Last Edit: April 13, 2015, 07:21:17 pm by Thom »
Injustice anywhere is a threat to justice everywhere - MLK |  Verbaltech2 Witness Reports: https://bitsharestalk.org/index.php/topic,23902.0.html

Offline monsterer

For Bitshares you want to learn C++ .

If you want to contribute to the bitshares core, then you want to learn c++. Otherwise not.
My opinions do not represent those of metaexchange unless explicitly stated.
https://metaexchange.info | Bitcoin<->Altcoin exchange | Instant | Safe | Low spreads

Offline tsaishen

  • Full Member
  • ***
  • Posts: 55
    • View Profile
Wow, this thread is incredible!  Thanks tsaishen for your reply, it is truly great stuff, and I was able to deduce invaluable insight from it.  :-)  Thank you Thom and Bytemaster for your advice as well.

I am interested in programming AI and will be pursuing that once I've gathered the more basic of skills.  I think C++ is probably the right tool for that application.  I'll check out css, html, and Java per your recommendation

It depends on what you're trying to actually accomplish with AI.  C++ has several good libraries so I wouldn't count it out. 

But the type of AI relevant to cryptos, finance and trading is in my opinion better handled by languages designed specifically for AI.
There are a few, LISP comes to mind which oddly enough someone was just asking about Clojure which is a LISP variant, so maybe that's a good choice.  Never actually used it though so YMMV.

If I were building an automated trading system, I would use machine learning framework with a language I already know.  Hadoop has a sub project called Mahout that provides an excellent basis for building a "smart bot" and it's Java so I don't have a learning curve there and I can acquire talent easy enough.  https://en.wikipedia.org/wiki/Apache_Mahout  The nice thing about building on top of this is instant scalability.  You have a problem that parallelizes well?  Spin up 10,000 nodes and be done in a few seconds instead of a few days.

I wouldn't discount OpenCV though especially for computer vision related AIs, it's C++ but has bindings for a number of languages.

When I select a language for a task I have a little mental flowchart I use so I can limit my choices rapidly and start focusing on the problems at hand.  I'm sure everyone else who has done this for a living follows a similar process.

#1 Identify the problem.  This literally means "Ask questions and break things down until the answers become blindingly obvious."

#2 Select the problem domain.  Is the project user facing?  Is it a server that needs to run reliably for years?  Is it something just needs a quick run once in awhile?

 I literally found myself stepping into a project once that had 3 years of development time under the previous manager.
It was nowhere near completion but we managed to complete it overnight. 

I was able to do that because up to that point, none bothered to notice the underlaying task could be run as a perl 1 liner on an hourly cron job.  They had built this huge framework with Spring & J2EE on JBoss, but missed something totally obvious.
They were looking for a programmatic Java based solution, when they should have asked the server admin to script the 1 liner and add it to cron.

So make sure you fully understand the problem domain & requirements before you try to look for solutions.

#3 Design a solution.  Again this is asking questions like, what resources do I have? what tools can I use?  There are so few "actually novel" problems in comp-sci.  Someone has probably solved your problem before, you should look to leverage their efforts.  Many time a "glue it and go" will provide a better solution than "coded from scratch".  Furthermore, it's been my experience that the best language for a particular job comes down to "What languages does my team already know".  Unless you are choosing something highly esoteric, most times there's a library out there for any given language that already gets you 90% of where you want to be.  You should just pick the language that your team is most comfortable with and roll with that.  Same with DBs and even OSs. 

I saw a really great company completely and epically fail because they decided to move from MSSQL to PostGres.  It was a cost saving move, but none of their software knew how to talk to it and their DB admins were MSSQL Certified with no clue about how to deploy PostGres.  By the time they caught this, they had already burned bridges with customers due to downtime. 

In otherwords, the most epic flaming sword is of no use to you and might be dangerous if you work in a paper factory.

#4 Create a validation framework.  This means answering the question "How do I know that number 3 solves number 1 without creating new problems?"  For many people this means you start by writing a test harness and crafting individual unit tests.  If you do this before you ever write a single line of actual functioning code.  Your code will self validate.  It either builds and runs, or you get lots of screaming red lights on your build tree.  If you do this, please learn to commit your code for the entire week before lunch time on Thursday. If make your team work late nights on Friday and Saturday you will become a pariah, quickly...

I'll let someone else add their horror story here. 
I tend to take Fridays off and turn off cellphones and emails after 5 on Thursday for this specific reason.

#5 Start coding.  You've identified that there is a programmatic solution to #1 that requires you to either write something from scratch or create some glue code to stick some existing frameworks together.  You've created a way to verify that your solution actually solves the danged problem.  Now you need to do the leg work to finish up.  This is actually these easy part.  Relax and enjoy yourself.

#6 Test, test EVERYTHING.  Check that each function you wrote returns correctly, not only in the common cases, but at ALL the edges. 

Try to imagine the worst possible way your code could fail (probably should have started doing that during #5 BTW), then realize that you are an idiot because you will always miss the obvious.  If you didn't realize that by now, reality is going to slap you upside the head really, really soon.

Here are some reality slaps, just off the top of my head.
Actual things that can really happen...

You have a trading bot that sees a trade of 1 BTC for 0.001 USD.  What happens? 
You need to track BTC vs BTS values, but BTS is now showing less than 1 satoshi, how does your software react? 

You used INTs for your INT values and now you are dividing in a what?
Uhh where the hell is that 0 coming from? (Might be a Java specific issue)   

You used a 32bit float to represent an INT value, now you have 5 billion ints, do you even know if the value is now positive or negative? 
What happens when one or more of your counters roll over? 

Yes test everything!  Also verify that all your assumptions are correct.  For instance if you are pricing from a price feed and the feed goes down, do you suddenly begin to price things to 0, or do you pause until the feed returns or switches over?  Are absolutely sure about that?

If there is a panic, or an exception don't ignore it and
please don't just log it as

"Ok something happened, but it's alright because this can't ever occur" or even worse...
Code: [Select]
//This line of code will never be reached

And for the love of God don't be this guy! 

*blockchain.info I'm looking at you*

#7 Give it to the user, have them help you identify new problems and repeat steps #1 through #6
#8 Maintain it, i.e. GOTO #1