• Log InLog In
  • Register
Liquid`
Team Liquid Liquipedia
EST 08:31
CET 14:31
KST 22:31
  • 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 ZvT29Behind the Blue - Team Liquid History Book19Clem wins HomeStory Cup 289HomeStory Cup 28 - Info & Preview13Rongyi Cup S3 - Preview & Info8
Community News
Team Liquid Map Contest - Preparation Notice0Weekly Cups (Feb 23-Mar 1): herO doubles, 2v2 bonanza1Weekly Cups (Feb 16-22): MaxPax doubles0Weekly Cups (Feb 9-15): herO doubles up2ACS replaced by "ASL Season Open" - Starts 21/0258
StarCraft 2
General
ByuL: The Forgotten Master of ZvT Nexon's StarCraft game could be FPS, led by UMS maker How do you think the 5.0.15 balance patch (Oct 2025) for StarCraft II has affected the game? Team Liquid Map Contest - Preparation Notice Weekly Cups (Feb 23-Mar 1): herO doubles, 2v2 bonanza
Tourneys
PIG STY FESTIVAL 7.0! (19 Feb - 1 Mar) RSL Season 4 announced for March-April Sparkling Tuna Cup - Weekly Open Tournament SEL Doubles (SC Evo Bimonthly) WardiTV Team League Season 10
Strategy
Custom Maps
Publishing has been re-enabled! [Feb 24th 2026] Map Editor closed ?
External Content
The PondCast: SC2 News & Results Mutation # 515 Together Forever Mutation # 514 Ulnar New Year Mutation # 513 Attrition Warfare
Brood War
General
It's March 3rd CasterMuse Youtube Recent recommended BW games Soma Explains: JD's Unrelenting Aggro vs FlaSh TvZ is the most complete match up
Tourneys
[Megathread] Daily Proleagues BWCL Season 64 Announcement The Casual Games of the Week Thread [LIVE] [S:21] ASL Season Open Day 1
Strategy
Soma's 9 hatch build from ASL Game 2 Fighting Spirit mining rates Simple Questions, Simple Answers Zealot bombing is no longer popular?
Other Games
General Games
Nintendo Switch Thread Battle Aces/David Kim RTS Megathread Diablo 2 thread Path of Exile Online Quake Live Config Editor Tool
Dota 2
The Story of Wings Gaming 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
Mafia Game Mode Feedback/Ideas Vanilla Mini Mafia TL Mafia Community Thread
Community
General
Things Aren’t Peaceful in Palestine US Politics Mega-thread Russo-Ukrainian War Thread UK Politics Mega-thread NASA and the Private Sector
Fan Clubs
The IdrA Fan Club
Media & Entertainment
[Req][Books] Good Fantasy/SciFi books [Manga] One Piece Anime Discussion Thread
Sports
2024 - 2026 Football Thread Formula 1 Discussion TL MMA Pick'em Pool 2013
World Cup 2022
Tech Support
Laptop capable of using Photoshop Lightroom?
TL Community
The Automated Ban List
Blogs
Just Watchers: Why Some Only…
TrAiDoS
Unintentional protectionism…
Uldridge
ASL S21 English Commentary…
namkraft
Life Update and thoughts.
FuDDx
How do archons sleep?
8882
Customize Sidebar...

Website Feedback

Closed Threads



Active: 2661 users

The Big Programming Thread - Page 179

Forum Index > General Forum
Post a Reply
Prev 1 177 178 179 180 181 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.
Craton
Profile Blog Joined December 2009
United States17279 Posts
Last Edited: 2012-10-18 02:57:22
October 18 2012 02:57 GMT
#3561
You should really try doing this stuff on your own. It only takes a few minutes to plug in these code snippets and run them. You will learn substantially more from trying than from hearing.
twitch.tv/cratonz
GreEny K
Profile Joined February 2008
Germany7312 Posts
October 18 2012 03:02 GMT
#3562
On October 18 2012 11:57 Craton wrote:
You should really try doing this stuff on your own. It only takes a few minutes to plug in these code snippets and run them. You will learn substantially more from trying than from hearing.


Well, normally I work things out on my own because I learn the best that way, but this just wasn't clicking. Seeing it made it click, and I understand it better now..
Why would you ever choose failure, when success is an option.
Thadorus
Profile Joined June 2010
Canada136 Posts
October 18 2012 06:29 GMT
#3563
On October 18 2012 09:57 berated- wrote:
Show nested quote +
On October 18 2012 07:44 Thadorus wrote:
anyone know what would cause vim to freeze? Just started using it and i was editing a program and it suddenly wouldn't let me do anything in insert mode and after a while (5 mins) it crashed and said priWrite failed: Broken pipe;.

I wasn't doing anything important but kinda scares me that it crash like that and now im wondering if its normally that unreliable?


Sounds more like you were using vim with a ssh session, and the ssh session failed not the vim edit. You're not using vim locally, are you?


yep was using ssh
LukeNukeEm
Profile Joined February 2012
31 Posts
October 18 2012 11:11 GMT
#3564
Somewhat of a broad question (C++11):
what are the differences between
#pragma omp parallel for
for (int i = 0; i < 10; i++)
{
doSomething(i);
}
and
concurrency::parallel_for(0, 10, [](int i)
{
doSomething(i);
});
Is there any advantage to either method?
tofucake
Profile Blog Joined October 2009
Hyrule19193 Posts
Last Edited: 2012-10-18 13:29:20
October 18 2012 13:28 GMT
#3565
int input = -1;
while(input < 0)
input = get_input_function();

int sum = (input + 1) * input / 2;
output "sum of input is " + sum;


do while is silly and I've never seen it in the wild.
Liquipediaasante sana squash banana
Fyodor
Profile Blog Joined September 2010
Canada971 Posts
October 18 2012 13:35 GMT
#3566
On October 18 2012 20:11 LukeNukeEm wrote:
Somewhat of a broad question (C++11):
what are the differences between
#pragma omp parallel for
for (int i = 0; i < 10; i++)
{
doSomething(i);
}
and
concurrency::parallel_for(0, 10, [](int i)
{
doSomething(i);
});
Is there any advantage to either method?

Well the first one will only work on windows with the microsoft compiler... afaik. I'd use the standard C++11 method for portability/longevity's sake?

Don't know which one is more efficient right now though.
llllllllllllllllllllllllllllllllllllllllllll
HomeWorld
Profile Joined December 2011
Romania903 Posts
October 18 2012 13:36 GMT
#3567
Oh well, since this is a programming thread, hope someone will have a solution for GDI BitBlt using CAPTUREBLT flag (intended for capturing layered windows too) without having mouse pointer hidden/shown every time BitBlt is called. (if this problem gets solved I think it will help a lot "Open Broadcaster Software" - OBSProject)
LukeNukeEm
Profile Joined February 2012
31 Posts
October 18 2012 13:40 GMT
#3568
On October 18 2012 22:35 Fyodor wrote:
Show nested quote +
On October 18 2012 20:11 LukeNukeEm wrote:
Somewhat of a broad question (C++11):
what are the differences between
#pragma omp parallel for
for (int i = 0; i < 10; i++)
{
doSomething(i);
}
and
concurrency::parallel_for(0, 10, [](int i)
{
doSomething(i);
});
Is there any advantage to either method?

Well the first one will only work on windows with the microsoft compiler... afaik. I'd use the standard C++11 method for portability/longevity's sake?

Don't know which one is more efficient right now though.

Should have mentioned that - since I'm using the Winapi in other parts of the program anyways, portability is no concern, only efficiency.
Kambing
Profile Joined May 2010
United States1176 Posts
Last Edited: 2012-10-18 14:16:44
October 18 2012 14:16 GMT
#3569
On October 18 2012 20:11 LukeNukeEm wrote:
Somewhat of a broad question (C++11):
what are the differences between
#pragma omp parallel for
for (int i = 0; i < 10; i++)
{
doSomething(i);
}
and
concurrency::parallel_for(0, 10, [](int i)
{
doSomething(i);
});
Is there any advantage to either method?


The former uses OpenMP standard as implemented by Microsoft. The latter uses Microsoft's new parallel patterns library (PPL).

The back-ends to each set of technologies are different, so each tech performs differently depending on the situation. The PPL (as a full-fledged library rather than a set of pragmas) fits better with C++ and will be the "way to go" for the future.

If you are worried only about efficiency, then you'll simply need to test your code with both approaches and see which performs better.

http://msdn.microsoft.com/en-us/library/ff461340.aspx
FFGenerations
Profile Blog Joined April 2011
7088 Posts
Last Edited: 2012-10-18 15:01:38
October 18 2012 14:58 GMT
#3570
On October 13 2012 07:09 CecilSunkure wrote:
Show nested quote +
On October 13 2012 06:35 FFGenerations wrote:
however i want to make the button to quit the loop to be 'g' rather than '0'

Then do something like this:
do
{
char input;
cin >> input;

// optionally if you include <stdio.h>
getchar( &input );
} while(input != 'g');


Floats take up 4 bytes of memory. If you don't know what a byte is, try looking it up. A character takes only a single byte. If you are trying to grab a float out of cin (your n variable is a float) it will be looking for something that it can interpret as a float, i.e. a number. You won't be able to convert a float to the character 'g' very easily. This is because the bit format for a float is very different from that of a character.

So, you use cin and extract a single character, which grabs the next 8 bits from the standard in stream (cin). If you aren't familiar with the difference between ' ' and " " in C and C++, then read the spoiler:
+ Show Spoiler +
Using the ' ' will generate a character literal, as in a single byte long character. 'a' is actually an integer, as characters are unsigned integers ranging from 0 to 255. 'a' represents the number 96. You can actually do 10 + 'a' and have valid code. 10 + 'a' is 106, or 'j'.

" " creates a string literal, as in an array of characters. " " takes whatever is inside the two brackets and creates an array of characters with the characters between the two quotes, and places the character representing the number 0 at the end. This represents a string in C. An array of characters with a null character ( 0 ) at the end is a string. So, using "sadf" returns a character array that represents a string, which looks like this:
"sadf" // equivalent to the following:
{ 's', 'a', 'd', 'f', '/0' }


Edit: I also don't like seeing everyone do "using namespace std;". I guess it's okay if this is only your second class, but really you should be fully understanding what a namespace is, what using means, and what std is. When you write cin you should be manually accessing the std namespace with the :: operator. The using operator clutters your global namespace. I'm just not a fan of using things you don't understand.
do
{
char input;
std::cin >> input;

// optionally if you include <stdio.h>
getchar( &input );
} while(input != 'g');



Thankyou for your reply.

I still dont understand really.

You basically said to use char but I'm not sure what else you said regarding my problem at hand..

So I came to this sort of thing (which doesnt work oc)

+ Show Spoiler +


#include <cstdlib>
#include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[])
{
char input[256];
int n1;
int sum;


cout<<"Enter numbers. Press 'q' to end."<<endl;

do
{
gets(input);
sum=atoi(input);
n1=n1+sum;

}

while (input!='q');


cout<<"Okay! The total sum of your numbers is "<<n1<<endl;


system("PAUSE");
}



This isn't school work btw, so go ahead and tell me the solution (relevent to me) if you want..
I thought we might cover it today but we just went straight onto For loops instead.
Honestly I don't think my tutor knows much about indepth coding, in the sense that he wouldn't know how to solve what I'm trying to do..

Thanks again

clean version:
+ Show Spoiler +


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
float input;
float n1;


cout<<"Enter numbers. Press 'q' to end."<<endl;

do
{
cin>>input;

n1=n1+input;

}

while (input!=0);

cout<<"Okay! The total sum of your numbers is "<<n1<<endl;


system("PAUSE");
}



Cool BW Music Vid - youtube.com/watch?v=W54nlqJ-Nx8 ~~~~~ ᕤ OYSTERS ᕤ CLAMS ᕤ AND ᕤ CUCKOLDS ᕤ ~~~~~~ ༼ ᕤ◕◡◕ ༽ᕤ PUNCH HIM ༼ ᕤ◕◡◕ ༽ᕤ
HomeWorld
Profile Joined December 2011
Romania903 Posts
Last Edited: 2012-10-18 15:33:45
October 18 2012 15:08 GMT
#3571
On October 18 2012 23:58 FFGenerations wrote:
Show nested quote +
On October 13 2012 07:09 CecilSunkure wrote:
On October 13 2012 06:35 FFGenerations wrote:
however i want to make the button to quit the loop to be 'g' rather than '0'

Then do something like this:
do
{
char input;
cin >> input;

// optionally if you include <stdio.h>
getchar( &input );
} while(input != 'g');


Floats take up 4 bytes of memory. If you don't know what a byte is, try looking it up. A character takes only a single byte. If you are trying to grab a float out of cin (your n variable is a float) it will be looking for something that it can interpret as a float, i.e. a number. You won't be able to convert a float to the character 'g' very easily. This is because the bit format for a float is very different from that of a character.

So, you use cin and extract a single character, which grabs the next 8 bits from the standard in stream (cin). If you aren't familiar with the difference between ' ' and " " in C and C++, then read the spoiler:
+ Show Spoiler +
Using the ' ' will generate a character literal, as in a single byte long character. 'a' is actually an integer, as characters are unsigned integers ranging from 0 to 255. 'a' represents the number 96. You can actually do 10 + 'a' and have valid code. 10 + 'a' is 106, or 'j'.

" " creates a string literal, as in an array of characters. " " takes whatever is inside the two brackets and creates an array of characters with the characters between the two quotes, and places the character representing the number 0 at the end. This represents a string in C. An array of characters with a null character ( 0 ) at the end is a string. So, using "sadf" returns a character array that represents a string, which looks like this:
"sadf" // equivalent to the following:
{ 's', 'a', 'd', 'f', '/0' }


Edit: I also don't like seeing everyone do "using namespace std;". I guess it's okay if this is only your second class, but really you should be fully understanding what a namespace is, what using means, and what std is. When you write cin you should be manually accessing the std namespace with the :: operator. The using operator clutters your global namespace. I'm just not a fan of using things you don't understand.
do
{
char input;
std::cin >> input;

// optionally if you include <stdio.h>
getchar( &input );
} while(input != 'g');



Thankyou for your reply.

I still dont understand really.

You basically said to use char but I'm not sure what else you said regarding my problem at hand..

So I came to this sort of thing (which doesnt work oc)

+ Show Spoiler +


#include <cstdlib>
#include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[]
{
char input[256];
int n1;
int sum;


cout<<"Enter numbers. Press 'q' to end."<<endl;

do
{
gets(input);
sum=atoi(input);
n1=n1+sum;

}

while (input!='q');


cout<<"Okay! The total sum of your numbers is "<<n1<<endl;


system("PAUSE");
}



This isn't school work btw, so go ahead and tell me the solution (relevent to me) if you want..
I thought we might cover it today but we just went straight onto For loops instead.
Honestly I don't think my tutor knows much about indepth coding, in the sense that he wouldn't know how to solve what I'm trying to do..

Thanks again

clean version:
+ Show Spoiler +


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[]
{
float input;
float n1;


cout<<"Enter numbers. Press 'q' to end."<<endl;

do
{
cin>>input;

n1=n1+input;

}

while (input!=0);

cout<<"Okay! The total sum of your numbers is "<<n1<<endl;


system("PAUSE");
}




well you are comparing a char array with a char (that should be the problem, afair , didn't c++'ed for a long time (i might be quite terrible wrong), it should be : while (input[0] != 'q');


I might add : " error: ISO C++ forbids comparison between pointer and integer" that's input!='q'
NOT TO MENTION YOU DIDN'T INITIALIZED n1

somewhat fixed

#include <cstdlib>
#include <iostream>
#include <stdio.h>

using namespace std;

int main(int argc, char *argv[])
{
char input[256];
int n1=0;


cout<<"Enter numbers. Press 'q' to end."<<endl;

do
{
gets(input);
n1 += atoi(input);
}
while (input[0]!='q');
cout<<"Okay! The total sum of your numbers is "<<n1<<endl;
}
LukeNukeEm
Profile Joined February 2012
31 Posts
October 18 2012 20:56 GMT
#3572
On October 18 2012 22:36 HomeWorld wrote:
Oh well, since this is a programming thread, hope someone will have a solution for GDI BitBlt using CAPTUREBLT flag (intended for capturing layered windows too) without having mouse pointer hidden/shown every time BitBlt is called. (if this problem gets solved I think it will help a lot "Open Broadcaster Software" - OBSProject)
Googling this led me to this
The problem is that internally MS does a ShowCursor (FALSE) / ShowCursor (TRUE) every time you BitBlt – this creates a Blinking Cursor.
One reeeeeeeaaaaaaallllyy hacky way to "fix" that that jumps into my head would be to detour ShowCursor() and prevent its execution this way.
billy5000
Profile Blog Joined December 2010
United States865 Posts
October 19 2012 08:29 GMT
#3573
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2012-10-19 08:50:20
October 19 2012 08:36 GMT
#3574
On October 19 2012 17:29 billy5000 wrote:
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.


Please make a few applications, run them on the emulator and see if you actually like the Android environment. It's very easy to just borrow a friend's phone for a couple hours, or call them over to your house to play a bit and use their phone in the meantime, versus spending $150 and then realizing it's not all that you thought it would be. Once you've gotten a taste for it, and actually like it, then you can start thinking about buying a dedicated testing device.
There is no one like you in the universe.
billy5000
Profile Blog Joined December 2010
United States865 Posts
October 19 2012 08:54 GMT
#3575
On October 19 2012 17:36 Blisse wrote:
Show nested quote +
On October 19 2012 17:29 billy5000 wrote:
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.


Please make a few applications, run them on the emulator and see if you actually like the Android environment. It's very easy to just borrow a friend's phone for a couple hours, or call them over to your house to play a bit and use their phone in the meantime, versus spending $150 and then realizing it's not all that you thought it would be. Once you've gotten a taste for it, and actually like it, then you can start thinking about buying a dedicated testing device.

The linked device only supports Android 2.3, so if you're really considering it, start to look into development a bit there first.


Actually, you somehow persuaded me that I should make web based apps. Somehow lol. I just had a moment of realization why I don't even own an android/ios device in the first place. It's just that 90% of my friends have them, and..yeah, naive.
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2012-10-19 09:07:40
October 19 2012 09:07 GMT
#3576
On October 19 2012 17:54 billy5000 wrote:
Show nested quote +
On October 19 2012 17:36 Blisse wrote:
On October 19 2012 17:29 billy5000 wrote:
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.


Please make a few applications, run them on the emulator and see if you actually like the Android environment. It's very easy to just borrow a friend's phone for a couple hours, or call them over to your house to play a bit and use their phone in the meantime, versus spending $150 and then realizing it's not all that you thought it would be. Once you've gotten a taste for it, and actually like it, then you can start thinking about buying a dedicated testing device.

The linked device only supports Android 2.3, so if you're really considering it, start to look into development a bit there first.


Actually, you somehow persuaded me that I should make web based apps. Somehow lol. I just had a moment of realization why I don't even own an android/ios device in the first place. It's just that 90% of my friends have them, and..yeah, naive.


Well, to be fair, it really doesn't hurt to give development on the emulator a go to see how you feel about it. You may feel that environment has the right feel, or that you really like it, or that you hate it with a passion. Can't tell until you give it a try.

It just seemed like you jumping the gun a bit by spending $150 then flipping a coin on whether you actually like developing on Android. Lots of developers do, and lots of developers don't. It's a preference, and you can't know until you try it out a bit. Not really naive, just a discovery process to see what you like and don't like.

The point is never to reject an idea immediately, but don't jump the gun and focus all your development and learning to the next big, and I use this loosely, "FOTM" when you don't even know if you'll like it. It's never wrong to learn, but you don't want to hurt yourself senselessly.
There is no one like you in the universe.
billy5000
Profile Blog Joined December 2010
United States865 Posts
October 19 2012 09:20 GMT
#3577
On October 19 2012 18:07 Blisse wrote:
Show nested quote +
On October 19 2012 17:54 billy5000 wrote:
On October 19 2012 17:36 Blisse wrote:
On October 19 2012 17:29 billy5000 wrote:
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.


Please make a few applications, run them on the emulator and see if you actually like the Android environment. It's very easy to just borrow a friend's phone for a couple hours, or call them over to your house to play a bit and use their phone in the meantime, versus spending $150 and then realizing it's not all that you thought it would be. Once you've gotten a taste for it, and actually like it, then you can start thinking about buying a dedicated testing device.

The linked device only supports Android 2.3, so if you're really considering it, start to look into development a bit there first.


Actually, you somehow persuaded me that I should make web based apps. Somehow lol. I just had a moment of realization why I don't even own an android/ios device in the first place. It's just that 90% of my friends have them, and..yeah, naive.


Well, to be fair, it really doesn't hurt to give development on the emulator a go to see how you feel about it. You may feel that environment has the right feel, or that you really like it, or that you hate it with a passion. Can't tell until you give it a try.

It just seemed like you jumping the gun a bit by spending $150 then flipping a coin on whether you actually like developing on Android. Lots of developers do, and lots of developers don't. It's a preference, and you can't know until you try it out a bit. Not really naive, just a discovery process to see what you like and don't like.

The point is never to reject an idea immediately, but don't jump the gun and focus all your development and learning to the next big, and I use this loosely, "FOTM" when you don't even know if you'll like it. It's never wrong to learn, but you don't want to hurt yourself senselessly.


I actually have it set up on my eclipse, but the emulator runs unbearably slow on my computer. In addition, I have absolutely no handheld device experience, so there's not a clear distinction of what the consumer wants and does not want.

Anyway, I was mainly curious because I want to finally do something fun and practical after 1 year at my university. It just hit me that I haven't thought about the web. Android/ios apps have that cutesy characteristic, which is probably the reason why I was interested.
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
Blisse
Profile Blog Joined July 2010
Canada3710 Posts
Last Edited: 2012-10-19 09:36:03
October 19 2012 09:35 GMT
#3578
On October 19 2012 18:20 billy5000 wrote:
Show nested quote +
On October 19 2012 18:07 Blisse wrote:
On October 19 2012 17:54 billy5000 wrote:
On October 19 2012 17:36 Blisse wrote:
On October 19 2012 17:29 billy5000 wrote:
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.


Please make a few applications, run them on the emulator and see if you actually like the Android environment. It's very easy to just borrow a friend's phone for a couple hours, or call them over to your house to play a bit and use their phone in the meantime, versus spending $150 and then realizing it's not all that you thought it would be. Once you've gotten a taste for it, and actually like it, then you can start thinking about buying a dedicated testing device.

The linked device only supports Android 2.3, so if you're really considering it, start to look into development a bit there first.


Actually, you somehow persuaded me that I should make web based apps. Somehow lol. I just had a moment of realization why I don't even own an android/ios device in the first place. It's just that 90% of my friends have them, and..yeah, naive.


Well, to be fair, it really doesn't hurt to give development on the emulator a go to see how you feel about it. You may feel that environment has the right feel, or that you really like it, or that you hate it with a passion. Can't tell until you give it a try.

It just seemed like you jumping the gun a bit by spending $150 then flipping a coin on whether you actually like developing on Android. Lots of developers do, and lots of developers don't. It's a preference, and you can't know until you try it out a bit. Not really naive, just a discovery process to see what you like and don't like.

The point is never to reject an idea immediately, but don't jump the gun and focus all your development and learning to the next big, and I use this loosely, "FOTM" when you don't even know if you'll like it. It's never wrong to learn, but you don't want to hurt yourself senselessly.


I actually have it set up on my eclipse, but the emulator runs unbearably slow on my computer. In addition, I have absolutely no handheld device experience, so there's not a clear distinction of what the consumer wants and does not want.

Anyway, I was mainly curious because I want to finally do something fun and practical after 1 year at my university. It just hit me that I haven't thought about the web. Android/ios apps have that cutesy characteristic, which is probably the reason why I was interested.


Well that's good, then do something fun! It doesn't even need to be practical. It only needs to be something you're interested in; a problem, or to learn, or to do something fun with. And you can have lots of fun doing lots of different things. I know that like, mobile development feels like it's all the rage right now, and that's good, but you can do equally awesome stuff on your desktop as well.

Also, don't worry about what the consumer wants and what you want. If you make something that you really want to use, you can bet there will be people who really want to use it as well. But since you're just starting, just go do whatever the heck you want. If you really want to get into the mobile market, just go for it and work hard, using that $150 as the motivation to push yourself into learning.

It doesn't matter as long as you're interested in it.


If you want to be more conservative, your computer might be slow, but don't let that be the reason you don't look into something you're interested in. If the emulator's slow, I believe there are some workarounds to make it faster. It's apparently even on very good machines. If your machine is just old, then it's a little more complicated.
There is no one like you in the universe.
billy5000
Profile Blog Joined December 2010
United States865 Posts
October 19 2012 09:42 GMT
#3579
On October 19 2012 18:35 Blisse wrote:
Show nested quote +
On October 19 2012 18:20 billy5000 wrote:
On October 19 2012 18:07 Blisse wrote:
On October 19 2012 17:54 billy5000 wrote:
On October 19 2012 17:36 Blisse wrote:
On October 19 2012 17:29 billy5000 wrote:
Hey guys, I've been thinking about getting an android device so I can make a few apps for it (I already have some small ones in mind). However, I'm pretty new to the mobile world and I don't plan on buying a phone. Instead, I found this. Would I be able to make apps for this as well as other android devices? I'm 99% sure that it would (as with all android based devices), but I just need to confirm this before I waste $150.


Please make a few applications, run them on the emulator and see if you actually like the Android environment. It's very easy to just borrow a friend's phone for a couple hours, or call them over to your house to play a bit and use their phone in the meantime, versus spending $150 and then realizing it's not all that you thought it would be. Once you've gotten a taste for it, and actually like it, then you can start thinking about buying a dedicated testing device.

The linked device only supports Android 2.3, so if you're really considering it, start to look into development a bit there first.


Actually, you somehow persuaded me that I should make web based apps. Somehow lol. I just had a moment of realization why I don't even own an android/ios device in the first place. It's just that 90% of my friends have them, and..yeah, naive.


Well, to be fair, it really doesn't hurt to give development on the emulator a go to see how you feel about it. You may feel that environment has the right feel, or that you really like it, or that you hate it with a passion. Can't tell until you give it a try.

It just seemed like you jumping the gun a bit by spending $150 then flipping a coin on whether you actually like developing on Android. Lots of developers do, and lots of developers don't. It's a preference, and you can't know until you try it out a bit. Not really naive, just a discovery process to see what you like and don't like.

The point is never to reject an idea immediately, but don't jump the gun and focus all your development and learning to the next big, and I use this loosely, "FOTM" when you don't even know if you'll like it. It's never wrong to learn, but you don't want to hurt yourself senselessly.


I actually have it set up on my eclipse, but the emulator runs unbearably slow on my computer. In addition, I have absolutely no handheld device experience, so there's not a clear distinction of what the consumer wants and does not want.

Anyway, I was mainly curious because I want to finally do something fun and practical after 1 year at my university. It just hit me that I haven't thought about the web. Android/ios apps have that cutesy characteristic, which is probably the reason why I was interested.


Well that's good, then do something fun! It doesn't even need to be practical. It only needs to be something you're interested in; a problem, or to learn, or to do something fun with. And you can have lots of fun doing lots of different things. I know that like, mobile development feels like it's all the rage right now, and that's good, but you can do equally awesome stuff on your desktop as well.

Also, don't worry about what the consumer wants and what you want. If you make something that you really want to use, you can bet there will be people who really want to use it as well. But since you're just starting, just go do whatever the heck you want. If you really want to get into the mobile market, just go for it and work hard, using that $150 as the motivation to push yourself into learning.

It doesn't matter as long as you're interested in it.


If you want to be more conservative, your computer might be slow, but don't let that be the reason you don't look into something you're interested in. If the emulator's slow, I believe there are some workarounds to make it faster. It's apparently even on very good machines. If your machine is just old, then it's a little more complicated.


Will do! I still have a lot of time to think about it, so I'll hopefully figure something out. Thanks.
Tiger got to hunt, bird got to fly; Man got to sit and wonder, 'Why, why, why?' Tiger got to sleep, bird got to land; Man got to tell himself he understand. Vonnegut
NeMeSiS3
Profile Blog Joined February 2012
Canada2972 Posts
Last Edited: 2012-10-19 16:16:23
October 19 2012 16:12 GMT
#3580
Question:
+ Show Spoiler +
1. Geometric Series

Consider the following geometric series, where -1 < r < 1:



Write a Java application to test this formula, given a value of r as input. Make sure to test that -1 < r < 1. If the input is out of range you should prompt again and again until an acceptable value of r is input. At each iteration compare the new estimate with the estimate from the previous iteration. Quit the loop if the absolute value of the difference is less than 1E-8 (0.00000001) and print the number of iterations. Also print your estimate and the value of 1/(1-r).

NOTE: For this question you only need to write one class. You may place all of your code in the main method of that class.

After you have tested your application and you're sure that it works properly, print a copy of your code. Also print sample output.


METHOD SO FAR:

+ Show Spoiler +
import java.util.*;

public class geoSeries
{      public static void main(String[] args)
      {      Scanner input = new Scanner(System.in);
            double r;

            System.out.println("Please enter a variable:");
            r = input.nextDouble();

            while(-1 < r && r < 1)
            {      System.out.println("ERROR: enter a number that is <= -1 or >= 1");
                  System.out.println("Please enter a variable:");
                  r = input.nextDouble();
            }


            while(r >= 1E-8)
             {
             }

      }
}


I don't really know where to go, I don't understand how to make the program loop for every r. I presume I need a statement like 1 *= r; but I can't understand how to get it going

Oh and the format, sorry it's hard to put the format into here because you have to {indent} shit.

NOTE** This is part of an assignment, I do not want the entire solution, I just want maybe an edge to help me out because I'm confused how to write that kind of code.

Thanks ^^
FoTG fighting!
Prev 1 177 178 179 180 181 1032 Next
Please log in or register to reply.
Live Events Refresh
Next event in 11h 29m
[ Submit Event ]
Live Streams
Refresh
StarCraft 2
BRAT_OK 96
StarCraft: Brood War
Sea 47237
Britney 38511
Bisu 5246
Hyuk 1580
firebathero 952
actioN 683
Mini 408
Soma 212
Light 209
PianO 175
[ Show more ]
Soulkey 169
Rush 153
ZerO 131
Dewaltoss 123
Mong 112
ToSsGirL 70
Backho 62
JulyZerg 48
Free 33
[sc1f]eonzerg 27
GoRush 25
sSak 25
sorry 23
910 21
scan(afreeca) 19
Nal_rA 18
zelot 13
ajuk12(nOOB) 11
soO 9
SilentControl 8
Icarus 8
Terrorterran 4
Dota 2
XcaliburYe91
NeuroSwarm50
Counter-Strike
olofmeister2172
fl0m1229
x6flipin418
allub176
Heroes of the Storm
crisheroes262
Other Games
singsing2122
Gorgc1700
Liquid`RaSZi1204
B2W.Neo1201
DeMusliM324
Lowko260
hiko202
Fuzer 181
Pyrionflax168
Mew2King74
Hui .18
ZerO(Twitch)17
Organizations
Counter-Strike
PGL116
StarCraft: Brood War
lovetv 17
StarCraft 2
Blizzard YouTube
StarCraft: Brood War
BSLTrovo
sctven
[ Show 15 non-featured ]
StarCraft 2
• intothetv
• AfreecaTV YouTube
• Kozan
• IndyKCrew
• LaughNgamezSOOP
• Migwel
• sooper7s
StarCraft: Brood War
• blackmanpl 17
• Michael_bg 3
• BSLYoutube
• STPLYoutube
• ZZZeroYoutube
Dota 2
• lizZardDota258
League of Legends
• TFBlade747
• Stunt707
Upcoming Events
PiGosaur Cup
11h 29m
Replay Cast
19h 29m
Replay Cast
1d 10h
The PondCast
1d 20h
KCM Race Survival
1d 20h
WardiTV Winter Champion…
1d 22h
Replay Cast
2 days
Ultimate Battle
2 days
Light vs ZerO
WardiTV Winter Champion…
2 days
Classic vs Nicoract
herO vs YoungYakov
ByuN vs Gerald
Clem vs Krystianer
Replay Cast
3 days
[ Show More ]
CranKy Ducklings
3 days
WardiTV Winter Champion…
3 days
MaxPax vs Spirit
Bunny vs Rogue
Cure vs SHIN
Solar vs Zoun
Replay Cast
4 days
Sparkling Tuna Cup
4 days
WardiTV Winter Champion…
4 days
Replay Cast
5 days
Replay Cast
5 days
Monday Night Weeklies
6 days
Replay Cast
6 days
Liquipedia Results

Completed

Proleague 2026-03-02
PiG Sty Festival 7.0
Underdog Cup #3

Ongoing

KCM Race Survival 2026 Season 1
Jeongseon Sooper Cup
Spring Cup 2026
WardiTV Winter 2026
Nations Cup 2026
ESL Pro League S23 Stage 1&2
PGL Cluj-Napoca 2026
IEM Kraków 2026
BLAST Bounty Winter 2026
BLAST Bounty Winter Qual
eXTREMESLAND 2025

Upcoming

ASL Season 21: Qualifier #1
ASL Season 21: Qualifier #2
ASL Season 21
Acropolis #4 - TS6
Acropolis #4
IPSL Spring 2026
CSLAN 4
HSC XXIX
uThermal 2v2 2026 Main Event
Bellum Gens Elite Stara Zagora 2026
RSL Revival: Season 4
NationLESS Cup
Asian Champions League 2026
IEM Atlanta 2026
PGL Astana 2026
BLAST Rivals Spring 2026
CCT Season 3 Global Finals
IEM Rio 2026
PGL Bucharest 2026
Stake Ranked Episode 1
BLAST Open Spring 2026
ESL Pro League S23 Finals
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...

Disclosure: This page contains affiliate marketing links that support TLnet.

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.