- Strength to Increase Rep
- +8
- Strength to Decrease Rep
- -2
- Upvotes Received
- 59
- Posts with Upvotes
- 50
- Upvoting Members
- 27
- Downvotes Received
- 3
- Posts with Downvotes
- 3
- Downvoting Members
- 3
All-around coder/developer for desktop/web/etc. Windows & Linux admin. Super-User.
- Interests
- Coding, VB.Net, Python, C, Windows, Linux, Mint, Ubuntu, Embedded Code, Arduino, Raspberry Pi, Art,…
- PC Specs
- Windows 8/Kubuntu 14.04 (HP Laptop), Windows 7/Ubuntu 13.04 with KDE (HP Desktop), Linux Mint 12 with…
| Re: You have an event loop up at the top (`while done==False:`) that runs until the user has quit. Because of the indention, your event loop runs until completion and only *then* draws what you wanted it to. Your indention signifies a 'code block'.Everything in that code block will run until … |
Re: when you write a view function, it must have a `request` parameter (try writing one without it). This is because Django automatically passes the `HttpRequest()` to your view so you can use it. You don't have to use it, I have plenty of views that do absolutely nothing with the … | |
Re: @sa_2, on line 282 you mixed single quotes with double quotes. The syntax highlighting shows it right here: cout<<' \t\t¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥¥\n\n\n"; Next time start a new question, so more people can help you. | |
Re: It's been a while since I messed with VB, but I can't find anything that sticks out as far as the overflow situation. It's hard to read anything the way you're building those queries. I'm pretty sure that they're prone to SQL injection anyway. Have you looked at [prepared statements](https://msdn.microsoft.com/en-us/library/system.data.sqlclient.sqlcommand.prepare(v=vs.110).aspx)? … | |
Re: I would refer to the API documentation for `DataResult<fmd>`. I'm sure there are methods to help you retrieve the images it captures. I'm not sure which SDK you are using, and the DigitalPersona documentation (which I think you may be using) requires that you purchase support. DigitalPersona does have a … | |
Re: I think it would help if you weren't shadowing the `cosa` name in your `for` loop. Classes should use CamelCase, to distinguish them from function names and other stuff. Instantiating a class is like calling a function, so if you are instantiating a `Cosa`, and not trying to call a … | |
Re: The data is compressed with gzip. I tested it with: $ curl http://stores.ebay.com/honesty-seller-ly9999 > bad_data $ file bad_data bad_data: gzip compressed data, from FAT filesystem (MS-DOS, OS/2, NT) The site is served with the header `Content-Encoding: gzip`, which isn't correct unless you request it with a `Accept-encoding: gzip`. Anyway, this … | |
Re: ..Commenting to move from 'Unanswered.' In the future, you may want to provide more information (such as a small example of what you have tried so far). For now, this article will help you learn how to ask smart questions to get smart answers: [How To Ask Questions The Smart … | |
Re: It looks like you are hard coding each possible answer. It would take pages to exhaust every possibility. Maybe try splitting the input on `-`, and parsing the two values you need (using `strsep()` and `sscanf()`). Once you have the two values, you can calculate whatever value you need. | |
Re: ..Commenting to move from 'Unanswered.' In the future, you may want to provide more information (such as a small example of what you have tried so far). For now, this article will help you learn how to ask smart questions to get smart answers: [How To Ask Questions The Smart … | |
Re: ..Commenting to move from 'Unanswered.' In the future, you may want to provide more information (such as a small example of what you have tried so far). For now, this article will help you learn how to ask smart questions to get smart answers: [How To Ask Questions The Smart … | |
Re: ..Commenting to move from 'Unanswered.' In the future, you may want to provide more information (such as a small example of what you have tried so far). For now, this article will help you learn how to ask smart questions to get smart answers: [How To Ask Questions The Smart … | |
Re: ..Commenting to move from 'Unanswered.' In the future,you may want to provide more information (such as a small example of what you have tried so far). For now, this article will help you learn how to ask smart questions to get smart answers: [How To Ask Questions The Smart Way](http://www.catb.org/esr/faqs/smart-questions.html) | |
Re: I was about to post this same message. It opens automatically when I load a page, and that's neat, but closing it only lasts for thirty seconds or so. I thought it was a new message when it opened the second time. I guess it just wanted to be open. | |
Re: This ID generator depends on enough time elapsing between calls. I can see that running this kind of code in a fast loop could make duplicates: for (int i = 0; i < 10; i++) { Console.WriteLine (DateTime.Now.ToString ("hh-mm-ss.ffff")); } Output: 05-16-12.2358 05-16-12.2779 05-16-12.2780 // <- Many duplicates are created. … | |
Re: This was posted in the wrong forum (looking for [Software Development -> Java](https://www.daniweb.com/software-development/java/9)). I'm posting to remove from 'Unanswered'. | |
Re: Put the form on your page with an id (let's say `'contactForm'`) and css set to `'display: none'`, so it's easily accessible with javascript but initially hidden. Make your "show form" button/link/whatever with an onclick event (there are multiple ways to do this): <a href='#contactForm' onclick='javascript: show_form();'> E-mail me. </a> … | |
Re: What is the content and type of `cfg.project["samples"][0]["files"]["bam"]`? A Tuple/List/Set/Dict? Maybe stepping through a debugger, or even a simple debug-print would help you see what you are getting, or why you're not getting what you think you should. testdata = cfg.project['samples'][0]['files'] print('Actual files content:') print('{!r}'.format(testdata)) print('Actual bam content:') print('{!r}'.format(testdata['bam'])) Also, … | |
Re: This question is difficult to understand. I don't think the wall of output text helps. Maybe you could word it differently, or provide a little pseudo-code to help us understand what exactly you are trying to do? What are the comparisons? A file? What does "takes that to [metadata][phenotype][embryo]" mean? … | |
Re: All three of these options are working for me: Plain `echo "string" > file`: read -p "What is your variable: " WHATIS echo "This should be a bunch of lines I want this \"variable\" to be embedded it is $WHATIS" > ./test.txt `cat` with `HEREDOC` and variable expansion: read -p … | |
Re: What is the actual problem? Is there a traceback when you run it? You say: >while p is less than the length of the list... ..which is basically describing what your code does. Can you give me a more general explanation? Like "I want to shift the ordinance of every … | |
Re: Small typo in that example, the font name. Should be `'Times New Roman'` | |
Re: I can only find python-based "watermark" plugins at the moment. You may have to make one. The `PIL` or `pillow` libraries can help you work with images. Outside of GIMP, I see the [StegHide](http://steghide.sourceforge.net/) application recommended for this. | |
Re: I see that your `__init__` method is misspelled, but you're gonna want an instance to work with. You have a `calculating` class, but no object. Instantiate the class: mycalc = calculating() ...then use the method (`mycalc.addition`). Also, its good practice in python for classes to start with a capital letter. … | |
Re: `enumerate()` is great for grabbing an index and item at the same time, and `f.tell()` can tell you the current position in the file: for i, line in enumerate(file): print('{lineno} ({pos}): {line}'.format( lineno=i + 1, pos=file.tell(), line=line)) | |
Grabs the location and name of the script file itself. | |
Re: You could use `RegEx`, but that may be overkill. I think `GetFiles` supports glob matching like `GetFiles("C:\dir", "*.exe")`, but you don't want to call `GetFiles` multiple times. So maybe a simple `If` statement would suffice: If IO.Path.GetExtension(s) = ".exe" Then MyOtherBox.Items.Add(IO.Path.GetFileNameWithoutExtension(s)) Else WithoutThisTypeBox.Items.Add(IO.Path.GetFileNameWithoutExtension(s)) End If My VB.Net is rusty, but … | |
Re: Sounds like homework. If you post what you have tried so far I'm sure you would receive the help you are looking for. | |
Re: This is an old post, but I didn't see any translation tables in here. So here you go, a less secure encryption method for low-risk data: rot13 = str.maketrans( 'ABCDEFGHIJKLMabcdefghijklmNOPQRSTUVWXYZnopqrstuvwxyz', 'NOPQRSTUVWXYZnopqrstuvwxyzABCDEFGHIJKLMabcdefghijklm') encrypted = 'This is encrypted'.translate(rot13) print(encrypted) decrypted = encrypted.translate(rot13) print(decrypted) You can make the translation tables almost anything you … | |
Re: This would probably be better for [Shell Scripting](https://www.daniweb.com/software-development/shell-scripting/113) [Snippets](https://www.daniweb.com/software-development/shell-scripting/code/_/113). Also, some [code formatting](https://www.daniweb.com/community/syntax) would help. |