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
kedo
Nov 27, 2007

Ahh, the joys of being a freelance developer in DC during election season. Just had my second (in as many weeks) unsolicited request for free, ultra-rush work for a political fundraiser whose main pitch was, "if you don't do this work you'll get four more years of Trump."

Adbot
ADBOT LOVES YOU

MrMoo
Sep 14, 2000

How is politic-land tech work, in general?

Ape Fist
Feb 23, 2007

Nowadays, you can do anything that you want; anal, oral, fisting, but you need to be wearing gloves, condoms, protection.

MrMoo posted:

How is politic-land tech work, in general?

For an existing government? It's alright. Be prepared for a client who takes z e r o responsibility for any mistake they make. For a candidate whose running? Get your contract signed in blood.

Moto42
Jul 14, 2006

:dukedog:

kedo posted:

Ahh, the joys of being a freelance developer in DC during election season. Just had my second (in as many weeks) unsolicited request for free, ultra-rush work for a political fundraiser whose main pitch was, "if you don't do this work you'll get four more years of Trump."
Obvious response: "So you don't pay contractors; just like Trump?"

kedo
Nov 27, 2007

I can only speak to my experience which is with small design/dev shops and as a solo freelancer, but there’s a lot of work to be had from contractors, advocacy groups (both issue related and industry advocacy), non-profits, NGOs, and of course all of the “normal” type of business you might get in another city of equivalent size. Contractors are the most dangerous imo because their funding isn’t always that secure and I’ve seen a couple fold and close up shop in the middle of a project. Non-profits are good in that they pay their bills, but are needy clients who often expect you to share as deep of a belief in their cause as they do. Issue advocacy groups are usually strapped for cash but are filled with good people, while industry advocacy groups are cash cows but are often filled with employees who give almost zero fucks about the industry they’re advocating for.

Most of my dev friends work for contractors and usually stay on the backend side of things, often coding in Java or some C variant. I get the feeling their work is a mind numbingly boring at times, but that’s just me reading between the lines. Since I’m doing contract work for a lot of different people, I get the full spectrum from boring sites for X association to wildly engaging and fun projects for weird political action groups. It’s exhausting, but not bad as far as the industry goes. Non-profits love WordPress, associations love Drupal.

One weird thing I’m not sure exists elsewhere: I’d guess probably half my income comes from organization grants which are earmarked for a specific purpose, and they’re a weird beast. I’ve had more than one project where I signed a pretty big scope of work for a decent figure only to have the organization ghost on me after paying their bills and before I did any work. I told a grant writer friend of mine this and her response was, “oh yeah, they probably needed to spend the money to hit a cap so they wouldn’t lose the grant next year, but they never had any intent on doing the project.” Those projects don’t happen often, but they do exist.

Campaigns are really the one thing I won’t work on for two main reasons: first, the deadlines are hilariously awful, and second, they’re filled with people who have a tenuous relationship with truth and are willing to say and do just about anything to get votes. They’re the only industry I stopped working with purely on ethical grounds. Political fundraisers are often assholes, they’re the worst part of any campaign. I have met fundraisers who seem like nice people, but that’s far from the norm.

E: oh, “advocacy group” is the polite way of saying lobbyist.

kedo fucked around with this message at 13:58 on Sep 9, 2018

Munkeymon
Aug 14, 2003

Motherfucker's got an
armor-piercing crowbar! Rigoddamndicu𝜆ous.



I thought campaigns mostly just worked from one of a few templates, but I guess I did see something recently about a candidate's site where they forgot to replace the name of the candidate in the <title> they copied it from, so maybe it's just that

kedo
Nov 27, 2007

Munkeymon posted:

I thought campaigns mostly just worked from one of a few templates, but I guess I did see something recently about a candidate's site where they forgot to replace the name of the candidate in the <title> they copied it from, so maybe it's just that

Yeah, it depends on what part of the campaign you're talking about. I haven't worked on any campaign's main site, but I did work on maybe five or six microsites either promoting or attacking particular candidates as part of a greater campaign. These were (mostly) from scratch. Working on them made me feel sleezy as hell, so I eventually started declining them.

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

I have a friend who is in a similar boat but in Canada; he founded a pretty high end bulletproof hosting company (crazy security, earthquake proof server rooms, multi tier-1 redundancy etc) and by default has ended up with basically all of the federal party business. His scope is larger in that he handles infrastructure and development, but it's kind of the same deal. A lot of hurry up and wait stuff, but the infrastructure is almost more important. I remember him telling me about a video address from a past prime minister that they had to support on the site that basically saturated close to 60% of his pipes, which doesn't sound like much, but when you're running a high end operation like him you're almost never going about 30% for peace of mind's sake.

PT6A
Jan 5, 2006

Public school teachers are callous dictators who won't lift a finger to stop children from peeing in my plane
Ugh, I'm dealing with the reverse of the usual "what do you mean the print design won't work for the website???"

My client has decided that he needs printed copies of the e-mail campaigns I've done for him and does not understand why it won't fit his requirements of being on a single 8.5x11 sheet of paper. I dunno... maybe because there's no earthly reason to constrain an e-mail to the same dimensions as a piece of paper?

Maleh-Vor
Oct 26, 2003

Artificial difficulty.

PT6A posted:

Ugh, I'm dealing with the reverse of the usual "what do you mean the print design won't work for the website???"

I'm having some of this problem too recently, but for videos. The site has a large hero block that's about 600px high and full-width, it was designed and developed to just play some drone footage to be pretty, with text and the menu overlaid. Someone new from the content team was brought on, and can't understand why they can't use these cutesy animations with text and graphics they made for their social media and have it look right on every resolution on that same block, since the video is cropped differently on each resolution. No amount of explaining "you can't have any text on the corners" or "the only safe area is the center" or "you really shouldn't use infographics in a video on mobile screens" helps send the message across, and they keep sending us videos with text overlays on the top left corner (under the logo) or just random small strings of text.

I'm going to have to end up destroying the hero and a bunch of full-width stuff to keep proportions just so they can put these awful videos where they don't belong.

edit: read that wrong, but I had that happen with them wanting the email campaign being a 300dpi letter sized pdf attached, which they then took a picture of and sent as the content of the email, then kept wanting to add content to, without it changing shape. After about 8 versions they finally just said "well why don't you just make it longer, we're not going to print that pdf anyway".

Maleh-Vor fucked around with this message at 22:10 on Sep 10, 2018

my bony fealty
Oct 1, 2008

E whoops wrong thread

kedo
Nov 27, 2007

I have a European client and am dealing with GDPR stuff for the first time. A question – can I cookie a user if the cookie contains no identifying data? Real world use case, if I display a GDPR notice in a fixed position div and the user closes it, can I cookie them (or store some session data) so it doesn't appear again on the next page?

Like, the cookie value will literally be a boolean.

MrMoo
Sep 14, 2000

Just stick it in local storage instead.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

MrMoo posted:

Just stick it in local storage instead.

That does not avoid GDPR. But since the info is not personally identifiable and as long as you display the notice, you should be fine.

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
I found an online hackathon that's actually going on this weekend: https://www.reactriot.com/

Would anyone here like to team up with me? I normally do game jams and have been looking for hackathons as a way to build a portfolio so that I'm not solo with all of my projects. Having other people to work with makes the process a lot easier and knowing that another person needs me to keep up with them helps me stay on task and more focused.

For whatever we'd be making, I'd prefer if it were something using the PERN stack in particular, but I'm a flexible person and will happily go along with whatever you want.

kedo
Nov 27, 2007

Thanks folks, I appreciate the input!

Love Stole the Day
Nov 4, 2012
Please give me free quality professional advice so I can be a baby about it and insult you
Here's what me and the 3 people in my team made for the hackathon this past weekend.

Please take a look:

https://www.youtube.com/watch?v=dCkspfo3HbA




Here's a link to the live demo: http://zoom.servequake.com/
And if you like it then please click the button at this link to vote for it: http://www.reactriot.com/entries/196-unemployable#feedback

ddiddles
Oct 21, 2008

Roses are red, violets are blue, I'm a schizophrenic and so am I
Got some more react-y questions.

Anyone whos worked in a decent sized react codebase, how do you handle API calls? Some people are saying put the API calls into their respective reducers that make the most sense, others say having an API action & reducer that handles all of the actual api call logic, and then dispatching different success/failure actions depending on the API being used.

I'd say at its most complex, this greenfield project I'm standing up will be hitting 10+ different endpoints for various things.

ddiddles fucked around with this message at 17:06 on Sep 17, 2018

Ahz
Jun 17, 2001
PUT MY CART BACK? I'M BETTER THAN THAT AND YOU! WHERE IS MY BUTLER?!

ddiddles posted:

Got some more react-y questions.

Anyone whos worked in a decent sized react codebase, how do you handle API calls? Some people are saying put the API calls into their respective reducers that make the most sense, others say having an API action & reducer that handles all of the actual api call logic, and then dispatching different success/failure actions depending on the API being used.

I'd say at its most complex, this greenfield project I'm standing up will be hitting 10+ different endpoints for various things.

What do you mean handled by the reducer? The reducer should have no side effects.

reversefungi
Nov 27, 2003

Master of the high hat!

ddiddles posted:

Got some more react-y questions.

Anyone whos worked in a decent sized react codebase, how do you handle API calls? Some people are saying put the API calls into their respective reducers that make the most sense, others say having an API action & reducer that handles all of the actual api call logic, and then dispatching different success/failure actions depending on the API being used.

I'd say at its most complex, this greenfield project I'm standing up will be hitting 10+ different endpoints for various things.

For smaller code bases, normally you'd use redux thunk. I'd always stick those in the action definitions.

For larger code bases, I'd recommend looking into redux sagas. That's what we're currently looking into for our large React project at work. The documentation is really good and straightforward which is a nice bonus.

ddiddles
Oct 21, 2008

Roses are red, violets are blue, I'm a schizophrenic and so am I

Ahz posted:

What do you mean handled by the reducer? The reducer should have no side effects.

Sorry, should have been more clear. All the logic would be in the single API action generator file, and a single API reducer that just stores the returned data/errors, whatever in the store.

The Dark Wind posted:

For smaller code bases, normally you'd use redux thunk. I'd always stick those in the action definitions.

For larger code bases, I'd recommend looking into redux sagas. That's what we're currently looking into for our large React project at work. The documentation is really good and straightforward which is a nice bonus.

Looks really interesting, will definitely bring that up with the team, thanks!

Right now I just feel like I'm repeating myself a lot when it comes to things like API calls, for example I have two different views, both for doing something completely different, but both views need to hit the same endpoint and grab some data and store it.

Right now I have a action generator file and reducer for both views, and the logic in the respective action generators is basically the same, but I didn't want to use the same reducer for both, because both views need to store the data returned from the endpoint as it'll be different.

Anyway, just talking out loud, I'm bikeshedding this for sure at this early in the project.

LOOK I AM A TURTLE
May 22, 2003

"I'm actually a tortoise."
Grimey Drawer
Another option is redux-observable, if you're into rxjs.

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

ddiddles posted:

Got some more react-y questions.

Anyone whos worked in a decent sized react codebase, how do you handle API calls? Some people are saying put the API calls into their respective reducers that make the most sense, others say having an API action & reducer that handles all of the actual api call logic, and then dispatching different success/failure actions depending on the API being used.

I'd say at its most complex, this greenfield project I'm standing up will be hitting 10+ different endpoints for various things.

You have a “service “ layer that *only* does API calls, and returns a promise. These services are called by async actions, either thunks, sagas, whatevers, that when the service succeeds or fails, sync actions are dispatched that the reducer handles.

You generally also want to dispatch a sync action that the API call is happening so the UI can show a loading indicator or something, but all API related code lives in its own space and only exposes methods that actions call.

Personally I use thunks, but all the options people posted are valid.

Tei
Feb 19, 2011
Probation
Can't post for 4 days!
HTML is a failture and is not going where we wanted it to go, is time to invent something new

Heres a idea to use text/plain.

This is a draw of a giant cat falling from the moon

code:

  ___
((   ))
  ---

/--\__________
|oo           |
|3            |
\/-\/------\/\/========D
   
---------------------   
   /!
  / !
 /  !
/   !

s/\\//http:\/\/en.wikipedia.com\/paw//
s/o/http:\/\/en.wikipedia.com\/eyes\/
--logo
top
moveleft 10
movedown 10
write "hello world"
My idea is to make websites in text/plain, and put a lot of regex in the bottom of the file, that would be executed by the browser to select substrings in the text to make them basically links to whatever is replaced to. See example above.

Edit:
for scripting, it can use turtle logo

Tei fucked around with this message at 16:31 on Sep 18, 2018

huhu
Feb 24, 2006

Tei posted:

HTML is a failture
What?



Seriously, what? You think HTML is bad so you suggest regex as part of the alternative?

I can't tell if you're serious or a really bad troll.

Moto42
Jul 14, 2006

:dukedog:

huhu posted:

I can't tell if you're serious or a really bad troll.
Sign of a good troll?

Scaramouche
Mar 26, 2001

SPACE FACE! SPACE FACE!

I heard the wooshing noise from over in Goons with Spoons

Submarine Sandpaper
May 27, 2007


Tei posted:

HTML is a failture and is not going where we wanted it to go, is time to invent something new

Heres a idea to use text/plain.

This is a draw of a giant cat falling from the moon

code:

  ___
((   ))
  ---

/--\__________
|oo           |
|3            |
\/-\/------\/\/========D
   
---------------------   
   /!
  / !
 /  !
/   !

s/\\//http:\/\/en.wikipedia.com\/paw//
s/o/http:\/\/en.wikipedia.com\/eyes\/
--logo
top
moveleft 10
movedown 10
write "hello world"
My idea is to make websites in text/plain, and put a lot of regex in the bottom of the file, that would be executed by the browser to select substrings in the text to make them basically links to whatever is replaced to. See example above.

Edit:
for scripting, it can use turtle logo

That's a penis

Bruegels Fuckbooks
Sep 14, 2004

Now, listen - I know the two of you are very different from each other in a lot of ways, but you have to understand that as far as Grandpa's concerned, you're both pieces of shit! Yeah. I can prove it mathematically.

Tei posted:

HTML is a failture and is not going where we wanted it to go, is time to invent something new

Heres a idea to use text/plain.

This is a draw of a giant cat falling from the moon

code:

  ___
((   ))
  ---

/--\__________
|oo           |
|3            |
\/-\/------\/\/========D
   
---------------------   
   /!
  / !
 /  !
/   !

s/\\//http:\/\/en.wikipedia.com\/paw//
s/o/http:\/\/en.wikipedia.com\/eyes\/
--logo
top
moveleft 10
movedown 10
write "hello world"
My idea is to make websites in text/plain, and put a lot of regex in the bottom of the file, that would be executed by the browser to select substrings in the text to make them basically links to whatever is replaced to. See example above.

Edit:
for scripting, it can use turtle logo

well at least it isn't closurescript. i'm down.

ModeSix
Mar 14, 2009

Tei posted:

HTML is a failture and is not going where we wanted it to go, is time to invent something new

Heres a idea to use text/plain.

This is a draw of a giant cat falling from the moon

code:

  ___
((   ))
  ---

/--\__________
|oo           |
|3            |
\/-\/------\/\/========D
   
---------------------   
   /!
  / !
 /  !
/   !

s/\\//http:\/\/en.wikipedia.com\/paw//
s/o/http:\/\/en.wikipedia.com\/eyes\/
--logo
top
moveleft 10
movedown 10
write "hello world"
My idea is to make websites in text/plain, and put a lot of regex in the bottom of the file, that would be executed by the browser to select substrings in the text to make them basically links to whatever is replaced to. See example above.

Edit:
for scripting, it can use turtle logo

Is the Typescript babel transpiler module available yet?

teen phone cutie
Jun 18, 2012

last year i rewrote something awful from scratch because i hate myself

Tei posted:

HTML is a failture

Tei's had some good ones, but this is a thread title if I've ever seen one

chami
Mar 28, 2011

Keep it classy, boys~
Fun Shoe
Not a Medium post, ignored

Tei
Feb 19, 2011
Probation
Can't post for 4 days!
I am thinking in writing a website to describe how I think Article 13 in the european union is the worst thing to happen to democratic values, freedom, security, privacy and web software developers.

I have yet to study how Article 13 works in detail, but what I understand now. Everything you post (maybe only video or images?) is processed by a service that somebody pay (maybe the website?) and if Disney, Sony or the bruselas politician has put a censorship on it, the posting will be rejected.

If I understand this correctly, is a huge invasion of privacy, is going to make user-based-content websites more expensive (so is going to kill a lot of these), is going to introduce a point-of-break for all these websites (if the validation service is down, you can't post) and many other problems. From what I can see.

The chilling effect is if this work in europe, USA may have soon their own version, as seems bad poo poo is contagious but the good poo poo is not.

Since this is going to affect all of us in this thread. What do you guys think about it?

Anyone have a good review of the Article 13 that is for humans (not lawyers)?

Ignoring the bad parts, this article explain better than I do.
https://www.wired.co.uk/article/what-is-article-13-article-11-european-directive-on-copyright-explained-meme-ban

Tei fucked around with this message at 10:54 on Sep 19, 2018

MrMoo
Sep 14, 2000

Is Cisco going to go to EU ISPs and say we have a product perfect for this, it powers the Great Firewall of China?

Lumpy
Apr 26, 2002

La! La! La! Laaaa!



College Slice

MrMoo posted:

Is Cisco going to go to EU ISPs and say we have a product perfect for this, it powers the Great Firewall of China?

Ding ding ding! We have a winner!

geeves
Sep 16, 2004

kedo posted:

I have a European client and am dealing with GDPR stuff for the first time. A question – can I cookie a user if the cookie contains no identifying data? Real world use case, if I display a GDPR notice in a fixed position div and the user closes it, can I cookie them (or store some session data) so it doesn't appear again on the next page?

Like, the cookie value will literally be a boolean.

Are you storing the data in a DB? If not it's fine - that's literally what GDPR wants to be done - let people know that cookies are present and in use.

There's a bit of confusion if you must store that someone opted in in a DB and none of the consultants we talked to could give us a firm answer on this. But we became privacy shield compliant before the deadline just in case.

Lumpy posted:

That does not avoid GDPR. But since the info is not personally identifiable and as long as you display the notice, you should be fine.

Cookies and IP addresses are named as PII. When collecting data for your application that someone signs up for, then yes, it's okay to keep the info around as long as its needed.

For two of our applications in which we are more a sub-processor, the most we had to do was hash cookie values and IPs. We don't track via location, demographics, etc. and our algorithms are mostly behavior-driven. We've never known who was who and we really didn't care, either. We mostly did this to avoid meddling from marketing, but it continues to show its benefits.

Chenghiz
Feb 14, 2007

WHITE WHALE
HOLY GRAIL

Tei posted:

I think Article 13 in the european union is the worst thing to happen to democratic values, freedom, security, privacy and web software developers.

Tei posted:

I have yet to study how Article 13 works in detail

ok

Moto42
Jul 14, 2006

:dukedog:
I think the short version of Article 13 is that it basically applies YouTubes takedown policy of 'someone filled out the form, we didn't look into it, your hosed now" to the entire internet in the EU.

We haven't looked into the details of how exactly that will be carried out, but the gist of it still sucks Cambell's corn chowder without a can opener.

Tei
Feb 19, 2011
Probation
Can't post for 4 days!

Now that I have read more about it, I know less than before.

Maybe it will be a good idea to wait a bit more what is exactly proposed.

Adbot
ADBOT LOVES YOU

LLSix
Jan 20, 2010

The real power behind countless overlords

I recently started a new job working on a browser-based application and am still learning the finer points of Javascript. I've got a question about what a JS interpreter following the spec should do with the following code snippet.

code:
node_list_foo = document.getElementsByName("bar");
//node_list_foo is now a node list with a length of lets say 3.
var element_from_item = NodeListFoo.item(4);
//element_from_item is now NULL according to [url]https://dom.spec.whatwg.org/#interface-nodelist[/url]
var element_from_index = NodeListFoo[4];
// my broswers are setting element_from_index to undefined in this case, but what should it be?
https://dom.spec.whatwg.org/#interface-nodelist appears to defer defining the behavior of out of range indices to the definition of supported-property-indices, am I reading that right?

"https://heycam.github.io/webidl/#dfn-supported-property-indices" posted:

If an indexed property getter was specified using an operation with an identifier, then the value returned when indexing the object with a given supported property index is the value that would be returned by invoking the operation, passing the index as its only argument. If the operation used to declare the indexed property getter did not have an identifier, then the interface definition must be accompanied by a description of how to determine the value of an indexed property for a given index.
If I'm reading that right, the spec says the behavior of the two access methods should be the same? So both should return undefined;

Curiously, https://developer.mozilla.org/en-US/docs/Web/API/NodeList, documents the observed behavior and not the behavior that I think the spec calls for.

What's the correct interpretation of the spec and is there another approach I should take to finding out how these kinds of things work?

Finally, if my interpretation of the spec is correct; nobody seems to actually follow the spec for using array style syntax; so as a paranoid and perfectionist programmer should I be using nodelist.item(x) as the preferred approach?

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