
Link to workspace is here: http://www.2shared.com/file/EpirAeqg/Othello.html
GameBoard is a simple JPanel that is filled with 8x8 small tiles (just like a chess board). Nop java-gui is the worst shit that ever landed on PC. What am I missing?
Forum Index > General Forum |
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. | ||
Qzy
Denmark1121 Posts
July 12 2011 14:24 GMT
#1361
![]() Link to workspace is here: http://www.2shared.com/file/EpirAeqg/Othello.html GameBoard is a simple JPanel that is filled with 8x8 small tiles (just like a chess board). Nop java-gui is the worst shit that ever landed on PC. What am I missing? | ||
heishe
Germany2284 Posts
July 12 2011 15:56 GMT
#1362
It's not at all a trivial field and research is still going on. Even among C++ compilers, there are differences in how well the compilers optimize code. Intel's C++ compiler is known for producing the fastest code, but it trades it in for compile time (it simply takes longer), also it isn't free like MSVC and gcc/pp. I'm pretty sure that C# and Java bytecode can still be optimized much much better than it is now, but the know-how on the development team of these languages simply isn't there yet. Especially since javac and the C# equivalent have to optimize without having the code lose to much information (after all the JIT compilers still optimize, but since they only see a fraction of the code at once, they can't optimize as well as whole-program-compilers like the C++ compilers) You have to remember that C# and Java are relatively new languages, compared to C++. Financially, compiler-programming isn't exactly an enormously big field, which is why there probably isn't that much research going on in that field, outside of a couple of universities and of course the relevant corporations themselves (Microsoft, Oracle, Intel etc.). Finally, I don't know how many guys at Oracle actually work on Java, and how much of the Java development is driven by the Open-Source community, but I reckon that they focus their money on something other than code optimization. | ||
MisterD
Germany1338 Posts
July 12 2011 22:19 GMT
#1363
On July 12 2011 23:24 Qzy wrote: A simple Java GUI question: Why the hell doesn't this work ![]() Link to workspace is here: http://www.2shared.com/file/EpirAeqg/Othello.html GameBoard is a simple JPanel that is filled with 8x8 small tiles (just like a chess board). Nop java-gui is the worst shit that ever landed on PC. What am I missing? you overwrote getX() and getY() in your BoardTile. Check your warning settings, so eclipse will flame you hard for not having added a @Override, at which point you *should* have noticed. | ||
obesechicken13
United States10467 Posts
July 14 2011 02:57 GMT
#1364
On July 11 2011 23:07 tofucake wrote: Show nested quote + On July 11 2011 22:11 obesechicken13 wrote: On July 11 2011 21:59 uzyszkodnik wrote: On July 11 2011 21:22 obesechicken13 wrote: On July 11 2011 18:32 uzyszkodnik wrote: @up http://php.net/manual/en/features.file-upload.multiple.php ? I read that. It's not dynamic. I still need help and that was a very rude answer. Well have you tried just accesing the array? Can you explain to me how exactly? I've thought about using this method, however there is a problem. When you pass information with post using html forms to php, you do it with "name" right? Well the different information here is being stored in "id" rather than name so I'm rather confused how to get the "id" array. I'm very new to PHP. It sounds like you need Javascript (<3 jQuery) to add in new fields as needed. The files can be accessed easily with a foreach over $_FILES['userfile']. You can then use file_get_contents to get the data directly, or you can copy the file to another location if you only want to save it. I don't know how I missed this post. Ok, so the code I provided IS javascript that helps to create a new field for more uploads. However I can't access more than one file if I dynamically allocate the number of forms using java. I do use $_FILES and the code works fine, when I create a set number of forms for attachments. I've given up on the issue though. It seems only google knows how to implement the feature, and if people need to submit more attachments to email, they should compress them into a zip file. | ||
delHospital
Poland261 Posts
July 14 2011 12:07 GMT
#1365
On July 14 2011 11:57 obesechicken13 wrote: Show nested quote + On July 11 2011 23:07 tofucake wrote: On July 11 2011 22:11 obesechicken13 wrote: On July 11 2011 21:59 uzyszkodnik wrote: On July 11 2011 21:22 obesechicken13 wrote: On July 11 2011 18:32 uzyszkodnik wrote: @up http://php.net/manual/en/features.file-upload.multiple.php ? I read that. It's not dynamic. I still need help and that was a very rude answer. Well have you tried just accesing the array? Can you explain to me how exactly? I've thought about using this method, however there is a problem. When you pass information with post using html forms to php, you do it with "name" right? Well the different information here is being stored in "id" rather than name so I'm rather confused how to get the "id" array. I'm very new to PHP. It sounds like you need Javascript (<3 jQuery) to add in new fields as needed. The files can be accessed easily with a foreach over $_FILES['userfile']. You can then use file_get_contents to get the data directly, or you can copy the file to another location if you only want to save it. I don't know how I missed this post. Ok, so the code I provided IS javascript that helps to create a new field for more uploads. However I can't access more than one file if I dynamically allocate the number of forms using java. I do use $_FILES and the code works fine, when I create a set number of forms for attachments. I've given up on the issue though. It seems only google knows how to implement the feature, and if people need to submit more attachments to email, they should compress them into a zip file. Giving several tags the same id is illegal and makes no sense. To name data sent in a form, you have to use... the name attribute. Here's a working example <script type="text/javascript"> And an example $_FILES array + Show Spoiler + array(1) { | ||
PizzaParty
Canada169 Posts
July 14 2011 19:33 GMT
#1366
Everything looks great, however Flash Builder 4.5 highlights all the instance the of the "selected" variable. It's a great feature, but I cannot find how to change the color of the highlight, so it gives me this result. I'm looking everywhere but I cant find where I can change it. Anyone ever played around with it in FB 4.5 ? | ||
Frigo
Hungary1023 Posts
July 14 2011 23:51 GMT
#1367
On April 27 2011 20:43 heishe wrote: Frigo, why do you want final methods (or classes for that matter)? They smell like bad design a lot and that stuff doesn't belong to C++ (there's a reason it's not natively supported and isn't part of C++0x). I've never used them and never saw a reason to. In Java it seemed like another one of those obsolete safety features which enabled you to say to another programmer who is a potential evil villain and who is playing around with your classes: "Hey you idiot, don't override this method or you'll break something!". Nobody should ever want to override methods of classes about which he doesn't know anything about anyways. And if you're using them yourself you should know what to override and what not to override anyways. Oh I forgot to answer this. I have a Final<T> class that prevents inheritance from its T virtual subclass, a NonCopyable class that prevents the automatically generated copy constructor and assignment operator from working, and a ValueType marker class. I found these three invaluable in differentiating between polymorphic classes and value types, which can prevent undefined or outright dangerous behaviour like object slicing or unintended object copying. These stuff are just useful tools to ensure correctness, just like final methods would be. I know better than to mix polymorphic behaviour and value semantics, however, there were already issues when other people tried to use my code incorrectly, namely subclassing from a value type then wondering why did half of the object disappear. My Final<T> solution would have been perfect for this case. I get a lot of hate for this and my "java-like" programming style by rabid fanboys of a subset of C++ though. | ||
obesechicken13
United States10467 Posts
July 15 2011 13:22 GMT
#1368
I'm having another peculiar problem now. I switched hosting service providers, but I parked the domain name. Then I changed the DNS nameserver configurations, and I checked with my domain provider tucows, and they tell me that I've finished propogating. I then checked some other dns propogation checker and it said that I'd finished propogating too. When I check my website, from my own laptop, while at work, I get the information (read files and databases) of my old hosting provider. It even changes as I change the information at my old hosting provider. When I check my website from any other computer in my workplace, or even from my laptop at home, or any computer at school, it works fine. There's something fishy with how my website is treating my ip address. I've cleared my cache and done a dns flush in the command prompt. Still no good. PM me for domain. | ||
delHospital
Poland261 Posts
July 15 2011 14:18 GMT
#1369
On the php side... google is your friend. You're probably gonna need to check if $_FILES['your_field_name'] is set, then run a foreach loop over $_FILES['your_field_name']['tmp_name'] in which you do sth like $contents = file_get_contents($foreach_var). Then check if the reading succeeded with if ($contents === true) and do sth with $contents. | ||
obesechicken13
United States10467 Posts
July 15 2011 14:48 GMT
#1370
On July 15 2011 23:18 delHospital wrote: It takes up to 24 hours, be patient (the NS you're querying is also caching the results). On the php side... google is your friend. You're probably gonna need to check if $_FILES['your_field_name'] is set, then run a foreach loop over $_FILES['your_field_name']['tmp_name'] in which you do sth like $contents = file_get_contents($foreach_var). Then check if the reading succeeded with if ($contents === true) and do sth with $contents. All right, perhaps propogation hasn't finished. But if the problem persists until 5 and a half hours from now (well after 24 hours) I won't take the risk and will just do a dhcp release and renew it Monday. I did a google, I wasn't sure if you had a better link. I'll try some php later today if I have time. Thanks again! | ||
![]()
tofucake
Hyrule18969 Posts
July 15 2011 14:53 GMT
#1371
On July 15 2011 23:48 obesechicken13 wrote: Show nested quote + On July 15 2011 23:18 delHospital wrote: It takes up to 24 hours, be patient (the NS you're querying is also caching the results). On the php side... google is your friend. You're probably gonna need to check if $_FILES['your_field_name'] is set, then run a foreach loop over $_FILES['your_field_name']['tmp_name'] in which you do sth like $contents = file_get_contents($foreach_var). Then check if the reading succeeded with if ($contents === true) and do sth with $contents. All right, perhaps propogation hasn't finished. But if the problem persists until 5 and a half hours from now (well after 24 hours) I won't take the risk and will just do a dhcp release and renew it Monday. I did a google, I wasn't sure if you had a better link. I'll try some php later today if I have time. Thanks again! Actually you want to use $contents !== false since if file_get_contents doesn't fail it returns the file contents, not boolean true. | ||
obesechicken13
United States10467 Posts
July 15 2011 15:52 GMT
#1372
| ||
Qzy
Denmark1121 Posts
July 16 2011 21:56 GMT
#1373
| ||
Omegalisk
United States337 Posts
July 18 2011 02:19 GMT
#1374
| ||
Xanbatou
United States805 Posts
July 18 2011 03:01 GMT
#1375
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? | ||
Frigo
Hungary1023 Posts
July 18 2011 19:43 GMT
#1376
That assuming they don't have trouble even with applied comp sci. Take software engineering for example, it seems people from other fields invariably fail it. I've seen a lot of code by them - it's TERRIBLE. Unreadable, unmaintainable, bug-ridden, lacking any kind of structure or paradigm, a paradise of anti-patterns at best. Even DSP and computer vision people write disgusting code, which is kind of ironic, because these fields ARE applied comp sci. A few domain specific languages outright encourage crappy code. These type of people have as much chance at making production level code as a 9 year old kid with a butter knife becoming a lumberjack. Sure, it's possible, but not very realistic. It would be nice if some basic comp sci education was compulsory, but that can't be a substitute for a full fledged comp sci education - it is a subject of considerable size and complexity, even a BSc degree provides only a cursory knowledge of it. | ||
tec27
United States3690 Posts
July 18 2011 20:12 GMT
#1377
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? That guy's full of shit. If anything, CS degrees are becoming more and more like Engineering degrees (which is why many schools now lump them into the same area). I'm not quite sure how you could say that computer science by itself is useless. Yes, CS can be helpful for solving problems in many realms, but it is also an end unto itself. Furthermore, like many other degrees, CS majors do not need to be a jack-of-all trades to be useful. As long as you have someone that can give you requirements, and/or describe things to you in a way that lets you develop requirements, you can develop software without in-depth understanding of the subject you are developing for. | ||
dogmeatstew
Canada574 Posts
July 18 2011 22:32 GMT
#1378
On July 19 2011 05:12 tec27 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? That guy's full of shit. If anything, CS degrees are becoming more and more like Engineering degrees (which is why many schools now lump them into the same area). I'm not quite sure how you could say that computer science by itself is useless. Yes, CS can be helpful for solving problems in many realms, but it is also an end unto itself. Furthermore, like many other degrees, CS majors do not need to be a jack-of-all trades to be useful. As long as you have someone that can give you requirements, and/or describe things to you in a way that lets you develop requirements, you can develop software without in-depth understanding of the subject you are developing for. I largely concur with tec27 but I'll add a couple things... Even if what you learn in a CS degree now is considered simple GE stuff in 10-15 years, the field of computer science and engineering will be significantly further advanced by this point and the world will still require specialists in the field to learn about bleeding edge technologies and develop the next big thing. Given that the guy you were talking to is full of shit and doesn't really understand technology very well... frankly, civil engineering has been around for fucking forever, the root principles of "build shit that won't fall down easily" has been pretty much the same for 1000 years but the entire population doesn't know or care how to build houses/bridges what have you and given that its a very complex and still developing field we (shockingly) still need people around to learn that stuff. Furthermore, as I hinted at in that last paragraph, even when computers run your lives we have no reason to expect that every member of the population will have any significant understanding of how the tools they use are built and work at a low level so we'll definitely still need computer specialists. If anything as the field gets more and more complex CS degree's (and equivalently computer engineering degrees) will likely get even more technical and demanding as there will be that much more stuff to know to be useful. | ||
kingcoyote
United States546 Posts
July 18 2011 22:35 GMT
#1379
On July 18 2011 11:19 Omegalisk wrote: Does anybody know some good books/guides for code design? I know the basics of programming and can get my way around code, but my code isn't really that elegant, well commentated, or structured that well (in other words, a design nightmare). I'm looking for a book to help me teach myself design methods, any suggestions? Design Patterns: Elements of Reusable Object-Oriented Software is fantastic. I also recommend Refactoring by Martin Fowler. | ||
RedJustice
United States1004 Posts
July 18 2011 22:46 GMT
#1380
I don't believe liberal arts actually teaches you this-- I do think that many people that study liberal arts are naturally good at picking up a variety of things already and study in liberal arts because of a wide field of interests (or they just can't make their minds up and pick something easy and completely impractical as a major). Not sure to what extent CS actually teaches you that either, or how much is just if you're smart enough to do well in it, you're smart enough to transfer what you learned about one object-oriented language to another, etc. The difference between CS and most liberal arts degrees is that it has a solid practical application. You don't just spend all your time talking about stuff, you actually produce shit. Disclaimer: Saying this as a liberal arts major with many cs-major friends. | ||
| ||
![]() StarCraft 2 StarCraft: Brood War Stormgate Counter-Strike Super Smash Bros Other Games summit1g10015 Grubby4241 FrodaN1857 shahzam1414 Day[9].tv1047 JimRising ![]() C9.Mang0343 Maynarde164 ViBE86 JuggernautJason34 Trikslyr32 Vindicta1 Organizations
StarCraft 2 • Berry_CruncH288 StarCraft: Brood War• Hupsaiya ![]() • davetesta31 • Mapu4 • IndyKCrew ![]() • sooper7s • Migwel ![]() • AfreecaTV YouTube • Laughngamez YouTube • intothetv ![]() • LaughNgamezSOOP • Kozan Dota 2 League of Legends Other Games |
PiG Sty Festival
Serral vs TriGGeR
Cure vs SHIN
The PondCast
Replay Cast
PiG Sty Festival
Clem vs Bunny
Solar vs Zoun
Replay Cast
Korean StarCraft League
PiG Sty Festival
herO vs Rogue
ByuN vs SKillous
SC Evo Complete
[BSL 2025] Weekly
Replay Cast
[ Show More ] SOOP Global
ByuN vs Zoun
Rogue vs Bunny
PiG Sty Festival
MaxPax vs Classic
Dark vs Maru
Sparkling Tuna Cup
|
|