very vague/general discussion of the pleasures of coding

Health insurance rip off lying FDA big bankers buying
Fake computer crashes dining
Cloning while they're multiplying
Fashion shoots with Beck and Hanson
Courtney Love, and Marilyn Manson
You're all fakes
Run to your mansions
Come around
We'll kick your ass in

Postby internetfriend » Wed Jan 31, 2018 3:51 pm

draw wrote:I don't get the C# one

i think it’s a general inheritance joke idk
iambic wrote:no don't make those posts
User avatar
internetfriend
pubg survivalist
 
Posts: 27274
Joined: Tue Aug 27, 2013 3:47 pm
Location: jikan desu!

Postby pantsoclock » Wed Jan 31, 2018 3:52 pm

It is probably a joke about how C# is very integrated into microsoft land but has troubling behaving outside of that specific environment.
I pay tax to help pay for things like police..fire..parks..but it goes to Ferguson like people and foreigners who are scamming our stupid government that is full of pasta thieves like this guy
User avatar
pantsoclock
 
Posts: 4887
Joined: Mon Dec 14, 2009 4:18 pm

Postby internetfriend » Wed Jan 31, 2018 3:53 pm

the truer C# one would be like "you set one organized horse up in a wizard's tower and he sends you ghost horses instantly whenever you need them"
iambic wrote:no don't make those posts
User avatar
internetfriend
pubg survivalist
 
Posts: 27274
Joined: Tue Aug 27, 2013 3:47 pm
Location: jikan desu!

Postby bongo » Wed Jan 31, 2018 3:53 pm

why is the dude in the c++ one puking
yeaaaaaaaaaaaa american nostalgia love it suburban living civilized families this could be my life
User avatar
bongo
man in hammock
 
Posts: 68799
Joined: Wed Nov 16, 2011 10:32 pm
Location: Malaise (Live Acoustic)

Postby pantsoclock » Wed Jan 31, 2018 3:54 pm

he's having a rough recovery day
I pay tax to help pay for things like police..fire..parks..but it goes to Ferguson like people and foreigners who are scamming our stupid government that is full of pasta thieves like this guy
User avatar
pantsoclock
 
Posts: 4887
Joined: Mon Dec 14, 2009 4:18 pm

Postby milano boy » Wed Jan 31, 2018 3:57 pm

i'm teaching myself elixir now and pattern matching is a wonderful pleasure i've come across. elixir in general just makes me happy :^)
User avatar
milano boy
 
Posts: 5023
Joined: Tue Sep 16, 2014 1:58 pm

Postby milano boy » Wed Jan 31, 2018 3:57 pm

also the sick ass pipe operator. some damn good syntactic sugar.
User avatar
milano boy
 
Posts: 5023
Joined: Tue Sep 16, 2014 1:58 pm

Postby draw » Wed Jan 31, 2018 4:00 pm

bongo wrote:why is the dude in the c++ one puking

Total brogrammer. Hit the 4 o'clock hump day IPAs too hard.
User avatar
draw
 
Posts: 2011
Joined: Fri Oct 20, 2017 1:49 pm

Postby internetfriend » Wed Jan 31, 2018 4:01 pm

Code: Select all
float4 frag(vertexOutput input) : COLOR
         {
            float4 color = _Color;

            // sample noise texture
            float noiseSample = tex2Dlod(_NoiseTex, float4(input.texCoord.xy, 0, 0));
            
            // dissolve colors
            float thresh2 = _Time * _ColorThreshold2 - _StartTime;
            float useDissolve2 = noiseSample - thresh2 < 0;
            color = (1 - useDissolve2)*color + useDissolve2*_DissolveColor2;

            float thresh1 = _Time * _ColorThreshold1 - _StartTime;
            float useDissolve1 = noiseSample - thresh1 < 0;
            color = (1 - useDissolve1)*color + useDissolve1*_DissolveColor1;

            float threshold = _Time * _DissolveSpeed - _StartTime;
            clip(noiseSample - threshold);
            
            return color;
         }


this is the frag function for a dissolve shader with a non-deterministic time to completion. why?
iambic wrote:no don't make those posts
User avatar
internetfriend
pubg survivalist
 
Posts: 27274
Joined: Tue Aug 27, 2013 3:47 pm
Location: jikan desu!

Postby internetfriend » Wed Jan 31, 2018 4:02 pm

honestly, i'm over it
iambic wrote:no don't make those posts
User avatar
internetfriend
pubg survivalist
 
Posts: 27274
Joined: Tue Aug 27, 2013 3:47 pm
Location: jikan desu!

Postby jca » Wed Jan 31, 2018 4:41 pm

milano boy wrote:i'm teaching myself elixir now and pattern matching is a wonderful pleasure i've come across. elixir in general just makes me happy :^)

ya pattern matching rules
User avatar
jca
 
Posts: 2173
Joined: Tue Aug 27, 2013 2:22 pm

Postby bear » Thu Feb 01, 2018 11:12 pm

i exist to please my customers!
hpn.center - the #1 source for all your boarding needs
User avatar
bear
good bear
 
Posts: 3806
Joined: Sat Dec 19, 2009 12:32 am

Postby bear » Thu Feb 01, 2018 11:13 pm

simply love to create new features that save people time
hpn.center - the #1 source for all your boarding needs
User avatar
bear
good bear
 
Posts: 3806
Joined: Sat Dec 19, 2009 12:32 am

Postby hopped » Tue Feb 06, 2018 12:12 pm

anybody wanna play 'optimize this query that is taking way too long to run'

i have 3 tables: recruited (~100rows), lines (440MM rows), claims (200MM rows)

each claim has multiple lines tied to its id but only one claimant

i want to count claimants for which a recruited id performed a specific kind of line


right now it's

Code: Select all

create table claimlines as select  a.claimantid, a.claimid, a.date, b.performingid, b.type from claims a left join (select claimid, performingid, type from lines where type in ('xxxx', 'xxxx'...) and performingid in (select performingid from recruited)) b on a.claimid=b.claimid;

create table claimcounts as select distinct performingid, count(distinct claimant) where &begdate <= date <= &enddate from claimlines group by performingid;



am i dumb as shit or what help me my family is dying
User avatar
hopped
 
Posts: 1646
Joined: Mon Dec 14, 2009 5:05 pm

Postby milano boy » Tue Feb 06, 2018 12:15 pm

can you give headers of the 3 tables and some dummy data?
User avatar
milano boy
 
Posts: 5023
Joined: Tue Sep 16, 2014 1:58 pm

Postby hopped » Tue Feb 06, 2018 12:23 pm

Code: Select all
lines:

claimid  type  performingid
123        g001  1234567
123        g002  1234567
123        g004  1234568
124        g001  1234567
124        b045  1234569
125        g001  1234570


claims:

claimantid     claimid   date
AB45645         123         01jan2018
AB45645         124         01aug2017
AB31764         125         01dec2015

recruitd

performingid name

1234567 mr. x
1234568 ms. y

User avatar
hopped
 
Posts: 1646
Joined: Mon Dec 14, 2009 5:05 pm

Postby milano boy » Tue Feb 06, 2018 12:46 pm

i dunno whatever this dialect is so i'm confused by the ampersands and the where coming before the from clause here:

Code: Select all
create table claimcounts as select distinct performingid, count(distinct claimant) where &begdate <= date <= &enddate from claimlines group by performingid;


anywho i think a lot of your slowness is coming from the multiple nested selects in your left join. you can try something like this.

Code: Select all
 WITH lines_data AS
(
       SELECT claimid,
              performingid,
              type
       FROM   lines
       WHERE  type IN ('xxxx',
                       'xxxx')
       AND    performingid IN
              (
                     SELECT performingid
                     FROM   recruited) ),
claim lines AS
(
          SELECT    claims.claimantid,
                    claims.claimid,
                    claims.date,
                    lines_data.performingid,
                    lines_data.type
          FROM      claims
          LEFT JOIN lines_data claims.claimid = lines_data.claimid)
 
SELECT DISTINCT performingid,
                COUNT(DISTINCT claimant)
WHERE           &begdate <= date <= &enddate
FROM            claimlines
GROUP BY        performingid;
User avatar
milano boy
 
Posts: 5023
Joined: Tue Sep 16, 2014 1:58 pm

Postby hopped » Tue Feb 06, 2018 12:59 pm

lol oops that was just from copy pasting around on my phone, the where should absolutely be after the from and the &s are macro calls to sas dates so could be replaced with 01jan2015 and 01jan2018 (there are just a bunch of them)

i'll test reducing the nested calls and see if it helps but i think the problem is probably just sas' sql implementation being t r a s h

thanks!!
User avatar
hopped
 
Posts: 1646
Joined: Mon Dec 14, 2009 5:05 pm

Postby theendoftheworld666@aol.com » Wed Feb 07, 2018 12:34 am

bongo wrote:FOR LOOP
FOR EVER, AGO


i started a bootcamp and now think about this post like 5 times a day
User avatar
theendoftheworld666@aol.com
sissy puppy
 
Posts: 3154
Joined: Thu Feb 11, 2016 4:38 pm

Postby pantsoclock » Wed Feb 07, 2018 2:48 am

hopped wrote:anybody wanna play 'optimize this query that is taking way too long to run'

i have 3 tables: recruited (~100rows), lines (440MM rows), claims (200MM rows)

each claim has multiple lines tied to its id but only one claimant

i want to count claimants for which a recruited id performed a specific kind of line


right now it's

Code: Select all

create table claimlines as select  a.claimantid, a.claimid, a.date, b.performingid, b.type from claims a left join (select claimid, performingid, type from lines where type in ('xxxx', 'xxxx'...) and performingid in (select performingid from recruited)) b on a.claimid=b.claimid;

create table claimcounts as select distinct performingid, count(distinct claimant) where &begdate <= date <= &enddate from claimlines group by performingid;



am i dumb as shit or what help me my family is dying


This seems like a situation where lines is foreign keyed to claims and recruited.

The dead simplest thing then should be
Code: Select all
SELECT l.performingid, count(distinct c.claimantid)
FROM lines l JOIN claims c ON l.claimid = c.claimid -- left joining here is only helpful if you're looking to collect a count for claims that map to a null performingid
JOIN recruited r ON l.performingid = r.performingid -- doing an inner join here is equivalent to filtering down to lines where performingid is in the recruited table. An alternative, which should be equivalent for most optimizers, is to have a where exists (select 1 from recruited r where r.performingid = l.performing)
WHERE l.type IN ('xxxx','yyyy',...)
AND c.date BETWEEN &begdate and &enddate
GROUP BY l.performingid;


If that's running slowly for you, sure your tables are big, but the next question is what indexes are present on the tables. Since claimid and performingid are foreign keys on the lines table, I would expect indexes on them. I would expect an index on the type field to help with that filter as well.
A range filter like "c.date between" is going to be slow without an index on date on the claims table.
At 100 lines recruited is small enough that indexes should not matter. The optimizer will always choose to full scan that table, and it will always live entirely in memory.

Postgres, MySQL, and Oracle all have EXPLAIN commands that can be used to examine what query plan the database is using and how much individual components are costing. That should tell you where it's spending its time and what indexes would help most.
I pay tax to help pay for things like police..fire..parks..but it goes to Ferguson like people and foreigners who are scamming our stupid government that is full of pasta thieves like this guy
User avatar
pantsoclock
 
Posts: 4887
Joined: Mon Dec 14, 2009 4:18 pm

Postby hopped » Wed Feb 07, 2018 1:54 pm

damn pants that's elegant for the request, thanks. there's an issue where one claimant can have multiple providerids and i have to roll up to state level so that's a separate issue. but i am terrible at foreign key joins like that and that's a helpful way of thinking about it.

i figured out the real big problem is that it's unix native encoding so the interpreter is the big slowdown. also prevents me from making any index in sas, so i'm gonna see about getting one for claimid and performingid made on the server before we get the exported tables every quarter. otherwise might just add a process of migrating and adding the indices as soon as the new table drops. sadly sas proc sql doesnt have a good EXPLAIN functionality

anyways still taking about an hour but that's better than 5.
User avatar
hopped
 
Posts: 1646
Joined: Mon Dec 14, 2009 5:05 pm

Postby pantsoclock » Wed Feb 07, 2018 11:34 pm

ah, dang, it's annoying when the layers in the middle of data access are slowing you down.
I had a similar thing recently where our data replicator was using number(19,0) types in the destination for integer values, so when I went to read those values in a python script, the driver was serializing them to Decimal types when they could have just been primitive ints, and that serialization was where most of the time was going.
Literally just switching the columns to bigint in postgres dropped read times more than 10x.
I pay tax to help pay for things like police..fire..parks..but it goes to Ferguson like people and foreigners who are scamming our stupid government that is full of pasta thieves like this guy
User avatar
pantsoclock
 
Posts: 4887
Joined: Mon Dec 14, 2009 4:18 pm

Postby ecto » Tue Mar 06, 2018 3:36 pm

Image

ok this feels nice
I'm 15 and want to be a part of this friend now. What can I do? (self.LazerBlade)
submitted 3 minutes ago by LazerBlade_Teen
User avatar
ecto
 
Posts: 27847
Joined: Mon Dec 14, 2009 2:53 pm

Postby milano boy » Tue Mar 06, 2018 3:42 pm

Image
User avatar
milano boy
 
Posts: 5023
Joined: Tue Sep 16, 2014 1:58 pm

Postby Classic Dog Avatar » Tue Mar 06, 2018 3:58 pm

ecto wrote:Image

ok this feels nice


Sorry you had to add anything
User avatar
Classic Dog Avatar
ride.
 
Posts: 10203
Joined: Mon Dec 14, 2009 2:48 pm

Postby ecto » Tue Mar 06, 2018 4:04 pm

that's the worst part- it was updating documentation
I'm 15 and want to be a part of this friend now. What can I do? (self.LazerBlade)
submitted 3 minutes ago by LazerBlade_Teen
User avatar
ecto
 
Posts: 27847
Joined: Mon Dec 14, 2009 2:53 pm

Postby ecto » Tue Mar 06, 2018 4:04 pm

and like a 2 line refactor but whatever, its fine! 600 lines, gone!
I'm 15 and want to be a part of this friend now. What can I do? (self.LazerBlade)
submitted 3 minutes ago by LazerBlade_Teen
User avatar
ecto
 
Posts: 27847
Joined: Mon Dec 14, 2009 2:53 pm

Postby jca » Tue Mar 06, 2018 4:53 pm

thats real nice. you put "we do not use this any more" on 7 separate lines? :P
User avatar
jca
 
Posts: 2173
Joined: Tue Aug 27, 2013 2:22 pm

Postby internetfriend » Tue Mar 06, 2018 4:54 pm

Deprecated
iambic wrote:no don't make those posts
User avatar
internetfriend
pubg survivalist
 
Posts: 27274
Joined: Tue Aug 27, 2013 3:47 pm
Location: jikan desu!

Postby bongo » Tue Mar 06, 2018 5:01 pm

theendoftheworld666@aol.com wrote:
bongo wrote:FOR LOOP
FOR EVER, AGO


i started a bootcamp and now think about this post like 5 times a day


hows the camp going
yeaaaaaaaaaaaa american nostalgia love it suburban living civilized families this could be my life
User avatar
bongo
man in hammock
 
Posts: 68799
Joined: Wed Nov 16, 2011 10:32 pm
Location: Malaise (Live Acoustic)

PreviousNext

Return to Mamma Mia... Here We Go Again....

Who is online

Users browsing this forum: Amblin, anephric, ASH NERVE, Bartatua, baseball, Beautiful Jugdish, blab, boatwave, Brain Stew, Brevity, brittle, bro tones, chumpchange, Clive, darger, digital friday, dragon jeans, dreamshake, drudge, Enemy Ace, Eyeball Kid, Ferrous Bueller, Franco, Future, galactagogue, gazedo, Gene Parmesan, Google [Bot], Google Adsense [Bot], Google Feedfetcher, guidance, guy forget, hadlex, Hal Jordan, harperesque, Hideaway Lights, hit record, hoopdog, Hugh, hyperbole man, Ides of Smarch, Itsmecraig, iwillneverpost, jack, jalapeño ranch, Jarl Skeletal, Jerk., jewels, joe, Julius Sumner Miller, kirito, landspeedrecord, launchpad, lights, loaf angel, Lucky, mcwop23, Mechanical bird, Mesh, minerals, mini, Mr Spaceship, NegativeCapability, No Good Advice, normal finkenstein, number none, odilon redon, Oh! Sweet Nuthin', OKterrific, pissydan, Prof. Horatio Hufnagel, PublixUltimate, Rainbow Battle Kid, RedHots!, Render, Repo, SabreFancS, shirts optional, Shotfrog, southpaw, Spooky Jim, springheeljack, terminus, tex porneau, tgk, tournicotis, transitive, trigross, TwoInchesOfTrouble, tyler_c, waldojeffers1, wario lopez