|
csammis posted:In your language of choice that supports regular expressions: String.Replace("<.+?>", "") will strip out anything between angle brackets.
|
# ? May 7, 2009 14:32 |
|
|
# ? May 16, 2024 20:10 |
|
Fullets posted:<![CDATA[ You might want to keep stuff between some angle brackets ]]> Please, if he was doing stuff that involved this he wouldn't be asking such a shallow question and getting shallow answers. Obviously the ideal is something that parses HTML.
|
# ? May 7, 2009 14:48 |
|
Cross post from the Windows software thread as I think it may be more appropriate here. This is a general question and any pointers to sites with relevant guides would be appreciated. Is it possible to have Vista / W7 sidebar gadgets show Excel sheets? I keep track of birthdays in a workbook and have a macro update a sheet to show me birthdays for today, this month and next month. If not show Excel, what would be a good storage format for this type of project? XML? I wrote a gadget for displaying F@H text files when Vista was still new. Do gadgets still use the same structure and scripting? I'm trying to find a lazy solution but one that will keep me informed with mininal interaction (other than adding contacts).
|
# ? May 7, 2009 18:01 |
|
gwar3k1 posted:Is it possible to have Vista / W7 sidebar gadgets show Excel sheets? I keep track of birthdays in a workbook and have a macro update a sheet to show me birthdays for today, this month and next month. Sure, if you want to find or write some code to do Excel interop from an ActiveX object. It'd probably be easier to export the spreadsheet to a CSV file and parse it in javascript. line.split(',') is a whole fuckton easier, Id wager.
|
# ? May 7, 2009 20:28 |
|
Munkeymon posted:Sure, if you want to find or write some code to do Excel interop from an ActiveX object. It'd probably be easier to export the spreadsheet to a CSV file and parse it in javascript. That'll do me fine. Thanks, I don't think things through like that. Excel to update contacts, save as a csv. Use javascript for the gadget. Simple, thanks.
|
# ? May 7, 2009 21:34 |
|
Munkeymon posted:I disagree (depending on the version of ASP). Yeah couldn't agree more. Both Classic ASP and PHP each have their strengths and weaknesses but are both relatively horrendous when you compare them to modern languages. Back in the day it wouldn't be unheard of to find yourself in a situation where for whatever reasons a client simply needed work done with Access, for example an existing investment in Windows hosting without the desire to invest in MSSQL. You could actually really push ADO/Access a lot further than people would have you believe, check out some of the stuff here: http://www.learnasp.com/advice/whygetrows.asp
|
# ? May 8, 2009 02:18 |
|
I'm in a basic mathematical computer science course and finishing up a project on sorting (bubble sort, better bubble, quick sort). We were given pseudocode that would work perfectly when translated, however it doesn't seem to. We're supposed to keep the sort algorithms in a seperate module and call them from the first module's main function. http://www.chicagoburning.com/mp4/sort.py Can anyone tell me what I'm doing wrong? Its not sorting the list I have set up to test it in the main function. The other files in the directory are the main program and the explanation. I'm almost positive the main program works 100% and my hiccup is just the sorting.
|
# ? May 8, 2009 13:04 |
|
Not an Anthem posted:I'm in a basic mathematical computer science course and finishing up a project on sorting (bubble sort, better bubble, quick sort). We were given pseudocode that would work perfectly when translated, however it doesn't seem to. We're supposed to keep the sort algorithms in a seperate module and call them from the first module's main function. range() assumes a default stepping of 1, to get it to create a decrementing list you need to explicitly set it to a stepping of -1. Your range(n, 1) should read range(n, 1, -1). Also, code:
|
# ? May 8, 2009 13:19 |
|
Fixed first with reversed(range(1,n)) and fixed second part wheee god why can I not see the tiny glaring errors when I check code I think, it works perfectly now. Not an Anthem fucked around with this message at 13:27 on May 8, 2009 |
# ? May 8, 2009 13:25 |
|
New issue: RuntimeError: maximum recursion depth exceeded I understand I have to increase the stack size via googling, but someone just suggested bumping sys.setrecursionlimit to 1500 instead of 1000. I don't want to just set it to 20000 or something because apparently it can really crash. What can I set it to? I'm sorting 20 test arrays starting at size 500 and incrementing up by 500 each time (we're graphing and showing big O and all that jazz). Oh, and this is quicksort, so its really recursive for these guys :/ edit: drat I got like halfway there with setrecusionlimit to 5000 (ubuntu 8.1) Not an Anthem fucked around with this message at 14:15 on May 8, 2009 |
# ? May 8, 2009 14:05 |
|
Not an Anthem posted:New issue: If you hit a recursion depth of 1000 with quicksort on an array that fits in your computer's memory, you have a problem. Edit: OK, worst case scenario that's not true, I forgot it could go to O(n) worst case... Just implement it iteratively. baquerd fucked around with this message at 14:12 on May 8, 2009 |
# ? May 8, 2009 14:07 |
|
You can transform it into an iterative form with an explict stack:code:
|
# ? May 8, 2009 14:13 |
|
tef and quadreb, this is my first python class and I don't know exactly what that means.. can you explain further?
|
# ? May 8, 2009 14:17 |
|
code:
|
# ? May 8, 2009 14:25 |
|
Not an Anthem posted:Like so? Do I replace the arguments from recursive call directly ie stack.push(low,m-1) and stack.push(lowa,higha) ? Half of learning how to program is throwing out something you think might work and then figuring out why it didn't. Does python have a step debugger available? Those can be really useful in figuring out what's happening.
|
# ? May 8, 2009 14:30 |
|
We can transform your first function into one that does not call itself: It takes a low, high pair, and returns a list of new pairs that need to be sorted. code:
We could then do code:
|
# ? May 8, 2009 14:32 |
|
This also means you can test quicksort partial to see if it is partitioning the lists. edit: because I haven't tested anything.
|
# ? May 8, 2009 14:33 |
|
Our teach said to just find help online if we get stack size problems, we didn't learn any of this stuff aghhh. Thank you for explaining what is going on, I'm going to see if this works edit- it seems like its working! thank you. testing it as well.. Not an Anthem fucked around with this message at 14:39 on May 8, 2009 |
# ? May 8, 2009 14:35 |
|
Hah. Right, simple idiot problem again, was swapping m++,i instead of x[m]++,x[i] and low,m instead of x[low],x[m]
Not an Anthem fucked around with this message at 15:01 on May 8, 2009 |
# ? May 8, 2009 14:51 |
|
quadreb posted:Does python have a step debugger available? Those can be really useful in figuring out what's happening.
|
# ? May 8, 2009 23:03 |
|
Python debugging isn't terribly hard. IDLE has a debugger, just look at the Debug menu in the shell and then right click on source to set breakpoints. Pydev takes advantage of Eclipse's debug interface as well. It's not hard to debug the way you want, without having to use a massive IDE like VS.
|
# ? May 9, 2009 01:35 |
|
Melonhead posted:I want to know this too. Basically my dream program is a python debugger that is as good as Visual Studio's. I am not able to rightly apprehend the kind of confusion of ideas that could provoke such a statement.
|
# ? May 9, 2009 02:14 |
|
tripwire posted:
Visual Studio owns.
|
# ? May 9, 2009 04:29 |
|
Free Bees posted:Visual Studio owns.
|
# ? May 9, 2009 05:24 |
|
Hey everyone... Hoping someone can help with some Oracle syntax that I am stumped on. I need to do an update statement to an Inventory table, but it will require subtracting values from two different tables, Is that possible? The two tables: --Invoice-- Invoice_Number Product_ID Quantity_Ordered Warehouse_ID and --Inventory-- Warehouse_ID Product_ID Invtory_Quantity What i need to do is subtract the "quantity ordered" in the invoice table from the "Inventory_Quantity" in the Inventory table and have that result be updated as the new "Inventory Quantity" so basically for example you had 20 units at the warehouse, someone orders 5 units, so you need the Warehouse inventory to be updated to 15. is it even possible to do a calculation in the update statement? I would REALLY appreciate any help you guys could offer. Sointenly fucked around with this message at 05:46 on May 9, 2009 |
# ? May 9, 2009 05:40 |
|
Free Bees posted:Visual Studio owns.
|
# ? May 9, 2009 18:43 |
|
Python is interpreted and comes with an interactive shell. On top of this it includes a debugger which has worked fine for me. What functionality are you missing from it that you can get in visual studio?
|
# ? May 9, 2009 19:00 |
|
I don't think they're talking about functionality so much as the intuitiveness of VS' debugger. In general, debuggers that are built into IDEs are easier for the neophyte to pick up - think about setting a breakpoint in Eclipse as compared to gdb, for instance. Once you know a bit about the latter there's nothing to it, but it seems a bit more arcane than clicking a tab to the left of the line you want a break on.tripwire posted:Python is interpreted and comes with an interactive shell.
|
# ? May 9, 2009 19:21 |
|
It isn't totally unrelated; depending on your application, you often can do a lot of useful investigation in an interactive mode without ever needing to actually start stepping through functions.
|
# ? May 9, 2009 19:31 |
|
Ah, that's a good point; I suppose instead of inspecting your data in a debugger, you could quite literally just print it out in the intepreter I hadn't really thought about things that way.
|
# ? May 9, 2009 19:48 |
|
I only have been coding in Python for a week, but Netbeans' debugger has most of the basic functionality you want in one (i.e. step, step-in, step-out, variable viewing, breakpoints, and *I THINK* conditional breakpoints). I was messing around with every free python IDE I could find looking for a decent debugger, and I'm pretty sure it's the best you're going to find, unless you want to tear your hair out and see if you can get Eclipse/Jython working properly (I couldn't).
|
# ? May 10, 2009 05:34 |
|
Why Eclipse/Jython? Why not just Eclipse with Python through pydev? Or just learn to use the pdb module I linked and not tie yourself to an IDE.
|
# ? May 10, 2009 06:40 |
|
hlfrk414 posted:Why Eclipse/Jython? Why not just Eclipse with Python through pydev? Or just learn to use the pdb module I linked and not tie yourself to an IDE. Well, when starting to program my goal was "find something that works" and the links off the Python wiki led me down the Jython route. Also using the eclipse CDT framework for a couple of months really soured me to using eclipse for anything but Java in general, rational or not.
|
# ? May 10, 2009 06:59 |
|
Works easy for me. Have Eclipse and Python installed. Go to Eclipse's help/updates. Add link to pydev and install it. Point pydev settings to python. Use pydev. Since I have to do a lot of java work with eclipse, it works well for me. I've never had too many issues using or installing Eclipse plugins though.
|
# ? May 10, 2009 07:23 |
|
One other mention. If you are using the python shell at all you should really, really install ipython. They should honestly just make it the default python shell as it is so much better that the standard shell in every conceivable way (automatic debugger invocation, syntax highlighting, tab completion, command history, output cache, aliases, shell command access, doctest support, object exploration....)
|
# ? May 11, 2009 15:27 |
|
BigRedDot posted:One other mention. If you are using the python shell at all you should really, really install ipython. They should honestly just make it the default python shell as it is so much better that the standard shell in every conceivable way (automatic debugger invocation, syntax highlighting, tab completion, command history, output cache, aliases, shell command access, doctest support, object exploration....) Totally. Click for full size
|
# ? May 11, 2009 17:53 |
|
Visual C++ gives me linker errors when I try to define inline functions in a .cpp file instead of the .h file where they're declared. According to MS' support page, this is intentional. They give several workarounds, and I'm thinking of using the first one (add "extern" keywords to all the inline function declarations). Is this a bad idea? I'm under the impression that you should usually assume that compilers know "what's best" for code organization and optimization.
|
# ? May 12, 2009 23:12 |
|
Well, the compiler cannot actually inline them if there is no definition available in the translation unit in which they are used.
|
# ? May 12, 2009 23:15 |
|
Ludicrous Gibs! posted:Is this a bad idea? I'm under the impression that you should usually assume that compilers know "what's best" for code organization and optimization. This may be true, but it assumes you know the semantics of the language, and in particular the compilation model in C/C++. Compilation for each translation unit occurs separately, so as Vanadium said, the full function definition is required in order to inline the function. Prepending extern will (most likely) turn off inlining of that function except inside the translation unit in which it is defined. Keep in mind that inline is a recommendation to the compiler and it is free to do whatever it pleases.
|
# ? May 12, 2009 23:27 |
|
|
# ? May 16, 2024 20:10 |
|
Vanadium posted:Well, the compiler cannot actually inline them if there is no definition available in the translation unit in which they are used. Modern compilers do link-time optimization which includes inlining.
|
# ? May 12, 2009 23:28 |