What makes you say that? It's an old screenshot I dug up, so I could be mistaken... But it has the distinctive l and 0 characters I expect from Bitstream Vera Sans Mono.That first one's not Bitstream Vera Sans.
What makes you say that? It's an old screenshot I dug up, so I could be mistaken... But it has the distinctive l and 0 characters I expect from Bitstream Vera Sans Mono.That first one's not Bitstream Vera Sans.
What makes you say that? It's an old screenshot I dug up, so I could be mistaken... But it has the distinctive l and 0 characters I expect from Bitstream Vera Sans Mono.
Opps. I wonder why I took a screenshot with that one... It did look slightly odd, but I figured it was just the rendering on a different machine.Yeah it's Bitstream, I made an edit. But it's the Serif version.
Any Android developers in here? How do you put up with this shit? Using the Android SDK with Eclipse on Windows has been a never ending nightmare.
How so? If you're using default SDK classes and gui elements, it's pretty straight forward. Most of the design is handled in XML with functionality done in Java. Environment setup is relatively straightforward in Eclipse too. Keeping dimensions relative can help with variable screen sizes, etc.
I'm not a developer, though. I studied it last semester in college. Seemed quite handy. We used the default SDK with SQLite and I found it relatively quick and painless to use once you use the SDK as intended.
Any Android developers in here? How do you put up with this shit? Using the Android SDK with Eclipse on Windows has been a never ending nightmare.
He might mean the android emulator...which is a complete piece of shit.
I'm starting to feel overwhelmed by Python. If anyone is willing to give me a hand understanding some concepts send me a PM.
Okay. I wasn't sure if asking for large explanations was allowed.Don't do that. Do it publicly so everyone can see and hopefully help someone else.
import random
import time
def displayIntro():
print('You are in a land full of dragons. In front of you,')
print('you see two caves. In one cave, the dragon is friendly')
print('and will share his treasure with you. The other dragon')
print('is greedy and hungry, and will eat you on sight.')
print()
def chooseCave():
cave = '' #Question 2 here.
while cave != '1' and cave != '2':
print('Which cave will you go into? (1 or 2)')
cave = input()
return cave #Question 3 here.
def checkCave(chosenCave):
print('You approach the cave...')
time.sleep(2)
print('It is dark and spooky...')
time.sleep(2)
print('A large dragon jumps out in front of you! He opens his jaws and...')
print()
time.sleep(2)
friendlyCave = random.randint(1, 2)
if chosenCave == str(friendlyCave):
print('Gives you his treasure!')
else:
print('Gobbles you down in one bite!')
playAgain = 'yes'
while playAgain == 'yes' or playAgain == 'y':
displayIntro() #Question 1 here.
caveNumber = chooseCave()
checkCave(cave)
print('Do you want to play again? (yes or no)')
playAgain = input()
[*]So I understand that functions don't work until they're called. Wouldn't that mean displayIntro isn't called until this line? If so, why is it indented? Isn't it not part of the while statement since that is specifically for playing again?
[*]I still don't quite understand why this is here. For the past week on Codecademy and reading the book I got this code from I've never seen a blank string used (at least in a function).
[*]What does the 'return cave' do exactly? I thought return instructed the code to end the loop. Does 'return cave' instruct not to allow anymore input for that function AND to go onto the next one?
[/LIST]
I've been trying to implement aspects of this code into an earlier set of code in the book without any progress. Hope people can help me tackle that next.
Okay. I wasn't sure if asking for large explanations was allowed.
So here's the code I'm looking at. It's not mine, I'm just trying to understand how it works:
---
Here are my numbered questions that I put a comment next to in the code:
- So I understand that functions don't work until they're called. Wouldn't that mean displayIntro isn't called until this line? If so, why is it indented? Isn't it not part of the while statement since that is specifically for playing again?
- I still don't quite understand why this is here. For the past week on Codecademy and reading the book I got this code from I've never seen a blank string used (at least in a function).
- What does the 'return cave' do exactly? I thought return instructed the code to end the loop. Does 'return cave' instruct not to allow anymore input for that function AND to go onto the next one?
I've been trying to implement aspects of this code into an earlier set of code in the book without any progress. Hope people can help me tackle that next.
First off: ew, tables.Hi guys, I'm web developmentally challenged... can anyone give me a hand? I'm trying to make a form with two tables that the user will fill out. I need each row of the second table to have some fields with various inputs in it but then a textarea below them.
Something like this:
http://i.imgur.com/PCYhYeL.png
I'm guessing this will require some kind of special CSS class for table but like I said, I'm web developmentally challenged...
Hey, I've been learning this for a week, cut me a little slack.You have some serious gaps at the fundamental level, I'll try to answer your questions but you should check another tutorial, a book or reread the first few chapters/courses you are following.
But why is it a part of this cycle?1.- They don't get executed until they are called. It's called on that line for the first time. It's indented because it's part of the while cycle or otherwise, it's part of the while cycle because it's indented (this is a specific feature of python which you should totally reread).
while playAgain == 'yes' or playAgain == 'y':
The reason this confuses me is I swear I've seen similar code without the variable assigned like that, but I could be misremembering.2.- He is initializing the variable otherwise it would raise an exception when it's compared to "1" and "2" on the next line. Remove the line and see what happens.
So what you're saying is when it gets to the next line 1 or 2 has been substituted for chosenCave because of return?3.- returns ends the execution of the current method and returns the specified value. See what happens when you remove that line.
That's what I've been doing with this code:Python is very easy to code so if you have doubts I'd recommend getting into an interactive console and type the different scenarios to see what happens.
# This is a guess the number game.
import random
guessesTaken = 0
print('Hello! What is your name?')
myName = input()
number = random.randint(1, 100)
print('Well, ' + myName + ', I am thinking of a number between 1 and 100.')
while guessesTaken < 6:
print('Take a guess.') # There are four spaces in front of print.
guess = input()
guess = int(guess)
guessesTaken = guessesTaken + 1
if guess < number:
print('Your guess is too low.') # There are eight spaces in front of print.
if guess > number:
print('Your guess is too high.')
if guess == number:
break
if guess == number:
guessesTaken = str(guessesTaken)
print('Good job, ' + myName + '! You guessed my number in ' + guessesTaken + ' guesses!')
if guess != number:
number = str(number)
print('Nope. The number I was thinking of was ' + number)
My bad. That was caused by me messing around with it.There's an error in the code by the way, checkCave should be called with caveNumber, not cave (since cave is never defined).
How do you suppress warnings in visual basic? I think it's not letting me compile because im using functions like strcpy, strlen and stuff >__>
EDIT - I meant Visual Studio ><
While this is generally true, Microsoft has a number of bad warnings. I'd recommend adding _SCL_SECURE_NO_WARNINGS and _CRT_SECURE_NO_WARNINGS to your preprocessor definitions. Some of what they warn against is good, but they warn about too many perfectly reasonable things for me to deal with them.Just friendly advice: treat warnings as errors regardless of whether or not your compiler is. I know a lot of people who let many, many warnings through without giving them a second thought; this isn't just bad practice, it's straight up dumb. Compile-time warnings are a great way of letting you know you're leaving the backdoor open for a lot of undefined behavior, or just accidents waiting to happen.
Obviously, exceptions to every rule, but yeah.
edit: Not directed at you Nekura; just quoted you for segue purposes![]()
But why is it a part of this cycle?Doesn't it initialize the code from the top? I know it doesn't work if it's not indented, I just don't get why it needs to be indented below that line. When you run the program the first time does it ignore this line going straight to displayinfo() ?Code:while playAgain == 'yes' or playAgain == 'y':
Yes it is.I'm guessing this is your first foray into programming period?
Okay, I FINALLY understand how it works. Being in the while loop just threw me off. First time I've seen it structured like that.The function definitions are just that, definitions. No code is run until they are called. Thus the first line of the program to be called is "playAgain = 'yes'" followed by the while loop. Everything after the while declaration is in the loop(since it's indented).
Hey, I've been learning this for a week, cut me a little slack.
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
Depends on what career path you want to follow. Proof of your work is always going to be more important than anything else though. Contribute to FOSS projects and/or create your own.
I think that's a big reason I took the dive into the Linux/Ubuntu community. I plan to contribute to some open-source projects to build a bit of a resume while at the same time my own experience. My skills are obviously far too under-developed at this point to really do anything yet. I'm unsure if in the time between now and my separation (~6 months) I'll be able to learn enough to land a job in this career path.
Thank you for your responses! =)
Maybe not, but I'll do my best. My life really consists of work... and then coming home to study/learn. So... we'll see haha.It's a high goal to achieve and most probably you won't do it (I didn't do it at least) in your first few years but it's something to keep in mind.
To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?
I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
As a developer, a college degree goes a long way. If you can code (especially if you're good at it), you can get a job without a degree. But it will be harder. IMO CS is defintiely a field where having a degree is worth it both short term and long term.To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?
I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
What can you do right now to increase your employability? Finish a project that you can show an employer as evidence that you know how to code. Excepting corporate type jobs, most employers just want to know if you can do the job or not. A degree is one signal that you can do the job, and completed projects under your belt is another.
I agree. When hiring you look at two main aspects. One is technical skills, which you can cover off from your work history or open source projects. In this regard you can take care of that as planned.
Just as importantly, the other aspect is knowing that this person will sit down for 40 hours a week and actually do the job. Generally commercial coding can be pretty bland and a lot of discipline is required. Will this person document? Will the follow the agile processes properly? Will they test their code even if it is the most boring and simplest bit of code you could imagine?
A degree is an indicator that you are likely prepared to do so. This is because 95% of a degree is pretty much bullshit, but you still did the work and got it done. Ironically having a lot of practical examples but not a degree, could end up counting against you.
Of course there are some places just looking for raw programming talent, but I'd say they are few and far between.
Thanks for the replies, I really appreciate it. Getting my degree is also a big personal goal for me, I was the first person in my family to attend college, and then I left to join the military (I felt like too much of a burden on my family). So school is a must for me - it's my number one goal. As far as working while in school, the intent is purely for experience. My school and housing will be paid for by the military, with cash to spare, so it's all about honing my skills.
With that being said, I'll continue with my current path. Keep learning and increasing my proficiency. I'm sure I'll ask you all some pretty elementary questions in the future, just a head's up. =)
Any resources you suggest outside of LearnPythontheHardWay and CodeAcademy?
Coursera is a good one iirc they had some python stuff not too long ago. Udacity does some of their projects in python as well. Good luck.
To those of you currently employed in a position as a programmer/developer, what kind of formal education do you guys have?
I ask because I'm currently on Active Duty in the US Army. I work in the communication field, specifically line of site radios (to include IP radios), satellite communications, server maintenance, basic networking, etc. I'll be getting my CompTIA A+, Net+, and Security+ certifications in the next 6 months and then I will be separating from the Military. My main goal is to attend college and get a BS in Computer Science from GA Tech, but I would like to work in the IT field or potentially as a developer while I go to school (I'm currently learning Python as well as increasing my proficiency with Linux).
Long story short... is a formal education going to set me THAT ahead of my peers? What should I be focusing on between now and school (Spring 2014) to prepare me for a career as a developer?
Another thing that helps immensely is knowing someone that works where you're applying. That's how I originally got my foot in the door at my current job, and I've been there for almost five years now.![]()
#include <iostream>
#include <cstring>
using namespace std;
class abc {
char def[15];
public:
abc( ) { strcpy(def, "JGNR"); cout << "A basic ABC" << endl; }
abc(const char s[ ]) { strcpy(def, s); cout << "A string ABC" << endl; }
abc(char c) { def[0] = c; def[1] = '\0'; cout << "A char ABC" << endl; }
abc(const abc &);
void operator=(abc); // this abc object accepted by VALUE (copy)!
friend abc operator++(abc &);
void out( ) { cout << def << endl; }
};
abc::abc(const abc &from) {
cout << "copy an abc..." << endl;
int i;
for(i=0; from.def[i]; i++)
def[i] = from.def[i] - 2;
def[i] = '\0';
}
void abc::operator=(abc to) {
int i, n = strlen(to.def), m = strlen(def);
for(i = 0; i < m; i++)
to.def[n + i] = def[m - (i+1)];
to.def[n + i] = '\0';
to.out( );
cout << "------" << endl;
}
abc operator++(abc &a) {
int i = 0;
abc c("OG");
while(a.def[i] != '\0')
i++;
for(int j = 0; c.def[j] != '\0'; j++) {
a.def[i] = c.def[j];
cout << "i:" << i << " j:" << j << " c.def[" << j << "]:" << c.def[j] << endl;
i++;
}
a.def[i] = '\0';
a.out( );
return a;
}
int main( ) {
abc x, y("NAWIBO-");
x.out( );
y = ++x;
x.out( );
y.out( );
return 0;
}
abc operator++(abc &a) {
int i = 0;
abc c("OG");
while(a.def[i] != '\0')
i++;
for(int j = 0; c.def[j] != '\0'; j++) {
a.def[i] = c.def[j];
cout << "i:" << i << " j:" << j << " c.def[" << j << "]:" << c.def[j] << endl;
i++;
}
a.def[i] = '\0';
a.out( );
return a;
}
Can someone explain to me when the copy constructor is called here?
return a;
}[/CODE]
Still a bit confused when copy constructors are called >>
I feel like the major difference between a lot of people who are self taught or went through trade tech stuff and people with full on CS degrees is the ability to be just a programmer vs being a computer scientist/engineer.
That being said, if you're good you'll find work.
FWIW my dad was active duty military for awhile and then got out and has been working as a programmer for Boeing for over 10 years IIRC, and his formal education includes like 1 semester at Rick's College and a couple of ITT Tech classes.
I work with a guy who was entirely self taught afaik and he's a better programmer than a lot of my college classmates.
This always helps. And the more demonstratable work you have the better.
Are you only learning python? Obviously it's early in your path but I'd recommend learning at least one other language well.
Maybe one in the c family. If you're strong in multiple languages it can definitely help your marketability.
This is so true, I have met many self taught programmers who can only write scripts to do simple tasks and just understand how to write code but not design software. Then I have met some who just get it, without the formal education.
For example in a software engineering class in college we were tasked with creating software that would be a mobile app for a workout routine. So the first issue is having a logical thinker thinker who can even come up with an application design before even starting to code.
Then we split up all the objects and psuedo coded them up, we had to provide UML stuff so it was necessary. Some people just choked, didn't know how to write UML. The worst was some guys didn't understand even what data they would even want in the object or what functions or functionality the object would need. He was a good coder, but he couldn't actually ever take an idea and design it into a program; and we are talking about a junior in a engineering school's CS program.
So it is all hit and miss, you have to know more than the languages, you can learn all of C++ in a 15 week course. But then understanding data structures, algorithms, sorting algorithms, databases, security & ops, operating systems, parallel computing, software engineering, and design is all just as important as knowing how to write code. Just cause you know English doesn't mean you can write good books, there is more to it than just knowing the languages.
My advice if you are going to do the self taught route, after you learn a language pick a college and look at the undergrad classes required for a degree and try and teach yourself that stuff at least for the first few classes. You can usually find out the book they use, or get a syllabus and learn each item on it yourself online. I actually still have all my syllabuses from my undergrad classes (at MS&T/UMR) in a box if anyone would be interested in a suggested list and order to try them in.
<!DOCTYPE html>
<html>
<head>
<title>Getting Timezone...</title>
<script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript">
var tz_off = (new Date()).getTimezoneOffset();
$.ajax({
url: "timezone.php",
type: "GET",
data: {
timezone_offset: tz_off
},
beforeSend: function() {
setTimeout(function() {
alert('Could Not Get Timezone Information');
window.location = '../home.php';
}, 2000);
}
});
</script>
</head>
<body>
</body>
</html>
<?php
start_session();
$_SESSION['timezone_offset'] = $_GET['timezone_offset'];
header('Location: home.php');
?>
whats the difference between peek and getFirst for linkedlists in java?
Programming gaf, I have a problem related to web technologies, and I want to find a good solution.
So, I need to retrieve the client's timezone offset. This is the way I intend to do it:
First, get the client's timezone offset using javascript and send it back to the server:
Code:<!DOCTYPE html> <html> <head> <title>Getting Timezone...</title> <script type="text/javascript" src="//cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min.js"></script> <script type="text/javascript"> var tz_off = (new Date()).getTimezoneOffset(); $.ajax({ url: "timezone.php", type: "GET", data: { timezone_offset: tz_off }, beforeSend: function() { setTimeout(function() { alert('Could Not Get Timezone Information'); window.location = '../home.php'; }, 2000); } }); </script> </head> <body> </body> </html>
Next, take that GET request and store the data in the $_SESSION variable, and then modify the header to redirect the browser to the homepage:
Code:<?php start_session(); $_SESSION['timezone_offset'] = $_GET['timezone_offset']; header('Location: home.php'); ?>
I was just wondering whether this was the best way to do it. It's the first solution I have come up with, and it seems a little hacky...
Any ideas?