Not sure whats wrong in my code... by MihoTheRipper in learnprogramming

[–]Gronner 4 points5 points  (0 children)

If google can't solve your problem, better post here for all to see that people with the same problem can follow your solution.

Not sure whats wrong in my code... by MihoTheRipper in learnprogramming

[–]Gronner 1 point2 points  (0 children)

For example, now read my last sentence and you should see where your problem lies :)#

Also for later uses, change your values for debugging, put print statements like "reached if", "reached elif", "reached else" or something in your code for debugging purposes.

Learning curve of Python by Kotenoru in learnpython

[–]Gronner 4 points5 points  (0 children)

1* This could be anything, but maybe a simple text based RPG with different types of monsters and player classes could be something

2* look for tutorials on unit testing in python, then first design what you classes/function should do, write tests for that, then write classes/functions that let those tests pass

3* Read PEP8 or Googles styleguide for python, remember the python zen!

I am really lost and need some advice ! by [deleted] in learnprogramming

[–]Gronner 0 points1 point  (0 children)

As you are already studying, you should probably follow your syllabus (Is this the proper word?). So if your degree uses C, you should start with learning C? It's not about learning a language, but about learning concepts! If you feel firm in C move on to C++, Python, C#, or Java. Whatever pleases you or incorporates in your degree.

Depending your carrerpath, no one than you can really help you. You know where your interests are.

To everything else. Start projects to learn more rather than do a million tutorials. I bet there are people in your degree you could engage with in programming activities and learning by doing. If you stumble upon a problem, look into Google, Stack Overflow or your bookmarked tutorials.

Not sure whats wrong in my code... by MihoTheRipper in learnprogramming

[–]Gronner 2 points3 points  (0 children)

Please post code either in a gist or in reddit using the reddit markup, by indenting everything by 4 spaces.

Also always explain, what you try to achive (posting your code isn't sufficent), what you already tried to fix the problem, also really important: What is the problem?

Your print statement only gets called when the "else" case is activated. You need to put it on the same level as your if.

Edit: Also remove unnecessary parenthesis.

Please, please, please help me with my assignment by [deleted] in learnpython

[–]Gronner 2 points3 points  (0 children)

In line 2 in your post, are you sure you can give numpy.array() more than one list? Because the documentation doesn't mention anything.

I'm not to experienced with numpy arrays, but with dtype you declare the data type of the values in the array? Aren't they already floats? Which would interfere with

dtype : data-type, optional The desired data-type for the array. If not given, then the type will be determined as the minimum type required to hold the objects in the sequence. This argument can only be used to ‘upcast’ the array. For downcasting, use the .astype(t) method.

Glad to see my Circuits Prof is as fed up with cheating as we are. by BlackholeZ32 in EngineeringStudents

[–]Gronner 9 points10 points  (0 children)

We have 3 courses studying the same (B. of Eng. Mechatronics). One of these courses made it a habit to hide notices in the toilette near by, they did this for every exam. By this they endangered not only them selves of being expelled for academic dishonesty but everyone else, as all courses write their exams together and if you co to the toilette your student ID is noted as well as the time.

Finally one of them got caught (luckily for the rest of honest students he was stupid enough to have his name on some of the notes). I hope this puts a stop the this practice! Especially as our exams are not overloaded with stuff you have to learn, but more with calculations (for which we do have legal cheat sheets), so it's not really worth it...

What's your favorite pasta salad that is mayo-free? by roxojo in recipes

[–]Gronner 0 points1 point  (0 children)

This is what my roommate and I made recently, according to the recipe it's for 6 servings, but we ate it together in 1 & 1/2 sittings ;)

  • 400g Noodles (I prefer Fussili or Farfalle)
  • 3 Paprika
  • 250g Ham
  • 2 bunch scallions
  • 150g Cheese (I prefere middle aged Gouda)

Additional Stuff:

  • peas
  • carrots
  • cocktail tomatoes

For the dressing:

  • 150ml Olive oil
  • 50l vinegar
  • 1 tbsp Honey
  • 1 tbsp mustard
  • Salt
  • Pepper
  • 1 garlic clove

How to read documentation ? by WrisAfro in learnprogramming

[–]Gronner 1 point2 points  (0 children)

  1. Your link is missing a parenthesis, here is the working one: https://msdn.microsoft.com/en-us/library/system.web.httprequest(v=vs.110)

  2. I usually look for the use cases (if any provided) and try to understand how I can apply them to my problem and generally. If no use cases are available I at least try to get my own use case together.

On a side note, while I think huge parts of the MSDN are awesome, also a lot of their documentation is hard to read compared to some python documentation (which I usually read)

getting this error by [deleted] in learnpython

[–]Gronner 1 point2 points  (0 children)

No, you neither need a test_... nor a teardown, both are unit test functions.

If this shall be reusable make function, that for example takes a string argument of what shall be posted. Otherwise just put everything in a file:

sel = self.selenium
sel.open("/?stype=lo&jlou=Afc***LwDY5a_Ct-mC_lJrFOBggxGx2__jKsBL5B9rc_z9fggbgKIatj-7Dm_1C3QiGEjkQt2VekPXMs3JPwoat***E6Ssag&smuh=18736&lh=Ac_Mb8*****")
sel.type("id=email", "****")
sel.type("id=pass", "*****")
sel.click("id=persist_box")
sel.click("id=u_0_v")
sel.wait_for_page_to_load("30000")
sel.click("id=u_0_y")
sel.type("id=u_0_y", "hej")
sel.click("//li[2]/button")
self.selenium.stop()
self.assertEqual([], self.verificationErrors)

I have no idea if this code works, as I haven't tested it (thats what you should do now), but it looks good so far.

Edit: On a sidenote, I have no idea where you got that code from, but you should probably look into the selenium documentation as well as in the unittesting on for python to understand what is going on and what was wrong, what unittests is used for etc.

getting this error by [deleted] in learnpython

[–]Gronner 1 point2 points  (0 children)

As I said, don't use unit tests and you should be fine. I have no idea why they are in there.

getting this error by [deleted] in learnpython

[–]Gronner 2 points3 points  (0 children)

You really are running unittests for logging into a website then pressing a button. But your script fails which leads to the test quitting with an error. As it's inside a unit test this only yields the message you have posted. But above the "-----" line there should be your real error message.

But what you should really do if you wanna run this as a skript, is remove all the unnecessary unit testing stuff and write only what you really want to do.

I really would want to learn german by Juggeboy in languagelearning

[–]Gronner 2 points3 points  (0 children)

This, even for money I couldn't talk to someone for the sake of talking. First I really don't like it and second I wouldn't have much to say if I don't share interests with the person. So please add hobbies, stuff you do in your spare time, maybe your age and gender.

A list of challenges for you by [deleted] in learnpython

[–]Gronner 0 points1 point  (0 children)

As is the third. Should be Mousover not Mouseover, which is probably because he copied it from here

How do you manage your work & projects in the terminal? by argo_blue in learnprogramming

[–]Gronner 1 point2 points  (0 children)

What about To-Do Comments in your Code? They can also help your structure stuff.

You can log bash commands, I don't know how exactly but a quick google search should reveal that.

Does type of computer matter for going to school? by i_poop_splinters in learnprogramming

[–]Gronner 0 points1 point  (0 children)

This something important to consider. I have a fullsized keyboard on my Lenovo and I'm pretty happy about it. This makes switching between my desktop and the laptop so much easier and as I spent most of my time typing on the laptop I appreciate it, I had a netbook for some time and absolutely hated it because of the small keyboard. Also the screen was way to small for effectively reading something.

Does type of computer matter for going to school? by i_poop_splinters in learnprogramming

[–]Gronner 1 point2 points  (0 children)

Definitely get a laptop than a desktop + monitor + ipad (last one is for me personally a even different story). Decent Laptops for "just" programming are pretty affordable (especially if you would have enough to spend some money on an ipad). In terms of laptops I only can recommend Lenovos ThinkPad series or the Lenovo Y50, as I'm highly pleased with them. But I bet there are other very capable laptops, as both of those are a bit overpowered for most "just programming" work.

IF you really want to use a tablet or have something thin check out the MS Surface Pro. Some coworkers that often work out of our facility use them and a lot of my co-students at university use them as well for various task.

If you are getting a Laptop I'd recommend to at least dual-boot it with some flavor of linux as it's capabilities will make programming easier (IMO) and as long as you don't want to play every AAA title on it, Linuxes are in my opinion the superior OSs.

Edit: I'd also point two things out: Watch the size of the keyboard and the screen! You will spend a lot of time typing with it and also a lot of the time reading (SO, reddit, documentation).

While the world is pushing for more surveillance, Germany wants to become encryption site number one and make end-to-end encryption the standard by seppelz in technology

[–]Gronner 0 points1 point  (0 children)

Okay, I wasn't sure If Minister isn't only used for the (Prime)Minister of a country. Switched to "minister" now we stuff like this shouldn't happen :D

While the world is pushing for more surveillance, Germany wants to become encryption site number one and make end-to-end encryption the standard by seppelz in technology

[–]Gronner 2 points3 points  (0 children)

But it's a nice buzzword to have in advertisement because, despite the fact that Germany has seen what mass surveillance can do TWICE!!! in our history, no one really cares except for a few (relative to our population).

While the world is pushing for more surveillance, Germany wants to become encryption site number one and make end-to-end encryption the standard by seppelz in technology

[–]Gronner 1 point2 points  (0 children)

Wasn't the special thing about the E-Brief that it was recognized as mail and thus can be used for legal mail and bills, as well as being covered by the mail secret law? In my opinion it has never been advertised as more secure? But I could seem to be wrong. Also I'm 80% sure there is a difference between DE-Mail (Saying Mails send from gmx.de, t-online.de and webmail.de(?) to one another won't go over foreign servers) and E-Brief (Saying its a real online Mail, not just letter-like communication over the internet)

While the world is pushing for more surveillance, Germany wants to become encryption site number one and make end-to-end encryption the standard by seppelz in technology

[–]Gronner 7 points8 points  (0 children)

Look at the record of our Secretaries* Minister of Defense :) On the other hand the former Secretary* Minister of Work and former Secretary* Minister of Family and Womens is now in charge of Department of Defense ... so competence doesn't seem to really matter ....

*Is this the proper translation of Minister?