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
Hadlock
Nov 9, 2004

I want to model a system, sort of like how Sim Tower started off life as an elevator systems model... a very basic 2D engine with some generic moving parts. I was looking at simulating a model of an airport, specifically the airstrip, terminals, parking and moving passengers from parking to the airplane through the concourse, based on different layouts and various constraints.

Is there a general engine/platform I could look at for this sort of thing?

Some things I've looked at so far and not been terribly impressed with were

Love2d (Lua)
libtcod (Python/C++/.net)
Construct 2
RPG Maker

Etc etc but these seem very pidgeonholed in to making a very specific type of game. I am a couple steps above a script kiddie but don't have the knowledge needed to build my own rendering engine etc. I feel like I might be better off re-purposing some sort of Checkers or Othello open source game and working from there.

Adbot
ADBOT LOVES YOU

Hadlock
Nov 9, 2004

I took objective based C++ in high school (this was a year or two before Java at the HS/Uni level exploded) and 99% of our work was reading and writing to text files, arrays, bubble sorts, structs, hidden functions, etc.. very business based programming. Most of what I do for work is Bash scripting, SQL queries and some powershell. We very briefly touched on some goofy Carnagie Mellon University graphics library in high school, drawing squares that changed color in the last week of class.

So I'm fairly nervous about getting my hands dirty writing some sort of slow, kludgy graphics when really I just want to write the logic under it. In theory some sort of game engine would let me bypass a lot of that. Also I guess I did a lot of Quake 1, 2 and TF2 level design at some point in the distant past.

Hadlock
Nov 9, 2004

I wonder if gutting a project like LinCity or OpenTTD would be easier than writing something from scratch? Pyglet + Cocos2d looks promising, thanks for the suggestions!

Hadlock
Nov 9, 2004

Tres Burritos posted:

What funky language

Assembly

Other, more realistic hipster coder options

Ada - work for an insurance company!
COBOL - work for the government repairing 1980s era weapons systems!

Every couple of years someone releases a custom built window/GUI system that will boot on a floppy and only uses 150KB or so in assembly. But they're completely insane. Systems 1-6 for the Mac was written in assembly and fit on a n 800kb floppy (and holy hell are they fast, even by today's standards).

Hadlock fucked around with this message at 06:14 on Apr 13, 2013

Hadlock
Nov 9, 2004

When we created the wookwook server whitelist system/pubbie kicking bot for bad company 2, and then ported it to battlefield 3, I maintained the code on github through v1 - v3.5. While I didn't write much of the code, it was really helpful to show my boss and say, "look at my project management skills! this was so useful we had five or six strangers fork the code and even pushed some bugfixes! I didn't write much, but I commented the majority of the code" etc etc. Got me the job anyways. 18 months after the project effectively died, I had two different people contact me wanting updates so that they could run the software on their server community.

We released everything under the wtfpl license.

Hadlock
Nov 9, 2004

My friend actually writes software for medical devices. From the stories he told me, there's no way my code would make it through the auditing process at the FDA.

Hadlock
Nov 9, 2004

ineptmule posted:

At work we're looking at getting an (I assume fairly simple) app or script to automatically re-establish comms after losing a connection on a piece of broadcasting software on a laptop that's closed up and carried in a backpack.

Have I given enough information to get an idea of what's needed - what languages might be suitable etc.?

Is this likely to be possible and/or easy?

Operating system? For windows some combination of powershell and/or AutoIT. Bash/Cron on Linux. It's pretty routine to monitor and restart a service via a script.

Hadlock
Nov 9, 2004

Is there an extremely simple 2D flight model that incorporates thrust, drag, lift and gravity? Perhaps not a one-liner, but a simple C library for arcade-style flight simulation that's less than 100 lines long. Or am I assuming this is a much more simple problem than it is? I can't find a whole lot of information on this topic.

Hadlock
Nov 9, 2004

When you guys write something new from scratch, do you just hammer out some giant awful mess of one or two original files + some helper libraries until it's working, and then refactor about half the code in to a bunch of separate maintainable files, or; do you know better to use all of the correct programming practices from the start? I've gotten better knowing how I want to structure a series of functions and methods but I still end up refactoring big chunks of it for efficiency later on I've noticed. I haven't written anything over about 3000 lines of code though.

Hadlock
Nov 9, 2004

So my object "Jet" has many properties, but a couple of them are going to be queried frequently; in particular these three:

-arrival
-departure
-hold

Is it better to create a single property as a string or int (
[string] Jet.status = "arrival"/"departure"/"hold" -- or --
[int] Jet.status = 0 / 1 / 2 )

Or should I set each property as a bool (
[bool] Jet.arrival = 0,
[bool] Jet.departure = 1,
[bool] Jet.hold = 0 )

Orrr since arrival/departure are standard and "hold" is kind of the exception state, two Bools,
[bool] Jet.status = 0 / 1,
[bool] Jet.hold = 0 / 1

The problem I have with the last setup is that I have to remember if arrival = 1 or 0 and vice versa, and trying to keep track of that definition when debugging this sounds like nightmare fuel as there's no obvious 0 or 1 analog.

Hadlock fucked around with this message at 09:29 on Jul 5, 2015

Hadlock
Nov 9, 2004

Yes, enums is exactly what I was looking for, thanks! Since I only had three elements I started googling for qubits and trinary variables which led me down the wrong path I think. Thanks for understanding, translating and answering the question I didn't know how to ask :)

Hadlock
Nov 9, 2004

How many object properties is too many? There's one Stack exchange question asking which browsers can support javascript objects with 70,000 properties. That seems.... excessive and poorly implemented.

On the flip side, is 40 properties per object realistically too much? 15? 64? I realize you can break down most properties in to collections of subgroups, etc but a game like dwarf fortress, from what I can tell, each tile has it's coordinates, temp, humidity, history, language, contents, etc etc etc, basically a lot of minutae. I'm wondering

a) when does too many properties begin to impact performance and
b) at what point (number) does having too many properties begin to point to a possible major flaw in your methodologies?

Hadlock
Nov 9, 2004

sarehu posted:

But: if you would find yourself capable of passing only the weapons_info or health_info object, instead of the entire player_info object, to a bunch of subroutines, then that's a substantial organizational win -- not "meh" at all.

This is gold, thanks, I think this answers, what I think I was trying to ask

This thread is awesome, I appreciate the discussion and extrapolation of questions here, I learn a lot every time someone here posts something because the people who answer are quite good at answering questions, thanks!

Hadlock
Nov 9, 2004

IratelyBlank posted:

(Windows) and can report who is running how many instances of this simulation software we use and how many cores, gb of ram, etc. they are using and it will all be displayed on a web interface so everyone has access to it.

You want to do this in powershell, enable psremoting on your remote computers/workstations/servers (command is "Enable-Psremoting" and then hit "a") it would be something like this run on your webserver, with it (the powershell script running what, every 2 minutes via windows task scheduler

code:
$cpu = ICM servername { Get-WmiObject win32_processor | select LoadPercentage  |fl } 
$numberofsims = ICM servername { @(get-process -ea silentlycontinue mysimulation.exe).count }
And then feed $cpu and $numberofsims in to whatever. ICM is valid powershell shorthand for Invoke-Command. You could probably feed it in to a giant string that outputs as static HTML and saves the text file in the folder served as a webpage. Just make the output like,

code:
$htmloutput = for each ($server in $servers){"<b> $server </b> has <b> $numberofsims </b> running and is using <b> $cpu </b> cpu <br>"}
And then like,
code:
Out-File -name c:\wwwroot\mysimsdashboard\simdashboard.html -content $htmloutput -force
That's all psuedocode but about half of it should work or you can google the correct syntax on the out-file.

We have a powershell thread :) http://forums.somethingawful.com/showthread.php?threadid=3286440

double edit: where $servers is an array (basically an ArrayList but powershell lets you get super lazy) of server names imported from a CSV file, $csv = Import-CSV -path c:\wwwroot\mysimsdashboard\myservers.csv; foreach ($line in $csv){$servers += $csv.server}

Hadlock fucked around with this message at 07:35 on Jul 12, 2015

Hadlock
Nov 9, 2004

Hughmoris posted:

This question may be more IT-focused but I'm willing to try any tool/language at this point: Can anyone offer advice on printing PDFs to network printers?

My goal is to regex a text file, get a string, and print a PDF to a specific network printer based off that string. Right now my current solution is having powershell first make the network printer be the Default Printer for my system, then print to default printer. Clunky, slow and prone to hiccups I think.

This will be on a Windows 7 computer.

powershell?

code:
for each($line in $textfile){ # parse each line of the text file
  if($line -match 'foo.bar"){ # this is your regex
    get-content c:\docstoprint\doc1.pdf | Out-Printer -name $printername # print to a specific printer
    }
  }
http://ss64.com/ps/syntax-regex.html
https://gregcaporale.wordpress.com/2012/01/18/powershell-to-print-files-automatically/
https://technet.microsoft.com/en-us/magazine/2008.09.windowspowershell.aspx

Hadlock
Nov 9, 2004

What's the term for why it takes so long to develop something from scratch, and people look back and go, "but that's so simple! why would that take three years to develop when I can crank out something identical in 20 minutes" when in fact they were the first ones to develop it

It's called something like, "the cost of first discovery process" or something like that. There's a specific term for it, but it's eluding me at the moment.

Hadlock
Nov 9, 2004

dougdrums posted:

E: Hell, it might be a good idea to start a crypto thread.

This is a great idea, please post a link when you get the OP up

Coursera offers the Stanford Crypto course for FREE and I highly recommend doing it. It just started Monday so you're not at a disadvantage. The lecture video player has a 1.25x and 1.5x speed adjustment which makes it easy to blow through the lectures a second or third time to really embed the info in your brain. I did it about two years ago and it really broadened my perception of how all that works and why there's really only about 100 people on the planet qualified to write commercial grade crypto-anything, and why WEP is such a flaming pile of garbage.

https://www.coursera.org/course/crypto

Hadlock
Nov 9, 2004

Hadlock posted:

This is a great idea, please post a link when you get the OP up

Coursera offers the Stanford Crypto course for FREE and I highly recommend doing it. It just started Monday so you're not at a disadvantage. The lecture video player has a 1.25x and 1.5x speed adjustment which makes it easy to blow through the lectures a second or third time to really embed the info in your brain. I did it about two years ago and it really broadened my perception of how all that works and why there's really only about 100 people on the planet qualified to write commercial grade crypto-anything, and why WEP is such a flaming pile of garbage.

https://www.coursera.org/course/crypto

NIST formally announced SHA-3 today

https://en.wikipedia.org/wiki/SHA-3

Hadlock
Nov 9, 2004

I think microsoft has a dummy db you can download and play around with. It's a lot easier to pick up if there's a good data set you understand, instead of trying to learn using tiny tables with fake data.

And yeah, SQL is SQL is SQL. There are some fancy vendor-specific SQL statements, Microsoft has their own called T-SQL which has cool stuff like MAX and a few others that I use as crutches in my day to day stuff.

Start off doing a bunch of SELECT queries, left joins, right joins etc etc., probably whatever data set you're working with you'll figure it out pretty quick, SQL is pretty drat basic so you can pick it up easy.

I picked up the bare bones basics in 2-4 days, and was writing pretty decent queries within 2-3 weeks.

Hadlock
Nov 9, 2004

program666 posted:

So, there is pretty much no way to program for android without using eclipse right (or some other IDE)? I tend to avoid using this stuff and when I programmed for j2me I used some very minimalistic program (that I forgot the name of) that would create the project structure and that was about it if I recall correctly, even compiling I was able to do with a simple command line I think. I'm looking for something like that for android but I guess it doesn't exist right?

Do you want to write and cross-compile console apps for the underlying linux layer on your phone, or write java android apps with all the Android L (5.1) touchscreen widgets?

Hadlock
Nov 9, 2004

Here is a powershell example where I am adding a boeing 777 jet to the airspace object in my simulator with a randomized flight number and randomized number of passengers. This is probably a bad example.

code:
function Rand777 {
    $Jet = $Jet.psobject.copy()
    $Jet.flight = Get-Random -Minimum 500 -Maximum 599 #$flight
    $Jet.passengers = Get-Random -Minimum 90 -Maximum 200 #$passengers
    $Jet
    Write-Host "[Spawned a jet]"
} 

$Airspace.jets.add((Rand777))

Hadlock fucked around with this message at 01:12 on Aug 25, 2015

Hadlock
Nov 9, 2004

I obviously can't get in to it, but you would be stunned how often that happens to this day.

Excel 2003/2007 is like the COBOL of my generation.

Hadlock
Nov 9, 2004

I was curious so I looked it up,

It looks like bittorrent used wxpython for the GUI and was packaged using py2exe

http://www.wxpython.org/
http://www.py2exe.org/

Hadlock
Nov 9, 2004

You mean like the spam filter (or whatever automated blah blah) is following the link and auto-verifying?

Two things I would do

1. Use cookies, the user that registered + the user that follows the link should use the same cookie (preferred)
2. Put some sort of delay in the system, i.e. email gets sent out, wait 90 seconds, then allow verification (very hacky but whatever). Put a message out there that says "we don't have your verification ready, yet. try back in 90 seconds" with some sort of live count-down and auto-refresh enabled

I'm not positive what the best practice is but #1 is probably loosely going down the correct path.

Hadlock
Nov 9, 2004

Has anyone written anything of great interest using Rust yet?

Is Atom/Sublime the new vi/emacs war?

Hadlock
Nov 9, 2004

I want to build a docker containerized app that will accept API posts and then display the most recent API post as an html page and save it to a database. The API post would include three things, auth token, roomid(int), occupied(bool). Longer term plan would be to output the last X records from the database based on an API for building graphs, etc.

Also I'd like to throw this finished in a docker container so if I could build it on top of a common language with a good docker base image (https://hub.docker.com/explore/) that would be great.

So to summarize, for an extremely simple API app with HTML output and basic db (could even be a flat file CSV really, performance is not important here) that has good containerland support, best language/tutorial(s)? Building and maintaining Ruby on Rails seems really excessive for what's little more than a "microservice".

Hadlock
Nov 9, 2004

You may want to look at ThingSpeak

The free tier allows up to 8 datapoints per API call, with a minimum average API delay of 15 seconds between posts. From there you can import the data directly in to Matlab with a visualization wizard of some sort

https://thingspeak.com/apps
https://thingspeak.com/apps/matlab_visualizations/templates

Thingspeak is also open source, so you can install it on your own server for free. Then you can do 100 datapoints every 1 second if you wanted.

If you have a linux machine somewhere, install Docker and you can spin up a ThingSpeak server in about 90 seconds. Pull this repository using github

code:
sudo apt-get install docker-engine
sudo service docker start
git clone https://github.com/Hadlock/thingspeak.git
docker-compose up -d
docker-compose run --rm web rake db:create
docker-compose run --rm web rake db:schema:load
I'm using this to pull in sensor data from the two restrooms in our (overcrowded) office and post it to a webpage so people know when there's a bathroom free. My use case is much lower than yours (2 bathrooms + 2 conference rooms @ 20 seconds) but it's an easy way to dump sensor data in to a database and get it back out again.

Hadlock fucked around with this message at 06:24 on Jan 22, 2016

Hadlock
Nov 9, 2004

re: P-value

If it's a single table, you could just store everything in a CSV file. There's no need to get hyper-fancy with Access unless you need the features available.

Hadlock
Nov 9, 2004

For those of you using JIRA and/or Bamboo by Atlassian as part of continuous integration,

What kind of test case manager are you using?

It looks like Zephyr is the 800lb gorilla, followed distantly by X-ray and Zapi. Is anyone using these? What do you use, what do you hate about it?

Hadlock
Nov 9, 2004

DoctorTristan posted:

Python and its environment/path fuckery is going to drive me to a killing spree one day.

I've been playing with Rust recently and am over the moon in love with Cargo build tool. Push button get program.

Hadlock
Nov 9, 2004

Check out MIT open courseware, it's their beginner -> computer genius computer science program for college freshmen, it's offered in Python:

https://ocw.mit.edu/courses/electri...thon-fall-2016/

I think it's using Python 2.7 but it might be 3.6+ but my buddy used this to make way more money than he ever thought possible

Hadlock
Nov 9, 2004

Xarn posted:

1) Makefiles are bad
2) Makefiles that call makefiles in subdirectories are worse
3) If you haven't you can turn off default rules for cheap speed up

My experience with people who have makefiles for loving everything, is that they write endlessly complex speghetti code

In my last four jobs we had two super-makers* and while they were able to churn out a bunch of technically functional code, it was so overly extensible that even small changes required multiple changes to multiple files due to the way the config inherited config from other areas

When they finally left their projects ended up getting a total rewrite because it was faster to rewrite a functionally similar code rather than try and wrap their head around all their design decisions

All their code was ridiculous multi nested makefile bullshit. Nested makefiles to build docker containers even

*Makefilers

Edit: oh yeah looking back a page, one of our services has a custom json based DSL for config. Same guy

Code golfing is fun and demonstrates how loving clever you are, but more often than not unless you have good reason for it, makes code unmaintainable

Hadlock fucked around with this message at 21:08 on Feb 20, 2020

Hadlock
Nov 9, 2004

Are there any US-based banks that provide an API where I can pull back my current balance amount

Hadlock
Nov 9, 2004

On further inspection there's Plaid they have an API and the free tier would allow me to pull back the balance of one account, which is all I need

Somewhat leery of handing my banking info over to a startup just to get my balance. Looks like Plaid is just literally screen scraping the website in most cases, which seems horribly inefficient but whatever

Looking at gnucash they have support for it looks like us bank, most of the integrations are for bank's stock trading platforms, which I don't especially care about. US Bank ofers ofx support for $3.95/mo I think, based on the doco I saw

Hadlock
Nov 9, 2004

Visual FoxPro is just a warmed over version of FoxPro with some compatibility layer for running on Windows 2000 AFAIK

FoxPro is the rebranding of something else, I think Microsoft bought them as part of their embrace extend extinghish campaign in the late 1990s. I worked at a place that put a foxpro system in place back in 1998 or so and even then it wasn't exactly cutting edge technology... good luck

Hadlock
Nov 9, 2004


Someone described this as the output of smooshing jaeger and... some competing open standard together, and it has a "driver" for Prometheus, is that about correct?

Has anyone actually used this in prod yet? What were your experiences

Looks interesting, and it's an official CNCF project, but seems new to me

Hadlock
Nov 9, 2004

Elasticsearch, Logstash, and Kibana

Dead reliable but Kibana wants $16K/year for SSO integration at the lowest tier

Hadlock
Nov 9, 2004

Is it A RESTful API or something serving up HTML or what? That will dictate your toolset/methodology

I would write a test harness for the old app in the new framework/language, and out the results in json, and then write a script to boot up both apps as containers, run the harness against both containers, and then diff the JSON output

Hadlock
Nov 9, 2004

Dominoes posted:

Don't learn JQuery. You need to learn to program for web servers, which is most easily done with a backend framework. PHP and node are popular examples, but they're both a mess. I recommend starting with a batteries-included framework like Python/Django, or Ruby/Rails. Another approach is using a minimal framework, like FastApi or Flask for Python, or one of the ones for Go or Rust. You'll have to write more manual code for solved problems this way, or use addons. Eg for the email notifications, login you mention.

You can complete your objective without using SQL, since the frameworks include high-level tools (called ORMs) that execute the SQL for you. That said, I recommend learning it, as it's universal, and will protect you from getting stuck in a particular framework, and its provincial DB dialect.


TLDR: Follow this tutorial to completion.

This is a good one: https://tutorial.djangogirls.org/en/

Walks you through how to build a blog

Oh, bummer, rails for zombies is down. Personally I like the djangogirls blog example, it's really straightforward, but rails for zombies is a sort of gamified way of building a twitter clone, but for zombies.

You could write something in Flask, but I think Django is a better option for something like this. You should be able to build the functional djangogirls blog app and then modify it to meet your needs. Personally I think there's just slightly too much magic in ruby on rails with hidden symlinks etc that cause weird unintended side effects. Django/python is a nice mix of batteries included, and "oh yeah, this thing goes here, ok, cool".

Adbot
ADBOT LOVES YOU

Hadlock
Nov 9, 2004

KillHour posted:

I use Lucidcharts and I like it.

I got into a fight with our director of IT over the mere discussion of revoking seats on our license

Lucid charts is really good, it works exactly how I expect a flowchart/diagramming app to work. And it's fast, and it supports stuff like copy-pasting transparent logos of products we use directly from Google image search into the app

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