|
beoba posted:google-test buddy! This was the test that I added which exposed the bug. I was getting some crazy errors from valgrind about uninitialized data allegedly created at a certain point in some function on the stack. It made no sense. We had had some problems that had allegedly been fixed with object sizes being too big, so I ruled that out. It turns out that they weren't fixed. I don't know what my coworkers are smoking. The stack pointer had completely overflown a guard page. It turns out that some performance monitoring variables just make a fixed-size array hardcoded to the maximum possible number of POSIX threads that the system allows. (It was a hard-coded constant in our project set to 128 -- by default we actually use fewer threads than that, depending on command line arguments or the CPU.) So putting such large arrays in an object is a braindead idea, especially when you have a bunch of them. And really the performance monitoring variables should have been allocating those arrays on the heap anyway -- that's something I should have fixed. (We can't nonchalantly say "dynamically decide how big such arrays should be based on command line arguments" because that would needlessly complicate them.) My coworkers found this sort of bug a few days before but apparently they only fixed the one case where they saw the behavior instead of thinking about the other places they had been mucking with performance monitoring. shrughes fucked around with this message at 09:00 on May 17, 2012 |
# ? May 17, 2012 08:56 |
|
|
# ? Jun 6, 2024 06:01 |
|
I don't want to keep linking this blog but this is amazing. http://abandonmatlab.wordpress.com/2012/05/17/heres-another-way-to-crash-matlab/ code:
People pay money for this.
|
# ? May 17, 2012 17:32 |
|
Fib posted:If you set crash=1, only the first part of the code runs. It creates a linked list of N items using cell arrays for the nodes. When MATLAB tries to garbage collect it, it will crash. The 'fix' is the guarded code below it, which manually pops from the head of the list so the garbage collection can process it one node at a time. How the gently caress Does it use a recursive mark-and-sweep collector and blow its stack when traversing the list or something? E: no, that can't be it or the fix wouldn't work as written. E: Oh, the post links to an earlier one that explains why it dies - apparently, when deallocating, the deallocator for the list head triggers deallocation of the next list node, which is to say, it calls the destructor for it. This means you end up with one stack frame per list node as they get destroyed and it rapidly blows the stack. Jesus. ToxicFrog fucked around with this message at 17:46 on May 17, 2012 |
# ? May 17, 2012 17:39 |
|
STS as in SpringSource Tools Suite (glorified Eclipse as far as I can tell)quote:DON'T INSTALL STS INTO "Program Files" UNDER WINDOWS 7. This causes a number of problems when STS, Roo or tc Server tries to write to files. Windows 7 treats the "Program Files" part of your drive very specifically, because it tries to avoid that programs manipulate the content of the "Program Files" directory. This causes weird problems with Spring Roo (which tries to write some configuration files) and possibly also tc Server.
|
# ? May 17, 2012 20:15 |
|
uncleTomOfFinland posted:STS as in SpringSource Tools Suite (glorified Eclipse as far as I can tell) I thought that if something tried to write config files to that location, windows did something with AppData\Local\VirtualStore instead?
|
# ? May 17, 2012 20:58 |
|
Sang- posted:I thought that if something tried to write config files to that location, windows did something with AppData\Local\VirtualStore instead? Sure, but if the OS silently writes them there and you've hard-coded %ROO_INSTALL_DIR%\some\path to go looking for them, they won't be there and things will act funny or outright break. I'm fairly certain there are still Notepad++ plugins that still don't understand this as well. Didn't Microsoft threaten to make Windows 7 not do that just to encourage good behavior? edit: By 'not do that' I mean hand the program a nice access error instead of letting it poo poo in the corner and pretend nothing happened. Munkeymon fucked around with this message at 23:19 on May 17, 2012 |
# ? May 17, 2012 23:00 |
|
You can always get around the issue of not writing to Program Files by just making your program always run as Administrator. Nothing could possibly go wrong with that. I hate to keep bringing more and more horrors from work to this thread, but when they're created right in front of my eyes by the "CTO", I... ugh. Boss decided that he was going to implement a Javascript-based cost calculator to our system when you add a device, ostensibly because I have too much to do as it is. The database table for it was already created backwards. Rather than create plans and tie the accounts to a plan, the plans are instead tied to the account, and everything is nullable. I can only imagine the kind of fun that will emerge if we have two rows in the plans table that have the same account ID, or if there's an account that has no matching rows in the plans table. Then I noticed that the layout of the page seemed wrong, like how most browsers break if you gently caress up a table or otherwise break something fundamental that makes it go into total quirks mode. So I open up the source to the page and code:
(as usual, the left-alignment is not an error in copying.) I tried to explain to him why his database table layout was absurd (it even includes an auto-created column from MySQL Workbench that is totally unused, like all of his other tables) and he basically just gave me a funny look and made some dumb joke. Fake edit: Oh god, I just realized that rather than pouplate the dropdowns on this form with the ID numbers from the table it pulls from, they're in that Typical_Boss_Coding~~MagicVal format. There's no way at all that can go wrong. (Oh, and the "specialists" that built this system also named all the form fields "field_1_4", because the fact you can name them field[1][4] and save yourself huge amounts of work seemed to have escaped them.)
|
# ? May 17, 2012 23:12 |
|
Zamujasa posted:<html xmlns="http://www.w3.org/1999/xhtml" /> Did he seriously close the <html> tag?
|
# ? May 17, 2012 23:30 |
Biowarfare posted:Did he seriously close the <html> tag? That's impressive. I didn't think it was possible to make that many different XML mistakes on a single XHTML page.
|
|
# ? May 17, 2012 23:47 |
|
When I used Matlab about 15 years ago it didn't have a reputation of being a broken piece of poo poo. Maybe Mathworks has had some major developer rotation since then. Although anyone who approaches Matlab with the idea that they won't have to translate their problem into matrix-crunching terms has already lost. Gazpacho fucked around with this message at 00:08 on May 18, 2012 |
# ? May 18, 2012 00:03 |
|
Zamujasa posted:You can always get around the issue of not writing to Program Files by just making your program always run as Administrator. Nothing could possibly go wrong with that.
|
# ? May 18, 2012 00:19 |
|
Biowarfare posted:Did he seriously close the <html> tag? I didn't even notice that. He didn't edit that part, though -- that's from the last people who worked on this monstrosity.
|
# ? May 18, 2012 00:55 |
Today my lab partner (I'm an undergrad physicist) told me he wrote a 400-line Python program to parse a CSV file. Here's what the file looks like:code:
|
|
# ? May 18, 2012 01:28 |
|
I'd be more worried about whatever generated that file.
|
# ? May 18, 2012 01:30 |
Vanadium posted:I'd be more worried about whatever generated that file. It's a spectrometer, which we have no control over unfortunately.
|
|
# ? May 18, 2012 01:36 |
|
That is not a CSV file.
|
# ? May 18, 2012 01:45 |
|
Gazpacho posted:When I used Matlab about 15 years ago it didn't have a reputation of being a broken piece of poo poo. Maybe Mathworks has had some major developer rotation since then. 15 years ago was Matlab 5 which the AbandonMatlab guy does not have fond memories of either. If I had to guess, I'd guess it's just a matter of less to compare it to and fewer people to do the comparison - Python was relatively new, most scientists were using MATLAB or Fortran and the proportion of scientists who were also programmers was smaller. MATLAB was originally meant to be a kinder, gentler interface to Fortran numeric computation libraries; its flaws are a lot less obvious when you're coming to it from Fortran '77 rather than SciPy or R.
|
# ? May 18, 2012 01:53 |
|
Zamujasa posted:*Don't know how to use arrays....* http://forums.somethingawful.com/showthread.php?threadid=2803713&pagenumber=281&perpage=40#post401853293
|
# ? May 18, 2012 01:56 |
|
Last week I posted in this thread about a terrible digital video camera driver that takes 300+ milliseconds to acquire a 640x480 image frame. After getting nowhere with the manufacturer on the issue I finally decompiled their dll file to see what the hell was going on. Their dll connects to a lower-level driver process via .NET's remoting system to pass data back and forth. Unfortunately none of .NET's picture classes are serializable in the way remoting requires so they can't be used. Their solution was to create a Pixel class that was serializable and then pass 640*480 = 307200 of those Pixel objects per frame, calling for each one individually. This consumes 100% of the CPU cycles for one core of a modern machine to pass ~3MB/second between two local processes. Then just for kicks the RGB values of each Pixel are mapped wrong and effectively you get BGR data with RGB labeling.
|
# ? May 18, 2012 02:01 |
|
Fib posted:People pay money for this. You're paying money for the libraries and toolkits, not the language. The language is from like 1975 and is trash and the interpreter is janky as a result. But that's not really the point, the point is that it's really fast to develop in and the library code is written by people with actual understanding of numerical methods. It's a prototyping environment, that's all. I haven't used SciPy a ton but I would imagine the libraries are still way behind where matlab is
|
# ? May 18, 2012 02:07 |
|
evensevenone posted:You're paying money for the libraries and toolkits, not the language. The language is from like 1975 and is trash and the interpreter is janky as a result. But that's not really the point, the point is that it's really fast to develop in and the library code is written by people with actual understanding of numerical methods. It's a prototyping environment, that's all. The AbandonMatlab guy certainly seems to think that SciPy and R stack up favourably against Matlab even when taking the libraries into account (and he has a lot bad to say about how hard developing and sharing libraries is in matlab). Not having used Matlab and only having barely used SciPy and R I can't say how right he is.
|
# ? May 18, 2012 02:22 |
|
Suspicious Dish posted:That is not a CSV file. There are values separated by commas! Of course it's a csv file! I bet it even imports to excel. In fact, if excel can read it I wouldn't think about the format. There's far worse in EE land...
|
# ? May 18, 2012 02:24 |
|
hobbesmaster posted:There are values separated by commas! Of course it's a csv file! I bet it even imports to excel. Agreed, that's not at all a bad output format for that kind of hardware. Generally the threshold of acceptability for measurement output files is (1) Can I open it in Excel? and (2) Can I interpret the Excel file without having to study the file format spec in rigorous detail? The main things I'd bitch about are that 'Channel' should really be displayed as wavelength (with units) and that the date/time fields have unnecessary commas. Also Matt and Devon need to fill out Description fields so they can associate a datafile with a particular experiment. For comparison, we have a spectrophotomer that produces output files like code:
|
# ? May 18, 2012 02:53 |
|
PDP-1 posted:Last week I posted in this thread about a terrible digital video camera driver that takes 300+ milliseconds to acquire a 640x480 image frame. After getting nowhere with the manufacturer on the issue I finally decompiled their dll file to see what the hell was going on. Was it Canon EOD? I had this problem, except that their image preview utility output video just fine, and the internet was full of people wondering how to get it to work that well with no solutions.
|
# ? May 18, 2012 04:00 |
|
Plorkyeran posted:You could also just make the installer grant write permissions to the user on the program's folder. Or even make the installer warn you about the fact that this unusual way of installing programs into Program Files will break your IDE.
|
# ? May 18, 2012 07:10 |
hobbesmaster posted:There are values separated by commas! Of course it's a csv file! I bet it even imports to excel. Not into Excel running on a machine with European number formats configured! Last time I tried loading a file with comma-separated values directly in Excel it just laughed at me and gave me rows with a single data cell in each, containing all the values. It wants semicolons here. (You can go through some explicit Import function to get it to load properly, but as I recall, you don't access it through the normal Open command.)
|
|
# ? May 18, 2012 08:35 |
|
nielsm posted:Not into Excel running on a machine with European number formats configured! Oh god, this has bugged me for so long. Every time somebody writes an export CSV function in some application, it comes out with comma or semicolon separated values. Then we proceed into getting complaints from half the office that it "won't work". I always thought it depended on the version of Excel being used, but somehow I didn't think of localized number formats. Is there a way to force Excel into dealing with it properly, or do I have to succumb to using xslx? Good job MS Office team
|
# ? May 18, 2012 08:45 |
|
Sang- posted:Matlab could fill this entire thread with how awful it is. Don't even get me started about MAPLE. I have no idea how people can write software that terrible. Been using Mathematica for a couple years now and it's oh so much better. Except this class requires me to use MAPLE.
|
# ? May 18, 2012 09:37 |
|
geonetix posted:Oh god, this has bugged me for so long. Every time somebody writes an export CSV function in some application, it comes out with comma or semicolon separated values. Then we proceed into getting complaints from half the office that it "won't work". I always thought it depended on the version of Excel being used, but somehow I didn't think of localized number formats. Is there a way to force Excel into dealing with it properly, or do I have to succumb to using xslx? If everyone's using Excel why are you using csvs in the first place?
|
# ? May 18, 2012 09:39 |
Jonnty posted:If everyone's using Excel why are you using csvs in the first place? Sounds like other software/scripts that produce raw data which they then want to process in Excel.
|
|
# ? May 18, 2012 09:53 |
|
Jonnty posted:If everyone's using Excel why are you using csvs in the first place? The office checks it in excel (or open office), we put it in other things and so do customers.
|
# ? May 18, 2012 09:55 |
geonetix posted:The office checks it in excel (or open office), we put it in other things and so do customers. At least OpenOffice asks you what format that CSV is actually in before opening, and gives you a preview. (But otherwise it's more annoying than Excel to use.)
|
|
# ? May 18, 2012 10:05 |
|
Suspicious Dish posted:That is not a CSV file.
|
# ? May 18, 2012 11:06 |
|
KaneTW posted:Don't even get me started about MAPLE. I made a couple of posts a while ago itt about Maple, but I don't think many people have used it, so I didn't get a response. Never used Mathematica.
|
# ? May 18, 2012 11:40 |
|
Hammerite posted:I made a couple of posts a while ago itt about Maple, but I don't think many people have used it, so I didn't get a response. Never used Mathematica. Yeah, I think Maple is more used in Europe than the US. My core complaints about Maple are that it tries to shoehorn 'all those programming trends' into a single thing and requires you to write code like code:
|
# ? May 18, 2012 12:36 |
|
If you control the output, use tab-separated. Tabs are almost *never* part of the valid data stream for these kinds of files. Why the hell would you use a really common character like commas or quotes? That would be like making the ? mark your end of line character instead of... I dunno, the unprintable CR/LF which are also almost never part of a valid data stream. Hell is other programmers.
|
# ? May 18, 2012 15:48 |
|
If only there were ascii characters for this very purpose
|
# ? May 18, 2012 16:06 |
If just there was an easy way to type them. (Yeah, there probably would be if they had ever been used in practice.)
|
|
# ? May 18, 2012 16:14 |
|
The cool thing is that they are printed as this weird symbol in the console, so the text doesn't look all run together. One of my guys was delimiting fields using a colon, guess what happened when we received a url? I told him about those separators and he got all happy and started using them everywhere they made sense.
|
# ? May 18, 2012 16:21 |
|
|
# ? Jun 6, 2024 06:01 |
|
Ender.uNF posted:If you control the output, use tab-separated. That's not much use if you want your average user to be able to double-click the file to load it into Excel. In which case the real solution is to properly quote/delimit special characters - it's not complicated. I wrote an Excel-compatible csv parser/generator in about 30 minutes not too long ago (because for some reason .net doesn't have one built-in).
|
# ? May 18, 2012 16:22 |