Open Side Menu Go to the Top

11-28-2011 , 08:06 PM
kyle, what are you using HipHop for?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
11-28-2011 , 08:14 PM
markov chains, simulations
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-28-2011 , 08:15 PM
Quote:
Originally Posted by kyleb
markov chains, simulations
i think you should write it in something functional. maybe oracle.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-28-2011 , 08:39 PM
not sure if srs

what do you mean by "functional" in this context?
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-28-2011 , 08:43 PM
Quote:
Originally Posted by tyler_cracker
not sure if srs

what do you mean by "functional" in this context?
not srs. just trolling kyleb, and he knows that.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
11-28-2011 , 09:09 PM
lol

but yeah it should be in erlang absolutely.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-01-2011 , 04:54 PM
Anybody know of a good book on mfc? Looking to improve my C++ skills on windows.

Mvh
Inga
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-01-2011 , 11:36 PM
sorry for tardin this thread up with my hwk ?'s, if you want me to stop..let us know lol

so this program inputs data from a file on the command line...if the file comes over a line which is '.NH' you have to print the next line, if its '.NH 2' you have to print the next line but indent it by 1, if its '.NH 3' indent it by 2 and so on...

when i try to use fgets twice, it doesnt collect all the data for some reason ..have i made a mistake? in the file im inputting into the command line, '.NH #' is always on a line of its own
I got told a line will be nomore then 1026characters

strlength is the new line of the file
strlength2 is the previous line of the file

Code:
#include <stdio.h>
#include <stdlib.h>

int main(int argc, char **argv)
{
 
        char strlength[1028];
        char strlength2[1028];

        FILE *fp;
        fp = fopen(argv[1], "r");
        if(fp == NULL)
        {
                fprintf(stderr, "File %s does not exist.\n", argv[1]);
                exit(0);
        }
         
        while(fp != EOF)
        {
                fgets(strlength, 1026, fp);
                
                if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] != ' ')
                {
                        printf("%s\n", strlength);
                }
                else if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] == ' ' && strlength2[4] == '2')
                {
                        printf("\t%s\n", strlength);
                }
                else if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] == ' ' && strlength2[4] == '3')
                {
                        printf("\t\t%s\n", strlength);
                }
                else if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] == ' ' && strlength2[4] == '4')
                {
                        printf("\t\t\t%s\n", strlength);
                }
                fgets(strlength2, 1026,fp);
        }
        fclose(fp);
}
the output looks like:
Code:
			True Graphical Independence

		Modularity

			Modularity and Documents

				Previous approaches

				Top-down or Bottom-up

		Thesis Structure

		PDF Structure

				Strings

				Dictionaries

				Indirect references

			PDF Syntax
however it meant to have all these in the above ^^

Code:
Introduction
Comparison of Digital Documents and Computer Programming Languages
Machine-Level Document Languages
Device-Independence
True Graphical Independence
Modularity
Modularity and Documents
Previous approaches
Top-down or Bottom-up
Thesis Structure
An Introduction to PDF
PDF Structure
PDF Simple types
Booleans
Name objects
The Null Object
Numbers
Strings
Dictionaries
Arrays
Streams
Indirect references
PDF Synta

Last edited by ElPonchis; 12-01-2011 at 11:59 PM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-02-2011 , 12:43 AM
Quote:
Originally Posted by ElPonchis
Code:
        while(fp != EOF)
        {
                fgets(strlength, 1026, fp);
                
                if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] != ' ')
                {
                        printf("%s\n", strlength);
                }
                else if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] == ' ' && strlength2[4] == '2')
                {
                        printf("\t%s\n", strlength);
                }
                else if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] == ' ' && strlength2[4] == '3')
                {
                        printf("\t\t%s\n", strlength);
                }
                else if(strlength2[0] == '.' && strlength2[1] == 'N' && strlength2[2] == 'H' && strlength2[3] == ' ' && strlength2[4] == '4')
                {
                        printf("\t\t\t%s\n", strlength);
                }
                fgets(strlength2, 1026,fp);
        }
You have an fgets at both ends of the loop, doing 2 reads. So strlength and strlength2 trade off lines instead of passing the current line to the variable you want to hold the previous line.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-02-2011 , 12:50 AM
Quote:
Originally Posted by TheIrishThug
You have an fgets at both ends of the loop, doing 2 reads. So strlength and strlength2 trade off lines instead of passing the current line to the variable you want to hold the previous line.
edit: thankyou!
loveyou guys in this thread

Last edited by ElPonchis; 12-02-2011 at 01:12 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-02-2011 , 04:43 PM
does anyone have an opinion on which GPU is better?

AMD Radeon™ HD 6670 1GB DDR5 (DVI, VGA, HDMI) [add $130.00]

or

1GB Nvidia GeForce GT 530 (DVI, VGA, HDMI) [add $110.00]


i realize this is in a vacuum, i don't know what it's going to be used for. not first-person shooters, but some kind of flight simulation probably.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-02-2011 , 05:03 PM
lol, our technology guy at the company I work for now hacked PartyPoker's "anonymous" tables and wrote a program that deobfuscates it. I wrote about it in Internet Poker and it's getting linked around by a bunch of people on 2p2; I can't link the company blog but I can show you the video of it in action:

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-02-2011 , 06:37 PM
so for the next "sprint" at my job, my tasks are going to be watching ALL of the Stanford ML lectures.

could become the first project I ever finished on time.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-02-2011 , 11:57 PM
That's a pretty sweet sprint task!
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-03-2011 , 11:18 AM
Wait till the next sprint when you have to transcribe or summarize them...
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-03-2011 , 08:42 PM
Quote:
Originally Posted by kerowo
Wait till the next sprint when you have to transcribe or summarize them...
Wouldn't you do this as you watch anyways?

** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-03-2011 , 09:07 PM
Quote:
Originally Posted by kerowo
Wait till the next sprint when you have to transcribe or summarize them...
Hell no. I am too senior for that. Maybe an intern can do it in the summer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 12:02 AM
I have a rather strange situation at work. snarky comment

A lot of our clients request excel files of all, or some of, our products.

I do need a database for my own purposes that *almost* aligns with the requests, so if I was to create a super-relation, it would look like this:

(product_id, product_name, product_type, column_one_price, column_x_quantity, column_x_price, column_x_code, column_x_coded_price... etc)

which (sort of) breaks down to:

(product_id, product_name, product_type)

(product_id, column_one_quantity, column_one_price, .... , column_x_quantity, column_x_price, column_x_code, column_x_coded_price... etc)

The issue is this: I don't know how the excel files should be formatted (I would be the first person to ever do this for the company), so say one person may want an excel file that looks like:

pId......product_type.....quanity......price

and another may want:

pId.....product_name.....column_one_quantity....co lumn_one_price.....column_two_quantity.....

and yet another may want:

pId.....last_column_price....column_code.....coded _price....

well, you get the idea.

So, with the future so uncertain, should I just create a database with a zillion tables or should I create one default excel file and let the clients sort it out? It wouldn't be a total disaster if some of them don't use the file (remember, this is the first time), but I'd feel pretty stupid if that were the case.

Now that I wrote this, I have to mention that the quantities are all different depending on the product, so there has to be some separation between all the quantities. (to enhance your understanding: the more you buy, the less you pay)

Would it be better to have:

Products(pId, pName, pType)

with:

ColumnOne (pId, quantity, price, code, coded_price)
ColumnTwo (pId, quantity, price, code, coded_price)
etc....

or:

Prices (pId, columnNumber, quantity, price, code, coded_price)

????

either way, getting the query to work into one ending relation would work to export to the excel file I think.

However, there is one caveat with all of this. Something prices include this or that, but other times not, so I think I would do something like:

notInclude(pId, no, actual_price)

and simply combine the relations to this and keep it:

Include (pId, yesNo (default = yes), add_on_price (default = null))
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 01:08 AM
Sounds like I'd make a database with a .php that that can generate .xls files based on a few checkboxes / options the customer wants to see.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 01:16 AM
I agree. Pile it into one database and use the CSV functions and mail() to parse them and send them off.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 04:02 AM
I agree totally, and that would be something I would do, but that stuff requires an actual programmer.

Seriously, I've thought of it, but I'm not thrilled with the idea of running that idea past management, since you know, I'm not trying to add 'webmaster' to my job description. In that light, I'm more inclined to do this hard way, but I'll sleep on it.

After thinking of it more, I guess:

Products (pId, pName, pType, pDescription, cOnePrice, cOneCode, cOneCodePrice, ...... inlcuded?, adjustedPrice, etc etc etc)

works just fine regardless if I do it via web or the hard way. Probably just have it so it can port out to either csv or xls.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 10:23 AM
I agree. Wipe together a database and write a script to spit out a csv file. For now, if your customer wants the data to be formatted differently, they can do it themselves. No extra work for you now and makes your life easier as you can print out a new csv anytime you want. This quick and easy solution also keeps management from thinking it is "real" software and thus adding another word to your job title.

Later on, if you find that customers have consistent requests or there might be a better way to represent the data, then you can make changes then to improve it.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 04:55 PM
Okay, my decision is to create the super-relation. This ultimately creates "less" work for me since once it's done, I can pull out what I need and add it to my own databases. Plus, I'll have it for anything new that pops up in the future, which is nice insurance.

Once it's done, it'll convert from my Postgresql to (I think) MySql on their site.

When a customer asks for a file, they will be emailed a link to the landing page (which I'll have to write), they will punch in a few check boxes (or one "all") and fill in their email. When they press submit, the system will send either a csv or xls file, which they can then have their (real, I hope) web dev deal with.

The tipping point was thinking about how much it would suck to query, export, and email all these files myself if I received 1,000 (or 50, really) requests in one week, I'd be so backed up that it would be patently absurd. Add into the fact that I'd probably send a few dozen errors and that would reflect really bad on me. Debugging the program would clearly be far less work.

This, I believe, is the Zen answer.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-04-2011 , 10:18 PM
bahahah it took my co-worker 3 hours to hack the bodog anonymous tables
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
12-05-2011 , 01:41 AM
cant believe how badly unix is being taught in my uni! 3k for a ****e teacher! yay

any decent awk tutorials? well i need to check that only two fields exist which is seperated by a tab($1 && $2) and that $3 doesnt exist...then print a certain message...help lol (im embarrassed to even ask this question as its so ****in basic!)

Last edited by ElPonchis; 12-05-2011 at 01:55 AM.
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD ** Quote
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **
$25m Guaranteed WPM on CoinPoker
Join the action now
Daily Rewards • Splash Pots • CoinRaces
** UnhandledExceptionEventHandler :: OFFICIAL LC / CHATTER THREAD **

      
m