|
Thread Rules 1. This is not a "do my homework for me" thread. If you have specific questions, ask, but don't post an assignment or homework problem and expect an exact solution. 2. No recruiting for your cockamamie projects (you won't replace facebook with 3 dudes you found on the internet and $20) 3. If you can't articulate why a language is bad, don't start slinging shit about it. Just remember that nothing is worse than making CSS IE6 compatible. 4. Use [code] tags to format code blocks. |
noone learns how to do everything. The thing you do learn as a computer science student is to know what you don't know, and to know how to learn and understand it. I totally annoy all people around me with this, but whenever they ask me something, i usually say "i have no idea" because i actually don't. If you put me infront of the problem (usually technology related obviously, because computer science people are predestined to fix computers and anything that runs on digital circuits), i'll usually solve it very quickly just because i intuitively look in the right spots. But still, i have absolutely no clue about it. Most people don't get that. They say "but you'll solve it almost instantly, so you must know it!", but i just know i don't.
but that is not limited to computer sciences. Of course, computer science is one of these fields where you absolutely need this. But basically, every engineer needs this. Engineers are "sort of" limited to getting into stuff that has hardware machines attached, while computer science people will have to get into anything, even stuff that's not researched enough yet so that anyone has a deep enough understanding to provide a more or less mathematical model of it.
that being said, i'm a cs student, but last semester i only had engineering courses, and while this last paragraph may have sounded like engineers get of easy, don't be fooled, the big machinery is usually just as complicated as any other random subject to work on so no hurt feelings please!
|
Can any of you guys help me? Java applets
This is the problem: + Show Spoiler + Create an applet with a Button. Display your name in an 8-point font. Every time the user clicks the Button, increase the font size for the displayed name by four points. Remove the Button when the font size exceeds 24 point.
So far this is what i've worked on: + Show Spoiler +import java.applet.*; import java.awt.*;
public class Exercise extends applet implements ActionListener { Button button1 = new Button("Press This"); Label label1 = new Label("Benjamin"); Font font1 = new Font("Helvetica",Font.BOLD,8);
public void init() { label1.setFont(font1); button1.addActionListener(this); add(label1); add(button1); }
public void ActionPerformed(ActionEvent thisEvent) { } }
Our instructor have not really tackled that deep, so i think I lack some basic commands to complete this problem.
Thanks in advance.
|
Your code doesn't compile.
I fixed it, see if its what you are supposed to do: + Show Spoiler + import java.applet.*; import java.awt.*; import java.awt.event.*;
public class Exercise extends Applet implements ActionListener { public void init() { label1.setFont(font1); button1.addActionListener(this); add(label1); add(button1); }
public void actionPerformed(ActionEvent thisEvent) { if(thisEvent.getSource() == button1) { mFontSize += 4; if(mFontSize >= 24) { button1.setVisible(false); } font1 = new Font("Benjamin", Font.BOLD, mFontSize); label1.setFont(font1); } } private int mFontSize = 8; private Button button1 = new Button("Press This"); private Label label1 = new Label("Benjamin"); private Font font1 = new Font("Helvetica", Font.BOLD, mFontSize); }
Explanation:
You've registered button1 to receive actions which will be handled by the class Exercise with the method actionPerformed. In this method you check to see what is the source of the action event triggered by the user. If it is the button, it will increase the size of the font by 4 and check if the size is greater than 23, if it is, then you turn your button invisible.
Notice that a class attribute has been created to keep track of the size of the font.
|
Thank you very much sir, my instructor haven't really said anything about using an assigned int value to set a font. I really have no idea on how to increase the size of the font before you posted it.
I have a question. What does the .getSource() class exactly do?
Thanks again!
|
Oh, no problem man!
The method getSource() returns the object target of the action which triggered the actionPerformed() callback.
|
You just saved me from not completing my laboratory examination.
Thank you very much, till next time sir!
|
I am having an interesting problem. I want to have a box with a border overlaid on top of a vlc web player. I can get it to work just fine if the background color is not transparent, but as soon as I set it to transparent, it gets drawn behind the player. Does anyone know how to get around this?
Here is a jsfiddle that shows what I am talking about (You need to have vlc web plugin installed in order for this to work. Additionally, you can only do overlays with firefox, for some reason).
http://jsfiddle.net/AsGuL/21/
|
Hi, I know very few about javascript, but I would like to create a button (or a link that I could click, or a shortcut in my chrome link bar) that transform an url of the page I'm currently browsing. But I don't know how to add this to my browser. What I want to do is when I'm on a http://www.youtube.com/user/hsypersakura2009#p/c/xxxxxxxxxxxx page, I'm get either a link or a button, or like I said just a shortcut in my quicklaunch bar that I manually press that transform the url to : http://www.youtube.com/view_play_list?p=xxxxxxxxxxxxx I know how to transform the url, I just don't know how to implement this and where to put the code, this should be like a very basic chrome plugin. I tried to create an html document, made a shortcut and I click it, but it doesn't retrieve the url I was in, either with document.url or document.referrer (the later is null) I'm sure it's a very basic question, but I have so low experience in this and I don't know how to do it.
|
Never mind I didn't read the OP very well!
|
On July 20 2011 00:59 MrCon wrote:Hi, I know very few about javascript, but I would like to create a button (or a link that I could click, or a shortcut in my chrome link bar) that transform an url of the page I'm currently browsing. But I don't know how to add this to my browser. What I want to do is when I'm on a http://www.youtube.com/user/hsypersakura2009#p/c/xxxxxxxxxxxxpage, I'm get either a link or a button, or like I said just a shortcut in my quicklaunch bar that I manually press that transform the url to : http://www.youtube.com/view_play_list?p=xxxxxxxxxxxxxI know how to transform the url, I just don't know how to implement this and where to put the code, this should be like a very basic chrome plugin. I tried to create an html document, made a shortcut and I click it, but it doesn't retrieve the url I was in, either with document.url or document.referrer (the later is null) I'm sure it's a very basic question, but I have so low experience in this and I don't know how to do it. A poor man's solution could be to make a bookmark named, say "asdf", with the address like javascript:window.location=window.location.toString().replace(new RegExp("(.*)user/[^/]*/c/(.*)"), "$1view_play_list?p=$2") and when you want to use it, enter asdf in the address bar and select the bookmark.
Oh, if you don't have the bookmark bar hidden, it could work quite nicely.
|
Man I have been trying to get into JSF 2 (work related) but it's sick hard. I really like java but I hate jsf so far. Anyone here who can offer help when I grind this tomorrow?
|
On July 18 2011 12:01 Xanbatou wrote: Hello TL,
I am a computer science major at UCSD. Recently, at the place I'm interning at, I got involved in a discussion about the future of the computer science degree. The guy I was talking with said in about 10-15 years, computer science will closely resemble a liberal arts degree, of sorts. He said that computer science by itself is useless and it's much better if you major in math, physics, biology, or something else and use computer science as a tool to help you get your job done. Furthermore, he said that basic computer science courses will probably be turned into GEs due to how helpful they can be to pretty much everybody.
What do people think about this?
You'll know he's full of shit in a few years.
|
On July 20 2011 05:20 Cambium wrote:Show nested quote +On July 18 2011 12:01 Xanbatou wrote: Hello TL,
I am a computer science major at UCSD. Recently, at the place I'm interning at, I got involved in a discussion about the future of the computer science degree. The guy I was talking with said in about 10-15 years, computer science will closely resemble a liberal arts degree, of sorts. He said that computer science by itself is useless and it's much better if you major in math, physics, biology, or something else and use computer science as a tool to help you get your job done. Furthermore, he said that basic computer science courses will probably be turned into GEs due to how helpful they can be to pretty much everybody.
What do people think about this? You'll know he's full of shit in a few years.
He is right about one thing. Computer science courses will gradually become more and more common outside of computer science majors' programs. I know my job would be a lot easier if the whole office didn't slow down when the IT guy took his vacation. I would also be able to do my work 8x faster if I had experience in anything other than visual basic.
|
On July 18 2011 12:01 Xanbatou wrote: Hello TL,
I am a computer science major at UCSD. Recently, at the place I'm interning at, I got involved in a discussion about the future of the computer science degree. The guy I was talking with said in about 10-15 years, computer science will closely resemble a liberal arts degree, of sorts. He said that computer science by itself is useless and it's much better if you major in math, physics, biology, or something else and use computer science as a tool to help you get your job done. Furthermore, he said that basic computer science courses will probably be turned into GEs due to how helpful they can be to pretty much everybody.
What do people think about this?
The thing is specialization & limited time.
A math student could probably do the same stuff I can do, if he spends some of his time researching the problem. On the other hand - I can probably do the same stuff a math student can do - given enough time.
Computer Science isnt "How to program".
|
On July 20 2011 04:07 delHospital wrote:Show nested quote +On July 20 2011 00:59 MrCon wrote:Hi, I know very few about javascript, but I would like to create a button (or a link that I could click, or a shortcut in my chrome link bar) that transform an url of the page I'm currently browsing. But I don't know how to add this to my browser. What I want to do is when I'm on a http://www.youtube.com/user/hsypersakura2009#p/c/xxxxxxxxxxxxpage, I'm get either a link or a button, or like I said just a shortcut in my quicklaunch bar that I manually press that transform the url to : http://www.youtube.com/view_play_list?p=xxxxxxxxxxxxxI know how to transform the url, I just don't know how to implement this and where to put the code, this should be like a very basic chrome plugin. I tried to create an html document, made a shortcut and I click it, but it doesn't retrieve the url I was in, either with document.url or document.referrer (the later is null) I'm sure it's a very basic question, but I have so low experience in this and I don't know how to do it. A poor man's solution could be to make a bookmark named, say "asdf", with the address like javascript:window.location=window.location.toString().replace(new RegExp("(.*)user/[^/]*/c/(.*)"), "$1view_play_list?p=$2") and when you want to use it, enter asdf in the address bar and select the bookmark. Oh, if you don't have the bookmark bar hidden, it could work quite nicely. Thanks, I'll try that.
|
On July 20 2011 06:33 Zocat wrote:Show nested quote +On July 18 2011 12:01 Xanbatou wrote: Hello TL,
I am a computer science major at UCSD. Recently, at the place I'm interning at, I got involved in a discussion about the future of the computer science degree. The guy I was talking with said in about 10-15 years, computer science will closely resemble a liberal arts degree, of sorts. He said that computer science by itself is useless and it's much better if you major in math, physics, biology, or something else and use computer science as a tool to help you get your job done. Furthermore, he said that basic computer science courses will probably be turned into GEs due to how helpful they can be to pretty much everybody.
What do people think about this? The thing is specialization & limited time. A math student could probably do the same stuff I can do, if he spends some of his time researching the problem. On the other hand - I can probably do the same stuff a math student can do - given enough time. Computer Science isnt "How to program".
Knowing all the exact details on how for example your computer works is not part of a math or physics major. I highly, highly doubt a math student can design, program and deploy an application as well as a CS major.
|
On July 20 2011 08:32 KaiserJohan wrote:Show nested quote +On July 20 2011 06:33 Zocat wrote:On July 18 2011 12:01 Xanbatou wrote: Hello TL,
I am a computer science major at UCSD. Recently, at the place I'm interning at, I got involved in a discussion about the future of the computer science degree. The guy I was talking with said in about 10-15 years, computer science will closely resemble a liberal arts degree, of sorts. He said that computer science by itself is useless and it's much better if you major in math, physics, biology, or something else and use computer science as a tool to help you get your job done. Furthermore, he said that basic computer science courses will probably be turned into GEs due to how helpful they can be to pretty much everybody.
What do people think about this? The thing is specialization & limited time. A math student could probably do the same stuff I can do, if he spends some of his time researching the problem. On the other hand - I can probably do the same stuff a math student can do - given enough time. Computer Science isnt "How to program". Knowing all the exact details on how for example your computer works is not part of a math or physics major. I highly, highly doubt a math student can design, program and deploy an application as well as a CS major.
Of course there are some fields (computer hardware, network security, ... ) which math students dont really learn. On the other hand my number theory knowledge isnt great and my financial time series analysis isnt existant at all  As I said "given enough time"
Also I dont know if the application development knowledge is that different from a math student who's focus i.e. is in Neural Networks compared to a CS student who's focusing on theoretical cs (is that a term in English? I mean languages & stuff like pumping lemma, or AI like neural networks) or a heavy crypto theorist. A "pure" software engineering CS guy would obviously know more
|
WorksheetCreateMethod CreateMethod = RequestTypes.Contains( ClientType ) ? ( ResponseTypes.Contains( ClientType ) ? WorksheetCreateMethod.Both : WorksheetCreateMethod.Input ) : ( ResponseTypes.Contains( ClientType ) ? WorksheetCreateMethod.Validation : WorksheetCreateMethod.None );
Programmers who love putting ridiculous nested statements like this all on one line, with no comments or documentation.. stop please! Giving me a headache looking over this code at work. I didn't even know you could do a ternary operator within ternary operator (mostly because I never use it for sake of readability).
I have a new found appreciation for clearly written and commented code after seeing the work of this one developer lol
|
I decided C# to be my first programming language, so I went ahead and installed Vistual Studio 2010 C# to use as my learning tool. I started reading: Learning C# 3.0: Master the fundamentals of C# 3.0, to get started since it seemed like it was aimed towards complete new-comers to programming.
Before stating my question, let me quote something from the book: when we refer to .NET, we mean the .NET 3.5 Framework; and when we refer to Visual Studio, we mean Visual Studio 2008. I'm worried if it is a waste of my time reading this book when it's about .NET 3.5, when 4.0 is available, and if not, whether or not I can use Visual Studio 2010 as apposed to 2008 following the book. Do I have anthing to worry about, or should I find a book not as "old" as this one? Sorry I'm a bit clueless
|
On July 27 2011 23:53 Wordpad wrote:I decided C# to be my first programming language, so I went ahead and installed Vistual Studio 2010 C# to use as my learning tool. I started reading: Learning C# 3.0: Master the fundamentals of C# 3.0, to get started since it seemed like it was aimed towards complete new-comers to programming. Before stating my question, let me quote something from the book: Show nested quote +when we refer to .NET, we mean the .NET 3.5 Framework; and when we refer to Visual Studio, we mean Visual Studio 2008. I'm worried if it is a waste of my time reading this book when it's about .NET 3.5, when 4.0 is available, and if not, whether or not I can use Visual Studio 2010 as apposed to 2008 following the book. Do I have anthing to worry about, or should I find a book not as "old" as this one? Sorry I'm a bit clueless 
I checked that book (http://msdn.microsoft.com/en-us/library/orm-9780596521066-01.aspx) and I do not think you will have any problems using VS2010 instead of 2008. If you are learning basics you wont find any difference wheter you use 2008 or 2010. And you dont have to be worried about .NET 3.5. I think that all the thinks you learn in 3.5 you can use in 4.0. Good luck!
|
|
|
|