Fayimora's Posts
Nairaland Forum › Fayimora's Profile › Fayimora's Posts
1 2 3 4 5 6 7 8 9 10 (of 42 pages)
@fallguy seriously? Mate you really do have a lot of wrong assertions in your post. FYI, from a "programming standpoint", compared to any dialect of Lisp, Java and VB are kinda too verbose IMHO! "C/C++ will never have a large following because of their difference from english" WHAT ? ? ? "Visual basic is the most popular language of all times ? " WHAT? ? ? Any reasonable references/statistics? and the worst of them all "lisp is shunned because of psychological rather than technical reasons." WHAT? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? ? |
I agree with you. However, you need to understand that the "brackety" nature of any Lisp dialect puts a lot of people off. I actually |
Use the right tool for the job Personally, I write Scheme/Racket and a little Clojure but just for fun! |
@pc_guru yeah vim is AWESOME.. Best text editor Learning vim is like learning Functional Programming. To learn FP, you have to forget all you know about programming. To learn vim, you have to forget all you know about text editing first.lol @ "uncommon languages I code in".. I use the best tool for the job ![]() |
@prodam the code there is 30 lines but look at it closely. The main stuff is about 10 lines. I added a few print statements for those who haven't used Scala Also, it's a recursive solution. I can make this way shorter but trust me, the code will be really cryptic if you are yet to meet FP.@pc_guru That is vim on a Mac. I'm a vim user. Also, the language is Scala not Python Also why don't you remove `addOne` and just print `_array.length+1` ? |
This is called The 3N+1 problem. I wrote this in Haskell but I was pretty sure the code looked too cryptic so I re-wrote it in Scala. Code: https://gist.github.com/fayimora/5069397 The gist also contains an HTML file I generated(see screenshot below), you can download it and open in your browser ![]() I can explain the code in detail if anyone wants me to but I can't be arsed to right now ![]() https://img12.imageshack.us/img12/7924/screenshot20130302at021.png @pc_guru You can implement it recursively in JS easily. Use a nested function! |
FYI, you can bookmark with infinte scroll.. Have a look at HTML5 history API and most importantly replaceState() With that, you can keep updating the url, appending the current post's number to the url(1 way to do it). So when post 3 is at the top of the page, url will be https://www.nairaland.com/1195236/3. Q.E.D ![]() |
It's possible to bookmark while infinitely scrolling! However it depends on the structure of your page. Something like a list of blog post is fairly trivial. |
Hey big man you still around! By slow I was referring to "searching visually". For instance on Twitter, I find that searching for a tweet is as easy as scrolling down my timeline. I seldom realize when I hit the next "page". Pagination breaks that flow. Same applies to Google images. But as I said above, I think they both have slightly different use-cases. |
@lordZOUGA Go, to Twitter -> Your Profile -> Your Tweets -> Scroll down(2-4 'pages'). Note your current location on your timeline Now from that page, click someone's username -> His/Her tweets. Use the back button to get back to your tweets and see where the app takes you to ![]() Pros of infinite scrolling, IMO - Speed (pagination is freaking SLOW) - Ease of use Cons - Skipping results IMHO, they both have slightly different use-cases. Pagination on Twitter for instance is just a waste of time and resources! @Seun pleaseeeeeee where is the preview button? |
Someone has changed his mind ![]() |
I definitely prefer to scroll. However, you must remember my last position(to the nearest pixel) when I use the back button.. |
Fixed your problem yet? If not then how about we figure out where the problem is coming from? Little math first A char is 2 bytes A String needs ((2 * String.length) + 16) bytes let longest string length = 30 Memory needed ~ 600000 * (32 + 16 + (30 * 2)) / 1024 ~ 65M // each string has: class, offset, length, array (total 32), each array has type, length (total 16) and data Now, I'm very sure your system has >70M of memory to spare(it does right?) So let's start by making sure reading in input isn't a problem. I have never had to not use Scanner so you can start with it. I'll get you started
|
I think @johnbendie has done a good job of breaking down your posts @OP. My question also piggy-backs off his initial question. What exactly is your qualification? What do you currently do? |
Personally, considering the fact that developers are beginning to program in a functional style, I think this is just a silly idea!(I mean that in the nicest possible way). What you are practically saying is this: every variable is a list and something like `val x = 2` is simply syntactic sugar for `x.add(2)`...eek! Think Twitter/Facebook/LinkedIn's social graph! The investment on memory alone will run them bankrupt in no time lol! Also, I find it hard to comprehend what you are trying to get across. You might want to gather your thoughts properly and write with the least possible number of words! I am not trying to indirectly insult you but it really does help! |
Well I can't tell you why you should use a framework, however, I can tell you why I use a framework. Basically, I want to concentrate on the business logic of the application and not boilerplate or some stupid configuration. I spent a good part of my life writing nifty things in PHP but when you want to write a proper application, you need to focus on the business logic. Frameworks like Rails offer that. You want a model? Generate a model. Need a controller to handle some requests? Generate a controller. Want to paginate your blog posts? Add 2 short lines of code, yes just 2 lines! Most importantly, they sometimes force you to design properly. Rails uses the MVC architectural pattern. If your app "fits in", and it almost always will, then use it. It has thousands of contributors, people who are experienced and know what they are talking about. Isn't that a whole lot easier that spending time writing boilerplate code? Question: How long would it take you to develop a well designed blog with basic functionality(posts, comments, tags, categories, authentication and authorization)? I'll roll that out WITH TESTS in >= 30mins using rails. Come over to my place with a stopwatch if you are in doubt I'll have 40% of the functionality working without opening a single source file. Just a few commands on the terminal.So do you still think you do not need a framework? We are killing this thread so we might have to jump on a new thread. |
Let me know how it goes. Post up the steps you took if something goes wrong. Quick Google search gave me this: Yeah a transition from windows to a UNIX system is a big one. Personally, I was using Windows, Linux(Virtual Box and Uni computers) and Mac OSX all at once. That way I was able to easily try things out without getting frustrated. After realizing how much suffering i've been going through on Windows(after 3 weeks lol), I switched to a Mac. I advise you do the same.. Install Ubuntu on VirtualBox. Try things out. If you need help understanding terminal commands, use `man`, short for manual. For instance, need help understanding sudo, just run `man sudo` and read! Youtube has a lot of short videos on how to use these commands too.. A lot of blog posts too. Google is also your friend. |
@Javanian continue what? My explanation of Scala and others? |
Ok no point taking this any further. You obviously .... oh well nvm! I'd rather talk to someone who is willing to learn and someone I can learn from. |
Write a bat script that contains the command needed to start your program(make sure you use the full path to the source file). Place that bat script in your startup folder. I hate windows so I can't remember where the damn folder is but you could figure that out. Note: You might want to use `javaw` as opposed to `java` to start the program. |
I was beginning to enjoy this thread until I read this "and I'm not about to start learning something as backward and pointless as Scala. Why that thing is even used is a mystery I cannot fathom." BACKWARD? POINTLESS?? MYSTERY ![]() If you say a thing like this in my environment, you will forever loose your integrity and reputation if you have any! Can you please state something you tried with Scala that gave you such an impression? I don't believe failing to understanding something is a reson to demean it! Now a lot of people have the misconception that Scala is an FP language. Oh well, it isn't! It's a full Object Oriented Language that includes most of the goodies of Functional Languages like SML and Haskell. FYI, it is actually more Object Oriented than Java can ever be! So why choose Scala? - Amazing Type System - Unified Types - Type Inference - Great support for variance(very important concept) - Strong Interoperability with Java libraries. - Functional Programing constructs like - Immutability - First class functions - Anonymous functions - for-comprehensions - Lazy evaluation/initialization - Pattern matching - Case classes - Higher order types - .. and soo much more - ..and soo much more Why choose Groovy? - Dynamically typed - Closures - Errr what else lol ![]() Groovy is like PHP, a mere hack!(I mean that in the nicest possible way) Scala was built from the ground up and can give Java a run for everything! You also mentioned this: "A good web framework is something that reduces your low level responsibility" And ruby on rails does what? Take some time to understand what "Convention over Configuration" means. if someone had shown me the Programming in Scala book by by Martin Odersky, Lex Spoon & Bill Venners back in 2003 I'd probably have never created Groovy.Full blog post here @megaplaza Scala is not hard but FP is(just until you get the hang of it of course). Notwithstanding, you do not have to write FP code in Scala. You can take the slow transition path! If you really want to learn FP, I have just one advise. Forget everything you know about programming. It's easier that way. @javaian I smell sarcasm lol |
ok Whiz. I guess you were talking out of context without carrying us along. FYI, I write a lot of Java code, mostly Scala now, and I do this comfortably in Vim |
@pak LOL you have made my evening! @whiz, please clarify your statement because last I checked, Vim and Emacs are simply text-editors ![]() |
Dear Mr Whiz, I was really beginning to like some of your posts but you just messed up, big time. No offence but before making claims on a public forum, do your research. You will NEVER learn if you are not ready to accept that your so-called correct answer can be 101% wrong. "What large software is writing with Vim or Emacs?" <- Seriously? You mentioned Linus. He USES Vi -> Please read https://plus.google.com/+LinusTorvalds/posts/iySKQGtkmtb Matz, the creator of "The Ruby Programming Language" uses EMACS! -> http://www.slideshare.net/yukihiro_matz/how-emacs-changed-my-life Should I go on? Again, please read http://stackoverflow.com/questions/208193/why-should-i-use-an-ide |
This is a joke right? Per annum ? HOLY! http://www./job/181772/web-developerprogrammer-in-lagos/ Another crazy joke! -> http://www./job/164184/professional-web-designerprogrammer-in-abuja/ |
Hmm this is interesting. Can someone please post some links to job vacancies in Nigeria(Dev related obviously). I just want to get a feel of what most companies are looking for. I don't know the tech companies else I would have done it myself. Gracias |
@candylips If you write your applications modular enough, and back them up with reasonable tests, you will almost never have to reach for the debug button. I work with legacy(10yrs+) and new systems everyday and I hardly ever need a debugger. However, there are times when i'm forced to use a debugger, like when i'm working with legacy code without tests which is just about 1% of the time. All I do is open in eclipse and debug, a little. Good read: http://stackoverflow.com/questions/208193/why-should-i-use-an-ide IDEs are for lazy people. Bottom line, you don't need an IDE. You simply want one! |
I was solving this with Java but stopped when I really understood the question. Scala and Functional Programming FTW!!! https://gist.github.com/4459253 Time spent: 10-12mins |
That is quite sad @Javanian. Things really need to change in Nigeria then. I still find it funny that CS students "contract out their projects". That's very very sad. If I were you, I'll stop working for such people, except they are ready to pay an exorbitant fee of course . @naija_swag I disagree. It's not a pointless topic. Not everyone believes in certifications. To be honest, I haven't heard anyone say anything about certifications in the last 12months. All I hear about are projects -> this pluggin or that extension or that library. |
I still don't see a reason. I think it's pointless lol. Certifications are just exams. IMHO Are they any good? Well, yeah kinda. I believe they prove you know how to prepare for and pass exams. Do they show your level of proficiency? ABSOLUTELY NOT! Yes I believe in proof too. Seeing is believing! Show me what you can do. The fact that an investment bank is hiring/interviewing you doesn't mean your games(be it 2D, 3D or even text based) are useless to them. What matters is how you approached the problem. Also, change! Has your knowledge of Software Development improved overtime? What about your analytical skills? It doesn't seem obvious how you can extract such information from someone's code but trust me when I say it's one of the easiest ways to do it. |
Slightly off topic question.. Why do Nigerians, well not all but most, care so much about certifications? |
@mashnino You might want to calm down and re-read this thread! |
Personally, I write Scheme/Racket and a little Clojure but just for fun!
Learning vim is like learning Functional Programming. To learn FP, you have to forget all you know about programming. To learn vim, you have to forget all you know about text editing first.



.