Welcome, Guest

Author Topic: Coding  (Read 261886 times)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #630 on: March 11, 2017, 09:17:21 PM »
2 space indents are fine
no

Kol 2 space sounds nice if you have a lot of loops. Coding Map War and some other stuff I got tired of all the code ending up in a small spot on the right

right but if you have proper coding style, you should never have more than a nesting depth of 4-5 (and that's pushing it), which is only like 1/4th of your column if you follow the 80 character/row rule

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #631 on: March 12, 2017, 10:49:31 AM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '179459'.

« Last Edit: March 22, 2021, 01:25:15 AM by FiahOwl »

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #632 on: March 12, 2017, 12:02:11 PM »
well spaces are bad yes

but you can set tab width

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #633 on: March 13, 2017, 02:23:02 PM »
I'm using PyQt to make a gui to control the magneto-optical trap (and a new one we're gonna build) for my master project, keep thinking this is a Yqt conspiracy because 1) PyQt and 2) coding

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #634 on: March 14, 2017, 12:07:58 AM »
i'd like to magneto-optical trap bla in a small green box as well

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #635 on: March 23, 2017, 01:07:50 AM »
so i wrote some code to plot my time
numbers are in hours per week

code is pretty messy, only reason i'm posting it is cause this is the coding thread

let me tell you getting the plot to look as good as it does now was not very easy at all
i basically had to do everything from scratch
« Last Edit: March 23, 2017, 02:57:00 PM by vh »

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #636 on: March 23, 2017, 07:08:44 AM »
dIslam

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #637 on: March 23, 2017, 05:42:16 PM »
i'd dlslam you if you know what i mean

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #638 on: March 25, 2017, 07:42:56 PM »
ai learning to play from pixels
(that is, it does not have any access to the game state, and is not told the objective or mechanics of the game)

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #639 on: March 26, 2017, 06:24:08 AM »
Kolkute

Darvince

  • *****
  • Posts: 1842
  • 差不多
Re: Coding
« Reply #640 on: March 26, 2017, 06:44:11 AM »
does it have to guess the controls too

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #641 on: March 26, 2017, 07:49:04 AM »
it knows there are 9 controls but not what they do ( it has to learn that)

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #642 on: March 26, 2017, 10:33:40 AM »
Breaking news: A user on USF called 'vh' is reported missing after developing an AI that's supposed to learn how to play a game. Rumors say the AI took control of a robot factory to recreate the game irl and abducted vh, forcing him to complete the track over and over while detecting his movements.

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #643 on: April 12, 2017, 01:18:43 PM »
100 pareto optimal elytra flight trajectories over the course of 13 seconds, optimized for distance and altitude
you have the choice between traveling 300 meters and increasing your altitude by 30, or traveling 600 meters and decreasing your altitude by 210, or anything in between!

i'm hoping the chart is pretty self-explanatory. on the x is distance, on the y is altitude relative to initial point. i put a point on each line every 10 ticks (0.5 seconds) for convenience
« Last Edit: April 12, 2017, 01:25:01 PM by vh »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #644 on: April 12, 2017, 01:19:19 PM »
oh right since this is the coding thread i better post the code too

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #645 on: April 12, 2017, 05:08:44 PM »
Verycute

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #646 on: April 19, 2017, 01:00:06 PM »
attempt at using a deep net to generate music.
i'll let you guys judge for yourself

FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #647 on: April 19, 2017, 10:03:24 PM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '180271'.

« Last Edit: March 22, 2021, 01:22:27 AM by FiahOwl »

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #648 on: April 19, 2017, 10:10:53 PM »
wtf that's freaky

Yqt1001

  • *
  • Posts: 0
    • Airline Empires
Re: Coding
« Reply #649 on: April 19, 2017, 10:35:09 PM »
That's actually really cool tbh

Anyways I've really taken a liking to being a JS dev. Here's code snippets for the same functions, one in the Java API the other in the Node API.
Java:
Code: [Select]
Customer cu = Customer.retrieve({CUSTOMER_ID});
Map<String, Object> updateParams = new HashMap<String, Object>();
updateParams.put("description", {NEW_DESCRIPTION});
...
cu.update(updateParams);

Node:
Code: [Select]
stripe.customers.update({CUSTOMER_ID}, {
  description: {NEW_DESCRIPTION},
  ...
});

Here's Python:
Code: [Select]
cu = stripe.Customer.retrieve({CUSTOMER_ID})
cu.description = {NEW_DESCRIPTION}
...
cu.save()

the language is freaking ridiculous idk how I survived for years using it
(also don't think about it too much, this example just has shitty java implementation, it could in theory be almost the same as the python implementation)

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #650 on: April 21, 2017, 01:59:08 PM »
hmm i promise it sounds much better this time around

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #651 on: April 25, 2017, 09:13:20 PM »
wrote some code to do more fine grained plotting of my time usage. each pie chart is a single week.
weeks arranged left to right first, and then top to bottom next (just like reading text guys)
this semester has pretty much exactly 16 weeks, which makes everything come out really nicely

https://drive.google.com/uc?export=view&id=0B6XNpALRcpv9TUYwV2ZQQkVxUFU



warning: massive image
« Last Edit: April 26, 2017, 05:54:41 AM by vh »

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #652 on: April 26, 2017, 03:05:02 AM »
Access denied

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #653 on: April 26, 2017, 05:55:13 AM »
fixed link hopefully

direct linking to images from gdrive is made, for some reason, really difficult

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #654 on: May 07, 2017, 07:29:20 PM »
i gave my neural network the bottom img and it made the one on top


FiahOwl

  • *****
  • Posts: 1234
  • This is, to give a dog and in recompense desire my dog again.
Re: Coding
« Reply #655 on: May 07, 2017, 09:23:09 PM »

This message is only viewable with Universe Sandbox Galaxy Edition. Access it and much more with promo-code '180595'.

« Last Edit: March 22, 2021, 01:21:24 AM by FiahOwl »

vh

  • formerly mudkipz
  • *****
  • Posts: 1140
  • "giving heat meaning"
Re: Coding
« Reply #656 on: May 07, 2017, 10:50:42 PM »
oh you silly filly!

atomic7732

  • Global Moderator
  • *****
  • Posts: 3848
  • caught in the river turning blue
    • Paladin of Storms
Re: Coding
« Reply #657 on: May 07, 2017, 11:21:37 PM »

Bla

  • Global Moderator
  • *****
  • Posts: 1013
  • The stars died so you can live.
Re: Coding
« Reply #658 on: May 07, 2017, 11:39:07 PM »
Kol wow

tuto99

  • *****
  • Posts: 533
  • Baba Booey
Re: Coding
« Reply #659 on: May 08, 2017, 12:07:16 AM »
syule, give your neural network this image:
http://i.imgur.com/7NjCVGg.png