Register a SA Forums Account here!
JOINING THE SA FORUMS WILL REMOVE THIS BIG AD, THE ANNOYING UNDERLINED ADS, AND STUPID INTERSTITIAL ADS!!!

You can: log in, read the tech support FAQ, or request your lost password. This dumb message (and those ads) will appear on every screen until you register! Get rid of this crap by registering your own SA Forums Account and joining roughly 150,000 Goons, for the one-time price of $9.95! We charge money because it costs us money per month for bills, and since we don't believe in showing ads to our users, we try to make the money back through forum registrations.
 
  • Locked thread
Jabor
Jul 16, 2010

#1 Loser at SpaceChem

FamDav posted:

Collections.singleton(T t) will infer T based on the return value of the method hth

edit: actually i'm fairly confident that java inference was improved in jdk8 to the point where it would infer it based on the parameter to singleton itself. i know they did a ton of work to improve type inference to make lambdas not a huge shitshow

the point at issue is that the type of the collection is deliberately different from the parameter type (presumably to conform to some imperfectly-defined interface)

Adbot
ADBOT LOVES YOU

JewKiller 3000
Nov 28, 2006

by Lowtax
the java lambda types actually make a lot of sense, you just have to *gasp* actually read the types. also the documentation. two things that programmers never want to do

CPColin
Sep 9, 2003

Big ol' smile.

cis autodrag posted:

in that example you don't want t though, you want s. it's returning the foo wrapped in a bar inside​ a bar collection that has one member.

Can you do:

code:
bar thing = new foo();
return Collections.singleton(thing);
or make the method return Collection<? extends bar> or something? Parameterizing method calls seems gross.

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

CPColin posted:

Can you do:

code:
bar thing = new foo();
return Collections.singleton(thing);
or make the method return Collection<? extends bar> or something? Parameterizing method calls seems gross.

jesus, was it not clear i wrote it that way just to show how the <> syntax works? the foo is a private member of a class that is used as a foo everywhere else but needs to be given to some other thing as a bar.

FamDav
Mar 29, 2008

cis autodrag posted:

in that example you don't want t though, you want s. it's returning the foo wrapped in a bar inside​ a bar collection that has one member.

You still shouldn't need to specify the type parameter explicitly, see https://ideone.com/DBO6ee

code:
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Collections.*;
 
class Foo {
	public String get() {
		return "hello world!";
	}
}
 
class Bar extends Foo {
	@Override
	public String get() {
		return "goodbye world!";
	}
 
}
 
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		for (Foo s : example()) {
			System.out.println(s.get());
		}
	}
 
	private static Set<Foo> example() {
		final Bar b = new Bar();
		return Collections.singleton(b);
	}
 
}

CPColin
Sep 9, 2003

Big ol' smile.

cis autodrag posted:

jesus, was it not clear i wrote it that way just to show how the <> syntax works? the foo is a private member of a class that is used as a foo everywhere else but needs to be given to some other thing as a bar.

No, it wasn't clear. And you didn't answer my question. v:shobon:v

The MUMPSorceress
Jan 6, 2012


^SHTPSTS

Gary’s Answer

FamDav posted:

You still shouldn't need to specify the type parameter explicitly, see https://ideone.com/DBO6ee

code:
import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Collections.*;
 
class Foo {
	public String get() {
		return "hello world!";
	}
}
 
class Bar extends Foo {
	@Override
	public String get() {
		return "goodbye world!";
	}
 
}
 
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		for (Foo s : example()) {
			System.out.println(s.get());
		}
	}
 
	private static Set<Foo> example() {
		final Bar b = new Bar();
		return Collections.singleton(b);
	}
 
}

i mean i guess but thats not the way the framework works and i thought the <> thing was neat. way to be a spoilsport.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
I hit people at work who do:

return (List<Foo>) Collections.EMPTY_LIST;

instead of

return Collections.emptyList();

ComradeCosmobot
Dec 4, 2004

USPOL July

FamDav posted:

You still shouldn't need to specify the type parameter explicitly, see https://ideone.com/DBO6ee

code:

import java.util.*;
import java.lang.*;
import java.io.*;
import java.util.Collections.*;
 
class Foo {
	public String get() {
		return "hello world!";
	}
}
 
class Bar extends Foo {
	@Override
	public String get() {
		return "goodbye world!";
	}
 
}
 
/* Name of the class has to be "Main" only if the class is public. */
class Ideone
{
	public static void main (String[] args) throws java.lang.Exception
	{
		for (Foo s : example()) {
			System.out.println(s.get());
		}
	}
 
	private static Set<Foo> example() {
		final Bar b = new Bar();
		return Collections.singleton(b);
	}
 
}

I want to say this raises a compiler warning if Bar is an explicitly typed generic (e.g. Bar<Baz>) because of type erasure poo poo, but it might have been fixed as part of Java 8's type inference rules.

cinci zoo sniper
Mar 15, 2013




i found a solution to a compliated mongodb query

1) pull raw mongo
2) janitor response in R

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

cinci zoo sniper posted:

i found a solution to a compliated mongodb query

1) get everything out of mongo asap

ftfy

Powerful Two-Hander
Mar 10, 2004

Mods please change my name to "Tooter Skeleton" TIA.


lmao a system at work let's users define filters by letting them type in arbitrary SQL and I bet it's not remotely sanitised before insertion

hope they never need to filter on 'drop tables

cinci zoo sniper
Mar 15, 2013





yeh that's the longcon, but i need to do work on mongo now and getting everything out takes time

HoboMan
Nov 4, 2010

C# code:
int priority;
if (!int.TryParse(fPriority.SelectedValue, out priority))
{ // default to the appropriate standard priority if it fails to parse
    priority = end.Date != start.Date ? 8 : 7; // ~magic numbers~
}

suffix
Jul 27, 2013

Wheeee!

MononcQc posted:

has mysql stopped silently truncating text that did not fit the input type?

tbh, yes, strict mode is the default from mysql 5.7, and in 8 they will even default to their stupidly named utf8mb4

but i would still default to postgresql unless i had a really good reason not to
(the reason is usually called "not rewriting all the code")

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.
mysql drools postgres rules

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
today i am going to try and convince my company to move our data to postgres from mongo i hope this works

cinci zoo sniper
Mar 15, 2013




MALE SHOEGAZE posted:

today i am going to try and convince my company to move our data to postgres from mongo i hope this works

good luck

ultravoices
May 10, 2004

You are about to embark on a great journey. Are you ready, my friend?

MALE SHOEGAZE posted:

today i am going to try and convince my company to move our data to postgres from mongo i hope this works

mongo sounds like an ethnic slur from a ya dystopia

gonadic io
Feb 16, 2011

>>=

ultravoices posted:

mongo sounds like an ethnic slur from current day England

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

MALE SHOEGAZE posted:

today i am going to try and convince my company to move our data to postgres from mongo i hope this works

godspeed

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat
some mongo guy asked me how to do sharding on postgres like mongo but the biggest dataset he has ever dealt with was less that 250mb.

"how will we scale if you can't shard?"

HoboMan
Nov 4, 2010

JavaScript code:
calendar.set_rangeMaxDate([2199, 12, 31]); // TODO: change this date back further in 2198

akadajet
Sep 14, 2003

ultravoices posted:

mongo sounds like an ethnic slur from a ya dystopia

it's a reference to a racist film from the 70s

Xarn
Jun 26, 2015
ctps:

git diff --stats posted:

48 files changed, 2733 insertions(+), 2625 deletions(-)

Time to make a commit I guess :v:

Sapozhnik
Jan 2, 2005

Nap Ghost
keep a big "wip" commit on the tip of your topic branch, reset HEAD^ and break chunks out of it as the need arises.

don't use stash. definitely don't get to the point where you have a stash stack.

anthonypants
May 6, 2007

by Nyc_Tattoo
Dinosaur Gum

akadajet posted:

it's a reference to a racist film from the 70s
blazing saddles owns though

Xarn
Jun 26, 2015

Sapozhnik posted:

keep a big "wip" commit on the tip of your topic branch, reset HEAD^ and break chunks out of it as the need arises.

don't use stash. definitely don't get to the point where you have a stash stack.

Agreed, I keep my stashing to when I need to change branches/synchronize with upstream.

Also, this is still going to be one big commit, but I cleaned up what gets committed a bit:

new git diff posted:

61 files changed, 319 insertions(+), 182 deletions(-)

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

MALE SHOEGAZE posted:

today i am going to try and convince my company to move our data to postgres from mongo i hope this works

oh man I hope this goes well for you

CRIP EATIN BREAD posted:

"how will we scale if you can't shart?"

JawnV6
Jul 4, 2004

So hot ...

CRIP EATIN BREAD posted:

some mongo guy asked me how to do sharding on postgres like mongo but the biggest dataset he has ever dealt with was less that 250mb.

"how will we scale if you can't shard?"

would a second DIMM count as a shard

Shaggar
Apr 26, 2006
I'm using dynamodb for simple storage of some basic data and holy poo poo NoSQL is the worst. how can anyone deal with this garbage?

Finster Dexter
Oct 20, 2014

Beyond is Finster's mad vision of Earth transformed.

Shaggar posted:

I'm using dynamodb for simple storage of some basic data and holy poo poo NoSQL is the worst. how can anyone deal with this garbage?

badly and/or with alcohol

cinci zoo sniper
Mar 15, 2013




https://www.jetbrains.com/rider/ jetbrains net ide is here

Arcsech
Aug 5, 2008

Shaggar posted:

I'm using dynamodb for simple storage of some basic data and holy poo poo NoSQL is the worst. how can anyone deal with this garbage?

crying

Luigi Thirty
Apr 30, 2006

Emergency confection port.

i've got a weird problem here with C

the reference to the jaguar's vram is
code:
extern uint8_t *jag_vidmem;
the equates file defines the blitter's memory window pointer register as

code:
typedef volatile uint32_t	vuint32_t;

#define A1_BASE 	(vuint32_t *)(BASE+0x2200)	/* A1 Base Address */
I have this macro I'm using for assigning longs to 32-bit registers

code:
#define MMIO32(x)   (*(vuint32_t *)(x))
but I can't seem to get it to cooperate and write the address to the vuint32_t* register? i tried casting jag_vidmem to a void* and vuint32_t*, my compiler just says invalid types for assignment?

code:
	MMIO32(A1_BASE)		= (void *)jag_vidmem;
	MMIO32(A1_PIXEL)	= (0 << 16 | 0);
	//etc etc...

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

Shaggar posted:

I'm using dynamodb for simple storage of some basic data and holy poo poo NoSQL is the worst. how can anyone deal with this garbage?

i only use it for very basic key/value store with expiration. it's not bad then.

CRIP EATIN BREAD
Jun 24, 2002

Hey stop worrying bout my acting bitch, and worry about your WACK ass music. In the mean time... Eat a hot bowl of Dicks! Ice T



Soiled Meat

2017.1 doesnt even support .net core 2.0, gotta get the EAP for it

jetbrains still owns, tho

FamDav
Mar 29, 2008

Shaggar posted:

I'm using dynamodb for simple storage of some basic data and holy poo poo NoSQL is the worst. how can anyone deal with this garbage?

very well if it suits your needs. do you need multi-key transactions, and if so why aren't you using something like aurora?

NihilCredo
Jun 6, 2011

iram omni possibili modo preme:
plus una illa te diffamabit, quam multæ virtutes commendabunt

my idea of "simple storage of some basic data [that isn't worth the effort of a sqlite db]" is a folder full of objects serialized to individual files. the api is really good

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006

FamDav posted:

very well if it suits your needs. do you need multi-key transactions, and if so why aren't you using something like aurora?

I just need something to store like 5 columns worth of data in a reliable, shared way and I didn't want to spin up a sql server for it.

  • Locked thread