• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 10:12
CET 16:12
KST 00:12
  • Home
  • Forum
  • Calendar
  • Streams
  • Liquipedia
  • Features
  • Store
  • EPT
  • TL+
  • StarCraft 2
  • Brood War
  • Smash
  • Heroes
  • Counter-Strike
  • Overwatch
  • Liquibet
  • Fantasy StarCraft
  • TLPD
  • StarCraft 2
  • Brood War
  • Blogs
Forum Sidebar
Events/Features
News
Featured News
ByuL: The Forgotten Master of ZvT26Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Weekly Cups (Feb 16-22): MaxPax doubles0Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0242LiuLi Cup: 2025 Grand Finals (Feb 10-16)46Weekly Cups (Feb 2-8): Classic, Solar, MaxPax win2
StarCraft 2
General
Oliveira Would Have Returned If EWC Continued ByuL: The Forgotten Master of ZvT Behind the Blue - Team Liquid History Book Weekly Cups (Feb 16-22): MaxPax doubles How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game?
Tourneys
StarCraft Evolution League (SC Evo Biweekly) Sea Duckling Open (Global, Bronze-Diamond) PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) Sparkling Tuna Cup - Weekly Open Tournament How do the "codes" work in GSL?
Strategy
Custom Maps
Map Editor closed ? [A] Starcraft Sound Mod
External Content
Mutation # 514 Ulnar New Year The PondCast: SC2 News & Results Mutation # 513 Attrition Warfare Mutation # 512 Overclocked
Brood War
General
ACS replaced by "ASL Season Open" - Starts 21/02 TvZ is the most complete match up CasterMuse Youtube A cwal.gg Extension - Easily keep track of anyone A new season just kicks off
Tourneys
Escore Tournament StarCraft Season 1 [Megathread] Daily Proleagues [LIVE] [S:21] ASL Season Open Day 1 Small VOD Thread 2.0
Strategy
Fighting Spirit mining rates Simple Questions, Simple Answers Zealot bombing is no longer popular? Current Meta
Other Games
General Games
Nintendo Switch Thread Beyond All Reason Battle Aces/David Kim RTS Megathread New broswer game : STG-World Diablo 2 thread
Dota 2
Official 'what is Dota anymore' discussion
League of Legends
Heroes of the Storm
Simple Questions, Simple Answers Heroes of the Storm 2.0
Hearthstone
Deck construction bug Heroes of StarCraft mini-set
TL Mafia
Vanilla Mini Mafia Mafia Game Mode Feedback/Ideas TL Mafia Community Thread
Community
General
US Politics Mega-thread Mexico's Drug War Russo-Ukrainian War Thread Canadian Politics Mega-thread Ask and answer stupid questions here!
Fan Clubs
The IdrA Fan Club The herO Fan Club!
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
Formula 1 Discussion 2024 - 2026 Football Thread TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
TL Community
The Automated Ban List
Blogs
ASL S21 English Commentary…
namkraft
Inside the Communication of …
TrAiDoS
My 2025 Magic: The Gathering…
DARKING
Life Update and thoughts.
FuDDx
Customize Sidebar...

Website Feedback

Closed Threads



Active: 1540 users

The Big Programming Thread - Page 149

Forum Index > General Forum
Post a Reply
Prev 1 147 148 149 150 151 1032 Next
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.
RoyGBiv_13
Profile Blog Joined August 2010
United States1275 Posts
July 05 2012 21:39 GMT
#2961
On July 06 2012 06:03 teamamerica wrote:
Hey peoples, I was wondering if anyone had any recommendations as to the fastest way to parse html from the web. The background is that it's summer and between work and sc2, I still have some free time so figured I'd try my hand at developing a opensource android application for the website captionfish (as right now it doesn't have one and I need to use it pretty often, even though I might end up being the only one to ever use the app ^^). Although it'd be nice to have a ton of features, my first concern is the speed of parsing the data and displaying it. Basically it's parsing the HTML for certain elements.

My question could be completely off base but I think that's what I need to do at least, since I've never attempted a project like this.

Should I:
use HTMLParser
use HTMLCleaner
use Androids built in document/XPath
use lxml (some python parser that wraps C libraries) and figure out how to use this through JNI
something else?

or: stop being a lazy bum, try all options, and report back (not keen on trying the lxml cause that'd mean figuring out how to use JNI, although I have some old class project that I can look back on so not too terrible I guess).


>use Androids built in document/XPath

Sounds like the smartest choice, but since you haven't seen any implementations close to this, I would start researching close implementations rather than designing your own.
Any sufficiently advanced technology is indistinguishable from magic
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
July 05 2012 21:52 GMT
#2962
On July 06 2012 06:39 RoyGBiv_13 wrote:
Show nested quote +
On July 06 2012 06:03 teamamerica wrote:
Hey peoples, I was wondering if anyone had any recommendations as to the fastest way to parse html from the web. The background is that it's summer and between work and sc2, I still have some free time so figured I'd try my hand at developing a opensource android application for the website captionfish (as right now it doesn't have one and I need to use it pretty often, even though I might end up being the only one to ever use the app ^^). Although it'd be nice to have a ton of features, my first concern is the speed of parsing the data and displaying it. Basically it's parsing the HTML for certain elements.

My question could be completely off base but I think that's what I need to do at least, since I've never attempted a project like this.

Should I:
use HTMLParser
use HTMLCleaner
use Androids built in document/XPath
use lxml (some python parser that wraps C libraries) and figure out how to use this through JNI
something else?

or: stop being a lazy bum, try all options, and report back (not keen on trying the lxml cause that'd mean figuring out how to use JNI, although I have some old class project that I can look back on so not too terrible I guess).


>use Androids built in document/XPath

Sounds like the smartest choice, but since you haven't seen any implementations close to this, I would start researching close implementations rather than designing your own.


The thing about HTML on the web is that it's not XML and can't be parsed like XML. Even sites that claim to be xhtml are often not xml because of lazy web designers. That means that xml libraries usually won't work.

Use a library that is specifically designed for HTML and is tolerant to faulty HTML. I don't know HTMLParser but it sounds like your best bet.
teamamerica
Profile Blog Joined July 2010
United States958 Posts
July 05 2012 22:27 GMT
#2963
On July 06 2012 06:52 Morfildur wrote:
Show nested quote +
On July 06 2012 06:39 RoyGBiv_13 wrote:
On July 06 2012 06:03 teamamerica wrote:
Hey peoples, I was wondering if anyone had any recommendations as to the fastest way to parse html from the web. The background is that it's summer and between work and sc2, I still have some free time so figured I'd try my hand at developing a opensource android application for the website captionfish (as right now it doesn't have one and I need to use it pretty often, even though I might end up being the only one to ever use the app ^^). Although it'd be nice to have a ton of features, my first concern is the speed of parsing the data and displaying it. Basically it's parsing the HTML for certain elements.

My question could be completely off base but I think that's what I need to do at least, since I've never attempted a project like this.

Should I:
use HTMLParser
use HTMLCleaner
use Androids built in document/XPath
use lxml (some python parser that wraps C libraries) and figure out how to use this through JNI
something else?

or: stop being a lazy bum, try all options, and report back (not keen on trying the lxml cause that'd mean figuring out how to use JNI, although I have some old class project that I can look back on so not too terrible I guess).


>use Androids built in document/XPath

Sounds like the smartest choice, but since you haven't seen any implementations close to this, I would start researching close implementations rather than designing your own.


The thing about HTML on the web is that it's not XML and can't be parsed like XML. Even sites that claim to be xhtml are often not xml because of lazy web designers. That means that xml libraries usually won't work.

Use a library that is specifically designed for HTML and is tolerant to faulty HTML. I don't know HTMLParser but it sounds like your best bet.


They're all designed around parsing HTML. I was just curious if anyone had exp. with them. For reference, I find the TL-android-app a bit slow (compared to the browswer) although I'm not sure if the bottleneck is in getting or displaying the data. It uses html-cleaner.
RIP GOMTV. RIP PROLEAGUE.
thedz
Profile Blog Joined March 2011
United States217 Posts
July 06 2012 14:35 GMT
#2964
On July 06 2012 07:27 teamamerica wrote:
Show nested quote +
On July 06 2012 06:52 Morfildur wrote:
On July 06 2012 06:39 RoyGBiv_13 wrote:
On July 06 2012 06:03 teamamerica wrote:
Hey peoples, I was wondering if anyone had any recommendations as to the fastest way to parse html from the web. The background is that it's summer and between work and sc2, I still have some free time so figured I'd try my hand at developing a opensource android application for the website captionfish (as right now it doesn't have one and I need to use it pretty often, even though I might end up being the only one to ever use the app ^^). Although it'd be nice to have a ton of features, my first concern is the speed of parsing the data and displaying it. Basically it's parsing the HTML for certain elements.

My question could be completely off base but I think that's what I need to do at least, since I've never attempted a project like this.

Should I:
use HTMLParser
use HTMLCleaner
use Androids built in document/XPath
use lxml (some python parser that wraps C libraries) and figure out how to use this through JNI
something else?

or: stop being a lazy bum, try all options, and report back (not keen on trying the lxml cause that'd mean figuring out how to use JNI, although I have some old class project that I can look back on so not too terrible I guess).


>use Androids built in document/XPath

Sounds like the smartest choice, but since you haven't seen any implementations close to this, I would start researching close implementations rather than designing your own.


The thing about HTML on the web is that it's not XML and can't be parsed like XML. Even sites that claim to be xhtml are often not xml because of lazy web designers. That means that xml libraries usually won't work.

Use a library that is specifically designed for HTML and is tolerant to faulty HTML. I don't know HTMLParser but it sounds like your best bet.


They're all designed around parsing HTML. I was just curious if anyone had exp. with them. For reference, I find the TL-android-app a bit slow (compared to the browswer) although I'm not sure if the bottleneck is in getting or displaying the data. It uses html-cleaner.


Generally, processors are fast enough now that parsing HTML is likely not going to be your bottleneck, assuming you're parsing and caching/memoizing parsed results intelligently.
enigmaticcam
Profile Blog Joined October 2010
United States280 Posts
Last Edited: 2012-07-06 19:58:00
July 06 2012 16:41 GMT
#2965
Does anyone here have any experience in iOS development? Specifically, publishing an app to the iPhone store?

I do iPhone development for my company, but that's all in-house enterprise stuff that doesn't get published to the store, so this is a first time for me. I'm writing an app for a friend of mine and his business. The thing I'm concerned about is that I think if I publish it using my developer's license, it will have to be in my name, and not his company's name. Is that true? Should I recommend him to buy his own developer's license?
SlowBullets
Profile Blog Joined December 2011
United States839 Posts
July 06 2012 23:21 GMT
#2966
Hey everyone,

I am taking java classes for the summer and am having a hard time understanding the material. I know what certain code/syntax does but it seems like I choke when it really matters (example: exams, and sometimes homework assignments). I have been recently practicing on http://www.codingbat.com and was wondering if just doing problems is the best way?

How useful is Java for learning other programming languages?
Also, I would appreciate any recommendations for books/videos. Thanks a lot!
1:1 go sc2 LAN? Oh wait...
waxypants
Profile Blog Joined September 2009
United States479 Posts
July 07 2012 07:07 GMT
#2967
On July 07 2012 08:21 SlowBullets wrote:
Hey everyone,

I am taking java classes for the summer and am having a hard time understanding the material. I know what certain code/syntax does but it seems like I choke when it really matters (example: exams, and sometimes homework assignments). I have been recently practicing on http://www.codingbat.com and was wondering if just doing problems is the best way?

How useful is Java for learning other programming languages?
Also, I would appreciate any recommendations for books/videos. Thanks a lot!


What are the exams like and what sort of things are you choking on? Java is commonly used as a starting language (don't necessarily agree with it, but it is). Most of the fundamentals from Java are going to carry over to most imperative programming languages (C#, C++, C, etc). Doing examples like those certainly is going to help as long as you are learning something and they aren't super easy for you. When I am learning a language, I will often make up my own super simple problems/experiments on the fly to make sure I understand the syntax and the behavior of features that I am not completely familiar with yet.
snively
Profile Blog Joined August 2011
United States1159 Posts
July 08 2012 14:45 GMT
#2968
ok, this is kind of wierd, but its driving me crazy.
its not really a programming question, but this is the only place i know where to get help from.
i jsut started teaching myself java with eclipse (4.2.0) and i was making an applet with graphics.
i had eclipse open, a folder open with the java source files and all that, and a folder where i was making my graphics.
i alt-tabbed to adobe flash so i could make a new gif, and when i looked back at my source folder, all my files were missing. the java class files were still there, but all of my graphics were just gone.
i had another folder inside the source folder with backups of my grpahics, but thats all gone too
it blew my mind, and i have no idea where they went. my java program doesnt work anymore because the files are missing. i checked the recycle bin, and used the built-in search function in windows explorer, and i cant find them anywhere.
im using windows 7.

is this an eclipse problem, a windows problem, or some kinda virus, and more importantly, how do i get them back???
i put a lotta work into those gifs and i really dont want to remake them from scratch T_T
My religion is Starcraft
Cloud
Profile Blog Joined November 2004
Sexico5880 Posts
Last Edited: 2012-07-08 15:06:27
July 08 2012 15:06 GMT
#2969
On July 08 2012 23:45 snively wrote:
ok, this is kind of wierd, but its driving me crazy.
its not really a programming question, but this is the only place i know where to get help from.
i jsut started teaching myself java with eclipse (4.2.0) and i was making an applet with graphics.
i had eclipse open, a folder open with the java source files and all that, and a folder where i was making my graphics.
i alt-tabbed to adobe flash so i could make a new gif, and when i looked back at my source folder, all my files were missing. the java class files were still there, but all of my graphics were just gone.
i had another folder inside the source folder with backups of my grpahics, but thats all gone too
it blew my mind, and i have no idea where they went. my java program doesnt work anymore because the files are missing. i checked the recycle bin, and used the built-in search function in windows explorer, and i cant find them anywhere.
im using windows 7.

is this an eclipse problem, a windows problem, or some kinda virus, and more importantly, how do i get them back???
i put a lotta work into those gifs and i really dont want to remake them from scratch T_T

That seems really weird but if in the future you want to avoid the same kind of thing I suggest you learn a version control system like git.
BlueLaguna on West, msg for game.
heishe
Profile Blog Joined June 2009
Germany2284 Posts
July 08 2012 15:22 GMT
#2970
For learning git, this was really awesome: http://try.github.com
If you value your soul, never look into the eye of a horse. Your soul will forever be lost in the void of the horse.
soiii
Profile Joined July 2011
Germany266 Posts
July 08 2012 15:41 GMT
#2971
On July 09 2012 00:22 heishe wrote:
For learning git, this was really awesome: http://try.github.com


This site looks nice to toy around with git without any pressure. Back in the days I learnt git the hard way reading the ebook "Pro Git": http://git-scm.com/book.

Whatever you do, stop using SVN or even worse CVS. Once you are into Git you do not want to go back again. It is such a beautiful and powerful tool.
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2012-07-08 15:56:44
July 08 2012 15:54 GMT
#2972
have you had a look at eclipses "restore from local history" feature? rightclick the parent folder of all your missing stuff and find it there. Maybe eclipse still has backup copies of your files.

the thing is, eclipse delete just does delete. It doesn't do the windows style "move to bin" instead of delete. A lot of applications actually do that. So your files will never go to your bin. So if you accidentally deleted something in eclipse, it's really gone, except for backup copies.

Best way still would be to use some kind of version control, or maybe even just dropbox which creates backup copies as well. But see if eclipse still has some backups with that restore from local history thing first.
Gold isn't everything in life... you need wood, too!
snively
Profile Blog Joined August 2011
United States1159 Posts
July 08 2012 20:28 GMT
#2973
On July 09 2012 00:54 MisterD wrote:
have you had a look at eclipses "restore from local history" feature? rightclick the parent folder of all your missing stuff and find it there. Maybe eclipse still has backup copies of your files.

the thing is, eclipse delete just does delete. It doesn't do the windows style "move to bin" instead of delete. A lot of applications actually do that. So your files will never go to your bin. So if you accidentally deleted something in eclipse, it's really gone, except for backup copies.

Best way still would be to use some kind of version control, or maybe even just dropbox which creates backup copies as well. But see if eclipse still has some backups with that restore from local history thing first.


i tried this just now and it says "no deleted resources in local history for selected container"

as another note, i found out that all my other projects with non-java source files (graphics and such) have had their files removed too, so theres no way i accidentally deleted all of my graphics in all my folders.

ive given up on getting my files back, but id like to know what the heck hapenend in the first place T_T

thanks for the help
My religion is Starcraft
MisterD
Profile Blog Joined June 2010
Germany1338 Posts
Last Edited: 2012-07-08 21:02:27
July 08 2012 21:01 GMT
#2974
On July 09 2012 05:28 snively wrote:
Show nested quote +
On July 09 2012 00:54 MisterD wrote:
have you had a look at eclipses "restore from local history" feature? rightclick the parent folder of all your missing stuff and find it there. Maybe eclipse still has backup copies of your files.

the thing is, eclipse delete just does delete. It doesn't do the windows style "move to bin" instead of delete. A lot of applications actually do that. So your files will never go to your bin. So if you accidentally deleted something in eclipse, it's really gone, except for backup copies.

Best way still would be to use some kind of version control, or maybe even just dropbox which creates backup copies as well. But see if eclipse still has some backups with that restore from local history thing first.


i tried this just now and it says "no deleted resources in local history for selected container"

as another note, i found out that all my other projects with non-java source files (graphics and such) have had their files removed too, so theres no way i accidentally deleted all of my graphics in all my folders.

ive given up on getting my files back, but id like to know what the heck hapenend in the first place T_T

thanks for the help

have you browsed the workspace folders manually to see if the files are still there? and i mean just go and look, not windows search or something. sounds more like you accidentally enabled a resource filter in eclipse that just doesn't display anything other than java files anymore Oo

or did you store all your image resource files in the bin folder? i hope not.
Gold isn't everything in life... you need wood, too!
Azerbaijan
Profile Blog Joined January 2010
United States660 Posts
July 09 2012 04:00 GMT
#2975
I'm working on learning C and I made this simple number guessing game. I'm curious about the length of what I wrote and if it actually needs to tbe this long. I'm sure theres a way to compress it, maybe with functions, but im not quite there yet. I do want to know if this looks ok as far as clarity and use of functions goes. I know that scanf() is not a good choice but I'm still working on figuring out getchar() as an alternative, it still seems really abstract to me, its mostly just that that data types of confusing I think. I did manage to use getchar() and putchar() to spit out the ascii value of a character for me. SO basically i'm still a total noob but I'm having fun.

Here's my game


+ Show Spoiler +


#include <stdio.h>
#include <stdlib.h>

/*
Number Guessing game!
*/

int main(void)
{
int number;
srand(time(NULL));

number = (rand() % 10) + 1;

int attempt;
int guess;
attempt = 0;

printf("I am thinking of a number between 1 and 10, you have 3 chances to guess it.\n");

for (attempt = 0; attempt < 3; attempt++){
scanf("%d", &guess);

if (guess == number){
printf("YES %d! congrats you guessed it!\n", number);
break;
}

if (guess < number){
if (attempt == 2){
printf("%d is too low\n", guess);
}
else{
printf("%d is too low, try again\n", guess);
}
}
if (guess > number){
if (attempt == 2){
printf("%d is too high\n", guess);
}
else{
printf("%d is too high, try again\n", guess);
}
}
}
if (attempt == 3){
printf("the number was %d\nsorry you lose\n", number);
}
printf("thanks for playing!\n");

getchar();
getchar();
return 0;
}


CorsairHero
Profile Joined December 2008
Canada9491 Posts
July 09 2012 04:08 GMT
#2976
On July 09 2012 00:41 soiii wrote:
Show nested quote +
On July 09 2012 00:22 heishe wrote:
For learning git, this was really awesome: http://try.github.com


This site looks nice to toy around with git without any pressure. Back in the days I learnt git the hard way reading the ebook "Pro Git": http://git-scm.com/book.

Whatever you do, stop using SVN or even worse CVS. Once you are into Git you do not want to go back again. It is such a beautiful and powerful tool.

My company just switched over to GIT from CVS and its been a great change. One of the issues with GIT that I've found is the lack of a relationship between a commit and a push. If someone has made 20 local commits and pushes it to my shared repo, there isn't an easy way to back out all of his changes except reverting each commit one by one.
© Current year.
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
Last Edited: 2012-07-09 05:51:44
July 09 2012 05:50 GMT
#2977
On July 09 2012 13:00 Azerbaijan wrote:
I'm working on learning C and I made this simple number guessing game. I'm curious about the length of what I wrote and if it actually needs to tbe this long. I'm sure theres a way to compress it, maybe with functions, but im not quite there yet. I do want to know if this looks ok as far as clarity and use of functions goes. I know that scanf() is not a good choice but I'm still working on figuring out getchar() as an alternative, it still seems really abstract to me, its mostly just that that data types of confusing I think. I did manage to use getchar() and putchar() to spit out the ascii value of a character for me. SO basically i'm still a total noob but I'm having fun.

Here's my game


+ Show Spoiler +


#include <stdio.h>
#include <stdlib.h>

/*
Number Guessing game!
*/

int main(void)
{
int number;
srand(time(NULL));

number = (rand() % 10) + 1;

int attempt;
int guess;
attempt = 0;

printf("I am thinking of a number between 1 and 10, you have 3 chances to guess it.\n");

for (attempt = 0; attempt < 3; attempt++){
scanf("%d", &guess);

if (guess == number){
printf("YES %d! congrats you guessed it!\n", number);
break;
}

if (guess < number){
if (attempt == 2){
printf("%d is too low\n", guess);
}
else{
printf("%d is too low, try again\n", guess);
}
}
if (guess > number){
if (attempt == 2){
printf("%d is too high\n", guess);
}
else{
printf("%d is too high, try again\n", guess);
}
}
}
if (attempt == 3){
printf("the number was %d\nsorry you lose\n", number);
}
printf("thanks for playing!\n");

getchar();
getchar();
return 0;
}




The middle part can be shortened a lot by using extra variables. You can also initialize variables when you are defining them.

+ Show Spoiler +


#include <stdio.h>
#include <stdlib.h>

/*
Number Guessing game!
*/

int main(void)
{
srand(time(NULL));

int number = (rand() % 10) + 1;
char *lowhigh_text = 0;
char *retry_text = 0;
int attempt = 0;
int guess = 0;

printf("I am thinking of a number between 1 and 10, you have 3 chances to guess it.\n");

for (attempt = 0; attempt < 3; attempt++){
scanf("%d", &guess);

if (guess == number){
printf("YES %d! congrats you guessed it!\n", number);
break;
}

lowhigh_text = (guess < number) ? "low" : "high";
retry_text = (attempt < 2) ? ", try again" : "";

printf("%d is too %s%s\n", guess, lowhigh_text, retry_text);
}
if (attempt == 3){
printf("the number was %d\nsorry you lose\n", number);
}
printf("thanks for playing!\n");

getchar();
getchar();
return 0;
}

opsayo
Profile Blog Joined July 2008
591 Posts
July 09 2012 07:22 GMT
#2978
not a big fan of using ? for if statements

readability > conciseness imo :-)
Deleted User 101379
Profile Blog Joined August 2010
4849 Posts
July 09 2012 07:53 GMT
#2979
On July 09 2012 16:22 opsayo wrote:
not a big fan of using ? for if statements

readability > conciseness imo :-)


If you add whitespace, that single line is a lot more readable than


if (guess < number) {
lowhigh_text = "low";
} else {
lowhigh_text = "high";
}


It always depends on how it's used. With the ternary ?: operator, it's clear that the variable gets assigned either value. In the if/else case you have to check each block to check if it's really the same variable that gets assigned.

While maintaining and repairing some of our legacy code, I got caught several times by code like:


if (a == b) {
temp = x;
} else {
tmp = y;
}


sundersoft
Profile Joined November 2011
91 Posts
July 10 2012 01:06 GMT
#2980
On July 09 2012 05:28 snively wrote:
Show nested quote +
On July 09 2012 00:54 MisterD wrote:
have you had a look at eclipses "restore from local history" feature? rightclick the parent folder of all your missing stuff and find it there. Maybe eclipse still has backup copies of your files.

the thing is, eclipse delete just does delete. It doesn't do the windows style "move to bin" instead of delete. A lot of applications actually do that. So your files will never go to your bin. So if you accidentally deleted something in eclipse, it's really gone, except for backup copies.

Best way still would be to use some kind of version control, or maybe even just dropbox which creates backup copies as well. But see if eclipse still has some backups with that restore from local history thing first.


i tried this just now and it says "no deleted resources in local history for selected container"

as another note, i found out that all my other projects with non-java source files (graphics and such) have had their files removed too, so theres no way i accidentally deleted all of my graphics in all my folders.

ive given up on getting my files back, but id like to know what the heck hapenend in the first place T_T

thanks for the help


You can use a file recovery tool such as http://www.piriform.com/recuva to attempt to recover some of the files. It will scan your hard drive for deleted files and allow you to restore them. The files may have been partially overwritten by other data if you've been adding new files to the hard drive after you lost your images (theoretically you could recover part of the image if this happens but I don't know if any tools exist to do so).

In the future you should use either a seperate external hard drive (which is not plugged in when it's not being used) or an online backup service for backups. Even a large capacity flash drive can be used to back up your most important files.
Prev 1 147 148 149 150 151 1032 Next
Please log in or register to reply.
Live Events Refresh
WardiTV Winter Champion…
12:00
Group C
WardiTV1146
IndyStarCraft 223
Liquipedia
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
Lowko433
IndyStarCraft 223
Vindicta 38
StarCraft: Brood War
Britney 37583
firebathero 4348
Horang2 3599
Calm 2733
Hyuk 1249
Jaedong 880
Light 463
Shuttle 326
Rush 155
Sea.KH 84
[ Show more ]
hero 82
ToSsGirL 75
Free 60
[sc1f]eonzerg 57
sorry 36
Hm[arnc] 31
scan(afreeca) 18
Terrorterran 12
Noble 9
NaDa 5
Dota 2
Gorgc5536
qojqva1917
febbydoto10
Counter-Strike
byalli4337
allub454
markeloff193
kRYSTAL_77
Super Smash Bros
Mew2King130
Heroes of the Storm
crisheroes241
Other Games
B2W.Neo874
hiko676
DeMusliM256
QueenE158
Sick110
Liquid`VortiX102
XaKoH 84
oskar63
ArmadaUGS54
Organizations
Counter-Strike
PGL853
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• StrangeGG 37
• AfreecaTV YouTube
• intothetv
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• HerbMon 10
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• WagamamaTV493
League of Legends
• Nemesis5918
• TFBlade929
Upcoming Events
Replay Cast
17h 48m
CasterMuse Showmatch
17h 48m
Light vs Queen
WardiTV Winter Champion…
20h 48m
The PondCast
1d 18h
Replay Cast
2 days
Korean StarCraft League
3 days
CranKy Ducklings
3 days
SC Evo Complete
3 days
Replay Cast
4 days
Sparkling Tuna Cup
4 days
[ Show More ]
uThermal 2v2 Circuit
4 days
Replay Cast
5 days
Wardi Open
5 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-02-22
LiuLi Cup: 2025 Grand Finals
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Acropolis #4 - TS5
Jeongseon Sooper Cup
Spring Cup 2026
WardiTV Winter 2026
PiG Sty Festival 7.0
Nations Cup 2026
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025
SL Budapest Major 2025

Upcoming

[S:21] ASL SEASON OPEN 2nd Round
[S:21] ASL SEASON OPEN 2nd Round Qualifier
Acropolis #4 - TS6
Acropolis #4
IPSL Spring 2026
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
FISSURE Playground #3
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
ESL Pro League S23 Stage 1&2
TLPD

1. ByuN
2. TY
3. Dark
4. Solar
5. Stats
6. Nerchio
7. sOs
8. soO
9. INnoVation
10. Elazer
1. Rain
2. Flash
3. EffOrt
4. Last
5. Bisu
6. Soulkey
7. Mini
8. Sharp
Sidebar Settings...

Advertising | Privacy Policy | Terms Of Use | Contact Us

Original banner artwork: Jim Warren
The contents of this webpage are copyright © 2026 TLnet. All Rights Reserved.