Open Side Menu Go to the Top
Register
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** ** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

02-18-2016 , 02:24 AM
Quote:
Originally Posted by PJo336
I'm not really sure I follow here. It sounds like he's suggesting making a object for any use case that holds the data it needs. This sounds incredibly unwieldy and bloated with objects, so I just must be misunderstanding.

I can sort of see how applying fields directly to table columns is "tying" to the database, but at the same time how I fill those fields is abstracted into my repositories so I can realistically fill the same fields anyway I want. So why is this bad exactly?
sorry, but i don't understand this comment. i was sort of afraid my comments were too abstract to be useful, and now i'm sure of it. without real specifics and code here, i don't think it's worth going on. also, it's possible i'm misunderstanding your problem.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 02:26 AM
Btw, i had to sum up 7 int fields individually in a list of objects.

Ie List( Obj(a1,b1,c1), Obj2(a2,b2,c2) ) summing up all as, all bs, all cs, etc


Finally had a real world scenario to try out fold left!

Warning, may be gross:

Code:
// all 7 start values in a tuple at 0
val start =(0, 0, 0, 0, 0, 0, 0)
objList.foldLeft(start)((total,entry) => {
  (total._1 + entry.a,
   total._2 + entry.b,
   total._3 + entry.c,
   total._4 + entry.d,
   total._5 + entry.e,
   total._6 + entry.f,
   total._7 + entry.g)
})

I think its beautiful
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 02:29 AM
Quote:
Originally Posted by gaming_mouse
sorry, but i don't understand this comment. i was sort of afraid my comments were too abstract to be useful, and now i'm sure of it. without real specifics and code here, i don't think it's worth going on. also, it's possible i'm misunderstanding your problem.
Its interesting bc it seems like such a basic problem without any perfect solution. Sounds like Im just overthinking it more than 99% of people and just need to do something
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 02:36 AM
Quote:
Originally Posted by PJo336
Its interesting bc it seems like such a basic problem without any perfect solution. Sounds like Im just overthinking it more than 99% of people and just need to do something
The general problem of the mismatch between database and application is legitimately very hard imo (I feel I still don't have a total handle on it), and Because AR is so entrenched, in almost every web framework in every language, 99% of people don't even realize a problem exists, or they only sense it when it rears its head in a really specific way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 02:42 AM
I think we have the opposite problem, were seeing ghosts in broad daylight. I suppose that comes from us both working at a company that had 10 year old java code and would never speak of taking time to refactor, so the concept of writing a solution now and fixing later when theres actually a problem seems foreign to us.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 02:49 AM
Quote:
Originally Posted by gaming_mouse
I think we're talking past in each other. Sorry about that, but this stuff is so abstract it's to be expected. Maybe an example will help. If you need a rule that says customers who have spent a lifetime total of $1000, not including any discounts (your VIPs), get a special discount that entitles them to 50% off any purchase on their birthday, but not to exceed $50 in total discount, that rule shouldn't live in your database. Even though, at the end of the day, that *is* about data integrity: it's just expressing a bunch of relations between numbers in the users table, the user_details table, and the orders table (or some such). RDBs, even sophisticated ones, do not have the expressive power needed to model complex business applications naturally.


EDIT: perhaps even more importantly, such rules are subject to very different rates of change than, say, rules about the allowed length of a first name. so you don't want them encoded in the database, otherwise when you change them you will break the integrity of existing data.
I didn't think anyone seriously did this level of complex calculations with a database or stored the results in a database... outside of highly specific and time-sensitive items, but even that's not a very good idea. It's a totally different digression. Anyone who defaults to this isn't thinking at all about how the database system works, and I'd have a long string of very difficult questions for anyone who suggests this unless his name is Erwin. Thought you thunk higher of me than this.

Of course, that doesn't mean you can't use windowing in your example, but that, IMO, has nothing to do with the data and doesn't have anything do with what I was trying to say. I don't think of the query language and the data as the same thing. I also don't think that code should be confused with the queries. All unix philosophy, I guess.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 02:56 AM
Quote:
Originally Posted by daveT
I didn't think anyone seriously did this level of complex calculations with a database or stored the results in a database... outside of highly specific and time-sensitive items, but even that's not a very good idea. It's a totally different digression. Anyone who defaults to this isn't thinking at all about how the database system works, and I'd have a long string of very difficult questions for anyone who suggests this unless his name is Erwin. Thought you thunk higher of me than this.

Of course, that doesn't mean you can't use windowing in your example, but that, IMO, has nothing to do with the data and doesn't have anything do with what I was trying to say. I don't think of the query language and the data as the same thing. I also don't think that code should be confused with the queries. All unix philosophy, I guess.
yeah, i wasn't implying you thought people did this. i was using an example i was sure you would agree should not be in the db, even though it expresses data integrity relationships.

i was defending my point that business rules often belong in ruby/python/similar code, and not in the db, which it seemed you had taken issue with. i was also clarifying the term "business rules" which gets thrown around a lot, and which people often have different interpretations of, by providing a concrete example of one.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 03:00 AM
What about simple operation, summing or multiplying 2 fields in the DB and returning that?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 03:08 AM
Quote:
Originally Posted by PJo336
What about simple operation, summing or multiplying 2 fields in the DB and returning that?
depends. i'd probably only do it in the DB if I needed to for performance or memory reasons. But it's not a clear line in all cases. I'm not against writing custom SQL when you need to. That's a different point altogether.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 03:16 AM
Just made my first Yo generator. It was pretty painless.

I did have one issue with the EJS templates though. We have EJS templates being generated by Yo. So we need to output literal <% %> tags into the output file. The problem is naturally EJS wants to interpolate those rather than spit them out.

I see in the EJS documentation that it's pretty easy to output a literal opening tag:

<%% Outputs a literal '<%'


Which works great - I see <% in the output after running through Yo.

But I can't find anywhere a similar way to output a script closing tag. I finally just made a template variable for it. IE <%- closingTag %> where closingTag='%>'.

But that seems cumbersome. Just wondering if there's a better way.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 03:16 AM
Quote:
Originally Posted by gaming_mouse
yeah, i wasn't implying you thought people did this. i was using an example i was sure you would agree should not be in the db, even though it expresses data integrity relationships.
Similarly, I suppose we have very different definitions of data integrity. In the text-book definition, data integrity is nothing more than the goal normalization, and good database design principals. ie, it is a concept that assumes a static state of the database.

I don't consider, in any shape or form, the calculation of data to be an integrity issue. Your example is interesting, but I don't think there is nothing wrong with using query tools to get results closer to the metal. I know I certainly would never want to calculate the aggregate sum of sales with some limit constrained to some dates with any programming language, especially if I know that query is pretty trivial, faster, and likely more accurate, with SQL. Nothing wrong, IMO, with using an excellent tool to get the base data you need before going all nuts. In other words, what PJo336 is exactly what I'd use the query language for.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 03:33 AM
Quote:
Originally Posted by daveT
Similarly, I suppose we have very different definitions of data integrity. In the text-book definition, data integrity is nothing more than the goal normalization, and good database design principals. ie, it is a concept that assumes a static state of the database. I don't consider, in any shape or form, the calculation of data to be an integrity issue.
It is static. It doesn't matter what you consider it, it is data integrity. That calculation results in static data that will have certain relationships. You can query the db and determine if any of the complex rules have been broken, or if the data is valid. There is no fundamental difference between the example I gave and a foreign key constraint, or the constraint that a field must be an int. There is a practical difference only because databases provide easy facilities for the latter, but not the former, through accidents of history, ease of implementation, demand, etc.


Quote:
Your example is interesting, but I don't think there is nothing wrong with using query tools to get results closer to the metal. I know I certainly would never want to calculate the aggregate sum of sales with some limit constrained to some dates with any programming language, especially if I know that query is pretty trivial, faster, and likely more accurate, with SQL. Nothing wrong, IMO, with using an excellent tool to get the base data you need before going all nuts. In other words, what PJo336 is exactly what I'd use the query language for.
I agree with all this. Again, I think you're misreading me.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 04:53 AM
cs 321 problem (data structures / ... sorting ****)

Quote:
For a given input array A: < 4a, 11, 5, 10, 2, 6, 4b, 9, 7> what is the sequence of numbers in A after the first partition (by calling Partition(A, 1, 9))? Note that 1 and 9 in Partition(A, 1, 9) function call are array indexes.
Answer?

(assume the correct answer is worth 10% of my final grade in the class and I have little clue as to what the prof will accept as an answer for full credit)

edit: he is talking about quick sort
http://opendatastructures.org/ods-ja...sed_Sorti.html
^ -> quickSort

Last edited by Ryanb9; 02-18-2016 at 05:03 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 05:45 AM
Hi all,


I've been using Code::Blocks for learning C and C++ and every time I close it, it tells me something about the perspective has changed, and asks if I want to save it, or tell it to shut the hell up permanently.

Does anyone know what this perspective business means, and if I can tell the damn thing to shut the **** up forever more?

Cheers!



Edit: I thought of another question for you lovely gents and ladies. Does anyone know of any good resources on how to go about building firefox add-ons? I think that would be a superbly great thing to learn how to do. Also, what language are those written in? Can you do them in C and C++? Python?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 10:19 AM
Browser extensions are "inside" the browser so are all in javascript.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 06:47 PM
Quote:
Originally Posted by catsec
Does anyone know of any good resources on how to go about building firefox add-ons?
greasemonkey might be what you're looking for
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-18-2016 , 08:50 PM
Quote:
Originally Posted by gaming_mouse
It is static. It doesn't matter what you consider it, it is data integrity. That calculation results in static data that will have certain relationships. You can query the db and determine if any of the complex rules have been broken, or if the data is valid. There is no fundamental difference between the example I gave and a foreign key constraint, or the constraint that a field must be an int. There is a practical difference only because databases provide easy facilities for the latter, but not the former, through accidents of history, ease of implementation, demand, etc.
Despite the thought that we are talking past each other, I think we have a fundamental disagreement.

My suggestion is that data integrity simply deals on the data storage level. I strongly disagree that what happens at the database level has anything at all to do with what happens on the code level. A well-designed database owes no consideration to what the code does with it, what kind of services use it, nor does the quantity of services matter.

Data integrity has a very simple definition: data is to be unique, non-redundant, and non-anomalous. This is not "my" definition. This is "the" definition. There is no such thing as a "flexible" and "expressive" schema design. Just like static languages are concerned with a certain class of mistakes, data integrity deals with a certain class of mistakes. For example, you have have a constraint table of valid country names (which will prevent misspellings), but you can't have a constraint table on ensuring a customer is joined to the correct country. The former is data integrity, the ladder is probably what you mean by business logic. This, of course, can only be solved by code or by human, and even so, there is no guarantees that the data is valid as it is the very expression of the uncertainty principal.

At the fundamental level, data storage is a very different concept than the languages that call it, whether that language is SQL, Python, C, or whatever. The languages you use to call and manipulate the data is a personal choice, but once again, has nothing at all to do with data integrity.

I think I'm confused by exactly what you mean by business logic. If you mean computing values and aggregates from a database, I don't think there is much debate here, but this, once again, is not a data issue, IMO.

Perhaps I'm just confused because I'm very comfortable working at the raw database level, and I don't see the problem from the same abstractions others do?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 06:49 AM
[IMG][/IMG]

Hi friends!,
I'm supposed to implement the above algorithm to produce a pseudo random bit stream, but I'm slightly confused about the first part.
i'm guessing i can use the xth bit of the clock to get a "random bit" in order to generate my seed?
but how do u "randomly" select 2 primes s.t. pq=3 mod4?, don't u have to already have a list of primes? or is it more a case of compute a list of number in the form 4x+3? and check if they can be written as pq?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 08:49 AM
Quote:
Originally Posted by CyberShark93
[IMG][/IMG]

Hi friends!,
I'm supposed to implement the above algorithm to produce a pseudo random bit stream, but I'm slightly confused about the first part.
i'm guessing i can use the xth bit of the clock to get a "random bit" in order to generate my seed?
but how do u "randomly" select 2 primes s.t. pq=3 mod4?, don't u have to already have a list of primes? or is it more a case of compute a list of number in the form 4x+3? and check if they can be written as pq?
i should clarify,

let's say i have a list of primes < some security parameter lambda, how do I "randomly" select them using only the entropy of the seed, say the system clock? say i need to call it more than once within a second, won't i get the same seed more than once?

Last edited by CyberShark93; 02-19-2016 at 09:00 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 11:23 AM
Quote:
Originally Posted by daveT
Despite the thought that we are talking past each other, I think we have a fundamental disagreement.

My suggestion is that data integrity simply deals on the data storage level. I strongly disagree that what happens at the database level has anything at all to do with what happens on the code level. A well-designed database owes no consideration to what the code does with it, what kind of services use it, nor does the quantity of services matter.

Data integrity has a very simple definition: data is to be unique, non-redundant, and non-anomalous. This is not "my" definition. This is "the" definition. There is no such thing as a "flexible" and "expressive" schema design. Just like static languages are concerned with a certain class of mistakes, data integrity deals with a certain class of mistakes. For example, you have have a constraint table of valid country names (which will prevent misspellings), but you can't have a constraint table on ensuring a customer is joined to the correct country. The former is data integrity, the ladder is probably what you mean by business logic. This, of course, can only be solved by code or by human, and even so, there is no guarantees that the data is valid as it is the very expression of the uncertainty principal.

At the fundamental level, data storage is a very different concept than the languages that call it, whether that language is SQL, Python, C, or whatever. The languages you use to call and manipulate the data is a personal choice, but once again, has nothing at all to do with data integrity.

I think I'm confused by exactly what you mean by business logic. If you mean computing values and aggregates from a database, I don't think there is much debate here, but this, once again, is not a data issue, IMO.

Perhaps I'm just confused because I'm very comfortable working at the raw database level, and I don't see the problem from the same abstractions others do?
You're still not understanding what I'm saying. But I think we need to just let this one go...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 11:47 AM
So giphy raised a 55m series C...

So much for a correction
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 11:55 AM
Quote:
Originally Posted by Larry Legend
So giphy raised a 55m series C...

So much for a correction
giphy is the one image plugin we use for slack that is pretty much guaranteed to *never* return a relevant image. Ironically this means it gets used *more* because people want to see what crazy image it comes up with.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 12:17 PM
Quote:
Originally Posted by Larry Legend
So giphy raised a 55m series C...

So much for a correction
Actually market seems to be somewhat undervalued to me FWIW.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 12:18 PM
Next time I buy an apple laptop with a retina screen I'm testing whether it is manufactured by Samsung and not LG.
There is a script that a quick Google search will show, where you put in a terminal and it outputs data that tells you which screen you have.

Why? Had the random case of what the web calls pixel explosion and I never even knew such a thing was possible. A pixel literally exploded in the center of the screen by over heat or whatever from a defective screen that I thought was fine until I really wiped and examined the thing closely. Around the center of the screen tiny 1 sized pixel, holes were found which apparently are burned out pixels.

I chatted with support online with online chat, said laptop is usually clean in the regard that I never have it in dusty or dirty environment and make sure nothing the size of sand is on the laptop when closing the lid. Only use water with Apple micro fiber cloth that came with it and live in the middle of no mans land where driving to an Apple Store is like a day of 10 hour driving. Basically got free shipping by fedex to send to Apple and they seem to have fixed it with no charge which is something cause I know they charge like a grand to replace the screen usually. Really great experience with Apple care if I'm not getting charged anything and only without the laptop for two days. This other experience I had with a repair place that somehow managed to be an apple repair center was awful and charged $130 to replace a failing battery and service the machine. They took two weeks to do it and sent the laptop back to me with missing bottom screws, bottom was completely not securely screwed in at all.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
02-19-2016 , 12:51 PM
taking the recent db discussions down to earth, to a real problem I'm working on, how would you handle storing hours a merchant is open in postgres?

should handle different hours each day of week, and lunch breaks, etc

eg
M closed
T-F 9-12, 1-6
S 10-2
U 10-3
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote

      
m