Open Side Menu Go to the Top

01-04-2013 , 11:45 AM
Well you guys were able to fix my last issue I was having so I'm going to try again.

Basically I have text that turns into an editable form when clicked (jQuery). When that form is submitted (AJAX) it fades out and I want the recently edited text to fade back in, but I can't get fadeIn to work.

I posted everything on StackOverflow here yesterday. Only got one response and it didn't solve the issue. Thanks a ton if someone knows the problem!
** 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 **
01-04-2013 , 12:01 PM
One thing I find helpful when debugging jquery stuff is to step through your jquery/js commands on the console. That way you can find exactly what line is wrong and if its a problem with your selector or with what you're trying to do.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-04-2013 , 02:53 PM
Yeah that's basically what I did and eventually figured it out so disregard my last post.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2013 , 01:54 PM
Anyone here have/know anyone who has some open source iOS projects they need help with on github, particularly working on UI elements (although open to other topics)? I've published three iphone apps for a client and have taken some CS coursework over the past year (was a math undergrad), and am looking to get started doing open source stuff. Happy to put in some legwork into an open source project or two.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2013 , 04:21 PM
Is there any opinions on those programming acceleration courses like App Academy or Dev Bootcamp?

I mean, for someone like me, who is deeply afraid of becoming a framework kitten..?

****

I have an interview for website intern coming up on Monday. I really don't know what to expect as there was nary a mention of technology in the job ad. I sort of sent my resume as a one-off, but rereading the description makes it look like I'd be doing more marketing and writing than anything else. Their pages are all appended with .php, so I guess that's what they use. The sites all look pretty good, so I'm not sure if they do internally or externally. I suspect internal because why would a decent dev house let the urls like that (I can actually name a few that do leave it, but just saying)?

EDIT TO ADD: This was actually more in line with what I am looking for. Not trying to get jobs doing any actual coding, just something circa the field, so the lack of technology mentions would be why I bothered.

Last edited by daveT; 01-05-2013 at 04:28 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2013 , 06:19 PM
Quote:
Originally Posted by daveT
I mean, for someone like me, who is deeply afraid of becoming a framework kitten..?
i'm confused. you learned programming doing scheme, created a website in clojure, seem to have a hacker's love of the guts of all technologies, and have never posted about any framework besides noir iirc. whence springs this fear of yours?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2013 , 07:51 PM
Corrections:

2 websites in Clojure, tyvm.

Noir is more like a suggestion of file systems with leaky abstractions.

I posted about Drupal (is it a framework?) and how much I don't like it.

* Is this a serious question?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2013 , 08:30 PM
more like a rhetorical way of saying your fear is silly
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-05-2013 , 11:15 PM
Framework's are incredibly useful, so long as you understand the underlying technology
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 06:02 AM
Quote:
Originally Posted by e i pi
Code:
for (i = p; i != id[i]; i = id[i]);
for (j = q; j != id[j]; j = id[j]);
if (i ==j) continue;
id[i] = j;
printf(" %d %d\n", p, q);
this is from sedgewick's algorithms in c. am i taking crazy pills or do each of these for loops only get executed once no matter what?
wait what
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 06:04 AM
oh i see what's going on. that's so weird to read.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 07:41 AM
Code:
#include <stdio.h>
#define N 10000
main()
  { int i, p, q, t, id[N];
    for (i = 0; i < N; i++) id[i] = i;
    while (scanf("%d %d\n", &p, &q) == 2)
      {
        for (i = p; i != id[i]; i = id[i]) ;
        for (j = p; j != id[j]; j = id[j]) ;
        if (i == j) continue;
        id[i] = j;
        printf(" %d %d\n", p, q) ;
      }
  }
yea took me a while to work out what was going on. also kind of tilts me that this is literally the 2nd code example in the book. in his other algorithms book it shows up on like page 250 something,

Code:
public class QuickUnion
{
  private int[] id;

  public QuickUnion (int N)
  {
    id = new int[N];
    for (int i = 0; i < N; i++) id[i] = i;
  }

  private int root(int i)
  {
    while (i != id[i]) i = id[i];
    return i;
  }

  public boolean find(int p, int q)
  {
    return root(p) == root(q);
  }

  public void unite(int p, int q)
  {
    int i = root(p);
    int j = root(q);
    id[i] = j;
  }
}
I don't even know java but that is more readable to me. Its kind of frustrating being in a spot where you're not sure if the book is unclear or if the material is just difficult.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 09:09 AM
Quote:
Originally Posted by daveT
Drupal (is it a framework?)
Not sure but for drupal 8 they are scrapping a lot of their code for symfony2, an MVC framework.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 12:59 PM
Quote:
Originally Posted by e i pi
Its kind of frustrating being in a spot where you're not sure if the book is unclear or if the material is just difficult.
welcome to software development.

Last edited by tyler_cracker; 01-06-2013 at 12:59 PM. Reason: iow, welcome to every code review ever
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 02:00 PM
Quote:
Originally Posted by tyler_cracker
welcome to software development.
i disagree with this actually. in the hands of a very good teacher, the vast majority of programming concepts are not that hard. the complexity can be broken down. similarly, if the code is hard to read, it most likely means it wasn't written well imo. now the programmer who wrote it might be very smart and very experienced and accomplished, but i'd consider readability to others a condition of well-written code.

so i think the answer to OP's question is, It's very likely the fault of the teacher. ofc, that only matters if you can find an explanation of the same material by a better teacher.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 02:21 PM
g_m,

i think you misunderstood my point. or are you saying that most of the code you encounter professionally has its complexity broken down and is easy to read?

(i.e. my comment was about how it is, not about how it should be. obviously all the code *i* write is well factored and transparent to even the greenest programmer, but the code of my colleagues... not so much.)
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 02:29 PM
Quote:
Originally Posted by tyler_cracker
g_m,

i think you misunderstood my point. or are you saying that most of the code you encounter professionally has its complexity broken down and is easy to read?

(i.e. my comment was about how it is, not about how it should be. obviously all the code *i* write is well factored and transparent to even the greenest programmer, but the code of my colleagues... not so much.)
yes ofc you are right about that. but you would justified in complaining about them. and OP would be justified to complain about the code samples in his book. we probably are not disagreeing about anything....
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 03:02 PM
Quote:
Originally Posted by gaming_mouse
similarly, if the code is hard to read, it most likely means it wasn't written well imo. now the programmer who wrote it might be very smart and very experienced and accomplished, but i'd consider readability to others a condition of well-written code.
This is true, but what's readable depends on the person reading it. There's a lot of perfectly well-written, easy-to-read code that most programmers will find painful to read, because to understand the code, they'd have to learn new concepts. In some cases, it may even be possible to restructure the program to avoid those concepts, but if the original system was well-designed in the first place, it's quite likely that the comprehensibility and extensibility of the whole system would suffer, even if the pieces become easier to understand. To use an extreme example, which is easier to understand for a complete newcomer to programming?

Code:
print 0;
print 1;
print 2;
print 3;
print 4;
print 5;
print 6;
print 7;
print 8;
print 9;


for (i = 0; i < 10; i++) {
   print i;
}
The former is indisputably easier to read and understand, because it doesn't require you to understand how loops, variables, incrementation, blocks, etc work. Now, nearly all programmers understand loops and variables but there are tons of basic abstractions that most programmers don't have strong understanding of: higher-order functions, threads, semaphores, monads, actors, continuations, type variance, lazy evaluation, etc, etc. Any code that uses those abstractions extensively will be difficult to read for most programmers regardless of how well-written it is. Now, there's tons of bad, hard-to-read code out there that is just bad. How do you tell when it's the code, not you? That's easy - if you can do it better, then it's not you, it's the code. On the other hand, if your alternative solution is much more verbose and/or much less performant than the code you're finding hard to understand, you're more likely to be the problem.

I find that bad code has three main flavors:

1) The programmer is not fluent in the abstractions he's using or lacking in basic competency, which results in lack of economy and verbose, extraneous code instead of direct solutions.

2) The programmer is too lazy, too timid or too unskilled to change and maintain code properly, which over time results in poor structure.

3) The programmer is overly eager to solve problems that don't exist, which results in creation of unnecessary abstractions, untested code paths that solve imaginary problems, premature performance optimization and abuse of fancy techniques.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 03:28 PM
Quote:
Originally Posted by candybar
1) The programmer is not fluent in the abstractions he's using or lacking in basic competency, which results in lack of economy and verbose, extraneous code instead of direct solutions.
tbh that's what my problem was here. I barely know C and couldn't see how he was using the for loops,

Code:
for (i = p; i != id[i]; i = id[i]) ;
to set the values of variables like,

Code:
private int root(int i)
  {
    while (i != id[i]) i = id[i];
    return i;
  }
my own fault for preferring python style for loops
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 03:38 PM
Quote:
Originally Posted by candybar
This is true, but what's readable depends on the person reading it. There's a lot of perfectly well-written, easy-to-read code that most programmers will find painful to read, because to understand the code, they'd have to learn new concepts. In some cases, it may even be possible to restructure the program to avoid those concepts, but if the original system was well-designed in the first place, it's quite likely that the comprehensibility and extensibility of the whole system would suffer, even if the pieces become easier to understand. To use an extreme example, which is easier to understand for a complete newcomer to programming?

Code:
print 0;
print 1;
print 2;
print 3;
print 4;
print 5;
print 6;
print 7;
print 8;
print 9;


for (i = 0; i < 10; i++) {
   print i;
}
The former is indisputably easier to read and understand, because it doesn't require you to understand how loops, variables, incrementation, blocks, etc work. Now, nearly all programmers understand loops and variables but there are tons of basic abstractions that most programmers don't have strong understanding of: higher-order functions, threads, semaphores, monads, actors, continuations, type variance, lazy evaluation, etc, etc. Any code that uses those abstractions extensively will be difficult to read for most programmers regardless of how well-written it is. Now, there's tons of bad, hard-to-read code out there that is just bad. How do you tell when it's the code, not you? That's easy - if you can do it better, then it's not you, it's the code. On the other hand, if your alternative solution is much more verbose and/or much less performant than the code you're finding hard to understand, you're more likely to be the problem.

I find that bad code has three main flavors:

1) The programmer is not fluent in the abstractions he's using or lacking in basic competency, which results in lack of economy and verbose, extraneous code instead of direct solutions.

2) The programmer is too lazy, too timid or too unskilled to change and maintain code properly, which over time results in poor structure.

3) The programmer is overly eager to solve problems that don't exist, which results in creation of unnecessary abstractions, untested code paths that solve imaginary problems, premature performance optimization and abuse of fancy techniques.
i agree with all this. i do think the question of what kind of competency we should expect from future readers of our code is not difficult in practice. i think it's acceptable to assume fluency in the language, as well as familiarity with the idioms of that language. if i'm writing js code, i can expect familiarity with OO-programming using prototypes, as well as functional programming concepts like closures, etc. if i use them and my code is confusing because of that, it's the other guys fault. if the other guy already understands those things and my code is still confusing, it's my fault.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 04:04 PM
Fluency in all/most aspects of the language is not always possible. A few months ago I looked into Scala.

I routinely saw examples of people who were shipping code day in and day out for years and it was still not possible to understand certain tricks or things that the language can do and it wasn't because of silly things like making methods that have poor names.

Quite a few people admitted that when they looked at code written by certain people, they were 100% clueless in some cases.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 04:21 PM
Quote:
Originally Posted by Shoe Lace
Fluency in all/most aspects of the language is not always possible. A few months ago I looked into Scala.

I routinely saw examples of people who were shipping code day in and day out for years and it was still not possible to understand certain tricks or things that the language can do and it wasn't because of silly things like making methods that have poor names.

Quite a few people admitted that when they looked at code written by certain people, they were 100% clueless in some cases.
as i said it's basically never a problem in practice. if you've been coding in a certain language for 6 mos or a year (and have general programming experience of more than that), and are even moderately up on what that language's current idioms are (maybe read stackoverflow, maybe a book or two on style/best practices) that is all i mean by fluent. doesn't mean you know every nook and cranny of the language, but you will be understand most code and quickly google what you don't know. compare that to someone who has no idea what a closure is and is trying to read js code written by an expert. that person is going to be lost, and it won't be a matter of a few google searches to get him on track.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 04:49 PM
Quote:
Originally Posted by gaming_mouse
as i said it's basically never a problem in practice. if you've been coding in a certain language for 6 mos or a year (and have general programming experience of more than that), and are even moderately up on what that language's current idioms are (maybe read stackoverflow, maybe a book or two on style/best practices) that is all i mean by fluent. doesn't mean you know every nook and cranny of the language, but you will be understand most code and quickly google what you don't know. compare that to someone who has no idea what a closure is and is trying to read js code written by an expert. that person is going to be lost, and it won't be a matter of a few google searches to get him on track.
K, so basically you read one sentence of my post then stopped. Gotcha haha.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 05:00 PM
just never been my experience.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
01-06-2013 , 08:30 PM
Quick survey: Absent any other information, which is preferable? (pseudocode)

Code:
foo1 = value1
foo2 = value2
foo3 = value3
Code:
foo = [value1, value2, value3]
** 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