|
mister_gosh posted:Thank you captain obvious. No, really, thanks! I was thinking in terms of Strings, but I think I've been too much Perl lately that I forgot I can throw these in any type of object. Uhh, what does your exposure to Perl have to with it? You could have done the exact same thing, storing an anonymous array as the value of each key.
|
# ¿ Mar 27, 2008 15:14 |
|
|
# ¿ Apr 29, 2024 15:50 |
|
Sartak posted:This is what mister_gosh meant. Clearly not. code:
|
# ¿ Mar 27, 2008 16:33 |
|
Uhh, whatever. If you want the job done in a blindingly fast manner with respect to time invested/development speed, go Perl, absolutely. If these go beyond "one time use" then either 1) learn how to program good, defensive Perl 2) choose a different language. Perl is tits at processing text. Let no one tell you otherwise. How the code looks is completely different from how it got it done. And it gets it done quickly and sexily. Well, in that retarded, gruesome, camel kinda way.
|
# ¿ Apr 2, 2008 23:20 |
|
JoeNotCharles posted:Because the guy specifically asked for text-processing languages, so I knew somebody very early on would say, "Perl is the no-brainer for this," which it is not. Why don't you spell out for us what text-processing tasks Perl is so terribly unsuited for that Python and Ruby spank it at?
|
# ¿ Apr 3, 2008 15:52 |
|
There isn't really a posterchild for "mainstream programmer". You'll find good/bad/excellent/retarded programmers of all types. Although, I haven't heard the term ColdFusion in a while, so maybe you'll want to stay away from that.
|
# ¿ Jun 23, 2008 06:01 |
|
Is there such a thing as a private interface? Or a private abstract method that needs to be implemented by their sub classes? I'm using Perl so technically no problem like this exists, but I'm just double checking, like when I move on to a more OOPish language. I have a process whose start and end is the same, and only one method, Start Process, is exposed via a superclass. Start Proccess consists of methods &Start, &Middle, and &End. Start and end are completely standardized while &Middle is what changes for any given subclass. So... Can &Middle be private? Technically it can't do anything on its own without the context of the entire process, that's why I'm wondering if it can be made private.
|
# ¿ Jun 26, 2008 20:53 |
|
Why again is emulation for video games slow? Is it because the programmers lack the EXACT documentation for the original architecture? Basically is it a matter of accuracy or is it really processing power? I guess it couldn't be processing power if today's systems are magnitudes more powerful than consoles... Also, just how powerful are the specialized components in consoles that couldn't be emulated away (quickly) in a modern desktop? (graphics, sound, "emotion", etc)
|
# ¿ Jul 2, 2008 21:20 |
|
Entheogen posted:why can't some brave soul bust into the xbox labs and take off with the specs? A boy could only dream, i guess. Probably because they can tell which people have access to that level of specs and it wouldn't be worth jeopardizing their awesome careers so some kids on the Internet can play games for free.
|
# ¿ Jul 5, 2008 11:39 |
|
Can you give any examples of the following scenario? Let's someone/company/group makes an artificial intelligence-related technology. It learns and stores/saves its intelligence somehow. And it gets smarter, and does all these amazing things. Yay, everyone celebrates. What does the intelligence look like? Like if you data dump that structure and reverse engineer it, would it look like the most mathematically sound solution? Or does it look like someone designed it? Or is it a nonsensical mishmash? Know what I'm saying? Wasn't there an article on Slashdot about a helicopter learning how to fly... The flying routines it invents, are they as good as ones made by real people? Or do they do techniques that people never would have thought of?
|
# ¿ Sep 3, 2008 21:49 |
|
I have various data formats that drive a data import system. And some of these formats have one database table worth of information, which is easy to work with. Others have multiple tables. In either case, I want to see one row (one atomic concept) worth of information that is used by the rest of the data import system. So, with one table, each row is a complete entity. With the multiple tables, they need to be joined together (on a key, obviously), and together, they will represent one complete entity (similar to the one table scenario). My question is, how do I model/design this to handle an N amount of tables? I realize that for joins, you have a base table and then a set of auxilary tables, and each auxilary table has a join condition... How do I program this? Do I manually make an SQL statement that creates a view, and program this into the data format (implemented by a class)? Or do I somehow make a join condition per auxilary table and associate that with each auxilary table (implemented by metadata in a database)?
|
# ¿ Sep 17, 2008 15:33 |
|
Let's say I have a handful of functions that are functional (side effect free), and the first argument to all of these functions refers to the same thing (an object, or id, whatever represents the main concept they operate on). Should these functions be bundled together into an instantiatable class? I actually already asked this some time ago but I can't find the original thread and I think I described it a little differently.
|
# ¿ Oct 28, 2008 21:03 |
|
I was told this was a stupid idea because it didn't relate to state at all. Like, the functions don't necessarily change the concept, or anything else for that manner (again, functional, stateless). I'm trying to see if there's like an OOP rule of thumb that will tell me who was right here. e: spelling Triple Tech fucked around with this message at 22:24 on Oct 28, 2008 |
# ¿ Oct 28, 2008 21:39 |
|
I like your pictures. That is all.
|
# ¿ Nov 24, 2008 12:42 |
|
Let's say I have a process that needs to be initialized (new Org::Process;) and it handles the import of various files. But the nature of the import is that it takes a non-trivial amount of time and has side effects (10-20 minutes, bcp'ing). How should the interface for this be written? Or, what do you think? A) Org::Process->importFile( $file ) takes a file and immediately imports it. B) Org::Process->addFile( $file ) takes a file and defers its import to some later time when Org::Process->importFiles is called.
|
# ¿ Dec 1, 2008 20:37 |
|
My code is very intimate with the database. (It manages the data going in and cleans it up.) And it's getting very messy/cumbersome. So I was thinking about making an abstract layer between the business logic and the raw database calls, to make maintaining database changes a lot easier. So my code will just ask questions, without knowing how they're implemented, and this layer will obviously sit on a DB. What's this layer called? I've heard this advice doled out many times, but now that I actually need it, I want to look up more definitive sources to make sure I'm not missing out on any patterns or practices.
|
# ¿ Jan 23, 2009 22:18 |
|
I just talked with a coworker about this. I'm not necessarily doing ORM work, but it's the same concept. ORM is a specific implementation of the word I want. I guess otherwise I'll just go around calling it "the database layer that's not actually the database itself but a front for it in code-space". Edit: And a tiny bit of Googling leads us to database abstraction layer. I guess that's pretty succinct and accurate. Triple Tech fucked around with this message at 22:46 on Jan 23, 2009 |
# ¿ Jan 23, 2009 22:41 |
|
Should one object class have functionality that depends on its data (like one method implemented with a switch statement) or should that behavior be outlined in two different subclasses, and then I make a factory to decide which one gets created?
|
# ¿ Jan 26, 2009 17:05 |
|
Fruit Smoothies posted:where they're fixated on the wrong part of the puzzle. How do you know it's the wrong part of the puzzle? Maybe you're looking at the wrong piece and that's what's confusing people. Something to consider, that's all. It's like asking a silly question like "how can I enable random access on a linked list?"* The premise is awkward and the question can't be taken at face value because the OP is on the road to mistakenville. * i'm so sorry i couldn't think of a better example
|
# ¿ Apr 7, 2009 17:14 |
|
This is an implementation detail. You should probably assume that the server is smart enough to cache the result of B so that it doesn't calculate it twice. To prove this you can make a CTE with FOO(A) precalculated and joined off A. The run times should be near similar, or worse for the CTE (in favor of what should be caching).
|
# ¿ May 1, 2009 22:13 |
|
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 |
|
Scaevolus posted:I wish CoC had a strict mod. use strict;
|
# ¿ May 16, 2009 00:19 |
|
Modern RDBMSes are based on arrays, right? So the data is stacked together, side by side as columns, and then rows, and it makes access really fast... But what if we had a database that was more suited for like... Trees? Like HTML or XML documents. How does that get represented as a stream of bytes in memory or on a disk? I'm thinking a linked list of some sort could solve the problem in some abstract way, but then the data isn't side by side anymore and makes lookups really slow. How are databases like this implemented?
|
# ¿ Jun 1, 2009 15:05 |
|
How expressive do you want access to your data? There's mostly fetch_by_id and fetch_all. Anything else, given customer intervention, is doomed to slowly reinvent parts of SQL.
|
# ¿ Jun 1, 2009 17:30 |
|
A factory?
|
# ¿ Jul 1, 2009 14:03 |
|
In GUI Outlook (like, I don't know how to do this programmatically) you can put attachments inline, so they aren't in an attachments tray, they're sort of in the body of the message. So if each attachment is only referred to once, you could put the attachments right next to where they are referred to. I think internally that's a multi part MIME message? I have no idea what I'm talking about, just guessing.
|
# ¿ Jul 8, 2009 17:58 |
|
cletus42o posted:Do you know the steps you take to do it through the GUI? I couldn't find a way to do that myself. If I can do that, I can probably reverse engineer the email that gets sent to create it programmatically. Thanks! I think AD is right. All I have on my system now is 2007 and I can't find any way to bring back a tray of attachments. Like, I'm typing a sentence, I decide to attach something, and it's just sitting there in the middle of my words. Kind of annoying. So I guess nab your hands on a copy of 2007, type some words, insert something, notice how it's right where your cursor is, type more wards, insert again, type more words, and then dissect what gets sent out. And then check how it gets rendered.
|
# ¿ Jul 8, 2009 18:28 |
|
Yeah I'm sorry I totally lied. I have 2003 in the office, but I have 2007 at home. I can check when I get back home.
|
# ¿ Jul 8, 2009 22:30 |
|
It sounds like you're making a regular website. If you are, then you can't prevent this. Maybe you want to develop a first class application that uses the webkit engine and points to a private website that can only be accessed by this user agent. While making the application, you could have the ability to turn off spell checking hooks. That or look up an enterprise way to manage Macs and turn off spell check and the ability to toggle spell check.
|
# ¿ Jul 23, 2009 13:58 |
|
I think they're bad in that in larger programs they're often indicative of poor, unscalable design. If you're just writing some small program for class or a one-off, it doesn't matter.
|
# ¿ Jul 31, 2009 20:10 |
|
tef posted:Aside: If you have no knowledge how did you come up with that estimate of time? People who don't know anything about the construction of virtual products think they can be made in Internet time.
|
# ¿ Sep 27, 2009 17:39 |
|
Boz0r posted:Does anyone know any good methods of getting a better overview of code? Like program graphs or some stuff like it. Print it out on paper with a small font. Look for anything weird looking.
|
# ¿ Oct 19, 2009 18:46 |
|
fletcher posted:I've got a situation where data is stored in two different RDBMS's and I need to essentially do a simple JOIN between two tables that are in the different systems. You should probably download the data and create a temp table out of it. For fun chips, index the table afterwards.
|
# ¿ Nov 29, 2009 07:00 |
|
Is there a canonical algorithm for choosing an element from a set of elements and weights? foo:2 bar:1 foo randomly gets chosen twice as often as bar given a call to pick an element.
|
# ¿ Dec 1, 2009 21:02 |
|
tef posted:I use this in buttbot http://prxq.wordpress.com/2006/04/17/the-alias-method/ Could you explain this less tersely? It's a bit hard to follow and it starts introducing variables out of nowhere.
|
# ¿ Dec 1, 2009 23:04 |
|
I'm trying to grok it as best as possible, but I still don't get it. The algorithm visually and I think cost-wise looks so much more complicated. And for what? I think to make it less computationally expensive? I'm not convinced... The naive solution doesn't look that expensive to begin with... Hmm I think maybe it is cost effective on recurring runs... That the naive implementation has a high search cost but the alias method is indexed... I guess that makes much more sense. Me, I only needed one run, so the naive implementation is cheaper. If you did repeated selections, then the alias method would be cheaper over time. Edit: It's terribly interesting. I will make the false promise of using my time and my poor foundation in computer science to draft something up that is infinitely more clear and verbose... Triple Tech fucked around with this message at 00:04 on Dec 2, 2009 |
# ¿ Dec 1, 2009 23:54 |
|
What are the definitions of API and protocol and how do they compare/contrast?
|
# ¿ Dec 2, 2009 17:19 |
|
Well these helpful folk in this thread have told me... Exceptions are exceptional. If this is a behavior you're likely to encounter, then it's not an exception (hence, go the try/boolean route). But if it's some weird crazy poo poo that you're practically never going to see but might see in a blue moon, then it is an exception. Or so I understand. Edit: The above partly motivated by the cost of exception handling, apparently?
|
# ¿ Dec 4, 2009 17:19 |
|
Let's say we invented some sort of software-based intelligence... If we decompiled said software, would it lead to some weird algorithm we've never seen before that unlocks the mysteries of life? Or would it be pretty normal looking?
|
# ¿ Dec 7, 2009 19:22 |
|
Why would someone want an in-memory database? My assumption here is that the data is important and not disposable. I get that moving databases to RAM makes it tons faster, but doesn't that make the data not safe in case of a power outtage or crash? How do these in-memory databases address this issue? Or are there really use cases where people don't care about the longevity of the data? If they did care, how and when would the data be written to disk?
|
# ¿ Dec 9, 2009 16:47 |
|
|
# ¿ Apr 29, 2024 15:50 |
|
fletcher posted:How do you ask a senior developer about the formatting of their code without offending them? This is what I hate about where I work. Emphasis on senior developer. He's generated three jobs because of the lovely work he does. When push comes to shove, we can't confront him about the code he makes because it will hurt his "feelings".
|
# ¿ Dec 10, 2009 00:53 |