₦airaland Forum

Welcome, Guest: RegisterLoginWith GoogleTrendingRecentNew

Stats: 3,325,134 members, 8,420,504 topics. Date: Thursday, 04 June 2026 at 10:32 PM

Toggle theme

Delomos's Posts

Nairaland ForumDelomos's ProfileDelomos's Posts

1 2 3 4 5 6 7 8 9 10 11 12 (of 12 pages)

ProgrammingRe: Application In Php by delomos(m): 1:45am On Feb 15, 2012
DonSegmond:
Whatever you are doing, you are doing wrong. Stop and look up how to use a template class.
Does everything have to be OOP?

Perhaps when all you have is a hammer, everything looks like a nail, ?
ProgrammingRe: Php Patterns by delomos(m): 1:43am On Feb 15, 2012
DonSegmond:
Read up on MVC

Start with code igniter first, it's very lightweight, then explore a more extensive frame work like symfony or zend.
Kohana might be a lighter one.
ProgrammingRe: Any Software Product From "nairaland Programmers"? by delomos(m): 1:40am On Feb 15, 2012
DonSegmond:
1. The cost of doing business is much less for you than for someone in Naija. It might not be much for you to buy a virtual server or dedicated server, but for someone in Naija, it does add up.

2. It's also true that one can also set up a RoR or Django on their personal computer if they decide to run Linux,

3. PHP was once ugly, but I don't feel it's ugly anymore, MVC is still very much alive, there are beautiful PHP applications out there. Can you say Facebook? Not to mention the countless CMS, and libraries out there.
^^ 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.
ProgrammingRe: Beaf's Mystery C# Conundrum! It Shouldn't Compile, But No, It Does! by delomos(m): 10:28pm On Feb 14, 2012
Ahahaaa , the conundrum indeed, here's on in JS:



var x=2, y=2

var Math_Funcs = {
add:function(x, y){ return ": ----- )))) "; },
multiply:function(x,y){ return "sad((((("; },
reminder:function(x, y){ return /*x % y*/ ":-D" ; }
};

alert(Math_Funcs.add(x,y));
alert(Math_Funcs.multiply(x,y));
alert(Math_Funcs.reminder(x,y));​


see what happens here: http://jsfiddle.net/gLmMm/2/

Oh no, but that was a fine looking piece of code?
ProgrammingRe: Any Software Product From "nairaland Programmers"? by delomos(m): 8:26pm On Feb 14, 2012
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:

, months ago. Trust me when I saw they way they deployed, lol I realised that all I have been doing in PHP was SMALL.
.
When some start seeing the power of PHP, they might start re-thinking Rails (at least the barrier of entry is slightly lower).
ProgrammingRe: Any Software Product From "nairaland Programmers"? by delomos(m): 7:00pm On Feb 14, 2012
Fayimora:


I can tell you something for sure tho, open source doesn't work that way. You just have to assume you are going to be alone on it but when you finally roll out something that interest developers, you would get tired of contributors. 
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.

ProgrammingRe: Coffeescript - What Is Coffeescript? by delomos(m): 2:48pm On Feb 14, 2012
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.
ProgrammingRe: Coffeescript - What Is Coffeescript? by delomos(m): 11:46am On Feb 14, 2012
@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"wink; }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.
ProgrammingRe: Nigerian Programming Real-time Irc by delomos(m): 11:06am On Feb 14, 2012
ekt_bear:
kodewrita, just start up a channel on irc.freenode.net or something
+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.
ProgrammingRe: Coffeescript - What Is Coffeescript? by delomos(m): 12:24am On Feb 14, 2012
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.
ProgrammingRe: Any Software Product From "nairaland Programmers"? by delomos(m): 7:18am On Feb 13, 2012
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
ProgrammingRe: Game Development: Join The Team by delomos(m): 3:47pm On Feb 12, 2012
samie4luv:
Are you a PHP developer from Nigeria? Are you interested in helping us preserve our heritage online? Come join the viewnaija team? Send a resume to ebinitie@viewnaija.com

Are you a Graphic Designer from Nigeria? Are you interested in helping us preserve our heritage online? Come join the viewnaija team? Send a resume to ebinitie@viewnaija.com

Are you a Network Engineer from Nigeria? Are you interested in helping us preserve our heritage online? Come join the viewnaija team? Send a resume to ebinitie@viewnaija.com
^^^^^ Damnmit mehn, we need our moderators to be more active, this should not be posted here!!!
ProgrammingRe: Humour: Does This Realy Say's Truth Abt Programmers by delomos(m): 3:40pm On Feb 12, 2012
paulo882:
@MrBible, Software Engineering and Programming are both branches of Computer Science. A Software Engineer by their profession deals with managing all the processes involved software development, from architecting the system, requirements gathering  to project managing it etc but has nothing to do with writing the actual software, that's the job of a programmer. So they are two different things. I would think employers would prefer a programmer with computer science instead of Software Engineering because a computer science graduate has had more hands on experience with coding than their Software Engineering counterpart. That's my take.
^^^^
ahhhh, so refreshing , I feel just finished a bowl of eba and egusi soup, maybe I just did actually.
ProgrammingRe: Humour: Does This Realy Say's Truth Abt Programmers by delomos(m): 8:35pm On Feb 10, 2012
MrBible:
But to an employer a programmer is someone that has a background in Software Engineering or Computer Science.
Depends on who you're talking to, and what role you will be in ,
ComputersRe: Using Remote Desktop With Ssh Root And Tunneler To Create A Mail Server by delomos(m): 5:49pm On Feb 10, 2012
Try this: http://mailchimp.com/ free up to 2000 people

Or 'find' this software: http://www.sendblaster.com/
ProgrammingRe: Humour: Does This Realy Say's Truth Abt Programmers by delomos(m): 5:43pm On Feb 10, 2012
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.
ProgrammingRe: Humour: Does This Realy Say's Truth Abt Programmers by delomos(m): 4:09pm On Feb 10, 2012
@csharpjava
csharpjava:
There is a difference between a programmer and a professional programmer. A professional programmer is one that have studied Software Engineering or Computer science while a programmer can be anyone who just picks up a book learn some syntax and then call themself a programmer.
A way to start a serious argument and derail the thread, for starters, definition(s) of professional >> http://www.merriam-webster.com/dictionary/professional
ProgrammingRe: Newbie Needs Help In 'programming' by delomos(m): 11:55pm On Feb 09, 2012
Fayimora:
There is just too much of these on the forum. No offence intended but dont you think you should be thinking about all these yourself?
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.
WebmastersRe: Help To Integrate Whois Domain Details To Website by delomos(m): 9:42pm On Feb 09, 2012
"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"wink;

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"wink;
}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"wink;

echo $output;

ProgrammingRe: Application In Php by delomos(m): 6:11pm On Feb 09, 2012
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
ProgrammingRe: Image Processing Using Handel-c by delomos(m): 1:07pm On Feb 09, 2012
@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?
WebmastersRe: Help To Integrate Whois Domain Details To Website by delomos(m): 10:10am On Feb 09, 2012
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.
ProgrammingRe: Simple Code Challenge: C#, Java, C, C++ by delomos(m): 9:59am On Feb 09, 2012
Beaf:
, The 3 arrays are meant to be tested individually, and you should get 3 positives not 2.
", 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:
, The 3 arrays are meant to be tested individually, and you should get 3 positives not 2 ,
it is, findPattern(array, array1, array2) through a single for loop , look carefully again @ what the code is doing.
ProgrammingRe: Should A Beginner Learn 2 Programming Languages At Once? by delomos(m): 1:50pm On Feb 08, 2012
@ekt_bear
ekt_bear:
1. Doesn't teach your Ruby though. Just teaches you Rails (they are different things.)
,
2. Fayimora, I don't think a 20% or 30% speed difference in Ruby vs. say other languages is a huge deal. The bottleneck these days is man-hours, not really computation. You can always just throw more computers at the problem, then worry about optimizing later.
I doubt Twitter would have gone anywhere if they'd implemented in an annoying language like Java from scratch.
No, they built their systems first in Ruby, then later started moving critical, performance-sensitive components over to Scala (a JVM language.)
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.
WebmastersRe: A+ by delomos(m): 1:44pm On Feb 08, 2012
ProgrammingRe: Should A Beginner Learn 2 Programming Languages At Once? by delomos(m): 12:58am On Feb 08, 2012
vinderbilt:
, but I want to get into serious web development now. Building powerful web based applications like social media and ecommerce sites. I think I'll go with Python for now or may be ruby if I can get my hands on ruby on rails.
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).
ProgrammingRe: Should A Beginner Learn 2 Programming Languages At Once? by delomos(m): 9:55pm On Feb 07, 2012
@Fayimora
Fayimora:
[font=Comic Sans MS][size=12pt]@delmos and @ekt I think ya'll should read this => http://stackoverflow.com/questions/1113611/what-does-ruby-have-that-python-doesnt-and-vice-versa DO you want to know why google uses python?

@delomos I doubt if Ruby is faster. . . Matz himself said Ruby supports convention over performance.
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.
ProgrammingRe: Need Help/collaborators On Occupy9ja.com by delomos(op): 9:40pm On Feb 07, 2012
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.
ProgrammingRe: Should A Beginner Learn 2 Programming Languages At Once? by delomos(m): 12:47pm On Feb 07, 2012
lordZOUGA:
I think at this point, it's safe for me to say that you don't really know what u are saying. Every programmer has a pattern that makes his code different from the next programmer. The differences can either be subtle or prominent,
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
ProgrammingRe: Home Page Logout On Page Refresh by delomos(m): 12:42pm On Feb 07, 2012
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

1 2 3 4 5 6 7 8 9 10 11 12 (of 12 pages)