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
DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
replace catch with tweet imo

Adbot
ADBOT LOVES YOU

Shaggar
Apr 26, 2006
log everything cause it will eventually come in handy and theres no real cost since u can just turn it off when u don't need it.

altho the vs remote debugger is fantastic

Fuck them
Jan 21, 2011

and their bullshit
:yotj:
I hate front end coding so much it hurts and procrastinate when I do it. So I spend more time on it. Ugh.

tef
May 30, 2004

-> some l-system crap ->

USSMICHELLEBACHMAN posted:

replace catch with tweet imo

code:
try {
   fh.close()
} tweet (FileIOTweet t)
   // todo
}

Corla Plankun
May 8, 2007

improve the lives of everyone
i have a timed coding test for a job interview soon

EAT THE EGGS RICOLA
May 29, 2008

code:
require 'twitter'

client = Twitter::Streaming::Client.new do |config|
  config.consumer_key        = "YOUR_CONSUMER_KEY"
  config.consumer_secret     = "YOUR_CONSUMER_SECRET"
  config.access_token        = "YOUR_ACCESS_TOKEN"
  config.access_token_secret = "YOUR_ACCESS_SECRET"
end

begin
  #stuff
rescue Exception => e
  client.update(e.message[0...140])
end

EAT THE EGGS RICOLA fucked around with this message at 16:39 on Jan 31, 2014

EAT THE EGGS RICOLA
May 29, 2008

gently caress the instagram and pinterest APIs don't let you post new images this is the worst

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
i wish code academy lessons didn't stop well before they get to the part where there are things i want to learn

also i wish they were in languages that are hard to learn

gonadic io
Feb 16, 2011

>>=

USSMICHELLEBACHMAN posted:

i wish code academy lessons didn't stop well before they get to the part where there are things i want to learn

also i wish they were in languages that are hard to learn

http://learnyouahaskell.com/ hth

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

that doesn't count because haskell is inherently fun

Pollyanna
Mar 5, 2005

Milk's on them.


2banks1swap.avi posted:

I hate front end coding so much it hurts and procrastinate when I do it. So I spend more time on it. Ugh.

the biggest obstacle to front end ive found is getting anything javascript to play nice

css and html are easy

also im working on not using so many frameworks.

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

USSMICHELLEBACHMAN posted:

i wish code academy lessons didn't stop well before they get to the part where there are things i want to learn

also i wish they were in languages that are hard to learn

we're slowly replacing books in our intro to x classes with codeacademy lessons

it's working out p dece but not so much for anything more than a survey of the language. that being said, a lot of students are having difficulty with them..

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

uncurable mlady posted:

we're slowly replacing books in our intro to x classes with codeacademy lessons

it's working out p dece but not so much for anything more than a survey of the language. that being said, a lot of students are having difficulty with them..

is this sagebrush

i cant remember who the other professor yosposters are

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

uncurable mlady posted:

we're slowly replacing books in our intro to x classes with codeacademy lessons

it's working out p dece but not so much for anything more than a survey of the language. that being said, a lot of students are having difficulty with them..

i think it's definitely a really fast way to get the basics down. which is good because once you've learned the basics a few times learning slightly different variations on the same thing is pretty boring

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

USSMICHELLEBACHMAN posted:

i think it's definitely a really fast way to get the basics down. which is good because once you've learned the basics a few times learning slightly different variations on the same thing is pretty boring

yeah, and it's genuinely useful in the courses because people tend to come in at varying skill levels esp. for web stuff. it allows us to define a plateau that we can jump into more advanced crap with, and structures the learning environment

we've gotten student feedback that some of them don't like it because they want to buy a book. i'm trying to think of a funny one to put on the requirements list for those people.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

uncurable mlady posted:

yeah, and it's genuinely useful in the courses because people tend to come in at varying skill levels esp. for web stuff. it allows us to define a plateau that we can jump into more advanced crap with, and structures the learning environment

we've gotten student feedback that some of them don't like it because they want to buy a book. i'm trying to think of a funny one to put on the requirements list for those people.

http://www.amazon.com/Introduction-Algorithms-Thomas-H-Cormen/dp/0262033844

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison
but that's actually a good book

Mr SuperAwesome
Apr 6, 2011

im from the bad post police, and i'm afraid i have bad news

Shaggar posted:

Add twitter lib from maven
add logback-core from maven
extend appenderbase that posts 2 twitter and reads login deets from logback.xml

java is too easy.

shaggar can u actually write some comedy app that does this just constantly tweeting its logs and all about all the great java poo poo that its logggin. just something that does a lot of smug twitter logging really idk

more like dICK
Feb 15, 2010

This is inevitable.

Mr SuperAwesome posted:

shaggar can u actually write some comedy app that does this just constantly tweeting its logs and all about all the great java poo poo that its logggin. just something that does a lot of smug twitter logging really idk

http://pastebin.com/RE96mWFU

https://twitter.com/ShaggarWasRight

example config here: http://pastebin.com/hFf4UBdM


Shaggar was right.

Shaggar
Apr 26, 2006
nice. you could also add a setLayout(Layout<E> layout) (or encoder) to have the config stuff in a layout/encoder so you can use it to format the string using existing layout classes instead of it being static

Shaggar
Apr 26, 2006
but for reals logback/slf4j is so loving well designed.

more like dICK
Feb 15, 2010

This is inevitable.

Shaggar posted:

nice. you could also add a setLayout(Layout<E> layout) (or encoder) to have the config stuff in a layout/encoder so you can use it to format the string using existing layout classes instead of it being static

I couldn't figure out how to use the standard encoding in the 10 minutes I spent in the documentation. I'll check this out, thanks.

I think I'll try to do this for lager as well.

Shaggar
Apr 26, 2006
take a look at OutputStreamAppender.

basically the encoder fires up an internal stream and when your appender gets an event you just fire it into the started encoder and it handles writing it to w/e the stream is. For u this would be kind of a pain cause you'd end up sending in an outputstream from your appender and then reading off of it after the encoder finishes writing.

This is I guess so you can do more than just string stuff w/ the encoder (ex: the encoder could compress the output stream data before passing it back to the appender which could then send the compressed data 2 whatever the appender destination is). tbh for a twitappender I would keep it to only accepting layouts cause it makes the most sense and outputstreams are effort as hell

Shaggar
Apr 26, 2006
like literally just add

Java code:
private Layout<E> layout;

public void setLayout(Layout<E> layout)
{
this.layout=layout
}

and change

Java code:

Format timestampFormat = new SimpleDateFormat("HH:mm:ss.SSS");
String timestamp = timestampFormat.format(new Date(event.getTimeStamp())).toString();
String message = String.format("%s [%s] %s %s - %s%n", timestamp, event.getThreadName(), event.getLevel(), event.getLoggerName(), event.getMessage());
Status status = twitter.updateStatus(message);

to

Java code:
String message;
if(this.layout!=null)
{
message = this.layout.doEvent(event);
}
else
{
//backup format if layout is null (or maybe initialize this.layout to a patternlayout in ur constructor)
Format timestampFormat = new SimpleDateFormat("HH:mm:ss.SSS");
String timestamp = timestampFormat.format(new Date(event.getTimeStamp())).toString();
message = String.format("%s [%s] %s %s - %s%n", timestamp, event.getThreadName(), event.getLevel(), event.getLoggerName(), event.getMessage());
}
Status status = twitter.updateStatus(message);
and I think that would work?

Shaggar
Apr 26, 2006
hell yeah writing logger codes on a Friday night. fuckin love it

MeruFM
Jul 27, 2010
I'm using knockout.js for a thing.
Is there a proper way to read an list and print out <p> for strings and <ul> for arrays?

Maybe this is better for COC, but i saw someone talk about knockout here.

Bloody
Mar 3, 2013

hope u get knucked out

Shaggar
Apr 26, 2006

MeruFM posted:

I'm using knockout.js for a thing.
Is there a proper way to read an list and print out <p> for strings and <ul> for arrays?

Maybe this is better for COC, but i saw someone talk about knockout here.

whats ur viewmodel and markup look like? if ur tolkein about an observableArray that contains strings and lsits you could do like

HTML code:
<div data-bind="foreach: listOfCrap">
<p data-bind="if: $data.testForStringOrSomethingIDK?, text: $data">
</p>
<ul data-bind="if: $data.isArrayIdkHow2testForThis, foreach: $data"> 
<li data-bind="text: $data/> <!-- at this point $data should refer to the content of the array we got form the parent list -->
</ul>
</div>
idk if that's the best but w/e

Janitor Prime
Jan 22, 2004

PC LOAD LETTER

What da fuck does that mean

Fun Shoe

Fucker, I was going to do this tomorrow morning. Meh I'll probably still do it and publish the maven artifact.

MeruFM
Jul 27, 2010

Shaggar posted:

whats ur viewmodel and markup look like? if ur tolkein about an observableArray that contains strings and lsits you could do like

HTML code:
<div data-bind="foreach: listOfCrap">
<p data-bind="if: $data.testForStringOrSomethingIDK?, text: $data">
</p>
<ul data-bind="if: $data.isArrayIdkHow2testForThis, foreach: $data"> 
<li data-bind="text: $data/> <!-- at this point $data should refer to the content of the array we got form the parent list -->
</ul>
</div>
idk if that's the best but w/e
That looks about right. I will try it

on monday

Nomnom Cookie
Aug 30, 2009



Shaggar posted:

whats ur viewmodel and markup look like? if ur tolkein about an observableArray that contains strings and lsits you could do like

HTML code:
<div data-bind="foreach: listOfCrap">
<p data-bind="if: $data.testForStringOrSomethingIDK?, text: $data">
</p>
<ul data-bind="if: $data.isArrayIdkHow2testForThis, foreach: $data"> 
<li data-bind="text: $data/> <!-- at this point $data should refer to the content of the array we got form the parent list -->
</ul>
</div>
idk if that's the best but w/e

that seems like an ok way to eat poo poo with a spoon if you have to serve only static assets

MeruFM
Jul 27, 2010

Nomnom Cookie posted:

that seems like an ok way to eat poo poo with a spoon if you have to serve only static assets

observables are dynamic

it doesn't matter though because my poo poo is static.

Shaggar
Apr 26, 2006

Nomnom Cookie posted:

that seems like an ok way to eat poo poo with a spoon if you have to serve only static assets

yeah theres not much point to doing that w/ knockout if it isn't static. even then i don't like the viewmodel that would create something that gross.

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
would it really break javascript to and add some explicit public/private declarations? like i get that it would affect closures somehow but it seems like it could be worked out? and then add something like a module so you can actually have namespaces??

i mean i guess the funky scoping is the point but goddamn

Shaggar
Apr 26, 2006
javascript isn't worth trying to fix

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

Shaggar posted:

javascript isn't worth trying to fix

shaggar was right

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder

Shaggar posted:

javascript isn't worth trying to fix

it's better than flash

Shaggar
Apr 26, 2006
ehhhh

DONT THREAD ON ME
Oct 1, 2002

by Nyc_Tattoo
Floss Finder
barely

Adbot
ADBOT LOVES YOU

kitten emergency
Jan 13, 2008

get meow this wack-ass crystal prison

is this one of those 'drown or burn' sort of questions that don't really have a right answer

  • Locked thread