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.
 
  • Post
  • Reply
coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Bloody posted:

lol nvm figured it out

new Thread(() => { FlingThePoo(butts, yourMom); viewModel.status = "Done"; }).Start();

boom boom

use

new Task(() => { FlingThePoo(butts, yourMom); viewModel.status = "Done"; }).Start();

or (preferentially)

Task.Factory.StartNew(() => { FlingThePoo(butts, yourMom); viewModel.status = "Done"; })

tasks draw from a thread pool so a) you can amortize the cost of instantiating a thread and b) you won't suffer thread starvation if you start spawning them left right and center

also whenever you modify a thing asynchronously be very careful. if the modification involves a single write that's the size of a native pointer or smaller (like setting viewModel.status to point to a different string), you're safe. if you want to do more writes or larger writes, it's time to do some reading on concurrency.

Adbot
ADBOT LOVES YOU

Subjunctive
Sep 12, 2006

✨sparkle and shine✨

coffeetable posted:

also whenever you modify a thing asynchronously be very careful. if the modification involves a single write that's the size of a native pointer or smaller (like setting viewModel.status to point to a different string), you're safe. if you want to do more writes or larger writes, it's time to do some reading on concurrency.

do the reading anyway. unless the CLR provides stronger ordering guarantees than the underlying hardware, writes and reads may not be visible to each other the way you expect.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Subjunctive posted:

do the reading anyway. unless the CLR provides stronger ordering guarantees than the underlying hardware, writes and reads may not be visible to each other the way you expect.
could have sworn id read somewhere that .NET had just that kind of stronger memory model, but googling around it looks like i imagined it

Shaggar
Apr 26, 2006
as long as the writes occur in order inside the task they should be fine, right?

or better yet don't design a viewmodel that requires things to be updated in a certain order.

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Shaggar posted:

as long as the writes occur in order inside the task they should be fine, right?
in java (which i know more about wrt this poo poo) the guarantee is "within-thread as-if-serial" ie reordering optimizations might well be performed, but only those optimizations that you can't detect from within a single thread. other threads though may well see things happen in a different order from how they're presented in the code

i could've sworn the CLR offers stronger guarantees than that but i can't find where i read it. the closest is a SO post that says the CLR doesn't do write reording on most architectures, but it's not written into the spec

rjmccall
Sep 7, 2007

no worries friend
Fun Shoe
if the CLR made that guarantee then it would have to use green threads on any architecture except x86, because otherwise every heap load/store would have to do a read/write barrier respectively

ARM makes a really neat memory ordering guarantee about address dependence that enables a lot of lock-free algorithms to avoid barriers on the read side, but it is not at all sufficient to emulate x86-style guarantees about store reordering

Bloody
Mar 3, 2013

coffeetable posted:

use

new Task(() => { FlingThePoo(butts, yourMom); viewModel.status = "Done"; }).Start();

or (preferentially)

Task.Factory.StartNew(() => { FlingThePoo(butts, yourMom); viewModel.status = "Done"; })

tasks draw from a thread pool so a) you can amortize the cost of instantiating a thread and b) you won't suffer thread starvation if you start spawning them left right and center

also whenever you modify a thing asynchronously be very careful. if the modification involves a single write that's the size of a native pointer or smaller (like setting viewModel.status to point to a different string), you're safe. if you want to do more writes or larger writes, it's time to do some reading on concurrency.

ya i know ive done real parallel poo poo in c++ before (:haw:) and if theres more than one copy of this task running at any time i have bigger problems :v:

my real issue was remembering how the gently caress to write the delegate correctly and it took me an embarrassingly long time + lot of googlin

Bloody
Mar 3, 2013

you know how prototype code doesnt exist and its always in production so do it right the first time?

im utterly disregarding that and its a near certainty that it will screw me over in like 3 months oh well :justpost:

Soricidus
Oct 21, 2010
freedom-hating statist shill

Bloody posted:

you know how prototype code doesnt exist and its always in production so do it right the first time?
hey now that's not always true. my team just finished writing a production version of a prototype I whipped up a few years ago

of course it took a couple of years of the prototype being slow and inadequate and impossible to fix for management to admit something needed to be done, but it happened!

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY
yeah i started rewriting the prototype id built over the last two months for production this week

but then again our "salesman" deliberately underpromised by a huge margin, so there's two impossibilities for you

Workaday Wizard
Oct 23, 2009

by Pragmatica
any scala nerds here?

gimme a jdbc wrapper that
1) makes querying simple (i should just give it some SQL and it should just do the thing and give me result without billion lines of boilerplate).
i dont want automagically created queries, and i don't want to create special classes or whatever for the sake of querying.
2) is updated this year (unlike this https://github.com/jpersson/prequel/)

i know i can use straight jdbc but i want someone else to have already written the irrelevant crap i dont want to write

Brain Candy
May 18, 2006

Bloody posted:

ya i know ive done real parallel poo poo in c++ before (:haw:) and if theres more than one copy of this task running at any time i have bigger problems :v:

my real issue was remembering how the gently caress to write the delegate correctly and it took me an embarrassingly long time + lot of googlin

and then the user changes the view model while your task is running

then yo haveu twproblemso

Shaggar
Apr 26, 2006

Brain Candy posted:

and then the user changes the view model while your task is running

then yo haveu twproblemso

thats why you disable inputs that can impact the parts of the viewmodel your long running task is working on.



Shinku ABOOKEN posted:

any scala nerds here?

gimme a jdbc wrapper that
1) makes querying simple (i should just give it some SQL and it should just do the thing and give me result without billion lines of boilerplate).
i dont want automagically created queries, and i don't want to create special classes or whatever for the sake of querying.
2) is updated this year (unlike this https://github.com/jpersson/prequel/)

i know i can use straight jdbc but i want someone else to have already written the irrelevant crap i dont want to write

you might as well use straight jdbc cause its just as stupid as writing a pointless "wrapper" around it.

the talent deficit
Dec 20, 2003

self-deprecation is a very british trait, and problems can arise when the british attempt to do so with a foreign culture





what's the best c++ ide? don't say visual studio

coffeetable
Feb 5, 2006

TELL ME AGAIN HOW GREAT BRITAIN WOULD BE IF IT WAS RULED BY THE MERCILESS JACKBOOT OF PRINCE CHARLES

YES I DO TALK TO PLANTS ACTUALLY

Shaggar posted:

thats why you disable inputs that can impact the parts of the viewmodel your long running task is working on.

this is where reactiveui really shines

quote:

In GitHub for Windows, the Sync Command is an invocation of the Pull Command followed by the Push Command - how can I create a Command whose CanExecute turns off until the Pull then the Push completes?
code:
var canSync = Observable.CombineLatest(  
    Push.CanExecuteObservable, Pull.CanExecuteObservable,
    (pl,pu) => pl && pu);

Sync = ReactiveCommand.CreateAsyncTask(canSync, async _ => {  
    await Pull.ExecuteAsync();
    await Push.ExecuteAsync();
});
http://log.paulbetts.org/whats-new-in-reactiveui-6-reactivecommandt/

ahmeni
May 1, 2005

It's one continuous form where hardware and software function in perfect unison, creating a new generation of iPhone that's better by any measure.
Grimey Drawer

the talent deficit posted:

what's the best c++ ide? don't say visual studio

the jetbrains c++ ide isnt out yet so probably vim

pseudopresence
Mar 3, 2005

I want to get online...
I need a computer!

the talent deficit posted:

what's the best c++ ide? don't say visual studio

Netbeans

Not even kidding

Shaggar
Apr 26, 2006

coffeetable posted:

this is where reactiveui really shines

code:
var canSync = Observable.CombineLatest(  
    Push.CanExecuteObservable, Pull.CanExecuteObservable,
    (pl,pu) => pl && pu);

Sync = ReactiveCommand.CreateAsyncTask(canSync, async _ => {  
    await Pull.ExecuteAsync();
    await Push.ExecuteAsync();
});
http://log.paulbetts.org/whats-new-in-reactiveui-6-reactivecommandt/

that is very pleasant.

HORATIO HORNBLOWER
Sep 21, 2002

no ambition,
no talent,
no chance
netbeans loving blows

Workaday Wizard
Oct 23, 2009

by Pragmatica
i am trying scala and i am stuck

can someone help me pls :sweatdrop:

Shinku ABOOKEN posted:

What's so wrong with this code that it actually crashes the compiler?
Java code:
package crashTheSystem
import scala.slick.driver.PostgresDriver.simple._

object crashTheSystem {

  def main(args: Array[String]): Unit = {
      Database.forURL("jdbc:postgresql://localhost/someDB",
        driver = "org.postgresql.Driver",
        user = "someUser",
        password = "somePassword") withSession {
        implicit session => {
          ()
        }
      }
    println("program terminating normally...");
  }

}
Scala version:
"Welcome to Scala version 2.11.2 (Java HotSpot(TM) 64-Bit Server VM, Java 1.8.0_11)"

Scala IDE version:
"Scala IDE build of Eclipse SDK
Build id: 3.0.4-2.11-20140723-2253-Typesafe"

Slick version: 2.1.0 for Scala 2.11

crazysim
May 23, 2004
I AM SOOOOO GAY
i don't have any experience but i remember reading that slick connects to the database when things compiling against it get compiled.


see if plain jane jdbc works.

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

crazysim posted:

i don't have any experience but i remember reading that slick connects to the database when things compiling against it get compiled.


see if plain jane jdbc works.

what no way

Workaday Wizard
Oct 23, 2009

by Pragmatica
plain jane jdbc works

crazysim posted:

i don't have any experience but i remember reading that slick connects to the database when things compiling against it get compiled.

a whaaaaaaaaaaaaaaaaaaaaaaaaat???????????

Notorious b.s.d.
Jan 25, 2003

by Reene
slick is alpha quality software at best

Try squeryl or hibernate

Workaday Wizard
Oct 23, 2009

by Pragmatica

Notorious b.s.d. posted:

slick is alpha quality software at best

Try squeryl or hibernate

i thought the typesafe company was built on scala therefore there product would be the best available

gonna try squeryl next

crazysim
May 23, 2004
I AM SOOOOO GAY

Shinku ABOOKEN posted:

plain jane jdbc works


a whaaaaaaaaaaaaaaaaaaaaaaaaat???????????

idk. im sure there's more documentation elsewhere about how this is invoked and used but i don't know where to find it.

https://github.com/slick/slick/issues/347

Sweeper
Nov 29, 2007
The Joe Buck of Posting
Dinosaur Gum

crazysim posted:

idk. im sure there's more documentation elsewhere about how this is invoked and used but i don't know where to find it.

https://github.com/slick/slick/issues/347

why??

crazysim
May 23, 2004
I AM SOOOOO GAY

idk. my best guess is that it uses info from a live DB connection to produce more strongly typed things rather than building up/compiling database info/queries at runtime. still don't know where in the documentation it talks about this though.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

ahmeni posted:

the jetbrains c++ ide isnt out yet so probably vim

i used jetbrains rubymine for a week and it made me hate programming so much that i got nothing done and suddenly started to think i couldnt do my job until i stopped using it and everything got better

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

your problem was using ruby, not the ide.

brap
Aug 23, 2004

Grimey Drawer
if hibernate is much like nhibernate, stay far away.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

fart simpson posted:

your problem was using ruby, not the ide.

if you'd read my post you would know that i still continued to use ruby after abandoning rubymine so that eliminates that theory.

i considered it at the time. but no, the problem was rubymine.

did i mention it has a button you have to press to make the garbage collector go?

crazysim
May 23, 2004
I AM SOOOOO GAY

MALE SHOEGAZE posted:

if you'd read my post you would know that i still continued to use ruby after abandoning rubymine so that eliminates that theory.

i considered it at the time. but no, the problem was rubymine.

did i mention it has a button you have to press to make the garbage collector go?

if it makes anyone feel any better, that button is no longer present by default.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

crazysim posted:

if it makes anyone feel any better, that button is no longer present by default.

but it should be, because it was basically unusable until i turned it on

Blinkz0rz
May 27, 2001

MY CONTEMPT FOR MY OWN EMPLOYEES IS ONLY MATCHED BY MY LOVE FOR TOM BRADY'S SWEATY MAGA BALLS

MALE SHOEGAZE posted:

but it should be, because it was basically unusable until i turned it on

fyi if you have antivirus running it will scan the contents of every jar file that jetbrains' software tries to load

i use pycharm occasionally and it was garbage until i set an exception for the jetbrains folder and now it works splendidly

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Blinkz0rz posted:

fyi if you have antivirus running it will scan the contents of every jar file that jetbrains' software tries to load

i use pycharm occasionally and it was garbage until i set an exception for the jetbrains folder and now it works splendidly

On a Mac. Unless rubymime has some sort of built in Antivirus which would not surprise. me.

ConanTheLibrarian
Aug 13, 2004


dis buch is late
Fallen Rib
just remembered the nock/hoon guy invented a bunch of single syllable names for punctuation including ace for space and lus for +

b0lt
Apr 29, 2005

ConanTheLibrarian posted:

just remembered the nock/hoon guy invented a bunch of single syllable names for punctuation including ace for space and lus for +

https://www.youtube.com/watch?v=8SkdfdXWYaI&t=684s

fart simpson
Jul 2, 2005

DEATH TO AMERICA
:xickos:

MALE SHOEGAZE posted:

if you'd read my post you would know that i still continued to use ruby after abandoning rubymine so that eliminates that theory.

i considered it at the time. but no, the problem was rubymine.

did i mention it has a button you have to press to make the garbage collector go?

i read your post but ruby's still bad

Adbot
ADBOT LOVES YOU

hackbunny
Jul 22, 2007

I haven't been on SA for years but the person who gave me my previous av as a joke felt guilty for doing so and decided to get me a non-shitty av
I'm going to be immortalized as a plush rabbit:

quote:

Those of you that were with the project when KJK was around might recall him and I creating something of an injoke wherein our secondary aliases, Hackbunny and ZWabbit, were in fact AIs. I expanded the idea a bit further in creating a kind of alternative story for the project wherein ReactOS was trying to create an AI, not an operating system. A few of you have seen various drafts of that story, but I never really finished writing them and let it go by the wayside after KJK left. The Hackbunny plush (it's going into production by the way, the person I've contracted has received initial down payment and will be sending me a picture of the prototype before doing the remaining ones) was something of a throwback to those stories, except that I'm pretty sure the majority of the present developers either don't know about those stories or have long forgotten them, nevermind the fact that the community at large never really picked up on the injoke. To introduce them, and potentially set them up as an "official" mascot fallback to beat off further attempts by the community to impose one on us, I thought we probably need to reintroduce the bunnies and their backstory in some way, shape, or form.

To this end, I've put together a short story, ~4600 words and counting at this point, that sets the tone for the alternate project's universe. It revolves around how "we" discovered the hackbunnies were self-aware AIs, along with the project's adoption of a plan they put together to ensure their long term survival. The draft is still very rough, I'm likely to need to add further exposition to make clear the fact that most of this is happening in a virtual reality environment, and maybe add some more padding in between the dialogue, but I'd like to at least get a yay or nay on my proposed intro to the bunnies and my characterization of the developers.

sorry for invading the thread but wtf

PS: the plushies are terribad:

quote:

Here's the prototype that the others will be based off of. The nose will see some adjustment but beyond that this will be what the rest look like.


  • 1
  • 2
  • 3
  • 4
  • 5
  • Post
  • Reply