Open Side Menu Go to the Top

06-01-2014 , 05:40 AM
Quote:
Originally Posted by daveT
Just learn Lisp, imo. (just kidding (or am I?))

Clowntable: do you really believe that Haskellers are smarter than everyone else or do you believe they are just too naive to care or simply don't give a **** when they start using it?
I have no idea but the average raw intelligence of Haskell programmers seems really high. Probably because there's a lot of mathematicians mixed in...dunno. It also kind of self-selects since it is pretty hard to learn and use well (imo as someone who still doesn't grasp monads so maybe it's supereasy if you learn it first or something but I have doubts).
Mostly tongue in cheek though.

Quote:
Originally Posted by Xhad
Having heard Scala called a Lisp multiple times now, I'm starting to think that "Lisp" has been corrupted to mean "Every language with first-class functions. And some without them."
JavaScript...the Lisp of the browser!

Quote:
Is ruby used for much professionally outside Web Development and scripts?
Gaining some momentum in cross platform mobile, used some in security related software (often scripting). Probably used for a lot of stuff in Japan, talked to a guy from the University of Tokyo and it's the language of choice there.
The nice internal DSL capabilities make it useful in a lot of contexts...some sort of machine control system comes to mind but I forgot the name of it (I guess that would technically be scripting though).
Doesn't really matter though, the web is the UI of our time and it's doing well there.

Last edited by clowntable; 06-01-2014 at 05:54 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
06-01-2014 , 03:19 PM
The hallmarks of Lisp are S-Expressions, homoiconicity, and a small collection of special forms.

S-Expressions:
(= (+ 3 2) 5)
==> true

Homoiconicity means that the code you write is the same code that exists at the interpretor / compiler level. (Today's lesson: Prolog is homoiconic)

Clojure special forms:

def
if
do
let
quote
var
fn
loop
recur
throw
try
monitor-enter
monitor-exit

The rest of the language is built in Clojure itself. The same idea exists in all Lisps.

Clearly, Scala is a lisp.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-01-2014 , 05:03 PM
Quote:
Originally Posted by daveT
The hallmarks of Lisp are S-Expressions, homoiconicity, and a small collection of special forms.

S-Expressions:
(= (+ 3 2) 5)
==> true

Homoiconicity means that the code you write is the same code that exists at the interpretor / compiler level. (Today's lesson: Prolog is homoiconic)

Clojure special forms:

def
if
do
let
quote
var
fn
loop
recur
throw
try
monitor-enter
monitor-exit

The rest of the language is built in Clojure itself. The same idea exists in all Lisps.

Clearly, Scala is a lisp.
http://programmers.stackexchange.com...a-lisp-dialect
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-01-2014 , 06:05 PM
I find it funny how controversial it is to define a Lisp. No one says Java is a Python. How is it possible to look at another language and say it may be a Lisp? Just count the damn parenthesis!

The fascinating part about the special forms in Lisp is that there is no defined data structure. The list is just a by-product of encoding the AST. The same goes for the cons, car, and cdr*: these operations appear so fundamental to Lisp yet the ideas are pure vapor.

*cons / conj, first, rest respectively in Clojure.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-01-2014 , 11:09 PM
Anyone create their own cheat sheets to help memorize functions?

I seem to very easily forget function names, parameters, uses so quickly since I don't program as frequently as I would like so I have begun a plan to create my own cheat sheets. I've made my first cheat sheet with R and plan on doing so with python's data analysis libraries.

So far its been very helpful and I could turn the sheet into flashcards using this open source project found here - http://ankisrs.net/
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 01:42 AM
For Python, "help" and "dir" imo

Dave: I have seen Python called a Lisp before, despite its designer being openly hostile to it! This may have died down around the time when it became trendy to call Ruby Lisp and JavaScript Scheme.

FWIW, that top answer on the SE post is pretty much exactly what I was thinking; that Scala has so much effing syntax, with a close second being the strong typing (oddly enough, I've never seen anyone call any of the ML-derivatives a Lisp even though that seems to be Scala's primary influence). I took 1 1/2 of Odersky's online courses and the language always felt really huge.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 03:07 AM
Greeksquared: You could also try creating a mindmap of the functions. Freemind is pretty good for it, you can copy&paste examples etc.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 01:57 PM
Anyone have any suggestions for best private video uploading? I need like a filepicker.io for videos basically.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 02:12 PM
Quote:
Originally Posted by Greeksquared
Anyone create their own cheat sheets to help memorize functions?

I seem to very easily forget function names, parameters, uses so quickly since I don't program as frequently as I would like so I have begun a plan to create my own cheat sheets. I've made my first cheat sheet with R and plan on doing so with python's data analysis libraries.

So far its been very helpful and I could turn the sheet into flashcards using this open source project found here - http://ankisrs.net/
my memory isn't the best when I tackle new stuff. I just learn by using stuff. While I'm learning a new framework, language, whatever... I just live in the API docs. Eventually you'll get it. Seems like studying when you could just be doing is a waste (unless you're a student or something and they want useless memorization).

edit: to be fair, it's probably worth writing down the basics if you're not programming often (as I glossed over). But I wouldn't go too in depth because that's why there is documentation.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 03:01 PM
I was just starting the ios programming book from BNR and now apple just released a new programming language called swift. WtF, I was just getting good
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 03:10 PM
Quote:
Originally Posted by Nchabazam
my memory isn't the best when I tackle new stuff. I just learn by using stuff. While I'm learning a new framework, language, whatever... I just live in the API docs. Eventually you'll get it. Seems like studying when you could just be doing is a waste (unless you're a student or something and they want useless memorization).

edit: to be fair, it's probably worth writing down the basics if you're not programming often (as I glossed over). But I wouldn't go too in depth because that's why there is documentation.
To be clear for the people who aren't familiar with python...you can type dir(foo) (where foo can be any object or module) and get a list of its methods and attributes, or type help(bar) to get the docstring associated with bar. So you can look up a lot of stuff without ever leaving the shell. I always have a REPL running while programming Python anyway.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 08:08 PM
Am I crazy or is posting something on your Facebook wall from an Android App hard (preloaded text, not type+post)? I googled around and am just using a workaround of posting a link and the stuff I want to test as the description for now.
FB integration and login etc. is set up already.

(First day of Android development, basically I want to build a "click some checkboxes, click submit and it posts the checkboxes you selected" App...I've gotten pretty far already except for...the posting)

Last edited by clowntable; 06-02-2014 at 08:14 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-02-2014 , 10:05 PM
Freemind looks cool. Someone made a data science subway map in a freemind-esque manner that I actually found quite helpful.


The big issue I have with sitting down and coding by looking back and forth through the API is that I feel that I will lose complete awareness of different packages/functions if I haven't used them in a while. I tend to just reuse the same functionality over and over again. The cheat sheets can be something that I can scan occasionally to put that rarely used function back into the forefront of my mind.

And if anyone is wondering - in R the following will give you a list of all the functions in a package. Didn't know about the dir() command in python. Will be using that quite a bit.

Code:
ls(getNamespace("package name"), all.names = T)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-03-2014 , 05:19 AM
All,

Looking to implement a feature on a project that turns user-inputted data into a chart. I'm confident our coders can turn the data into the pie chart, but I'm curious about the most functional way to retrieve the data.

A user will select the amount of fields they'll be using. We need to figure out the best way for our code to "calculate" the % to assist the user in creating the right percentages easily.

So if they select 3 services and type in 50% for the first one, we would pre-fill (in placeholder text) the next 2 services at 25% each. If they change one of the 25% to 40%, the final would change to 10%, etc.

So basically they'd react to one another and calculate to a whole 100%.

Is this very difficult? Do you guys know of any live examples of this already?

Thanks!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-03-2014 , 09:19 AM
http://coursera.org has a free class, programming 4 everyone that just opened M0nday, that I believe is taught out of Michigan State University in the states. They teach Python


ANyone have any experience with coursera classes/?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-03-2014 , 11:11 AM
Quote:
Originally Posted by catsec
ANyone have any experience with coursera classes/?
I've TA'ed a couple.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-03-2014 , 11:57 AM
There are quite a substantial amount of beginning programming courses that have now been offered on coursera/edx/udacity. My first full course that I completed was the 'Interactive programming in python' coursera class produced from rice university. It was very fun - we built a new game every week.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-03-2014 , 12:42 PM
Quote:
Originally Posted by Nchabazam
Anyone have any suggestions for best private video uploading? I need like a filepicker.io for videos basically.
Im pretty sure Vimeo Plus allows you to upload private videos and share them with specific people. You could also use dropbox or google drive.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-03-2014 , 11:20 PM
Quote:
Originally Posted by catsec
http://coursera.org has a free class, programming 4 everyone that just opened M0nday, that I believe is taught out of Michigan State University in the states. They teach Python


ANyone have any experience with coursera classes/?
Anything that teaches the difference between 0 and o will do you good.

Coursera is pretty hit or miss. If you want hard-core, go to EdX.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2014 , 12:17 AM
Quote:
Originally Posted by Greeksquared
Anyone create their own cheat sheets to help memorize functions?

I seem to very easily forget function names, parameters, uses so quickly since I don't program as frequently as I would like so I have begun a plan to create my own cheat sheets. I've made my first cheat sheet with R and plan on doing so with python's data analysis libraries.

So far its been very helpful and I could turn the sheet into flashcards using this open source project found here - http://ankisrs.net/
i just keep the help docs open. i cant be fkd
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2014 , 03:35 AM
Quote:
Originally Posted by Nchabazam
Anyone have any suggestions for best private video uploading? I need like a filepicker.io for videos basically.
screencast.com is decent for private vids IIRC.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2014 , 09:16 AM
Any coders here ever been to bangalore for project work? Just interested if anyone has any experience of the place and advice.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2014 , 06:23 PM
Having trouble getting a php contact form to work. I believe the html form and php file are set up correctly, so is next option to get in touch with hosting provider and ask about it?

Here's the html. I've got a form with action attribute pointing to the php file and a button type="submit".

Code:
<form class="contact-form" method="post" action="contact-form.php">
    <p class="contact-form-name">
        <label for="name">Name <span class="required">*</span></label>
        <input type="text" aria-required="true" size="30" value="" name="name" id="name" class="form-control" placeholder="Name">
    </p>
    <p class="contact-form-email">
        <label for="email">Email <span class="required">*</span></label>
        <input type="email" aria-required="true" size="30" value="" name="email" id="email" class="form-control" placeholder="Email">
    </p>
    <p class="contact-form-subject">
        <label for="subject">Subject <span class="required">*</span></label>
        <input type="text" aria-required="true" size="30" value="" name="subject" id="subject" class="form-control" placeholder="Subject">
    </p>
    <p class="contact-form-message">
        <label for="message">Message</label>
        <textarea aria-required="true" rows="8" cols="45" name="message" id="message" class="form-control" placeholder="Message"></textarea>
    </p>
    <p class="contact-form-submit vertical-margin-40">
        <input type="submit" value="Send" id="contact_form_submit" name="contact_submit" class="theme_btn">
    </p>
</form>
Here's the php, which I've verified is the correct filename to which the html points. Am using the mail() function to send the email as the hosting provider recommends in its guide.

Code:
<?php 
//////////////////////////
//Specify default values//
//////////////////////////

//Your E-mail
$your_email = '[email protected]';

//Default Subject if 'subject' field not specified
$default_subject = 'Site Contact Form';

//Message if 'name' field not specified
$name_not_specified = 'Please type a valid name';

//Message if 'message' field not specified
$message_not_specified = 'Please type a vaild message';

//Message if e-mail sent successfully
$email_was_sent = "Thanks! We'll get back to you shortly."

//Message if e-mail not sent (server not configured)
$server_not_configured = 'Sorry, mail server not configured';

///////////////////////////
//Contact Form Processing//
///////////////////////////
$errors = array();
if(isset($_POST['message']) and isset($_POST['name'])) {
	if(!empty($_POST['name']))
		$sender_name  = stripslashes(strip_tags(trim($_POST['name'])));
	
	if(!empty($_POST['message']))
		$message      = stripslashes(strip_tags(trim($_POST['message'])));
	
	if(!empty($_POST['email']))
		$sender_email = stripslashes(strip_tags(trim($_POST['email'])));
	
	if(!empty($_POST['subject']))
		$subject      = stripslashes(strip_tags(trim($_POST['subject'])));


	//Message if no sender name was specified
	if(empty($sender_name)) {
		$errors[] = $name_not_specified;
	}

	//Message if no message was specified
	if(empty($message)) {
		$errors[] = $message_not_specified;
	}

	$from = (!empty($sender_email)) ? 'From: '.$sender_email : '';

	$subject = (!empty($subject)) ? $subject : $default_subject;

	$message = (!empty($message)) ? wordwrap($message, 70) : '';

	//sending message if no errors
	if(empty($errors)) {
		if (mail($your_email, $subject, $message, $from)) {
			echo $email_was_sent;
		} else {
			$errors[] = $server_not_configured;
			echo implode('<br>', $errors );
		}
	} else {
		echo implode('<br>', $errors );
	}
}
?>
At the moment the "send" button on the site just doesn't respond. I tried entering 'echo "hello";' into php file just to see if I got a response, but I didn't.

See any blatant errors, or think this is a server-side issue?

I'm new to this, and not looking to be handed the answer. If you'd like to point me to the next step in bugfixing this type of issue I'd love to hear it.

Thanks.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2014 , 07:42 PM
Quote:
Originally Posted by Urinal Mint

At the moment the "send" button on the site just doesn't respond. I tried entering 'echo "hello";' into php file just to see if I got a response, but I didn't.

See any blatant errors, or think this is a server-side issue?
Instead of printing out 'hello' get in the habit of printing out the data you care about,

Code:
print_r($_POST);
die;
But since the button isn't responding, I think it's a client side problem otherwise you'd be redirected to some blank white page or php error message. Learn to open the chrome dev console and watch the network requests. You might not even be sending the request.

When you press the submit button does it compress and just not do anything, or does it not even compress? If it doesn't compress you might have a fixed height on your form and some z-index issues preventing you from even pressing the submit button. If it does compress you might have some javascript intercepting the submit and sending it with ajax which you might want to disable while debugging.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
06-04-2014 , 08:02 PM
Urinal,

It's been a long time since I really wrote PHP but...

Code:
$email_was_sent = "Thanks! We'll get back to you shortly."
This line is missing a semi-colon. Are they mandatory in PHP?

Also you should login to the server and check for error logs. There's likely an error.log file somewhere, probably in the root public directory of your site.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m