|
| T O P I C | |
|
|
The Future of Planetcrap's Message Board
January 7th 2012, 08:01 CET by Charles With Quarter to Three in the process of becoming a forum that no one can post on at all (with a current 1/15th of the posts belonging to banned users), is this finally Planetcrap's chance to regain the spotlight? Will the site revive? WILL MORN COME BACK? Probably not. |
| C O M M E N T S |
|
Home »
Topic: The Future of Planetcrap's Message Board
|«« - Previous Page - Next Page - »»| |
|
bago, I see XML as a solution to a problem that didn't exist in the first place. And by your own words it still contains the some/same errors that can be found in a regular old flat file. Granted, I haven't messed with XML much at all...is there a way to index into it? If I want the value in the last tag I have to read the whole file? If the latter is the case, on a huge file that read action really bogs things down. What is the recommended size of an XML file before you should saysay..ok..we need to switch to a database? 10K, 100K, 1MB, 10MB, 100MB? Zep-- w0rd up!
|
|
Xml files and databases are not really interchangeable. If you're using xml to replace an rdbms you're doing it wrong. Xml describes data but is most useful when you're communicating data with external parties or across application layers. She's probably had sex with like 4 different guys by now and has no idea who he is anymore, his face lost in a memory sea of dicks.
|
|
Yeah, XML is sort of a transitional way to store data; using it as your primary way to store data is silly (outside of, say, configuration files for applications). Just as an example, we store all sorts of things in a collection of MySQL databases but when we want to present that data to other systems, we do so using XML - whether that's through some kind of SOAP-based API or through a file that's dumped onto disk for the other system to retrieve. Having said that, I don't think it's designed to be used to store large amounts of data. Nor is it designed to be accessed in a serial fashion - you typcially load the entire file into memory and run it through your XML parser, which gives you access to the varies nodes and sub-nodes. Put it this way: if you're working with a rigidly defined data-set encompassing thousands of rows of data then a direct database connection or a delimited text file that you can read line by line is probably the way to go. If your dataset is smallish and you need some flexibility in what data is going to be include in each record then XML is worth a look. |
|
+1 for Gunpoint and deadlock. In enterprise, XML is good when you need an universal intermediate format, esp. when you just want to dump objects for 3rd party. In small applications, think of it as serializing objects into human and computer-readable format. If you want some speed, there are several binary XML formats. I've worked with XML files around 100MB, but it's definitely not easy to work with, nor it should be a typical scenario. And once again, XML is not a database. It's just a flexible format used sometimes to store data (like metadata about android application), or I'd say primarily, exchange data (SOAP, XML-RPC, any number of non-standardized formats used for public APIs). Parhelic Triangle is coming. Eventually.
|
|
Real world example: One of the largest UK retailers with electronics has several web shops, running on different engines. Their shitty ERP system stores data in who knows what, and since integration from PHP to a critically important back-end is unacceptable, they spit out 30MB XML with their product info. And since the can effectively represent what would be LEFT JOINs in SQL, except instead of NULL you just omit the data, you can have something like this <product id="123"> <stock onLocation="10" incoming="50" eta="2 days" /> <colour>brown</colour> <dimensions>...</dimensions> <related> <product id="234" type="alternative" /> <product id="545" type="accessory" /> </related> <price current="10.0" onSale="true" formerPrice="13.99" date="1.1.2011"/> </product> Or something. Ideally, when you come to a new system and look at the XML, you have an idea what kind of structure the system has. You can imagine the system would have tables like Products, Related Products, Historical Prices, Product Metadata, etc. Of course, the XML isn't used in real time, but imported to SQL database overnight. Parhelic Triangle is coming. Eventually.
|
|
Milan, Your example is where I think they fucked up the spec. The "stock" line for example. Why go thru all the trouble of creating a tag based flat file...then hey..We can also just cram a bunch more tags IN A TAG. BRILLANT! It just seems stupid to me. why arn't onlocation, incomming, eta sub tags of STOCK instead of being "attributes" or whatever that nonsense is called? Zep-- w0rd up!
|
|
It isn't a flat file. That's the whole point. But if you're offended by child tags you can always write them as attributes instead: <product id="123" colour="brown" /> She's probably had sex with like 4 different guys by now and has no idea who he is anymore, his face lost in a memory sea of dicks.
|
|
Wudi, I was making up the example of the fly, but you got it right - if you just start hacking an XML without a schema, you'll end up with a pile of steaming tags. You can write <dimensions>some string</dimensions> as well as <dimensions width="12.3" height="12.5" unit="inches" /> And, if it hasn't been explained to you, width, height and unit in this example ARE attributes. (Or you could even use <dimensions width="12.2">This product is fucking huge, like 12"</dimensions> or even <dimensions> <!-- let's suppose we're copying a structure of some products_dimensions table --> <width>12</width> <height>44</height> <sizeCategory category_id="123">so big it hurts</sizeCategory> </dimensions> The nice thing is that XML doesn't care. In practice however, accessing them is as easy as (using the example from the previous post) foreach $xml as $product { $databaseProductModel->setCurrentStock( $product->stock['onLocation'] } or, if you're working with XSLT or XPath, just product/stock@onLocation Parhelic Triangle is coming. Eventually.
|
|
XML is self descriptive. Binary data is not. That's why it's useful. |
|
Except when people don't get it and you end up with tag names such as <i21> or <0x020_object4> She's probably had sex with like 4 different guys by now and has no idea who he is anymore, his face lost in a memory sea of dicks.
|
|
<dimensions width="12.3" height="12.5" unit="inches" /> But I'll see shit like this <dimensions width="12.3" height="12.5" /> <dimensions unit="inches" /> I mean c'mon, WTF? It's like, let's make someone totally fucked up that a database would never do. It just looks like bad practice/data management to me. Zep-- w0rd up!
|
|
/someone/something/ w0rd up!
|
|
You guys are killing PlanetCrap. |
|
Really, Wudi, really? - I've seen table names with diacritical marks, you know, like `Zázazníci` instead of `customers` - I've seen the dickretarded habit of naming tables `tbl_something` - I've seen tables that needed no less than 3 joins to be of any use, because some dickwad couldn't just add `order_id` to it. - I've seen a database when foreign key (or lack thereof) to table users was called `user_id`, `users_id`, `id_users` or just `user` - ditto with table names, mixing singulars and plurals, like `users` and `delivery` - I'm not going to mention people who don't add PK, FK, indexes, or use VARCHAR for any data type, or instead of adding two columns with flags have one column with, say, numbers, and 2 special values like "NA" and "PENDING" (and of course NULL, too) Bad data design is universal. People who don't know what they're actually doing will fuck projects up with any technology. Parhelic Triangle is coming. Eventually.
|
|
Also - just as you can make table Dimensions and set width, height, unit to NOT NULL, you can just as well make an XML schema that checks that. (note - this snippet isn't valid, I'm just copypasting shit together) <xs:element name="product_sku" type="xs:positiveInteger"/> ... <xs:element name="dimensions"> <xs:complexType> <xs:attribute name="width" use="required" /> <xs:attribute name="height" use="required" /> <xs:attribute name="width" use="required" type="unit" /> </xs:complexType> </xs:element> <xs:simpleType name="unit"> <xs:restriction base="xs:string"> <xs:enumeration value="inch"/> <xs:enumeration value="mm"/> <xs:enumeration value="nautical mile"/> </xs:restriction> </xs:simpleType> So yes, it's much longer than defining column as ENUM or DECIMAL(10,2), but you can add regexps, complex types, all kinds of recursion, etc, etc. Again, not a replacement for database, but it has its uses. That said, XML Schema (.xsd files) are not mandatory, and from my experience, not used that often (unless, of course, it's an enterprise solution, where no sane person would avoid XSD or some alternative like RELAX NG... but RELAX NG is for hippies like Ian Hickson). Parhelic Triangle is coming. Eventually.
|
|
Also, Gunpoint, please tell me that you've made that example up and it has no real basis in real projects. Pretty please? Parhelic Triangle is coming. Eventually.
|
|
No, I've seen that several times on projects where people don't really understand XML or SOAP or webservices but they just generate a WSDL based on their weird object structure. In those cases they pretty much expect people to generate a proxy from the WSDL and never come into contact with the raw XML. She's probably had sex with like 4 different guys by now and has no idea who he is anymore, his face lost in a memory sea of dicks.
|
|
Gunpoint, that is... depressing. I'm depressed now. In other non-news, what the fuck is so interesting about Tiny Towers? I know everybody bitched about it seven decades back, but, seriously? The game stops being fun after 2 minutes, then it's all pure F2P blackmail. I mean, seriously? The game has almost zero mechanics that don't require playing the game 230 times a day and waiting for 30 minutes for everything. I mean, yes, I understand what F2P is, but I was hoping it would be a fun strategy game like Sim Tower for at least, I don't know, one week, two weeks? Oh naive me. Parhelic Triangle is coming. Eventually.
|
|
+1 for bago. Sounds like you need a less stressful job my friend. +1 for XML. It has it's uses, and just like anything else, those uses can be perverted or incorrectly implemented, but it shouldn't diminish XML because people don't know how to correctly build it. Real world examples I've used XML for: config files, transporting data between databases and between protocols, tiny database systems, web pages. All in cases where data needed to be more than just a list of numbers, but a fully self explained and relational system. "programmers talk from a very deep gnome cavern, full of gold mechanics" - wisdom from the ancients
|
|
Tiny Towers is fairly disgusting. |
|
We use YAML and JSON, but it sounds many of the same principles apply. Human-readable and -editable data allows easy prototyping of new features, since it's just a matter of adding new fields and values and you're done. And should one of the tools break that usually edits the data it's still possible to get shit done. Also easy to check history, since all the usual VCS tools work. Another major advantage we've had with files over databases is that it's dead-simple to branch off into a sandbox to develop new features. We're always adding stuff so the data is constantly evolving, and being able to easily branch code and data is all kinds of critical. Basically comes down to editing a file is easy for everyone but databases require domain-specfic knowledge that no one in their right mind wants to get into. There's a time and a place for databases, but for almost all data I work with files are far more appropriate. |
|
Actually, why use XML at all over JSON or YAML? Honest question, I'm not super familiar with XML. It could be that I'm spoiled by Python which comes fully supporting of both standards. I mean, YAML allows serialization and deserialization to and from data-structures, it's as easy as calling YAML.dump/load. I hear XML is useful if the data needs validation but I don't know why you can't just validate the data itself once it's in data-form, if you don't trust the source. For something like a config file YAML and JSON has been great successes for me since the data read/writes are completely trivial. It's my understanding you need to do more of the serialization legwork yourself with XML, but maybe I have that wrong? |
|
#730 by gaggle We use YAML and JSON, but it sounds many of the same principles apply. Human-readable and -editable data allows easy prototyping of new features, since it's just a matter of adding new fields and values and you're done. And should one of the tools break that usually edits the data it's still possible to get shit done. Also easy to check history, since all the usual VCS tools work. Another major advantage we've had with files over databases is that it's dead-simple to branch off into a sandbox to develop new features. We're always adding stuff so the data is constantly evolving, and being able to easily branch code and data is all kinds of critical. Basically comes down to editing a file is easy for everyone but databases require domain-specfic knowledge that no one in their right mind wants to get into. There's a time and a place for databases, but for almost all data I work with files are far more appropriate. QFMFT Parhelic Triangle is coming. Eventually.
|
|
XML, YAML and JSON can be, if I remember this correctly, all converted between each other without data loss. XML has namespaces, that might be a bit tricky? Dunno. *hic* Wudi might like YAML better since it's shorter. I think he looks like a YAML guy to me. Validation by XML schema is good gaggle, because it usually throws an error before even you get to your parsing/processing/importing/API/RPC code. Basically, it's for saying "fuck off 3rd party, I'm not reading your XML, it doesn't validate plz fix kthxbai". Parhelic Triangle is coming. Eventually.
|
|
I doubt I would like it either. I don't care much for this neckbeard shit. Zep-- w0rd up!
|
|
Said the guy who works with Microsoft technologies. Parhelic Triangle is coming. Eventually.
|
|
Are you saying that's a bad thing? |
|
I'm saying Microsoft developed XML, and MSSQL Server can index and search XML columns with XPath or XQuery or something. Or so I've heard. Which sounds pretty exciting to me, honestly. Parhelic Triangle is coming. Eventually.
|
|
#730 by gaggle Basically comes down to editing a file is easy for everyone but databases require domain-specfic knowledge that no one in their right mind wants to get into. What? Hey, fuck you! Everyone needs a database. A data warehouse, even. EVERYONE. Whether they know it or not. "One part disembowels me while another slowly eats its way through the gas line. As I bleed out on the floor, it reminds me that I need to buy milk." - Jibble
|
|
TOAD for MySQL (or rather its working db compare tool) was a game-changer for us - a bit tardy game, yes, but it's a nice way to deploy changes between environments. Also, I'm sure #738 is missing at least 4 links in the sig - linkedin profile, old website, new website, and some client reference. Parhelic Triangle is coming. Eventually.
|
|
#739 by Milan Brezovský Also, I'm sure #738 is missing at least 4 links in the sig - linkedin profile, old website, new website, and some client reference. That's how I usually find work. "Fuck you! Here's my CV." "One part disembowels me while another slowly eats its way through the gas line. As I bleed out on the floor, it reminds me that I need to buy milk." - Jibble
|
|
Dim conf As New Soap.TicketConfiguration With conf .DeviceId = "" .ExtensionData = Nothing .Id = 0 End With Dim st = New Soap.ServiceTicket() With _ { _ .TicketNumber = "0", _ .Summary = "New Summary Test", _ .SiteName = "Silent Hill", _ .Board = "MDSIA", _ .ServiceType = "New", _ .Status = "1", .StatusName = "New", _ .ProblemDescription = "New Problem Test" _ } then I do this with throws an exception st.Configurations(0).Id = conf.Id "Object reference not set to an instance of an object." Well no shit, st.Configurations(0).Id= Nothing, why isn't it setting it to conf.id? WTF am I doing wrong? Zep-- w0rd up!
|
|
Have you tried JavaScript? Parhelic Triangle is coming. Eventually.
|
|
You use what are are told to use when they pay you, in this case vb.net 2008 Zep-- w0rd up!
|
|
Heh. Luckily I don't have any experience with VB.net, but don't you have a stinking debugger? Is the array element 0 a valid instance? Parhelic Triangle is coming. Eventually.
|
|
Sounds like st.Configurations or st.Configurations(0) is null, and it's choking when you try to access the Id property of a null object. BUYBUYBUY
|
|
41 new posts and it's all about fucking XML. 52 Weeks and Something's On Movie Blog
|
|
They would fuck XML if they could. Freaks. |
|
yeah...st.Configurations, st.Configurations(0), st.Configurations(0).Id all those = "Nothing" when I breakpoint there..cannot even set it when I click the little + by "st" i'm starting to think I can't set that to a value and that it's set and then returned by the web service here's how the property is defined, is it settable? Public Property Configurations() As Soap.TicketConfiguration() Get Return Me.ConfigurationsField End Get Set If (Object.ReferenceEquals(Me.ConfigurationsField, value) <> true) Then Me.ConfigurationsField = value Me.RaisePropertyChanged("Configurations") End If End Set End Property Zep-- w0rd up!
|
|
Seems like it should work. Are you actually setting the Configurations property or are you counting on it to be set by the ServiceTicket constructor? BUYBUYBUY
|
|
the bit of code where i try to set it is in #741 Zep-- w0rd up!
|
|
No, you're setting st.Configurations(0).Id. Which you can't do, because you said st.Configurations is null. You should try setting st.Configurations = new Soap.TicketConfiguration() first, or whatever gives you the collection you're looking for. BUYBUYBUY
|
|
This should be what the future of PlanetCrap's message board is. :( |
|
Introducing the whole new Stack Overflow - where half of the answers is "eat a bag of dicks". Also, anyone played Jagged Alliance: Back in Action? Is it as annoying as their voice acting? Parhelic Triangle is coming. Eventually.
|
|
WTF am I doing wrong? Using VB.Net... |
|
SwiftKey X is a shitty application. I mean, how much does their "natural language" algorithms suck if even after scanning my motherfucking gmail, they cannot give me a suggestion for "motherfucking"? Is there another dictionary I could download, English (REAL)? Parhelic Triangle is coming. Eventually.
|
|
Since we're talking programming stuff - today I saw my first couple of pages of C# code. Granted, there was quite an obvious level of wizard usage involved, but even considering that, for a console program not an awful lot beyond the level of helloworld... jesus fuck, but it looked ugly and bloated all to hell. Line after line, everything seemed to extend way past the sacred 80 column limit. Even as I'm in the midst of a Java project, it looked positively horrifying. I'm sure it was just bad formatting or whatever, but it still put me off even thinking about picking up C# anytime soon. ¤ "Apple hates everyone now." - BJB
|
|
80 columns are for old people. BUYBUYBUY
|
|
80 columns is still a valid guideline imo. Very wide code is not good design anyway (whether by nesting or very long variable names), and 80 wide means your code will fit nicely on my portrait-mode monitor. It's not that 80 is particularly awesome, it just do happens 80 is good enough and a classic standard everyone can conform to. |
|
If you don't have a widescreen monitor, you have no business writing code. You should be printing newspapers or cobbling shoes. BUYBUYBUY
|
| C O M M E N T S |
|
Home »
Topic: The Future of Planetcrap's Message Board
|«« - Previous Page - Next Page - »»| |
| P O S T A C O M M E N T |
|
|
| C R A P T A G S | ||||||||
|
|
| There are currently 0 people browsing this site. [Details] |
|
Powered by blah 0.9.1-dev •
PlanetCrap is © 1997-2035 Hendrik "Morn" Mans |