Delomos's Posts
Nairaland Forum › Delomos's Profile › Delomos's Posts
1 2 3 4 5 6 7 8 9 10 11 12 (of 12 pages)
DonSegmond:Does everything have to be OOP? Perhaps when all you have is a hammer, everything looks like a nail, ? |
DonSegmond:Kohana might be a lighter one. |
DonSegmond:^^ Now I need to go chop Eba to push this down well well, ahhhhhh :-) Btw, on #2, in all honesty RoR has a lower barrier of entry than PHP-based framework (Cake, CodeIgniter, Kohana) plus a web server comes within the framework as long as you have Ruby installed. |
Ahahaaa , the conundrum indeed, here's on in JS:
see what happens here: http://jsfiddle.net/gLmMm/2/ Oh no, but that was a fine looking piece of code? |
I'm talking of building a server to host rails app -- yes, it's very easy if you're hosting third party, and of course there's Cap (which is indeed awesome if you're, again, hosting third party, in fact if you're hosting on Heroku, deploying RoR is brain dead simple) -- I actually wrote a scaled down Capistrano that does continuous integration for Wordpress (https://github.com/delomos/bash-deploy). And yes, deploying on the right framework is a piece of cake (and there are many these days, notably Jenkins). Code > Build > Deploy [repeat] Fayimora:When some start seeing the power of PHP, they might start re-thinking Rails (at least the barrier of entry is slightly lower). |
Fayimora:Not taking particular jabs at anyone -- and yes, I don't expect folks to contribute to a project they care little about, I just thought this was a fun little one. And a quicky on RoR, I ran back to PHP when I got into the ultimate stumbling block >> Depolying a RoR App , Jesus F@cking Christ, deploying a rails app is a pain (and please don't mention cloud, Heroku, and all those goodies, for a small projects they're just too expensive). It takes me like 20 mins to set up a LAMP server, I've been stuck on configuring passenger to work with Apache so I can host this freaking Rails App (https://github.com/gitlabhq/gitlabhq), one wall after the other. But sorry, I'm ranting . I <3 Ruby.
|
I agree, CS is definitely easier to read/write (though I must agree, there's a more readable way to write that block -- but it'll deviate a bit off JS idioms e.g. use anonymous function if function is not called elsewhere, which many language frown upon but I think is sweet, as you mention, not exactly pleasantly readable) But don't forget you still have to compile, and debug a JS file (CS is only giving "syntax sugar"). In my mind, I'd most likely use CS is I'm doing a hardcore JS project, oooouch , but then there's Backbone.js , Dojo, Mootools, and other serious JS libraries that won't be in CS anytime soon. |
@ekt_bear This days, most of javascript work is heavy on jQuery which itself tries to abstract the working with the DOM, so say I want to do the oft AJAX thingy, say we're doing, using just JS/jQ: $.get('somepage.php', {s:s_query }, function(data, xhr){ if(!xhr.success) { console.log("some error" ; }else {$('#some_id').html(data) } }, json); ^^^ that is sure some heavy abstraction from writing pure XMLHttpRequest, then in CoffeeScript: $.get 'somepage.php' ,{s:s_query}, ->(data, xhr) if !xhr.success console.log "some error" else $('#some_id').html data ,json (which then compiles into JS that binds locally, and even more abstracted [synatically] ). One misconception most folks have about CoffeeScript is that it frees you from understanding javascript -- well, wrong. One has to actually understand JS well, quite well actually to find CoffeeScript useful (since you have to debug in JS anyways). jQ makes working with the day-to-day JS abstracted enough -- and frankly, getting used to some of CS idioms is too much trouble is all you're really doing is manipulating DOMs. |
ekt_bear:+1 that, don't invent the wheel. I hang on a few IRC channels quite a bit, will be sure to hang more in that if there's one. |
Took some time today to take another look at CoffeeScript through reading the beta of "Programming in Coffeescript" (due for release May/June 2012) -- a few interesting things with it lately but frankly, there's only so far abstraction should go, still sticking with vanilla Javascript. Maybe it's the book (which I'm giving feedback to), or just me --- meehhhh. |
Yup, it's more a forum for discussion though I'm starting to think soem of the folks on here are all talk, considering I've opening a topic to find contributors on my project and no one has signed up, Anyways, I have a few, see my github page: http://github.com/delomos. And currently working on one for African Fashion Designers (An African Web Fashion platform) <-- these are my side projects, separate from what I do for work |
samie4luv:^^^^^ Damnmit mehn, we need our moderators to be more active, this should not be posted here!!! |
paulo882:^^^^ ahhhh, so refreshing , I feel just finished a bowl of eba and egusi soup, maybe I just did actually. |
MrBible:Depends on who you're talking to, and what role you will be in , |
Try this: http://mailchimp.com/ free up to 2000 people Or 'find' this software: http://www.sendblaster.com/ |
Software Engineering: is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches; that is, the application of engineering to software. (wikipedia) Computer Science: [/i]designates the scientific and mathematical approach in information technology and computing. A computer scientist is a person who does work at a professional level in computer science. (wikipedia) [i]Programmer is someone who writes computer software. (wikipedia) That was an interesting article, but it's talking of regulating the "industry." Which, if you followed the US's recent SOPA issues (Jan 18th internet black-out), that will be a serious uphill battle. (ref: http://en.wikipedia.org/wiki/Stop_Online_Piracy_Act) And by the above definition, you and I can agree that the 3 could refer to exclusive 3 people. Most Software Engineers happen to be programmers, and some other programmer care less about the industry of "software" -- and even lesser work in the [theoretical] computer science field. |
@csharpjava csharpjava:A way to start a serious argument and derail the thread, for starters, definition(s) of professional >> http://www.merriam-webster.com/dictionary/professional |
Fayimora:Urgggg, can you maybe create a sub-forum for things like these or write a general post on the rules -- I think a sub-forum would work best. |
"whois" is a native tool installed on most Linux/Unix servers, and it is very easy to use from within a PHP script. An example: $hostname_to_lookup = "nairaland.com" // of course this wil be a dynamic variable from your users $output = shell_exec("whois $site" ;echo $output; // see attachment of my output when I run this. And of course, you can do interesting things with the output you get. Very important though, be very sure you're checking the input your users are giving you, "shell_exec" is very power and can be exploited, from the top of my head, I will check it like so (I didn't test this code, so you do the work, our experimenting): if(!preg_match(/http:\/\/[a-z]+.[com|edu|net]$/, $_POST['user_url']) ) { die("Sir, abeg enter correct URL" ; }else { $user_url = $_POST['user_url']; // or $_GET['user_url']; } $hostname_to_lookup = trim($user_url); // clean up the output $output = shell_exec("whois $site" ;echo $output;
|
In addition to @ekt_bear's response, sprintf might not always be practical (especially if you're not sure the original lines you're expecting, so let's say you have your lines in $lines, you can do: $excerpted_lines = substr($lines, 0, 50); //chops the line into, but this can chop things off in the middle so , //, let's clean it up $lines_array = explode(' ', $excerpted_lines); $word_count = count($lines_array); // now we have the cleaned up version, $clean_lines = impode(' ', array_slice($word_count,0, $word_count -1)); then I can do something like echo $clean_lines . ", "; I'm sure you can play with this in more interesting ways, here is a reference to the main PHP functions used here: http://dochub.io/#php/substr http://dochub.io/#php/implode http://dochub.io/#php/explode http://dochub.io/#php/array_slice |
@OP Out of curiosity, are you asking for algorithm (google , there are tons of image processing ones) , patterns (ditto algorithm), or language specifics, what exactly? -- can you outline what exactly you've already done and what you need help with. Your question is rather too broad, don't you think? |
You can read this :http://en.wikipedia.org/wiki/WHOIS You can use php `whois` to call native whois if your host is on a unix type machine then formatting your output accordingly. |
Beaf:", a single for loop that will find the following pattern (as a single unit): 1,3,0,0,8" 1,3,0,0,8 should be consecutive , ? Yes, I did read the previous solutions/post before posting. Beaf:it is, findPattern(array, array1, array2) through a single for loop , look carefully again @ what the code is doing. |
@ekt_bear ekt_bear:1. There's actually a chapter there on ruby (rather brief though, just enough to get along with rails), one will need a more serious book to enough ruby idioms though ('Programming Ruby' comes to mind which i'm actually going through now) 2. Nailed it. I should also add that is what has lead to the growth of agile development, man-power is very expensive. |
I have one here: https://www.nairaland.com/nigeria/topic-864237.0.html https://github.com/delomos/occupy9ja what is being worked on: http://www.occupy9ja.com/ |
vinderbilt:Good choice, just cut all the bullsh$t, for your ruby on rails, this is awesome: http://ruby.railstutorial.org/ruby-on-rails-tutorial-book?version=3.2#top It takes you from zero knowledge to building full scale web app (by the time your done with the lessons, you will have build a twitter clone). |
@Fayimora Fayimora:1. Yes, I do know why Google uses python. Do YOU know why Facebook uses PHP, or why Groupon uses Rails? What exactly is your point? 2. Every modern language (c. 90's+) are caring more for convention, readability over speed. So, in the speak of is Ruby faster; the real question is, faster to write or faster to execute? And yes, it's absolutely faster to write. |
Yup it is, active pulls are appreciated. I'm looking for folks wanting to devote (at least for a while) to the project. If you care to look around: https://github.com/delomos/occupy9ja thanks in advance. |
lordZOUGA:If you're talking about coding style, yes. If you're talking about Programming/Software Design Patterns, NO. You can't just stick to one. Is just like saying, in coding I found arrays and I stuck to using only arrays in my data structures. See here about design patterns: http://en.wikipedia.org/wiki/Software_design_pattern |
try switch up the logic: session_start(); $_SESSION['username'] = $username //I"m assuming you name this somewhere? if(!isset($_SESSION['username']) { header('Location:index.php'); // } //continue what you want everyone with cookie to see here , (or if you don't want to store anything, just check if a session ID is set) session_start(); if(!defined('SID') { header('Location:index.php'); // } //continue what you want everyone with cookie to see here |
((((("; },
; }else {