Hey guys I got my first programming job, and I start on Monday. I was wondering if there are any online tutorials or something that I can use to refresh my memory on Java. I've used it before many times, but I haven't used it for about a year and a half and I don't want to go into my job a complete noob.
What have you been working with?
This quarter it was SQL, the quarter before that I had MATLAB, the quarter before that it was Python, before that was OpenGL and Ruby and Scheme.
I'd figure anything that covers database and swing/gui shit would be more than fine. You probably won't do much more than database driven apps.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
Hey guys I got my first programming job, and I start on Monday. I was wondering if there are any online tutorials or something that I can use to refresh my memory on Java. I've used it before many times, but I haven't used it for about a year and a half and I don't want to go into my job a complete noob.
What have you been working with?
This quarter it was SQL, the quarter before that I had MATLAB, the quarter before that it was Python, before that was OpenGL and Ruby and Scheme.
And what is the job? j2ee? Some sort of swing gui stuff? Back end libs? Android? What technology will you be working with. The good and bad thing about Java is that it's huge and has a ton of different stuff, so it's hard to recommend what to look up, beyond basic "intro to java" type stuff which probably won't be all that useful to you without knowing what it is you'll be working with.
I'm not sure. I don't think I'll be working with GUI all that much, but again I'm not sure. The company is a data warehouse company, so I assume some SQL stuff. They told me Teradata and Java are the things I'll need to pick up or learn as I go. I'm okay with that.
I guess I'd like to refresh my memory with stuff like abstracts and creating classes, and stuff like that.
I'm not sure. I don't think I'll be working with GUI all that much, but again I'm not sure. The company is a data warehouse company, so I assume some SQL stuff. They told me Teradata and Java are the things I'll need to pick up or learn as I go. I'm okay with that.
I guess I'd like to refresh my memory with stuff like abstracts and creating classes, and stuff like that.
Maybe start at Oracle's site about Java? There's a LOT of info there, it appears. I know when it was run by Sun they had a full online book (which was also available in print) that taught Java.
There's a whole section about data warehousing stuff, too, so some of that might also be useful.
I very nearly did a "if success return true" statement today.
Forgive me.
I still occasionally get confused by Ruby returning values by default if they're the last statement to be executed. Then I go "oh yeah" when I see a line with nothing but "foo == bar".
I very nearly did a "if success return true" statement today.
Forgive me.
I still occasionally get confused by Ruby returning values by default if they're the last statement to be executed. Then I go "oh yeah" when I see a line with nothing but "foo == bar".
Perl does the same thing. I hate it when people do that. I prefer to be explicit about it even when I don't have to be (you might be asking why the hell I write Perl then right about now). It makes it more clear what is going on and less likely to break when I have to go back and make some changes later.
grrrr. What am I missing with this Django view and modelForm?
def add_version(request):
content = get_object_or_404(Content, id=request.GET.get('content',None))
version_id = request.REQUEST.get('version','')
if version_id:
version = ContentVersion.objects.get(pk=version_id)
form = att_load_app_content_version_form(instance=version)
else:
version_count = ContentVersion.objects.filter(content__id=content.id).count() + 1
form = att_load_app_content_version_form(initial={'content':content,'qiid': '%s-%s' % (content.name,version_count)})
#This save here fails for some reason claiming that content.id cannot be null
#form.save()
if request.method == 'POST':
#This bit here works just fine if I hit the button to save my form
form = att_load_app_content_version_form(request.POST, request.FILES, instance=version)
if form.is_valid():
form.save()
return HttpResponseRedirect('/att_app_load/view_versions/?content=' + `content.id`)
else:
return render_to_response(
'app_load/add_version.html',
{'content':content,},
context_instance=RequestContext(request))
devices = Device.objects.all()
return render_to_response(
'app_load/add_version.html',
{'content':content,
'devices':devices,
'form':form},
context_instance=RequestContext(request))
I want to save the form there if it's a new ContentVersion being created because I need the ContentVersion.id in my view. When I do form.save() it says that the content_id column in my contentversion table cannot be null.
Why is it null? content has an id as I'm able to create the object ok. The value for qiid shows up correctly in my final output, which means that content.name is there and content.id must be there for i to get version_count. I also access content.id in the template and it's there.
What silly little detail have I missed?
edit: nevermind, figured it out, I guess. It seems that creating the form and passing the initial values to it and saving doesn't actually save the form to a new instance of the model. I needed to create an instance of the ContentVersion object first and then initialize a form with that instance of the model.
So 3.5 years ago I got a laptop from my company that had a nice big 1600x1200 display.
Now our highest resolution laptop is 1600x900.
Good lord I hate widescreen displays.
But you can write like you have two terminals side by side!
But I could do that with a 1600x1200 display and display more lines in my file!
You know what would be a nice experiment to try?
Get one of those e-ink displays, and use that for a monitor.
I mean, if we're going to be staring at a monitor for hours every day, might as well make it comfortable, right?
The refresh rate would probably be a problem, though - although there might be 5 minutes of nostalgia - "Awwww... fades out like the old green monochrome CRTs!"
Well. That example will work. My actual case was much harder. But hell on earth, as you see, there is zero debugging capabilities for Blocks in XCode 4. None. At all.
Figured this might be an appropriate place to ask. I'm working on making some sort of resource to enable high school teachers to teach CS-related stuff. I'm planning on doing something to explain the concept of intractability and NP-completeness (which will actually be a part of their curriculum next year). The first step is to find a bunch of other resources and evaluate what could be used at this level.
I was just wondering if anyone here had seen some good explanations of this stuff. I'm hoping to track down videos/lecture slides of examples that aren't just formal proofs. More 'real-world' scenarios like the travelling salesman problem are great, but I'm trying to pull together as much stuff as I can.
As an example, here's a video of my lecturer teaching primary school kids about finite state machines (obviously this is aimed at a slightly lower level ;-))
The most annoying part of the accidental deletion is the code was not yet in git. It was a project that I started just to see if it might work. I decided today that it was definitely doable and a good idea and also realized I had a good bit of code, so that delete was actually me cleaning up the crap to get it ready to go into git. Argh. Should be able to have it all back up and running with just a couple of hours of work, though.
Question, not really programming but maybe someone will know.
I have a PC I use as a server, it's got a fairly old gentoo install on it. I discovered that the HttpRequest PHP module wasn't installed, so I went to download it, but there's no makefile that I can see. So another site tells me to go get this pear library to install it with and I did, but it's still not working (well technically on restarting apache to check I seem to have broken php completely, but that's something else.) So, any tips on getting it to install?
Question, not really programming but maybe someone will know.
I have a PC I use as a server, it's got a fairly old gentoo install on it. I discovered that the HttpRequest PHP module wasn't installed, so I went to download it, but there's no makefile that I can see. So another site tells me to go get this pear library to install it with and I did, but it's still not working (well technically on restarting apache to check I seem to have broken php completely, but that's something else.) So, any tips on getting it to install?
I'm not going to ask you guys to do my work for me. But if you guys could help me here I'm a bit lost.
Basically I'm given this in C.
/*Enumerated type creates set of constants numbered 0 and upward */
typedef enum{MODE_A,MODE_B,MODE_C,MODE_D,MODE_E} mode_t;
int switch3(int *p1, int*p2,mode_t action)
{
int result = 0
switch(action) {
case MODE_A:
case MODE_B:
case MODE_C:
case MODE_D:
case MODE_E:
default:
}
return result;
}
And I have to fill in the holes so that the assembly code looks like this
I'm running around like a headless chicken trying to figure how to even begin
Any help would be much appreciated
Hey guys, its me again. I don't think I've progressed enough with this and I am still in need of help.
From my understanding this is what I have so far. If you guys could help me as to where this would
go under each mode I'd greatly appreciate it. I swear to God I'm going to get this even if it kills me.
28 movl 8(%ebp), %edx Stores int *p1 in result
29 movl (%edx), %eax Stores a pointer to result in eax
30 movl 12(%ebp), %ecx Stores *p2 in ecx
31 movl %eax, (%ecx) Sets *p2 = *p1
32 movl $17, %edx Falls through to Case E where it sets edx to 17.
/*Enumerated type creates set of constants numbered 0 and upward */
typedef enum{MODE_A,MODE_B,MODE_C,MODE_D,MODE_E} mode_t;
int switch3(int *p1, int*p2,mode_t action)
{
int result = 0
switch(action) {
case MODE_A:
result = *p1;
p1 = *p2;
p2 = p1;
*p2 = p1;
case MODE_B:
result = *p1 + *p2;
*p2 = result;
break;
case MODE_C:
*p2 = 15;
result = *p1;
break;
case MODE_D:
*p2 = *p1;
result = 17;
break;
case MODE_E:
result = 17;
break;
default:
;
}
return result;
}
That's my best guess. Looks a bit woobly in A, but I'm assuming there's a bit left off in line 5.
Hey, any POSIX gurus in the house? I've got a problem.
I've got this hardware driver, we'll call it The Driver. It puts data in a big chunk of memory and then has a function that gives my code a pointer into this big chunk of memory.
I've got this communication library. It gives me a pointer to a buffer where I put data, and then I can publish this data with a different function.
I'd really love it if that buffer from the driver and that buffer from the library were actually pointing at the same piece of memory so I don't need to waste time with memcpy() over and over. I feel like this should be possible with mmap() or something but I don't know where to start.
(No, I can't modify the driver or the library, and yes, I need to use them).
/*Enumerated type creates set of constants numbered 0 and upward */
typedef enum{MODE_A,MODE_B,MODE_C,MODE_D,MODE_E} mode_t;
int switch3(int *p1, int*p2,mode_t action)
{
int result = 0
switch(action) {
case MODE_A:
result = *p1;
p1 = *p2;
p2 = p1;
*p2 = p1;
case MODE_B:
result = *p1 + *p2;
*p2 = result;
break;
case MODE_C:
*p2 = 15;
result = *p1;
break;
case MODE_D:
*p2 = *p1;
result = 17;
break;
case MODE_E:
result = 17;
break;
default:
;
}
return result;
}
That's my best guess. Looks a bit woobly in A, but I'm assuming there's a bit left off in line 5.
A would be:
result = *p1;
*p1 = *p2;
Which makes me suspicious that this isn't even compiler generated code, a compiler would be unlikely to do that, it would do:
Hey, any POSIX gurus in the house? I've got a problem.
I've got this hardware driver, we'll call it The Driver. It puts data in a big chunk of memory and then has a function that gives my code a pointer into this big chunk of memory.
I've got this communication library. It gives me a pointer to a buffer where I put data, and then I can publish this data with a different function.
I'd really love it if that buffer from the driver and that buffer from the library were actually pointing at the same piece of memory so I don't need to waste time with memcpy() over and over. I feel like this should be possible with mmap() or something but I don't know where to start.
(No, I can't modify the driver or the library, and yes, I need to use them).
Buffers are a good thing, you'll want to continue copying memory.
Infidel on
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
edited March 2011
In my computer arch class last quarter, the correct answer to about half the questions was "a buffer".
So this spring break, I want to implement as many sorting algorithms as I have time for. All I've done so far is call Go's standard library sort (a quicksort) for a baseline control, and a Radix sort, because I never could wrap my head around it before.
As it is, I've been using a few KB of randomly generated uint64's. I'm thinking, maybe I should try to find a practical example of a large chunk of data that needs sorting. But where would I find such a thing?
Monkey Ball Warrior on
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
In my computer arch class last quarter, the correct answer to about half the questions was "a buffer".
So this spring break, I want to implement as many sorting algorithms as I have time for. All I've done so far is call Go's standard library sort (a quicksort) for a baseline control, and a Radix sort, because I never could wrap my head around it before.
As it is, I've been using a few KB of randomly generated uint64's. I'm thinking, maybe I should try to find a practical example of a large chunk of data that needs sorting. But where would I find such a thing?
Make a name generator?
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
0
Options
Monkey Ball WarriorA collection of mediocre hatsSeattle, WARegistered Userregular
In my computer arch class last quarter, the correct answer to about half the questions was "a buffer".
So this spring break, I want to implement as many sorting algorithms as I have time for. All I've done so far is call Go's standard library sort (a quicksort) for a baseline control, and a Radix sort, because I never could wrap my head around it before.
As it is, I've been using a few KB of randomly generated uint64's. I'm thinking, maybe I should try to find a practical example of a large chunk of data that needs sorting. But where would I find such a thing?
Make a name generator?
Hmm, you mean actual names that are reasonable, not just random chars. Thats... an interesting challenge in itself.
But what you are saying is that sorting strings is more common than sorting ints?
Monkey Ball Warrior on
"I resent the entire notion of a body as an ante and then raise you a generalized dissatisfaction with physicality itself" -- Tycho
I've dealt more with sorting strings than ints. They're practically the same thing in theory. Though comparing 4 bytes of memory to 4 bytes of memory is different than comparing 15 bytes to 25 bytes. And it's also why a lot of sorting/searching algos make copious use of hashing.
bowen on
not a doctor, not a lawyer, examples I use may not be fully researched so don't take out of context plz, don't @ me
I find that I do much more sorting for searching than pure sorting. Often, when I want something sorted, it's just easier to keep it sorted all the time.
Posts
I'd figure anything that covers database and swing/gui shit would be more than fine. You probably won't do much more than database driven apps.
I'm not sure. I don't think I'll be working with GUI all that much, but again I'm not sure. The company is a data warehouse company, so I assume some SQL stuff. They told me Teradata and Java are the things I'll need to pick up or learn as I go. I'm okay with that.
I guess I'd like to refresh my memory with stuff like abstracts and creating classes, and stuff like that.
There's a whole section about data warehousing stuff, too, so some of that might also be useful.
Forgive me.
That's only bad if you have an "else return false"!
I still occasionally get confused by Ruby returning values by default if they're the last statement to be executed. Then I go "oh yeah" when I see a line with nothing but "foo == bar".
Don't worry, we all do it occasionally.
Then hurry and push another revision before someone notices.
I want to save the form there if it's a new ContentVersion being created because I need the ContentVersion.id in my view. When I do form.save() it says that the content_id column in my contentversion table cannot be null.
Why is it null? content has an id as I'm able to create the object ok. The value for qiid shows up correctly in my final output, which means that content.name is there and content.id must be there for i to get version_count. I also access content.id in the template and it's there.
What silly little detail have I missed?
edit: nevermind, figured it out, I guess. It seems that creating the form and passing the initial values to it and saving doesn't actually save the form to a new instance of the model. I needed to create an instance of the ContentVersion object first and then initialize a form with that instance of the model.
But I could do that with a 1600x1200 display and display more lines in my file!
You know what would be a nice experiment to try?
Get one of those e-ink displays, and use that for a monitor.
I mean, if we're going to be staring at a monitor for hours every day, might as well make it comfortable, right?
The refresh rate would probably be a problem, though - although there might be 5 minutes of nostalgia - "Awwww... fades out like the old green monochrome CRTs!"
someBlock = ^{
someBlock();
}
actually work?
This guy.
Well. That example will work. My actual case was much harder. But hell on earth, as you see, there is zero debugging capabilities for Blocks in XCode 4. None. At all.
Unable to delete "modified" - file in use. But I did manage to delete every other file, like you requested!
That is what you wanted, right?
I've done something VERY VERY similar before.
[ed] Also, eeccccoo, I lol'd at that.
Figured this might be an appropriate place to ask. I'm working on making some sort of resource to enable high school teachers to teach CS-related stuff. I'm planning on doing something to explain the concept of intractability and NP-completeness (which will actually be a part of their curriculum next year). The first step is to find a bunch of other resources and evaluate what could be used at this level.
I was just wondering if anyone here had seen some good explanations of this stuff. I'm hoping to track down videos/lecture slides of examples that aren't just formal proofs. More 'real-world' scenarios like the travelling salesman problem are great, but I'm trying to pull together as much stuff as I can.
As an example, here's a video of my lecturer teaching primary school kids about finite state machines (obviously this is aimed at a slightly lower level ;-))
I have a PC I use as a server, it's got a fairly old gentoo install on it. I discovered that the HttpRequest PHP module wasn't installed, so I went to download it, but there's no makefile that I can see. So another site tells me to go get this pear library to install it with and I did, but it's still not working (well technically on restarting apache to check I seem to have broken php completely, but that's something else.) So, any tips on getting it to install?
You're trying to hack my Gibson, aren't you!
Hey guys, its me again. I don't think I've progressed enough with this and I am still in need of help.
From my understanding this is what I have so far. If you guys could help me as to where this would
go under each mode I'd greatly appreciate it. I swear to God I'm going to get this even if it kills me.
That's my best guess. Looks a bit woobly in A, but I'm assuming there's a bit left off in line 5.
Steam
I've got this hardware driver, we'll call it The Driver. It puts data in a big chunk of memory and then has a function that gives my code a pointer into this big chunk of memory.
I've got this communication library. It gives me a pointer to a buffer where I put data, and then I can publish this data with a different function.
I'd really love it if that buffer from the driver and that buffer from the library were actually pointing at the same piece of memory so I don't need to waste time with memcpy() over and over. I feel like this should be possible with mmap() or something but I don't know where to start.
(No, I can't modify the driver or the library, and yes, I need to use them).
A would be:
result = *p1;
*p1 = *p2;
Which makes me suspicious that this isn't even compiler generated code, a compiler would be unlikely to do that, it would do:
movl 12(%ebp), %ecx // ecx = p2
movl (%ecx), %eax // eax = *ecx
movl 8(%ebp), %ecx // ecx = p1
movl (%ecx), %edx
movl %eax, (%ecx) // *ecx = eax
jmp .L19 // break
instead
edit: unless optimizations are turned off I suppose
Buffers are a good thing, you'll want to continue copying memory.
So this spring break, I want to implement as many sorting algorithms as I have time for. All I've done so far is call Go's standard library sort (a quicksort) for a baseline control, and a Radix sort, because I never could wrap my head around it before.
As it is, I've been using a few KB of randomly generated uint64's. I'm thinking, maybe I should try to find a practical example of a large chunk of data that needs sorting. But where would I find such a thing?
Make a name generator?
Hmm, you mean actual names that are reasonable, not just random chars. Thats... an interesting challenge in itself.
But what you are saying is that sorting strings is more common than sorting ints?