|
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. |
Poland794 Posts
What do you mean by "without using GET"? Anytime you do stuff like "url?parameter=value" you're using GET.
You mean you want to pass the entire $data array to the form somehow? Then probably the best way to do it is:
<input type='hidden' name='data' value='<?php echo base64_encode(serialize($data)); ?>' />
Then, in the target script you get the value by:
$data = unserialize(base64_decode($_POST['data']));
|
Bisutopia19299 Posts
I'm a c++ programmer. Been using script for almost 2 years though. Now I have a huge job opportunity at my work but I need to learn linux.
Any advice how the hell I learn linux, the only thing I know is I need to use VIM and Eclipse. But I need the best starters guide available!
|
Only way to learn linux is to use it. Install it and learn to use it for all the things you currently use it for (except games...). Start by learning to install things on linux, and go from there.
Protip: google.
|
Oh Hi Illintar! It's WGT-Stars 
And thanks for the reply, that actually made more sense...
But I just ended up doing javascript:
onSubmit="this.action+=''+document.getElementById('state').value;"
worked like a charm.
|
On March 13 2013 21:32 WindWolf wrote: Visual Studio 2010, C++ question.
When building my program, the build takes time to do this
1>Link: 1> Generating code
Could that be because the project I'm working on is kinda big (~170 code files excluding externals), or is there something I can do to improve that because my group mate, who has the same laptpo and everything doesn't seem to have this "problem" (It builds perfectly, it is just that it takes time to build it) Now all of a sudden, linking goes quickly again, same computer at all. And I mean, it went from 15-20 seconds to 1 second. And I did not do any that can affect the linking times that radically (Long answer short, I don't wanna break the game we are working on with ~1 week to go. Visual Studio 2010 is weird sometimes
|
On March 20 2013 02:43 ShoCkeyy wrote: <?php $data = array( 'Select a State'=>"Select a State", 'AL'=>"Alabama", 'AK'=>"Alaska" ); $selected = $_POST['state']; ?> <div class="input"> <form action="in-test.php?state=<? echo http_build_query($data, '', '&'); ?>" method="post" onSubmit="return validateForm()" name="myform"> <div class="select"> <select name="state" id="state" class="uni"> <?php foreach ( $data as $value=>$text ) { if ( intval($selected) == intval($value) ) { echo '<option value="'.$value.'" selected="yes">'.$text.'</option>'."\n"; } else { echo '<option value="'.$value.'">'.$text.'</option>'."\n"; } } ?> </select> </div> <div class="btn_area"> <input name="getstarted" type="submit" class="input_btns" value=""> </div> </form> </div>
I need to be able to pull the state value into the URL with out using GET. Any clue on what syntax I should be using? - _ -; Been stuck on this for a while, right now it's giving me only the first array as AL=Alabama. I need it to be just the value (AL)... Reason I can't use method="get" is because of how the system we post into is set to HTTP POST and I can't change it.
Why are you using intval on a String? Remove the intval and your code should work.
|
On March 19 2013 22:34 obesechicken13 wrote:Show nested quote +On March 19 2013 12:52 Release wrote:Hi. Current junior in high school and am thinking about a future in programming. Which majors/colleges should I be looking into? + Show Spoiler + I know that CMU/MIT/Standford are the three of the best but what are some others?
Most computer engineering and computer science majors in big name universities teach a lot of unnecessary courses. You don't need to build an operating system or compiler or build gates or use gaussian distributions or draw circuit diagrams etc...
That's a scary and very incorrect proposition that most of the core classes of a computer science degree are unnecessary.
Again, a computer science major is not just about programming, but preparing you to apply computational skills to solve problems. To do this effectively, you need to understand not only how to program, but what affordances your underlying technology offers you as well as mathematical and computational techniques to tackle the domain-specific problems that you will encounter in your day-to-day job.
|
Poland794 Posts
On March 20 2013 06:55 Kambing wrote:Show nested quote +On March 19 2013 22:34 obesechicken13 wrote:On March 19 2013 12:52 Release wrote:Hi. Current junior in high school and am thinking about a future in programming. Which majors/colleges should I be looking into? + Show Spoiler + I know that CMU/MIT/Standford are the three of the best but what are some others?
Most computer engineering and computer science majors in big name universities teach a lot of unnecessary courses. You don't need to build an operating system or compiler or build gates or use gaussian distributions or draw circuit diagrams etc... That's a scary and very incorrect proposition that most of the core classes of a computer science degree are unnecessary. Again, a computer science major is not just about programming, but preparing you to apply computational skills to solve problems. To do this effectively, you need to understand not only how to program, but what affordances your underlying technology offers you as well as mathematical and computational techniques to tackle the domain-specific problems that you will encounter in your day-to-day job.
This. Compiler or operating system classes are not supposed to teach you how to write your own compiler or operating system module (although that's often the teaching method employed), but to teach you how modern compilers / operating systems work.
|
On March 20 2013 07:08 Ilintar wrote:Show nested quote +On March 20 2013 06:55 Kambing wrote:On March 19 2013 22:34 obesechicken13 wrote:On March 19 2013 12:52 Release wrote:Hi. Current junior in high school and am thinking about a future in programming. Which majors/colleges should I be looking into? + Show Spoiler + I know that CMU/MIT/Standford are the three of the best but what are some others?
Most computer engineering and computer science majors in big name universities teach a lot of unnecessary courses. You don't need to build an operating system or compiler or build gates or use gaussian distributions or draw circuit diagrams etc... That's a scary and very incorrect proposition that most of the core classes of a computer science degree are unnecessary. Again, a computer science major is not just about programming, but preparing you to apply computational skills to solve problems. To do this effectively, you need to understand not only how to program, but what affordances your underlying technology offers you as well as mathematical and computational techniques to tackle the domain-specific problems that you will encounter in your day-to-day job. This. Compiler or operating system classes are not supposed to teach you how to write your own compiler or operating system module (although that's often the teaching method employed), but to teach you how modern compilers / operating systems work. Even more generally, I'd argue that almost no high-level university class is actually intended to teach you the information introduced in the course, but rather to teach you the tools required to understand that information. Programming a compiler is a useless skill for the vast, vast majority of programmers, but knowing the things you need to know in order to program a compiler is very useful. Similarly, the number theory stuff I learned in my higher level math classes was not specifically useful, but the underlying understanding of how mathematics works that I gained has been invaluable. The physics lab where you plot the trajectory of ping pong balls isn't meant to make you an expert on table tennis ballistics, but to force you to learn to apply mathematical models to observed phenomena. And so on, and so on. People get so hung up on the superficial top layer of course work that they entirely fail to understand what they're actually supposed to be learning. That's why you get these kids who get through university by memorizing facts from flashcards to get past the tests, then they get into the real world and I can't hire them because they're completely ignorant of the underlying principles that they were supposed to be learning.
|
On March 20 2013 06:55 Kambing wrote:Show nested quote +On March 19 2013 22:34 obesechicken13 wrote:On March 19 2013 12:52 Release wrote:Hi. Current junior in high school and am thinking about a future in programming. Which majors/colleges should I be looking into? + Show Spoiler + I know that CMU/MIT/Standford are the three of the best but what are some others?
Most computer engineering and computer science majors in big name universities teach a lot of unnecessary courses. You don't need to build an operating system or compiler or build gates or use gaussian distributions or draw circuit diagrams etc... That's a scary and very incorrect proposition that most of the core classes of a computer science degree are unnecessary. Again, a computer science major is not just about programming, but preparing you to apply computational skills to solve problems. To do this effectively, you need to understand not only how to program, but what affordances your underlying technology offers you as well as mathematical and computational techniques to tackle the domain-specific problems that you will encounter in your day-to-day job. To add more: It's also kinda scary how many students think its a waste of time to take classes that are educational on the hardware topics. Many don't realize the limitations of a software and its processing power requirement. If the computer lacks the computing power then all of a sudden that code you wrote is useless.
It's quite funny though to see pre-med students complaining about taking calculus. The math isn't important to them but utilizing the logistics and critical thinking component of the brain is important in solving medical problems (identifying health problems, performing the minimal amount of tests to effectively diagnose the patient etc...)
|
On March 20 2013 07:54 heroyi wrote:Show nested quote +On March 20 2013 06:55 Kambing wrote:On March 19 2013 22:34 obesechicken13 wrote:On March 19 2013 12:52 Release wrote:Hi. Current junior in high school and am thinking about a future in programming. Which majors/colleges should I be looking into? + Show Spoiler + I know that CMU/MIT/Standford are the three of the best but what are some others?
Most computer engineering and computer science majors in big name universities teach a lot of unnecessary courses. You don't need to build an operating system or compiler or build gates or use gaussian distributions or draw circuit diagrams etc... That's a scary and very incorrect proposition that most of the core classes of a computer science degree are unnecessary. Again, a computer science major is not just about programming, but preparing you to apply computational skills to solve problems. To do this effectively, you need to understand not only how to program, but what affordances your underlying technology offers you as well as mathematical and computational techniques to tackle the domain-specific problems that you will encounter in your day-to-day job. To add more: It's also kinda scary how many students think its a waste of time to take classes that are educational on the hardware topics. Many don't realize the limitations of a software and its processing power requirement. If the computer lacks the computing power then all of a sudden that code you wrote is useless. It's quite funny though to see pre-med students complaining about taking calculus. The math isn't important to them but utilizing the logistics and critical thinking component of the brain is important in solving medical problems (identifying health problems, performing the minimal amount of tests to effectively diagnose the patient etc...) It's also interesting at how sadistic pointer typecasting in C is. Nobody should even learn OOP by implementing it in C.
[me]Beats the horse.[/me]
|
In a C# .asmx web service I am calling an unmanaged c++ .dll. If two people call this web service simultaneously it will crash; it only works if one person is calling it at a time. So am I right to think that both calls to the .dll are running in the same thread and interfering with each other by trying to simultaneously access global variables. If I make all the variables just local variables in the function that is exposed in the dll should this remedy the problem?
|
On March 20 2013 08:00 CecilSunkure wrote:Show nested quote +On March 20 2013 07:54 heroyi wrote:On March 20 2013 06:55 Kambing wrote:On March 19 2013 22:34 obesechicken13 wrote:On March 19 2013 12:52 Release wrote:Hi. Current junior in high school and am thinking about a future in programming. Which majors/colleges should I be looking into? + Show Spoiler + I know that CMU/MIT/Standford are the three of the best but what are some others?
Most computer engineering and computer science majors in big name universities teach a lot of unnecessary courses. You don't need to build an operating system or compiler or build gates or use gaussian distributions or draw circuit diagrams etc... That's a scary and very incorrect proposition that most of the core classes of a computer science degree are unnecessary. Again, a computer science major is not just about programming, but preparing you to apply computational skills to solve problems. To do this effectively, you need to understand not only how to program, but what affordances your underlying technology offers you as well as mathematical and computational techniques to tackle the domain-specific problems that you will encounter in your day-to-day job. To add more: It's also kinda scary how many students think its a waste of time to take classes that are educational on the hardware topics. Many don't realize the limitations of a software and its processing power requirement. If the computer lacks the computing power then all of a sudden that code you wrote is useless. It's quite funny though to see pre-med students complaining about taking calculus. The math isn't important to them but utilizing the logistics and critical thinking component of the brain is important in solving medical problems (identifying health problems, performing the minimal amount of tests to effectively diagnose the patient etc...) It's also interesting at how sadistic pointer typecasting in C is. Nobody should even learn OOP by implementing it in C. [me]Beats the horse.[/me]
I've made my students do that in my C/C++ course. It's a good exercise, but yes, once you have already been introduced to OOP in a Java-like language. =)
|
hi everyone I have an assignment to draw a spiral which I need help in general idea or pseudocode of how to construct it. The spiral should look like this
Thank you
|
On March 20 2013 14:15 tuho12345 wrote:hi everyone I have an assignment to draw a spiral which I need help in general idea or pseudocode of how to construct it. The spiral should look like this Thank you
well the size of each line increases by one unit every two lines in the picture you included. by two lines I mean-- a discrete block of time before moving in a different direction. so one unit up, one unit left, then two unit down, two unit right, then three ... ya feel me? and of course all this while simply alternating between up left down right up left, etc.
|
Spiral psuedo code:
distance = number
while distance > 0 move left by distance move up by distance distance = distance - 1 move right by distance move down by distance distance = distance - 1
To get this psuedo code I just looked at your picture for like 10 seconds. You just follow the line and examine how it changes. Then think of how to write lines of code that model this change; quite an intuitive process.
|
On March 20 2013 11:32 JeanLuc wrote: In a C# .asmx web service I am calling an unmanaged c++ .dll. If two people call this web service simultaneously it will crash; it only works if one person is calling it at a time. So am I right to think that both calls to the .dll are running in the same thread and interfering with each other by trying to simultaneously access global variables. If I make all the variables just local variables in the function that is exposed in the dll should this remedy the problem? You're probably kind of on the right track, but not really. The requests are likely running in separate threads, but accessing shared state and interfering with each other that way. (If they were running in the same thread, things would likely work fine as they couldn't interleave their access that way, but you also wouldn't be able to support multiple requests at once.) The solution is to synchronize access to the shared state, or remove the shared state and give each run-through its own state. Which is suitable here depends on whether or not the currently shared state actually needs to be shared.
|
Hello, someone of you coded a PHP Script to check Online/Offline Status from twitch.tv channels? When yes, can u share it please?
thanks
|
On March 20 2013 16:03 Aeh wrote:Hello, someone of you coded a PHP Script to check Online/Offline Status from twitch.tv channels? When yes, can u share it please? thanks 
$channelname = ""; $link = "http://api.justin.tv/api/stream/list.json?channel="; $data = file_get_contents($link.$channelname); if(strlen($data) > 2) { //ONLINE } else { //OFFLINE } ?>
You could also parse the json Array in $data to get more informations e.g. viewer numbers
|
Alternative pseudo code for the spiral problem.
generatedBitmap = <empty bitmap>; targetBitmap = <the picture you posted here>; float correct = 0;
while(correct < 1) { candidate = <add a black pixel to generatedBitmap at randomly generated coordinates>; candidateCorrect = <number of pixels that are the same in both bitmaps>/<total number of pixels in the bitmaps>; if(candidateErr < err) { generatedBitmap = candidate; correct = candidateCorrect ; } }
|
|
|
|
|
|