IT/Software career thread: Invert binary trees for dollars.

alavaz

Trakanon Raider
2,001
713
I know some JS guys that get paid good bucks working for google, salesforce and other high techs. I think they are fairly involved in the back end as well though so it's not purely front end artsy shit.
 
  • 1Like
Reactions: 1 user

Ao-

¯\_(ツ)_/¯
<WoW Guild Officer>
7,879
507
Graduating with a CS degree in a year -- busy hunting around for part-time work or internships right now. If anyone has any advice or potential job hookups, shoot me a PM please. I'm in VA.
Check your PMs yo.
 

Lendarios

Trump's Staff
<Gold Donor>
19,360
-17,424
I'm in the last 2 weeks of a coding boot camp here in Portland. I was working hard labor for the past 15 years but was a Microsoft tech rep 17 years ago.
I'm pretty sure I haven't really absorbed most of what I've been taught but I can google-fu until it all really sinks in.
I've been a windows user for most of my life, haven't gotten into Linux or anything else yet....it's on the list of things to learn right away.
They've blasted html5, css3, really basic JavaScript, J Query, SQL, some database work, a lot of focus on C#, and visual studio community.
I have a unpaid internship with a company out east for about a week or two afterwards for some light, real world experience.

I've got a family member that has been in the field for 10 years and he suggested i get right into web development and branch out from there when I'm done.
He's suggested I just go freelance.
I'm curious what some of you veterans would suggest I aim for so I can be earning some real experience and cash without falling into some sort of shit show of a job.
I'd like to be at 70k within 2 years...is that really a realistic goal?
Duplicate this forum.

No really, it is a good exercise.
 
Last edited:
  • 1Like
Reactions: 1 user

Noodleface

A Mod Real Quick
37,961
14,508
I am now our expert on our DOORS relational database for document control and for making 160 page SVD/VDDs. Fuck my life.
 

Big_w_powah

Trakanon Raider
1,887
750
I guess if you really want to have designer names on your resume it matters. I stayed pretty close to home in Ohio of all places and I'm doing alright. I'm not rolling in lambos and having hookers do lines of coke off my dick but I'm living a comfortable life. Not sure exactly what the end goal is but if the goal is to just live a good life you can very easily do that with a CS degree in any state.

To be fair, this is the reason my 40k/yr in fucking dfw wasn't enough. Blow costs too much, had to hustle to afford the hookers and blow.

You can keep your bullshit lambo.
 
  • 1Worf
Reactions: 1 user

wilkxus

<Bronze Donator>
518
210
...and then The Bureaucracy smothered all life in the one department with fresh meat. It sucked even the last scent of scant memories of creative joy of life from the marrow of the fresh soul naive enough to venture within its seductively easy reach......

I ran away screaming in terror from my one flirt of a stint with govt IT development. After just 4 months. To be fair it was a "relaxing" atmosphere.... but "Bran growing into the root structure with life getting slowly sucked out" relaxing sort though.

@Eidal : use your last year in school wisely. Experiment and do a cool 4th year project + some extra OSS work more on the side. It might be your last chance to have some fun for a long time. Try to use this project/research and code as a springboard to apply to a company writing software you might actually enjoy (without worrying about geographic location).

In CS, think experience towards career first, money and location will follow eventually.
 

Tenks

Bronze Knight of the Realm
14,163
606
I am now our expert on our DOORS relational database for document control and for making 160 page SVD/VDDs. Fuck my life.

I've never heard of DOORS before this post and a quick google indicates if I had to use it I'd commit sudoku
 
  • 1Worf
Reactions: 1 user

a_skeleton_03

<Banned>
29,948
29,762
So I have this python script that I want to put some debugging messages into but have no clue what I am doing.

Here is the script:

Code:
'''
fetch function from https://gist.github.com/Hellowlol/ee47b6534410b1880e19
PlexPy > Settings > Notification Agents > Scripts > Bell icon:
		[X] Notify on pause

PlexPy > Settings > Notification Agents > Scripts > Gear icon:
		Playback Pause: create_wait_kill_all.py

PlexPy > Settings > Notifications > Script > Script Arguments:
		{session_key}

create_wait_kill_all.py creates a new file with the session_id (sub_script) as it's name.
PlexPy will timeout create_wait_kill_all.py after 30 seconds (default) but sub_script.py will continue.
sub_script will check if the stream's session_id is still pause or if playing as restarted.
If playback is restarted then sub_script will stop and delete itself.
If stream remains paused then it will be killed and sub_script will stop and delete itself.

Set TIMEOUT to max time before killing stream
Set INTERVAL to how often you want to check the stream status
'''

import os
import platform
import subprocess
import sys
from uuid import getnode
import unicodedata

import requests

## EDIT THESE SETTINGS ##

PLEX_HOST = '172.18.0.1'
PLEX_PORT = '32400'
PLEX_SSL = '' # s or ''
PLEX_TOKEN = 'XXXXX'
PLEXPY_APIKEY = 'XXXXX' # Your PlexPy API key
PLEXPY_URL = 'http://localhost:8181/' # Your PlexPy URL

TIMEOUT = 120
INTERVAL = 20
REASON = 'Paused for too long so resetting the session.'
ignore_lst = ('test')

class Activity(object):
	def __init__(self, data=None):
		d = data or {}
		self.video_decision = d['video_decision']
		self.state = d['state']
		self.session_key = d['session_key']

def get_get_activity():
	# Get the user IP list from PlexPy
	payload = {'apikey': PLEXPY_APIKEY,
			   'cmd': 'get_activity'}

	try:
		r = requests.get(PLEXPY_URL.rstrip('/') + '/api/v2', params=payload)
		response = r.json()
		res_data = response['response']['data']['sessions']
		return [Activity(data=d) for d in res_data]

	except Exception as e:
		sys.stderr.write("PlexPy API 'get_get_activity' request failed: {0}.".format(e))

def fetch(path, t='GET'):
	url = 'http%s://%s:%s/' % (PLEX_SSL, PLEX_HOST, PLEX_PORT)

	headers = {'X-Plex-Token': PLEX_TOKEN,
			   'Accept': 'application/json',
			   'X-Plex-Provides': 'controller',
			   'X-Plex-Platform': platform.uname()[0],
			   'X-Plex-Platform-Version': platform.uname()[2],
			   'X-Plex-Product': 'Plexpy script',
			   'X-Plex-Version': '0.9.5',
			   'X-Plex-Device': platform.platform(),
			   'X-Plex-Client-Identifier': str(hex(getnode(:emoji_nose:
			   }

	try:
		if t == 'GET':
			r = requests.get(url + path, headers=headers, verify=False)
		elif t == 'POST':
			r = requests.post(url + path, headers=headers, verify=False)
		elif t == 'DELETE':
			r = requests.delete(url + path, headers=headers, verify=False)
		if r and len(r.content): # incase it dont return anything
			return r.json()
		else:
			return r.content
	except Exception as e:
		print e

def kill_stream(sessionId, message, xtime, ntime, user, title, sessionKey):
	headers = {'X-Plex-Token': PLEX_TOKEN}
	params = {'sessionId': sessionId,
			  'reason': message}

	activity = get_get_activity()

	for a in activity:
		if a.session_key == sessionKey:
			if a.state == 'paused' and xtime == ntime:
				sys.stdout.write("Killing {user}'s paused stream of {title}".format(user=user, title=title))
				requests.get('http{}://{}:{}/status/sessions/terminate'.format(PLEX_SSL, PLEX_HOST, PLEX_PORT),
							 headers=headers, params=params)
				return ntime
			elif a.state in ('playing', 'buffering'):
				sys.stdout.write("{user}'s stream of {title} is now {state}".format(user=user, title=title,
																					state=a.state))
				return None
			else:
				return xtime

def find_sessionID(response):

	sessions = []
	for s in response['MediaContainer']['Video']:
		if s['sessionKey'] == sys.argv[1]:
			sess_id = s['Session']['id']
			user = s['User']['title']
			sess_key = s['sessionKey']
			title = (s['grandparentTitle'] + ' - ' if s['type'] == 'episode' else '') + s['title']
			title = unicodedata.normalize('NFKD', title).encode('ascii','ignore')
			sessions.append((sess_id, user, title, sess_key))
		else:
			pass

	for session in sessions:
		if session[1] not in ignore_lst:
			return session
		else:
			print("{}'s stream of {} is ignored.".format(session[1], session[2]))
			return None

if __name__ == '__main__':

	startupinfo = None
	if os.name == 'nt':
		startupinfo = subprocess.STARTUPINFO()
		startupinfo.dwFlags |= subprocess.STARTF_USESHOWWINDOW

	response = fetch('status/sessions')
	fileDir = fileDir = os.path.dirname(os.path.realpath(__file__))

	try:
		if find_sessionID(response):
			stream_info = find_sessionID(response)
			file_name = "{}.py".format(stream_info[0])
			full_path = os.path.join(fileDir, file_name)
			file = "from time import sleep\n" \
				   "import sys, os\n" \
				   "from {script} import kill_stream \n" \
				   "message = '{REASON}'\n" \
				   "sessionID = os.path.basename(sys.argv[0])[:-3]\n" \
				   "x = 0\n" \
				   "n = {ntime}\n" \
				   "try:\n" \
				   " while x < n and x is not None:\n" \
				   " sleep({xtime})\n" \
				   " x += kill_stream(sessionID, message, {xtime}, n, '{user}', '{title}', '{sess_key}')\n" \
				   " kill_stream(sessionID, message, {ntime}, n, '{user}', '{title}', '{sess_key}')\n" \
				   " os.remove(sys.argv[0])\n" \
				   "except TypeError as e:\n" \
				   " os.remove(sys.argv[0])".format(script=os.path.basename(__file__)[:-3],
													   ntime=TIMEOUT, xtime=INTERVAL, REASON=REASON,
													   user=stream_info[1], title=stream_info[2],
													   sess_key=stream_info[3])

			with open(full_path, "w+") as output:
				output.write(file)
			subprocess.Popen([sys.executable, full_path], startupinfo=startupinfo)
			exit(0)

	except TypeError as e:
		print(e)
		pass

I think this is where I need to do the logging but not sure:

Code:
def kill_stream(sessionId, message, xtime, ntime, user, title, sessionKey):
   headers = {'X-Plex-Token': PLEX_TOKEN}
   params = {'sessionId': sessionId,
			 'reason': message}

Any suggestions?

This might be how I do it.

At the top I put in:

Code:
import logging

logging.basicConfig(level=logging.DEBUG)

And then for that block I change it to look like this:

Code:
def kill_stream logging.debug(sessionId, message, xtime, ntime, user, title, sessionKey):
   headers = {'X-Plex-Token': PLEX_TOKEN}
   params = {'sessionId': sessionId,
			 'reason': message}
 
Last edited by a moderator:

a_skeleton_03

<Banned>
29,948
29,762
No, this is where I need to change it.

Code:
sys.stdout.write("Killing {user}'s paused stream of {title}".format(user=user, title=title))
 

alavaz

Trakanon Raider
2,001
713
So change logging.basicConfig statement to this (with whatever file you want):

Code:
logging.basicConfig(filename='C:\whatever.log',level=logging.DEBUG)

Then change this:

Code:
sys.stdout.write("Killing {user}'s paused stream of {title}".format(user=user, title=title))

To this:

Code:
loggin.debug("Killing {user}'s paused stream of {title}".format(user=user, title=title))
 

a_skeleton_03

<Banned>
29,948
29,762
So change logging.basicConfig statement to this (with whatever file you want):

Code:
logging.basicConfig(filename='C:\whatever.log',level=logging.DEBUG)

Then change this:

Code:
sys.stdout.write("Killing {user}'s paused stream of {title}".format(user=user, title=title))

To this:

Code:
loggin.debug("Killing {user}'s paused stream of {title}".format(user=user, title=title))
I did that already but instead of outputting it to a file I am using a different tool that is already logging information from this script. Going to give it a shot and see what happens now.

I actually had already replaced every instance of sys.stdout.write with logging.info throughout the script so I can see things happening in that log which is less busy. They have too many things in the DEBUG log that shouldn't be there in my opinion.
 

alavaz

Trakanon Raider
2,001
713
Generally speaking I would log stuff that is written to stdout to logging.info and stuff that is stderr to logging.error and reserve the debug log for logging things like variable values and array sizes or things of that nature. I notice there are also some print statements that you want to replace with logging as well.
 

a_skeleton_03

<Banned>
29,948
29,762
Generally speaking I would log stuff that is written to stdout to logging.info and stuff that is stderr to logging.error and reserve the debug log for logging things like variable values and array sizes or things of that nature. I notice there are also some print statements that you want to replace with logging as well.
Thanks, I am playing with it a bit more, good call on those two for starters.
 

Kalaar kururuc

Grumpy old man
530
453
I am now our expert on our DOORS relational database for document control and for making 160 page SVD/VDDs. Fuck my life.

I'm a mechanical design engineer but hearing DOORS gives me the heebie jeebies, our aerospace partners are always talking about it, puts me right off working for them. They wanted to add us to their system and I politely declined and ran screaming.
 

ShakyJake

<Donor>
7,623
19,247
Probably because front end development is barely programming. At the very least you don't encounter the same programming challenges as back end programming.
Haha WHAT? I'm sorry, client-side development is horribly complicated and difficult. I wish I could just do server-side development. That would be paradise.
 
  • 1Like
Reactions: 1 user

Big_w_powah

Trakanon Raider
1,887
750
Haha WHAT? I'm sorry, client-side development is horribly complicated and difficult. I wish I could just do server-side development. That would be paradise.

coming from a non programmer who had to edit a web template to allow us to handshake via html 5 and allow javascript to function in a cross domain iframe......I barely understand what I typed. I agree with you.
 

Tenks

Bronze Knight of the Realm
14,163
606
Haha WHAT? I'm sorry, client-side development is horribly complicated and difficult. I wish I could just do server-side development. That would be paradise.

Then do it. The salaries don't lie. There are tons of web developers so they make less.
 
Last edited:

Cad

<Bronze Donator>
24,487
45,378
Haha WHAT? I'm sorry, client-side development is horribly complicated and difficult. I wish I could just do server-side development. That would be paradise.

It's mostly horribly complicated and difficult because it's done primarily by amateurs who have no fucking idea what they're doing.