Welcome, Guest. Please login or register.
April 24, 2019, 09:51:04 am

ballp.it is the community forum for The F Plus.

You're only seeing part of the forum conversation. To see more, register for an account. This will give you read-only access to nearly all the forums.

Topic: Thread.setTitle("Programmers Anonymous");  (Read 14441 times)

LaserSeusan

  • Paid
    • 571
    • 41
Thread.setTitle("Programmers Anonymous"); #120
For my latest project, I'm trying to drop jQuery in favor of just regular JS, and part of the process involves moving from $.getJSON() to fetch(). However, I'm trying to fetch the json data from HTTPS to HTTP, which throws an error. I can set the call mode to 'no-cors', but then all I get is an opaque response, likely because the HTTPS server isn't set up to handle the request. Is there any way to make fetch() work? I assume it has to be possible since $.getJSON() works just fine. I could just make the source use HTTPS as well to get around the whole issue, but I'm trying to make it so that the code will work no matter where it's being run from (basically, is it common practice to make HTTPS a hard dependency?)

Edit: nevermind, did a deep dive into how JSONP works, and how jQuery automates the process behind the scenes. I've learned how to append the script into the head tag to pull it's info.
« Last Edit: November 18, 2018, 09:58:06 pm by LaserSeusan »

Tupocky

  • egg
  • Paid
  • egg
  • 3
  • 1
Thread.setTitle("Programmers Anonymous"); #121
I'm in a "concepts of programming languages" class, and the past few weeks have been entirely on this language, Standard Meta Language. Using it is kinda like coding exclusively in command-line Python, but with the added bonus of being a functional language from 1983. I think at this point in my education I can justifiably say "why the hell am I learning this, and when will this ever be useful?"

Ambious

  • Paid
  • Up the Irons!
  • 2,350
  • 14
Thread.setTitle("Programmers Anonymous"); #122
TIL that with "Git Extensions" you can stage discrete lines for commits rather than entire files if you want to. Made splitting up the GIANT commit I had for my month long project into subject commits much easier.
Also the more I use C# the more I discovered how great it really is.

LaserSeusan

  • Paid
    • 571
    • 41
Thread.setTitle("Programmers Anonymous"); #123
Got my first interview request! I'm going to be cramming and preparing for interviews as much as possible over the next couple of days (haven't confirmed on an interview date). There's a few things that might work against me: 1) I don't have a relevant degree (Graphic Design, not Computer Science), and 2) I've never used Vue.js, which is something they're really looking for. I'm basically going in on the premise that I can easily apply my current degree's skills to match their needs, and plan to be upfront about not knowing Vue but willing to self-teach (already started with the basics, seems fairly straight-forward and not too different from React!). Do you guys have any advice on these things, or anything in general?

Darkly

  • Paid
    • 396
    • 27
Thread.setTitle("Programmers Anonymous"); #124
Not sure how many people here will care, but I'll share anyway.

The next version of Pythonista (iOS Python IDE) will apparently include a custom system-wide keyboard that lets you use any text editor app as a Python interpreter.

https://twitter.com/olemoritz/status/1070002291535740928

jack chick

  • he/him
  • Ridiculist
  • Metal tyrant from hell
  • 2,839
  • 666
Thread.setTitle("Programmers Anonymous"); #125
today i was reverse engineering a test from another team in order to access some arcane APIs and encountered the a GET call titled "get website". being the intrepid sort that I am, I called it and received a 6.2k line JSON object back containing, presumably, the website. the very next call in the repo is called "update website", which is a POST request that submits a 6.2k line JSON object to a very similar URL. They did, however, change about 20 fields or so. as this is tangentially related to the work i'm doing, i explored around to see if this was relevant to the test that's being run, and no, it doesn't actually have any effect. HOORAY!!!

Ambious

  • Paid
  • Up the Irons!
  • 2,350
  • 14
Thread.setTitle("Programmers Anonymous"); #126
today i was reverse engineering a test from another team in order to access some arcane APIs and encountered the a GET call titled "get website". being the intrepid sort that I am, I called it and received a 6.2k line JSON object back containing, presumably, the website. the very next call in the repo is called "update website", which is a POST request that submits a 6.2k line JSON object to a very similar URL. They did, however, change about 20 fields or so. as this is tangentially related to the work i'm doing, i explored around to see if this was relevant to the test that's being run, and no, it doesn't actually have any effect. HOORAY!!!
jack chick, January 05, 2019, 12:58:47 am

This is how security breaches are born.
Back when I was working in retail I found a similar call on a competing company's website that basically gave me access to all their products and pricing, and so I made a scraping tool for our sales reps to be able to match prices on the fly.

SATAN MILKSHAKE

  • some people's reactions such as the fuck,the hell,wtf, or what the hell
  • Paid
  • I have a problem and then I have another problem
    • 1,978
    • 146
Thread.setTitle("Programmers Anonymous"); #127
Good: I'm learning PHP as I work on building my own portfolio website.

Bad: "//The tag array is sorted alphanumerically by default."  The tag array, after thirty minutes of breaking half the web page, turns out to not be sorted alphanumerically, or, indeed, at all.

jack chick

  • he/him
  • Ridiculist
  • Metal tyrant from hell
  • 2,839
  • 666
Thread.setTitle("Programmers Anonymous"); #128
Hey, question. Anyone super familiar with the builder design pattern?  (my project is in Java)

Basically: I have a class with ~30 fields, and an inner public builder class. The build() method of the inner class returns a new instance of the parent class and passes in an instance of itself. the parent class has a private constructor which assigns the fields collected by the inner class to the private fields on the parent. One of my coworkers has  requested that I move the initialization of those fields out of the private parent constructor and into the build() method between instantiating the new parent and returning it.

The question is: Does this matter? Is there any real tangible gain here aside from not having to pass an argument? The person making the request hasn't explained why he wants this beyond "the way you're doing it is Bad".  Guy is also kinda dumb so I'm not really inclined to listen to him.

Lemon

  • (I have no sex virus)
  • Administrator
  • Miss Priss, I'd like to piss on your coat.
  • 3,397
  • 380
Thread.setTitle("Programmers Anonymous"); #129
This seems like the right place to bring this up:

Trying an experimental redesign of the code block. First attempt was to mimic the Apple ][e color scheme.

https://github.com/AhoyLemon/ballpit/issues/50

If you have a preference on how you'd like to see it, let me know. Keeping in mind that I'm not gonna do syntax colors - whatever it ends up being, it'll be monochrome.

Lemon

  • (I have no sex virus)
  • Administrator
  • Miss Priss, I'd like to piss on your coat.
  • 3,397
  • 380
Thread.setTitle("Programmers Anonymous"); #130
Ignore me, testing something.

javascript
alert('hi');

Ambious

  • Paid
  • Up the Irons!
  • 2,350
  • 14
Thread.setTitle("Programmers Anonymous"); #131
Hey, question. Anyone super familiar with the builder design pattern?  (my project is in Java)

Basically: I have a class with ~30 fields, and an inner public builder class. The build() method of the inner class returns a new instance of the parent class and passes in an instance of itself. the parent class has a private constructor which assigns the fields collected by the inner class to the private fields on the parent. One of my coworkers has  requested that I move the initialization of those fields out of the private parent constructor and into the build() method between instantiating the new parent and returning it.

The question is: Does this matter? Is there any real tangible gain here aside from not having to pass an argument? The person making the request hasn't explained why he wants this beyond "the way you're doing it is Bad".  Guy is also kinda dumb so I'm not really inclined to listen to him.
jack chick, February 15, 2019, 12:41:17 am

It only matters if any of the fields is meant to be read only, and even then your way is better. It also depends on how the inheritance relationship is implemented - but it doesn't REALLY tangibly matter.
Most design patters are highly theoretical anyway and only exist to make different coders remain internally consistent, and especially in languages like Java and C# it doesn't really matter.

Darkly

  • Paid
    • 396
    • 27
I'm hoping to code something with some picky requirements, so I'm wondering if anyone has recommendations.

Basically, I want to make a simple app that I'll be using at work. Any language/frameworks I use are going to have to be portable, since I can't really install things on work PCs. Additionally, it'll have to be easy to run on different computers, so it can't have any dependencies that aren't easily bundled into the app itself.

I'm considering just using html and javascript, but I'll want to save/load files (probably just json data) and I feel like an html "app" would have too much friction with that, although I've never really done a lot of javascript so I could be wrong.

I'm pretty familiar with Python, and I can install a portable Python version on my own PC to do my development. Would something like py2exe make it easily runable on other PCs? I've never really used it before.

Is there anything else I should consider?

Ambious

  • Paid
  • Up the Irons!
  • 2,350
  • 14
A lot of people here dabble in code.
Let's share our experiences and bitch about how much we hate it but can't stop doing it anyway.
I'll go first:

My name is Ambious and I've spent my entire evening programming my first Python app.

WHO THE FUCK INVENTED THIS MESS!?
IT HAS ALL THE SYNTAX CONSISTENCY OF VISUAL BASIC!!!
AHHH!!! HOW IS THIS SHIT SO POPULAR!?
Ambious, July 01, 2016, 04:20:08 pm

This post did not age well.
Given the choice of language to perform scripting operations nowadays I'd pick Python over anything.
I still prefer C# for OOP, as Pyhton's OOP is extremely bad and feels like it was tacked on as an afterthought, but yeah Python is great and I was wrong.

I'm hoping to code something with some picky requirements, so I'm wondering if anyone has recommendations.

Basically, I want to make a simple app that I'll be using at work. Any language/frameworks I use are going to have to be portable, since I can't really install things on work PCs. Additionally, it'll have to be easy to run on different computers, so it can't have any dependencies that aren't easily bundled into the app itself.

I'm considering just using html and javascript, but I'll want to save/load files (probably just json data) and I feel like an html "app" would have too much friction with that, although I've never really done a lot of javascript so I could be wrong.

I'm pretty familiar with Python, and I can install a portable Python version on my own PC to do my development. Would something like py2exe make it easily runable on other PCs? I've never really used it before.

Is there anything else I should consider?
Darkly, March 16, 2019, 01:44:07 pm

I think you'd be best to go with Node.js
It's very portable (unlike Python, the packages are per-project so they go with you), and it's cross - platform and versatile.
Darkly

Darkly

  • Paid
    • 396
    • 27
I think you'd be best to go with Node.js
It's very portable (unlike Python, the packages are per-project so they go with you), and it's cross - platform and versatile.
Ambious, March 16, 2019, 02:04:06 pm

I tried node.js for another unrelated project once, and I was turned off from it when I tried installing node-sass but couldn't without admin privileges.

I might give it another shot though. It seems pretty attractive as long as it works in my environment.

Edit: after playing with node some more, I think that plus electron may actually be exactly what I need!
« Last Edit: March 16, 2019, 05:19:26 pm by Darkly »