#development
1 messages Β· Page 46 of 1
@buoyant creek Experience does not mean much.. I've read a lot of C++ code for a piece of software I use at work, also added a few debugging statements here and there, when it didn't work as expected. But I'm not able to start anything from scratch. Without any extra info "Experience with" does not mean a lot.
Then it's up to him to give more details, we already gave some nice tips with what he just said.
@ashen sky thanks. I know c++. Im a graphics software engineer with openGL and c++ primarily.
The reason im interesting in javascript for realtime image processing and computer vision, is because ill be building a javascript web application for a company, who in the future may want to expand to an app and add that type functionality.
@buoyant creek to be determined. ^^^ Im trying to see if its possible to lower the cost with javascript as well, as c++ takes a lot more to write.
Like if it works, it works. Ya know? I just dont even know if its possible with how fast javascript is vs c++.
Choppy and glitchy is not the goal lol.
Anyways, i think i came up with a solution for the company now... one that would avoid the need or drastically lower the added value for such an app.
But im under NDA, so i cant really say anything specific.
@delicate snow thatβd be something fit for webassembly. If youβre concerned about compatibility, then maybe asm.js. But nearly every browser supports webassembly nowadays.
Thatβs a very common use-case for webassembly. I have a qrcode scanning webassembly project that runs using the camera on the device. It uses OpenCV to scan for barcodes and qrcodes in real-time. Standard JavaScript was successfully scanning at about 1 frame/second. Webassembly would get about 10 frames a second in Mobile Safari on the iPhone.
It was very unoptimized code, but it worked, and 10 frames/second was very acceptable for us.
Hmmmm @lunar quail well that gives me something to think about. That sounds like it may be something thats less intensive to compute though. This would be along the lines of 3D tracking to super impose an image.
@lunar quail i dont think theyll explore it tbh. I told them that what they are thinking about is very complicated, and not cheap.
But i just gotta make sure i keep that door open with a low effort path there from whatever i write.
@delicate snow if/when you do get around to it, emscripten is your friend. It does all the transpiling and library loading with llvm. It even builds an html loader file as an example
Mmm solid recommendation. Youre not the first. I was told to use it to compile c++ to javascript, but havent explored it yet.
I know its solid, cuz so many people have told me to use it for all sorts of things.
@delicate snow web app or phone app?
for android app, use Tensorflow lite from C++, and interact with it with the JNI
for a web app, tensorflow non-lite from Python or C++
for Apple, fuck idk
im specifically talking about computer vision, for image processing, see if you can offload that to the GPU via webgl or similar
How good is Tensorflow C++ api compared with Pytorch? I have seens talks about the latter one, seems pretty sweet.
Okay I need some help
I am trying to figure out how I am going to get Razer Chroma to talk to my Coolermaster RGB. I think I might need to use the SDK and translate the API between both adding support.
Both have an SDK
@proper gale why not like openCV? I havent delved into th field of image processing and computer vision yet. I just have like some basic theory knowledge, and same for AI and machine learning. Same for mobile.
My expertise is in graphics programming, like i said. Im... ive spent about a year learning programming and about 6 months learning math i think. So i think im considered new to programming? π
Well what do you actually need it to do?
Computer vision and image processing are so generic that no answer is really wrong
Also, opencv is built on top of tensorflow
Iirc on opencv
Any Python guys in here?
Me
@worthy dirge i mean, tensorflow's python API is implemented on top of its C API, C++ being idfk but you can use the C API
the C++ API is meant specifically for embedding stuff though
so, you have a model you trained in Python already, you can load that in C++ and not need to bother with Python
@proper gale I guess you're a bit confused. OpenCV and tf are 2 completly different projects. In fact, opencv is way older
the what the fuck is wikipedia on about, ive heard of OpenCV, knew what it did more or less, never checked into much more about it
specifucally OpenCV supports the deep learning frameworks TensorFlow, Torch/PyTorch and Caffe.
its not just tensorflow, but i can be tensorflow
i omitted the others because, well, nobody cares, everything is tensorflow.
thats what wikipedia/github seems to be saying at least
relvant github link https://github.com/opencv/opencv/wiki/Deep-Learning-in-OpenCV
You can use OpenCV (a computer vision meant for real time stuff) along with tf/pytorch/we in order to gather images from the first and pass that images into your DL framework
yea, that makes more sense
anything ive done stayed as TF
TF-lite is a competetor to OCV i guess then?
iirc, its designed for real time inferencing.
yup, i was correct there, its for inferncing on mobile devices.
TensorFlow Lite is an open source deep learning framework for on-device inference.
from tensorflow.org
opencv is meant to work with vision, and you can attach models made somewhere else for it to use
TF-lite can do that same thing, but meh
tf-lite is meant to run any kind of pre-trained model (not actually any, but that's not relevant), be it images or not
im not knowledgable enough here really.
You can do inferences from data extracted from a pdf, image or chat messages
i rarely touch anything not C++
and the ML/CV stuff while i do a bit of that shit, its minimal.
I used to work with embedded and automotive stuff, but made the jump to ML and DS last year
want to run arbituary C++ code compiled at runtime? i can help you with that.
as soon as LLVM fixes their operator overloading bugs with C++20
well, Clang
Reminder to any game devs here, this weekend is Global Game Jam 2020.

@last ingot when embedding shit, Clang works far better. and from my experiance clang has better errors than GCC< so i use clang
if its something someone else wrote, they should be pretty damn similar
ive used both, i can use both just fine, Clang is easier to work with when you fuck up.
GCC errors are or at least were significnalty more cryptic.
new code.
porting shit i dont know.
comparatively cryptic
both are horrid for template errors, but meh
no compiler does a good job there
also, from a code base standpoint, Clang is better for embedding than GCC
Clang being part of the by design modular LLVM stack, vs GCC being, well, not.
embedding in an application/driver/etc
for drivers, AMD at least uses them in their drivers
not sure about Nvidia
embedded systems shouldn't be running a compiler in the first place.
well, lets say you want to make a GPU driver, you need a way to compile the shaders, instead of calling something on the command line, you use an API provided by Clang to compile the code.
Clang/GCC are almost perfectly interchangable on linux
so long as you dont go fucking with the standard libraries, you can link between them just fine
libc++ will fuck you up a bit there, because you need to make sure everything else is compiled against it for it to work correctly
if libc++ stuff is used in the API, if its not then you dont actually need to, its weird
does anyone have servers and wanna start a host
I really love clang, but gcc has far better support for some embedded devices
I would say msvc has better template error message than gcc
i was comparing GCC and Clang, havent used MSVC basically at all myself.
Does anyone have or can get me the Clickteam Fusion Android Exporter? Mine is corrupted. Thanks
Yeah?π€ But there is MSVC running on wine on compiler explorer
I just realised how easy HTML is
it's easy until it's not. and if you haven't reached the point where it's not you haven't done it enough yet
I mean as programming goes, it's not hard compared to things like c++
it really depends on what you see easiest
some might be talented in web design and others in low level stuff like C
@nocturne galleon HTML is as much programming as writing a document in word...
I have couple of questions for you guys
- Anybody uses Window Subsystem for Linux is good compare to something like Git Bash?
- Is Dual Boot worth it ? For learning to code
3 Have you used chocolatey if yes it worth it ?
Please reply ASAP
- Used to use its first version until I was allowed to install linux at my previous job, it was really slow and had some problems with the file system, but I guess it was better than git bash
- I think so? I haven't used windows in years, so I can't say much
- Again, not a windows user, but it seems like a cheap shot at a package manager for windows
@vocal fable
- Anybody uses Window Subsystem for Linux is good compare to something like Git Bash?
Not used it but I use Git Bash on my work and it is "fine" but not that great.
- Is Dual Boot worth it ? For learning to code
Personally, I am not that big fan of dual boot since it makes it rather inconvenient to change between each installation each time you want to change context. I would start with a Virtual Machine and if you are going to like it, go full Linux on a dedicated machine.
3 Have you used chocolatey if yes it worth it ?
Yes, and I think it is a rather horrible attempt to simulate a package manager on Linux but at the same time trying to much to make everything automatically with some really nasty scripting.
Thanks @sage vector !
@vocal fable cough just install linux
Sorry.
-
Git bash and the WSL are two completely different beasts. One just tries to be a nicer environment to run git commands whilst the other litterally tries to be Linux. From my experiance getting files in and out of the WSL environment is a bit of a pain but I beleive they have fixed that mostly?? So... depends on your use case as to whether it's 'good' or not.
-
Dual booting is well.. Annoying imo. You'll probably find that you just end up using what your used to all the time leaving the other OS mostly unused and a waste of space. If you intend on learning Linux, use it like you mean it, install it outright and learn otherwise you'll probably just neglect it. If your thinking of using linux for leanring to code... ehh, find a platform you like (whether it's linux, mac or windows) and learn on that. Coding environments differ slightly from platform to platform and learning the ins and outs of your platform for what your learning is rather helpful. I've used Linux for >5 years and I'm at the stage where I have no clue how to even use windows let alone compile C code on it.
-
Exactly what @sage vector said although I want to add that unlike linux package managers, chocolately doesn't download from a software repo like package managers but rather just grabs the latest version from the software's website and therefore has no concept of version control or upgrading software or even making sure that what it's downloading is going to be reliable. The usecase for chocolatey is when your trying to automate the deployment of new windows machines rather then for the end user trying to maintain their software.
Thanks @raven kernel for your advice
np happy to help
by they which linux disto are you running right now?
@vocal fable Arch Linux (and have done that for the last 14ish years)
ok I am running Pop OS on VMware right now
Arch is bit too much for me right now
what kind of development are you doing right now?
Well, I am not using Linux at my work but for home projects I am using primarily IntelliJ on Linux to develop Dart and Java programs
My current project is making a lib to interface LIRC (infrared remote control system to send and receive infrared signals) with Dart
But yes, Arch is not for everybody but it is really great for people like me π
sounds cool
Anyone here ever tried to use nginx as a server for a rtmp stream that allows clients to view it through mpeg-dash?
I am using Ubuntu server (I have two servers). Currently my work computer has dual boot with Windows 10 and Arch Linux. But I will install Manjaro Linux (Based on Arch Linux) soon.
Manjaro is said to be Arch on training wheels
Manjaro is really not Arch. It is more like a fork than a distribution based on Arch.
@zealous ginkgo Can you share your Dual boot experience ?
I switched to Arch from Ubuntu desktop but I am still not familiar with Arch using from command line. That is why I think that it would be better to install Arch with DE first. Then move to command line.
Yes, I can share.
If you want to make dual booting configuring/installation (I do not know the right word for it) easy, I recommend choosing Linux Mint or Ubuntu. They have option to install alongside Windows.
This install alongside Windows installation option partitions your hard drive automatically, but you can do it by yourself.
But it is not really hard to partition hard drive by yourself.
I was thinking of dual booting Pop os
do you have a specific reason to dual boot or you are doing it just for fun
I am using Windows for gaming, but it is not a good reason because many games can be installed and played on Linux distros.
Linux for development I guess
So sorry I thought that you were asking why I am keeping Windows. I use Linux because I program PHP, Node.JS and Python. So yes, Linux for development. And I am using Windows for gaming and running some exes (I know WINE exists).
will you recommend dual boot to any one who is learning coding?
No, if the purpose is to learn coding I don't think it makes much sense to also start learning linux
Unless you are going to make some Linux specific development
Should add that I think it is important to lean Linux (especially if you are going to be professional developer) but Linux can be complex enough alone π
If you're starting, I don't think it matters
But there's only one guy where I work that prefers to use windows for dev purposes lol
The rest of us mostly use linux, with some on macs
Well thanks guys for your time everyone
Well I am not just starting out I am getting back into Coding after almost a year
Also I have Computer sci degree but it's curriculum is pretty old
@vocal fable Why would you need linux, just to "learn to code"?
Why not?
Why not?
@ashen sky sorry but I didn't get that.
@vocal fable What makes Windows development unfriendly?
You install Visual Studio, and that's it? You install PyCharm, and Python, pretty easy. Also making windows software is QUITE unfriendly on ANYTHING but windows. π
Also knowledge of Linux is considered good for a developer
@ashen sky do you use windows for development?
Depends on what you want to do. If you want to do stuff for the web, sure, but if you want to write business software, windows would be more interesting.
I use whatever I need to get the job done. Mostly we write in PHP, and PHP IS a nightmare on Windows, however, if we used C#, getting it to work on anything BUT windows, would be a nightmare. So it really depends on the platform you develop for, and the level of control you ACTUALLY needs of the system. For learning, I think not much beats VisualStudio when it comes to getting an IDE up and running. It's litterally just a matter of pressing next, and selecting the platforms (Like mobile, web, desktop) and languages you need (Python, C#, C++), then wait and you're ready.
But if you need to develop something, doing it on the target platform is mostly always the way to go. No OS will ever be better suited for the job, than the OS your users use.
And to answer your question, I mostly use PHPStorm and PyCharm on a Mac, as our main target platform is the LAMP stack.
And for a terminal, powershell is quite capable, once you get to know it.
@vocal fable Most of my colleagues use Windows btw.
I trying to learn web development
For that, development OS make no difference. Most of the great tools exists and are fairly easy to install on all three major platforms. (Win, Mac, Lin)
@vocal fable Also, in my opinion, good knowledge of your development OS, will really help whenever something goes wrong. It's WAY easier to troubleshoot something if you KNOW where to look, know where everything is. It makes it much easier to work out, if the problem is in your code, your toolchain, or some OS setting, you never knew existed.
If you want to learn Linux, fine, if you want to learn development, fine, want to learn development on linux? Also fine. However, don't try to learn everything at once. Get to know the OS you want to learn, THEN setup a development environment, and get coding. Trying to learn everything at once, can easily lead to frustrations, when you have no idea where to start, when things don't work as expected.
Okay thanks for your advice @ashen sky
@vocal fable only bit im gonna add, if you think you are going to eventually want to move from windows to linux, make sure whatever IDE you use works well on both.
thats why i didnt spend the time to learn Visual Studio, opting for Clion instead, it runs on Windows and Linux, and i already knew how to use JB IDEs
On Windows, Clion is slower, and less nicer to use imo than Visual studio. And it's not free for everyone
I don't think it's a good idea to get attached to an IDE at all
Use some general purpose editor like sublime, vscode, atom or even vim
I only use IDEs when a specific project/team has build everything on top of it
I would add to this that the need of using an IDE is very dependent on the language you are programming. E.g. it will not be a great experience to be a Java programmer without using an IDE and I guess the same could be said for C#. Even Dart (which are closer to script languages) can be rather annoying without the tooling from an IDE.
The best approach is you know how to work without an IDE, and then just use an IDE
Yes π
i was more getting at that its a PITA to switch IDEs, and you probably dont want to do that at the same time as learning a new OS, your approach to how you like to code is up to you
@worthy dirge, VS being nicer than Clion on windows is exactly why i considered VS in the first place
You can consider QT too, an even less nicer but free version of Clion, if used as C++ ide
the whole reason i went with Clion was because i already knew how to use JB IDEs
the few IDE features i actually want, CLion has, so im just gonna stick with it.
Finally got into Unity for the first time and I'm really impressed. I made a lot more progress then I thought I ever would. I don't really have any idea in mind yet, just learning.
Anybody wanna tell me what I have to learn/do to make my.own smartwatch?
Well, for starters, you're going to need hardware, either something small like an arduino or Tiny board + LCD screen, or a full production facility. Then you'll need to take an off the shelf OS, like Android, and develop it into your own, or write something from scratch, including an app to sync it with smartphones.
Or from the play store
Use STM32 to build from scratch
@buoyant creek For beginners, setting up an entire development toolchain, including editor, compiler, debugger etc. is quite a task on it's own. If you want to get started learning how to write the code, an IDE will lower the barrier quite a bit. Also, never seen a much nicer debugger than the one included in VS. I suppose the one in CLion will be pretty much like what you get in PHPStorm and PyCharm, while gdb or the like, has quite a learning curve of its own.
Fair enough. Although, FWIW, CLion does use gdb as a debugger
And you need extra stuff to set up Clion compiler and Cmake. While VS will run with one key after installed.
If we're talking C/C++ IDEs for starters, nothing beats Code::Blocks
Bundles everything, cross-plat and isn't fucking big like vs

@buoyant creek Visual studio is so much better than Code::Blocks
Code::Blocks is awful. Sometimes GCC doesn't even install correctly and fucks the whole thing up and as an IDE, VS is just nicer, better to use, easier, more features and can do a lot more, not to mention how much better it looks.
Eh, I'm really not a fan of VS, way too clunky and heavy for my taste without bringing much to the table compared to other solutions
Along with being non-free and windows only
It's free
Not if you're using it for actual work
Define actual work
And also in the sense of being proprietary
Something that brings you money
Because then you'd need a commercial license
I do actual work and I use free community edition
from their own site
I don't see a conflict
If you're using as an individual for your own projects, it's fine
For an actual company/workplace, it's not
Wow I bet microsoft is gonna send FBI to your work place
You do know that it's common for them to make audits and get in contact with people that are misusing their licenses, right?
A quick google shows many cases of that happening
Also, your company can't be taken seriously if you don't even pay your own licenses
hmmm, what about VSCode ?
@bleak harness I find it quite lacking, for my taste. It's very similar to Atom.
wait what ? with all the official extensions that exist ?
@bleak harness Having to go through and install a bunch of extensions, is quite wasteful in a work setting, unless it's the only tool able to do the job. I'm about to start on a C# project, and installing a windows development machine, with VS on it, and whatever needed to access our source repositories, took a few hours. If I also needed to install a bunch of extensions just to get basic functionality like integrated compiling, debugging and running of the code, it would had taken a lot of time. I bet you can customize VSCode to be quite useful, however, for me, it's simply not worth my time to find the extensions I need, and install them. I've done it for other IDE's and editors, and to be sure you get the right environment, you have to go through quite a lot of extensions, even some you either decide not to install, or remove after testing them.
If I didn't have any other options, I might had taken the time to customize either VSCode or Atom, but I do have a license for VS, and everything is included after install. π
hmmm, I get your point.
I've been blasting through it with c, py, dart/flutter but I usually run a terminal (ubuntu-bash or powershell) for all my git and compilation needs, which in itself makes it more manageable
I wanted to murder CMakeLists.txt at multiple points back in the day
Sure, I just hate having to switch between applications to do simple things like starting a debugging session. However, I do use Sourcetree for most git operations.
between applications ? I use the terminal pane in VSCode
and I've tried git GUI's but I always end up making branches and f*cking up stashes
Yeah, well, I mostly work with PHP, whenever I use something written with C/C++ or using any kind of make build process, I'm compiling someone elses software. (Mostly Open Source projects)
ah yeah, I do that too, I just take the *NIX version and run make
Well, I probably have too few things I need a terminal for. PHPStorm which is my primary IDE, has a terminal built in, but I've never really had a need for it.
yeah, same with PyCharm, but I sometimes do some grep in bash
Well, mostly you run some combo of ./configure && make && make install
yeah
I hardly ever work with file based data. Whenever I do, it's troubleshooting deployed code, not on my own machine. Which means SSH sessions to remote machines, not doing something in the IDE at all.
hmmm, depends on the work I guess then.
The last few days I've been hardcore using dart/Flutter and VSCode has been a life saver (especially for my laptop's potato RAM)
Yeah, and what environment you're used to. π
Just a matter of using the tool that works best for you, to do the job.
whats wrong with cmake?
I used to love Intellij and the likes, but it's pretty much neodynium in terms of memory and CPU usage
cmake is someone taking 'copy me but don't make it too obvious' literally and just rendering a simple tool unusable
imho
Well, I've not had problems with resource usage in PHPStorm or PyCharm, I've not used other JetBrains IDEs though. The main RAM hog on my work computer are Safari and Chrome. π
how much RAM do you have ?
CLion usually sits at 20-25 for me
my home desktop is at 32 which makes it my main when not otr
@proper gale of RAM ?
mhmm
w.t.f
ive got 96GB in my system, so, meh
@bleak harness Haha.. Actually had to remote in and check. But 16GB in the work computer. But the previous machine I had, had 8GB, which was also no problem for the IDEs.
However, I DID once run VERY much out of RAM, when Safari used about 80 GB (Yes, 80 GigaBytes of RAM)
@ashen sky it's a problem when opera has 70 tabs open one of which is spotify and another youtube
@proper gale can't extend my laptop^s ram sadly
only 70 tabs?
weird flex but ok
i usually have 300-400 open
Well, I use Tidal for music, and just installed the application instead. Don't know if you have that option, or a policy prevents it.
I do, but then I get ads
Ahh.. So you don't have a paid account?
Ahh.. So you're one of the reasons, they don't really make any money. π
yes my 8.- contribution shall be missed
I have NO idea what their ad revenue on free accounts is... But one person will not make much of a difference. It's the combined number of people doing it that does. But I suppose they could solve the problem with most ad blockers, if the problem was big enough.
oh yea, i also have this
too much flex
there is a chance, that i have more ram, than you do SSD space
Well no
I can play along with that @proper gale
1TB of ram, good good
i said chance
Well, to be hornest, it's 2 machines in a VMWare cluster. π
mine are three machines, and only 512GB
y'all crazy
i need to get an IB card in Kizuna so i can use that 256GB of ram as a stupid fast ramdisk
for rem/ram
fucking WSL
that's my J: disk
@proper gale Yeah, well, we need a lot of smaller servers, not a few big ones. However, we DID try to compile stuff like asterisk and firefox on the bare metal, before installing VMWare on them. With 16 cores each, it took about 5 minutes to compile Firefox, and about 30 sec to compile asterisk.
this is my desktop
@ashen sky about that, Kizuna (my fastest server for compiling), yea, it takes 40 minutes for it to compile tensorflow
64 thread bulldozer @ 2.2ghz
rem and ram are behind Kizuna at 60 minutes
and my other serves fall behind there somewhere
C++
Just c++?
pretty much
Oh and for the neofetch scrreenshots.. Here's my home desktop...
what is this, a quad core?
A 6-7 year old machine, if I'm not mistaken. π
@ashen sky about that, Kizuna (my fastest server for compiling), yea, it takes 40 minutes for it to compile tensorflow
@proper gale Never compiled tensorflow, so can't say if it's fast or sole. π
try it sometime, it takes a while
I've compiled PHP, Apache and the Linux kernel, on a 486 machine.. Does that count? π
I think it took like 3 hours for all of them. I'm pretty sure I've watched a movie while it was compiling.
use MKL and MultiWorkerMirrored, crashes
As in several workers doing exactly the same at the same time?
multiple machines working on the same model, using different parts of the same dataset
Ahh.. Ok. And machinelearning and data analysis tasks, also explain the need for huge quantities of RAM. π
also why i have IB between those two machines
when i first got them, i was running tests with the onboard ethernet ports
bad scaling because latency, and maxing them out
even IPoIB is lower latency, and its much faster
Yeah. The most crazy connection we have, are 10Gbit ethernet P2P between our 2 ESX hosts, for speedy vmotion tasks.
and somehow its supposted to work with RDMA, but as it is right now, i can get the same performanuce with one of them instead of two by using an mkl compiled TF vs a non-mkl clustered
and have lower power draw while doing it
The only concept there I kinda get, is RDMA for "Remote Direct Memory Access" if I'm not mistaken. π
i wanna upgrade my cpu and change my motherboard since i cant change the fan speed right now, can anyone help me?
yee
sure
@craggy acorn Hmm.. Potentiometer on the power line to the fan, would allow you to adjust the speed.
using RDMA latency can be lowered vs using the TCP/IP stack on top of IB (RDMA anyway)
IPoIB is still faster than normal ethernet though
And I suppose my understanding that IB = Infiniband is correct. π
@ashen sky where do i find that? i dont see it anywhere
@craggy acorn amazon, ebay, local electronics store, local hardware store
eth ```64 bytes from ram.localdomain (172.17.1.50): icmp_seq=4 ttl=64 time=0.225 ms
an old volume knob, etc...
IPoIB ```64 bytes from 192.168.150.3: icmp_seq=4 ttl=64 time=0.153 ms
@craggy acorn Wherever you get you electonic components (That is stuff like resistors, IC's and the like)
@craggy acorn Something like this one, should do it. You need to apply the power line from the PSU/Fan header, to one of the outer pins, ground to the other of the outer pins, and the powerline to the fan to the middle pin. By turning the knob, you change the resistance on the circuit, limiting current/voltage flowing to the fan, and thereby limiting its speed. It's a quite analog solution, but also pretty low budget, since a potentiometer costs about USD 1-2, then add the wires you need, and either solder or some other means of connecting the wires.
Actually that's how casemodders limited fan speeds about 15-20 years ago. π
It WILL however, not give you an excuse for upgrading CPU and mainboard. π
i think im still gonna upgrade my cpu though
I'd probably go that route myself as well, as the CPU and mainboard in my computer is pretty old.
wooh, just had a 20 minute C debugging adventure
only 20 minutes?
Y'all flexing tons of cores while I still go by just fine with my cheapo FX
@proper gale yep, was a friends code, she'd f*'d up some includes and a socket address family declaration
in and out, 20 minute adventure
anyone experienced with c++ by any chance
@bleak harness At least it wasn't a 4 hour adventure
I suppose while we are flexing our system specs, iβve got an AMD Ryzen 7 2700, 16 GB of RAM (going to upgrade to 32 in the near future) and a GTX 1660
@wet stump just ask your question
@light isle I want to have arch with dwm so bad, but every time something goes wrong at some point with dual bootloader windows/arch π
Arch sucks dont use it
how come?
It requires extra work for now achievable benefit
I find setting it up pretty easy and I loved how easy it was to customize it for my dev environment
though I wonder if nvidia has any drivers yet for 2080ti
cool, I remember my friend always had issues with his 1080ti when it came out for like a year
I had a 1070 and it worked fine
might give it a try someday soon, really miss my arch setup
was the most productive environment I had
windows couldn't implement proper virtual desktops for so many years and when they did it was utter garbage
and still is
I can't really stand using windows nowadays. Anything on it is so... sluggish
it's not that it's sluggish for me, more that in windows I have to jump through bunch of fire hoops before I could do something that on my linux setup is just a single shortcut press
and that I can just code in any little thing I need into my window manager
meanwhile in windows land nowadays: remember the thing that took 2 clicks to do? now it's 5 clicks and 10 dialogs away π
never tried it
Had to use it for a while
Made using windows more bearable
But still not comfortable enough
WSL feels like they sloppily threw something together, I'm waiting for WSL 2
is it possible to use two different drives for bootloaders, windows/linux uefi setup?
@olive terrace use cygwin
WSL is brilliant for tty only things (compilation tools such as gcc, ...)
gonna double my RAM very soon
yo im teaching myself python and I'm stuck on a simple bug. could anyone dm for a min and help me out?
WSL 2 has been available for a while now?
yo im teaching myself python and I'm stuck on a simple bug. could anyone dm for a min and help me out?
@elder iris why don't you just put it here, you might get help faster instead of others having to reach out to you...
Anyone over here who's good at Vuforia ?
9000 threads on a 4c/8t laptop cpu
casualy matching the performance of 10 1080's
as you do
anyone here got experience with swift?
Here's the only swift code you'll ever need
import Foundation
do {
try Process.run(URL(fileURLWithPath:"/bin/bash"), arguments: ["-c", "pacman -S gcc"]) { (process) in
print("C > Swift")
}
} catch {}```
you're also going to need binutils and gdb if you ever need to debug or such
learning Java still, can you use getters and setters for exception handling? like, can you put your exception handling mechanics in your setters and getters?
looking very nice. Love the color scheme
what is the best programming language for games i wanna get into game developing ive done some research and the internet says C++ but i wanna hear an opinion from real people
ya C++ is pretty neat
Isn't here also internet?
It is the best time to learn C++, with C++20
I am trying to learn some C#, and I have a piece of text I'd like centered in the console, regardless of window size - Can one of you point me in the right direction?
Define small
Modules literally changed how the language works
You don't want to change the syntax to a language
You can find many infos about modules but you will find much more after major compiler supports it. Basically, no more header files headaches and easy to use packages like python does
Every headaches can be solved by if you have experience with ...
Hi, not sure if this is the best place to ask but I think it should be.
Someone from our team messaged in #tech-chat-1 a little while ago but I guess it was missed.
Me, Sirocyl and Langerhans work on switchroot android, which you currently have a video on floatplane on, if you have any questions or comments about it we would love to hear them
so many things are different from c++11 to c++20 lol
make_unique, compile time integer sequences, user-defined literals for standard library types, new [[attributes]], variable templates, type deduction, lambda capture, generic lambdas, binary literals, parallel algorithms, splicing for maps and sets, std::byte, std::filesystem, std::apply, std::invoke, std::string_view, std::any, std::optional, std::variant, direct initialization of enums, u8 char literals, constexpr if, selection statements with initializers, structured bindings, nested namespaces, inline variables, lambda capture this by value, constexpr lambda, folding expressions, template argument deduction for class templates, concepts, designated initializers, template syntax for lambdas, ranged-based for loops with initializers, constexpr virtual functions, explicit(bool), char8_t, immediate functions, using enum
and more
No most of the changes aren't just for readability, most of what's added gives you better ways to manipulate your objects (addition of STL algos that play with prvalues,...) so you get optimization boosts.
You could even experience optimizations compiling c++11 code with a c++20 compiler.
Saying you could just use boost and stick to c++11 isn't really justified. Depending on boost (even though it's a good library) isn't really a good thing. Having stuff in the standard takes care of portability and dependencies.
Of course you could simulate C++20 behavior with C++98 or C++11 but you would be wasting time (unless there are a few legacy compatibility restrictions, in which case you should still port the old code to C++20, but some companies are dumb).
well in the near future old code bases are bound to be updated to new versions, preprocessor directives making everything messy are bound to be extinct
I'm not a big fan of writing auto in my code, but I like the operator and the deduction that comes with it
it's the trick part in trick question
anyways this site is amazing http://cppquiz.org/
I already answered everything it was so addictive
answer to the screenshot here:||it's undefined behavior||
they use C++17 because it's was the latest official version people that are into the language know
but some C++14 and C++11 behaviors are tested too
C++ new standard is always trying to be compatible to older standard, so that you don't break your code
I just can't wait for them to add questions about C++20
Hi Is there anyone in here who is versed in Python
or who could maybe help out a poor college student figuring out where things are breaking?
My problem is it's kind of al ong string
and I didn't want to just bury everyone's talk
@pulsar sparrow @bright olive hey you two i found something in one of LTT's videos that might need editing out. Could potentially demonetize the video?
is there a place to submit this information?
I dunno if there is a place to submit something like that other than emailing the info@linusmediagoup.com, is it the ripped shorts thing or something else?
Well now I'm curious, what's the ripped shorts thing?
its is the ripped shorts thing! I kept scrolling down comments and finally started seeing people mentioning it so i assume you all read the comments semi regularly?
all good then, it'll get changed if they think it needs to.
Sounds good, sorry to bother you. I'm sure you're not technically working right now.
lol, all good.
@median python you've gotta DM me the video lmao
@olive terrace its in the dyson video. You'll have to watch the entire thing to find it π
@olive terrace i wanted you to watch the whole thing in order to keep their user attention rating high π
ya i thought they were about to plug LTTstore lmfao i was really confused
why the fuck are you bringing this up in the #development channel
So anyone here wanna join me on fun project ?
First of all i know there is not much point of making this but its just fun project with open possibilities.
I was thinking about designing web browser but iam not programer so i cant do it in Chromium. But if you are interested to do this Dm me.
I wanna build a rocket to the flame nebula who's in
well its just fun side project, i will be doing the ui anyway so if its not programed its not any loss to me. i just ask if someone is looking into building portfolio
I am building a portfolio but I have no clue on how to setup a chromium lol
I am currently redesigning https://www.kizmotek.com/
I made this background in photoshop, I am thinking about removing the turquoise blocks on the bottom and using CSS/JS to make animated ones that play an infinite loop so it would look like you are getting closer to the mountains
Would that animation be "too much?" I wanna make my portfolio website look unique
just make it slow enough to not be annoying
anyone know how to set policy on ChromeOS using terminal. Developer boot mode is enabled as well as Linux
i <<= 1 is the same as doing i /= 2
isn't it O(N log N) ?
?
The accurate sum is (2N-1)
this seems like just regular algorithms course in uni
likely the first one
the sum? it's not about the sum is it
It's about complexity, but in this question it's about looping times
the outer is log N and the inner is N --> N log N
lol
?
You don't simply multiply two complexity to get the total complexity
for (j = 0; j < N; j++)
foo()```
O(N^2) is it not?
Yes, but it's because the inner loop var doesnot depend on the outter
yes
and then for each i the inner runs i times?
This is obvious
so the inner is O(N)
same difference in big o notation isn't it
The reason here is simple to reason. If you make N=8, the statement runs 15 times, if N=16, 31 times and so on... The nested loop is equivalent to a non-nested one, running (2N-1) times
o.O that's still in the same order of time
@tribal ermine I uploaded a "work in progress" version of my new portfolio page, this seems to be about the best I can get the animation working. If anyone wants to help on how I can make it look better, let me know.
https://www.kizmotek.com/Beta/
Here is the code for making that animation
CSS:
@keyframes introMoveUp {
0% {
height: 8vh;
bottom:0;
}
100% {
height: 0vh;
bottom:100%;
}
}
@keyframes introOpacity {
0% {
opacity: 0;
}
5% {
opacity: 1;
}
90% {
opacity: 1;
}
100% {
opacity: 0;
}
}
.effect {
position: absolute;
width:100%;
background-color: #2AD1C8;
animation: introMoveUp 10s ease-out 0s 1 , introOpacity 10s ease-out 0s 1 ;
animation-iteration-count: infinite;
}
JS:
function bottomIntroAnimation() {
var boxAmount = 7
var boxDelay = 1.4
boxes++
console.log(boxes)
var bottomIntro = document.getElementById("bottomIntro");
var element = document.createElement("div");
element.className = "effect"
bottomIntro.appendChild(element);
if (boxes == boxAmount) {
clearTimeout(introAnimation)
} else {
introAnimation = setTimeout(bottomIntroAnimation, boxDelay*1000);
}
}
html is a bitch
so many brackets
observation by me, someone who has used it for 10 minutes
CSS and JS use brackets, I am used to it lol
HTML uses < > which is more annoying for me
I don't know what they're called so I just use brackets :P
so far I've got a stupid poem and a rickroll
Oh wait, they are called angle brackets
but the rickroll doesn't work :(
Does the URL not work? lol
It's basically an emulator :P I don't have a website
and apparently it doesnt like loading other links
Ah, I see
Use Repl if you want to code in the browser
It saves the stuff you code and actually works
is it an addon for Firefox?
No its a website you code on
gonna have some fun with that tomorrow
how do you add multiple styles to text?
doesn't seem to work
You just put them in 1 style @severe whale
<p style="font-size:10px; color:white;">Words</p>
Thanks!
if (month % 3 and day >= SEASON_SWITCH):
Back with homework help, Python 3. It's not reading this as true when entered with 6 and 21, which would make it true..is my formatting wrong?
create some css classes instead
6 % 3 is 0 isn't it? (and 21) so maybe you want to check it against 0
@frigid jetty so where's the assignment answer
@elder ivy just reading up on the stuff you guys have put. Answers havenβt been released yet
They do it so we can practice for real kinda dumb
oh I see
@pale onyx the timing of the animation is a little irregular and the page does not scale properly on mobile (firefox for android here). I'll check it out on desktop in a minute
Yeah, I didn't implement mobile scaling yet
Let me know how it looks on the computer for you, I think it looks a little bit off too but I am not sure how I can make it look better
@pale onyx It looks better on pc (also firefox) but there's still the timing issue. Two things: setTimeout is not very accurate, it only guarantees a minimum delay, not an exact time. And the animation is backwards, unless you want to create the illusion of going away from the mountains.
Ah shoot, I didn't realize the animation was backwards lol
I'll fix that tommorow
As for the setTimeout issue, I don't think it's a big deal but is there an alternative? I was going to do a for loop but that seemed too unnecessarily complicated
a for loop will use a lot of cpu resources anyway, something mobile users will hate
True
you can use a separate thread / web worker to run the timer in. then it wont be bothered by other events on the page
the timing between the blocks is determined while the page is loading, the busiest time on the main thread. so the time jitter is expected
I run the function on window.onload so not sure if that might help with that
I don't have a whole lot of JS for the index page anyways, I haven't done the separate thread/web worker thing before so I will look into that
pretty sure the main thread is shared with the under the hood stuff of loading the page resources and stuff
All the function does is create a couple of HTML elements and give class, the CSS handles the animation
you could also wait until the page is done loading / a second or two and then dramatically bring in the horizontal bars. could be a nice effect, the and the main thread has calmed down
don't forget the analytics stuff you're loading in also works on the main thread
True, I might remove that though
I just wanted to compare Google's analytics to Cloudflares
I'll look into doing the animation where it quickly loads in then animates normally
Thanks for the help!
plan c could be to give the bars a predetermined space between each other
or give their animations an absolute offset somehow, idk whether css can do that.
Hmm... Maybe, I'll have to see what looks nice
I'll mess around with the delays and animation speed
Anyways, I gotta get some sleep. Thanks π
Good night
What is the use of the Cite function for blockquotes? (HTML)
as far as I can see it does nothing.
God bless Python
oh god
There I go with Javascript
grr
the text for the popup doesn't show up
ah found the issue nevermind
huh, weird. The console says there's no function called myFunction, however I clearly have one
Do I need to add in some code to define it?
ReferenceError: myFunction is not defined
fixed. Had to define it before it was called on
haha, my site is technically mobile friendly :P
unless you use safari, but we don't talk about that
@tribal ermine I didn't figure out how I can load in the animation quickly yet but I fixed the direction, it seems to look a bit better now? What do you think?
https://www.kizmotek.com/Beta/
@pale onyx better!
The next thing would be to make sure the black bars and the colored bars are the same size. The colored bars grow as they come closer which is good but the black bars shrink which breaks the illusion; everything that is farther away seems smaller, even the spaces between things.
The Simpsons in CSS
is there any trick to make "html" less boring . PLz i hate it
@quasi plover Write it in word? π
what's "boring" about it?
or maybe change over to React using TSX. and throw in some other stuff that uses CSS in JS
take your html project and do javascript for it
that will make it more fun
if you really want a fun modern challenge, make yourself a custom html tag:
why would you want a custom HTML Tags?
code componentization and reuse
Hi everyone, noob question here, one thing I dont understand with programming is how people get the information on how to write decode/encoders for videos and music, like is there a website that details how file types and protocols (like h.264, h.265, mp3, mp4 etc) are structured so developers can write parsers, encoders or whatever they are called to access those file types in a program (e.g. open source video/music editors/players), please @ me
Its such a complex field that generally people use libraries which do that for them.
Particularly video
But if you really want to do so the way people do is by reading the spec for the format and the reference implementation
Although note that mp4 is a container format not the actual audio or video
Which is another layer of complexity. Many formats are containers for other formats which contain the actual information
If you are asking so that you can play back an audio or video the standard method is to use a library which does it for you or most of it for you
If you are asking so that you can learn about audio and video formats its an entire field but start at learning how a wav file works
Its pretty straightforward
But you can learn a lot to start
can anyone hook me up with a way of converting text to numbers in python, in the way of a = 0, z = 25
@novel spear thanks for that info, where do I go to find the specs and references for them?
From the individual standards bodies who make the standard
Some standards may be commercial to purchase
Aah cool
So if I wanted to learn about mp3 files I google βmp3 specificationsβ?
Correct
Which may reference other specs
And again normally a dev will use an existing API
If you want to google like mp3 decoder reference implementation
You may find some
Aaaah ok, thanks
Aah cool, thanks
Wich datatype do i use for my function where I can pass in both string and int in the param in c++?
why do you need both?
@jaunty seal don't remember exactly how to do it in python, but at least in javascript, I'd use an array
Just make your own object or use templates?
@gaunt finch
???????????
ok so my friend is trying to use some sort of game stat api and i like to do the same but with a different game so im helping him learn how to do it but his api requires a token and in python it's like this...
import requests
url = "ehh whatever"
headers = {
'Authorization':
"token"
}
response = requests.request("GET", url, headers=headers)
data = response.json()```
but in a web browser how would i enter the token
because the api is hard to read so i like to view it in chrome then look for keys and enter the keys
Use something like postman, it'll allow you to set headers
is that a browser?
No
I've personally just used it as an API tester
ok thanks
it says invalid
@gaunt finch Make two functions with the same name, one which takes an int, one which takes a string, convert the int to a string and call the string one (or the other way around)
unless conceptually they are two diff methods, in which case use templates, or use an std variant or a C union, you can also use an interface and pass an interface in which does just the things you need, and you dont work right with the string or the int
I can narrow it down if I have more info on why it needs both
Why would you bother making multiple functions when templates do that for you? Especially if the methods are quite similar, it makes the code clearer.
Depending on how you code and the operators you have overloaded, polymorphism can be succinct just by using templates correctly
Multiple functions in this context is explicit type conversion
SetPort("80") vs SetPort(80)
Thats not a good use for templates, its an okay use for implicit conversion but it depends what you want
there is not enough information in "can pass in both string and int"
There is no implicit conversion from string to int
and the operators are not the same for the use case
Templates don't require for the arguments to be convertible
they dont, but you have to do something useful with the knowledge you have π
they will generate a function for each relevant type
eg: setport presumably sets a port number on a socket
which cant be two different types
which is why "there is not enough information in "can pass in both string and int""
You can get information out of different type of arguments in a similar way in a polymorphic manner
templates very well could be the answer
you wont between string and int in that context
you can add two strings together but you cant add a string and an int together and get what you want
so it depends on what you want to do different string vs int
and why you can not answer the question with one answer
you are going to overload the operators in int and string?
it depends on what you want to do
EXACTLY
you could even make a custom object that has custom opperators and make it polymorphic for most types
and still keep it in the template
sure you could
depending what you want
as I said
there is not enough information in the question to give one answer
but that doesn't go against the idea of using templates tohugh
I mean, it adds three layers of complexity if all you want to do is convert the string to an int port number π
operator overloading is starting to sound reall good in that context
err
argument
you don't have to make interfaces hard to read
the essence of cpp is keeping everything simple and clean so that someone can have an idea of what's happening in the shortest amount of time possible
so you are going to:
- add an i port number type
- add a conversion between int and string to multiple implementations of i port number
- make the method take a i port number
or
you add two methods π
you see
templates arent a catch all
they are not always more clear
it depends on what you want to do
the point is all the work under the hood can be hidden when you make your own object
hidden from the maintainer? π
hidden from people that read the code
nothing is hidden from the people who have to understand and maintain it
but not everybody is going to try to understand what it does if it's made obvious enough in the first place
rather than looking at POD constructs
you can make a converter and have it convey what it does pretty simply
Again, entirely depending what OP wants to do, there is not one answer to the question, and from a maintainability perspective its entirely possible explicit implementations of conversions is probably going to do the job in one context, and from another context doing something fancy and generic is also what you want
rather than making two or more functions that act differently from eachother depending on how polymorphic you want your thing to be
templates are best used in contexts where you want something generic with the same operators
not for conversion
unless you have MANY conversions
or logical implicit conversions
I don't quite get what you mean by explicit implementations 
whereas with templates you'd only have one line
ok show me this template
I can't just invent what the guy wants to do with his code
SetPort(thing);
yes

don't mind the includes I was trying some other stuff
convenient π
lets assume
you are calling connect(int port)
afterwards with it
somewhere down the line
you need it as an int at the end
right?
sure
nothing a converter can't handle
add it to that
yea, or just doing the damned thing in the class π
abstraction is indirection, abstraction works for you when the implementation is something you dont want this class to know about
but in this class the specificd
of a string also being comparible to an int
the fact that it may raise an exception if convert fails
etc
lend itself to an explicit implementation
eg: setPort("hello world") is totally invalid
so you are going to build something which converts strings to ints for the purpose of this sole one class
with no benefit beyond "the compiler did it for you" when you had to do it for the compiler anyway
its simply not a good use case for templates, and as I said, this is an example, there may be cases where op does want templates. But without knowing just saying "templates" is not a complete answer.
and I am not saying you are wrong for saying templates, you asked me, I didnt ask you
hey what do you guy think of this
private TreeSet<File> allJavaFiles;
private String userName;
private String password;
Password() {
}
Password(String comp, String userName, String password) {
this.allJavaFiles = findFiles(comp);
setUserName(userName);
setPassword(password);
}
public static void main(String[] args) {
Password p = new Password();
p.allJavaFiles = findFiles("jlbea");
p.unlockAllFiles();
}
String[] packages;
File[] javaf;
TreeSet<File> allJavaFiles = new TreeSet<>();
for (int i = 0; i < projects.length; i++) {
// Makes sure that it doesn't try to add the .metadata folder
if (i != 0) {
// Gets each package for each project
directoryPath = new File(directOrg + "\\" + projects[i] + "\\src");
// Makes sure it doesn't add this file
if (!directoryPath.equals(NOTALLOWED)) {
packages = directoryPath.list();
for (int j = 0; j < packages.length; j++) {
// Gets each .java file from each package from each project
directoryPath = new File(directOrg + "\\" + projects[i] + "\\src\\" + packages[j]);
javaf = directoryPath.listFiles();
// Adds all of the files except this one into a TreeSet
for (int k = 0; k < javaf.length; k++) {
allJavaFiles.add(javaf[k]);
}
}
}
}
}
return allJavaFiles;
}
public void lockAllFiles() {
for (File i : this.allJavaFiles) {
i.setReadOnly();
}
}
public void unlockAllFiles() {
for (File i : this.allJavaFiles) {
i.setWritable(true);
}
}
public String getUserName() {
return userName;
}
private void setUserName(String userName) {
this.userName = userName;
}
public String getPassword() {
return password;
}
private void setPassword(String password) {
this.password = password;
}
}```
It locks all your files in your workspace to read only
and unlocks them to writable
with a userName and pass
I haven't finished the user name and pass
I'm going to do a gui
but why
Go flight, are you going to use swing for GUI?
Hello everyone! I'd love to ask for some feedback on a project I've been working on for the past lots of months, it's a programming language. Here are some snippets:
https://puu.sh/FhEHk/18730b90f8.png
https://puu.sh/FhEIk/35a9a58ea7.png
Anything in particular you want to archive by creating a new language, or are you just doing it for a challenge?
Well, at the moment, I do it as things like this are my passion. And I don't really have a direction in particular. I just work on it and see where it takes me. The main goal is to have the syntax clutter free, as you can see there, no semicolons, no parentheses for function calls, things like that
At the moment it's closed-ish source. Mostly because I want to get it to a usable point before I release it to the public, but until then, only patrons have access to it. But I hope to make it public in half a year tops
Here's something I had fun throwing together in an hour: https://puu.sh/FhRiS/1967b710b9.png
Ok.. I do think we have enough languages as is, but as a fun project, it's fine. π
Also I don't really see much of a difference to other languages, in terms of syntax, the missing parentheses for function calls, reminds me quite a lot of basic, I'll leave it to you do decide if that's good or bad.
I got the idea for the syntax from a combination of Scala, Haskell and Rust
Funny, I actually thought some of it reminded me of some examples I've seen in Haskell. π But never used a functional language.
I do want to take it in a functional direction at some point. Or at least have a lot of focus on immutability and functional programming in the standard library. Having functions like map, fold, filter, those sorts
Well, whatever you do, stay with ONE way of writing programs. Don't mix functional, procedural and object oriented. (Unless you're trying to make a new PHP. π )
Rust and Scala are getting away with it in a glorious way
It won't be object oriented, it will be structural, with similar features to polymorphism but done with contracts, similar to interfaces in other languages
Well, as long as you make sure you don't make things too confusing, it should work out.
Also algebraic types. So you can have sum types, intersection types, disjunction types. For example, Haskell's Maybe type, or Rust's Option type, both are sum types
So you can imagine it as a form of null, but it still has a value. It's either some thing, or nothing. But that nothing is itself a value
Yeah, the way I understand it, is they are either a value you can work with, or a value you don't care much about, and can't work with to do anything other than checking it.
Indeed, that's how it goes
But what's nice, most languages do have functions that operate on the nothing part. So you can have functions that return something if the value is nothing, or panic, or things like that. So you don't have the billion dollar mistake once again
For example in C, you can pass NULL to literally anything that takes a pointer or a reference. With this, it's impossible, as passing nothing to a function that expects something, will fail, under any circumstance. Or the programming language will force you to handle the case where it's nothing
Yeah. Fortunately many IDEs will warn you about possible bugs whenever you don't check for null. π
Indeed they do, but why even allow it when you can completely avoid it? π
Because the language don't want to restrict you. C is, after all, a language that allows you to shoot yourself in the foot, twice, by only pressing the trigger once.
Yes, but it doesn't only apply to C. It applies to C, C++, C#, Java, all major programming languages. Both procedural and object oriented
To my knowledge, C# and Java will only allow you to shoot yourself once with every press of the trigger. π
Well, C's segfaults are safer than C#'s writing an infinite amount of NULLs in your database
On that note, C# 8 is getting close, it allows you to forbid null in the project unless you specifically make the type nullable, which is good
And that nullable type in C# is working in the same way as sum types from Haskell and Rust
Or runtime errors! Those are annoying. Why have runtime errors when most can be caught at compile time? Like out of bounds, uninitialized values, things like that?
In C#, you can very well write a program, compile it, and not set a value for anything. Only after you run it, it crashes
Because nothing is better than spending a few minutes compiling something, just to have it crash when launched. π
Let's not forget that some projects take a little more than a few minutes, and maybe crash one week into runtime because you forgot to initialize a variable that gets used in that specific case that only someone in particular uses
And it's so important to them that it's either it works, or the business goes down. Speaking from experience here with a client at some point
Or the beauty of dependency injection. Everything compiles, runs fine, and at the end of the month, when the customer decides to do billing, oops, the service was not initialized correctly and the whole software crashes
And yes, it was tested, but the debug build sets up a different container than the release build
What's even better, is when your billing automatically charges the customers credit card, and it's made to start at intervals, check if it already ran this month, then if it didn't do a billing run, then record it completed. But instead of completing it crashes halfway through, then next time it checks if it needs to run, it does, runs the same customers AGAIN, and charges them once again, and again, and again. Practically draining peoples bank accounts...
Exactly! So why allow runtime errors again?
A null is a runtime danger, and can't be statically checked
Also, I've noticed how far the discussion has drifted
Well, because that was probably the best way to do things whenever the language was created.. The amount of analysis required, could had make things more complex on earlier computers. And for languages that were created before I was born, it might have made sense to allow runtime errors, because checking for them while compiling, would require more resources than the computers of the time had.
But today, it makes no sense.
Well, even with our current computers, you still can't statically check for null values. It would require the program to go through every possible state. Maybe with a quantum computer, but that's a whole other thing
But you should be able to find many more mistakes, like uninitialized values.
That is true
But imo, it's easier just to outright forbid them from the language, and less error prone
Yeah, but I can see that it might not had made sense historically, to forbid it.
null is statically checked in C#8 if you enable nullable reference types
things cant be null unless you explicitly tell it, and it forces you to handle it if its one which can be null and you go to access it
and the creator of C# called allowing references to be null by default the worst mistake he made
Alrighty
Hi peeps, I need some help with my homework
I have the code where I can output my results to strings
I need to change it so I take an image file and replace my 4 results with the image of a card's face which is saved on a separate package
I need to output a card from a deck, reshuffle, pick another card and only output if it's from a different suit until I get 4 cards with different suits
Why not use 4 decks, one for each suit. Then first you select the suit, then the card.
Then just select a random number 1-13, to select the card. Your package with the card faces should have a function that returns the face given the suit and card as input.
yuck Java
@somber sigil The way I see it, 4 decks, each one suit, just makes a lot more sense, when you want to make sure you get one card from each. π
@round dome Same can be said about pretty much any language. π
A lot of javas bad reputation, is from the early version, especially the browser applets, that ran at a ridiculously slow speed, and required quite a bit of RAM. On modern hardware, this is not much of an issue anymore.
every cpp imperfections are instantly forgiven due to the fact that it's the best language out there π‘
java is like a bad version of C# π‘
Well, I don't care much for religious beliefs, so I guess I'll pass on the bait...
same, tbh.
Having worked with all three languages, managed langs do have their advantages.
uniformly saying C++ > all is missing the point - productivity.
It's why JavaScript is king with UI these days (on the desktop)
sure, it has warts, but it gets stuff done for folk
Well, there are ups and downs in ANY language. And just like text editors and IDE's there are different religions. At the end of the day, it's all a matter of getting the job done, and any language can accomplish that.
true
but I do think there's a point to be made that there isn't a free lunch. And the way that Java is thinking about this (namely Valhalla and Loom) make me hopeful that we can address this.
one sec... I don't know how much i should dump...
so my work around this problem is this... in a nut shell
boolean keepRunning = true,jackpotWon = false, payoutWon = false;
int day = 0, month = 0, year = 0,totalAmountOfPlayers = 0, totalAmountOfMachines = 0;
int firstrun = 0;
SlotMachine[] machineArray;
Player[] playerArray;
Date date = new Date();
Date todaysDate = new Date(day, month, year);
firstrun = game.getFirstrun();
do{```
im calling into main and out of main to set and get
but i have a on load method to initialize the object arrays
I need to have three slot machines configured on load, and one player, but if i don't have a condition in place than that method would get called again
and if it is called again the object array will be over written
and it needs to be able to have users create new slot machines and players
T.T
@floral stirrup the short answer is it looks like you are on a very wrong track (functional instead of object oriented) to do what you want
and the problem starts here
switch(menuSelect){ //menu
case "q":
keepRunning = false;
break;
case "Q":
keepRunning = false;
break;
case "p":
buildingPlayer(null, 0, null, false);
break;
case "P":
buildingPlayer(null, 0, null, false);
break;
case "s":
buildingSlotMachine(null, 0, null, false);
break;
case "S":
buildingSlotMachine(null, 0, null, false);
break;
case "g":
runGame(totalAmountOfPlayers,totalAmountOfMachines,machineArray
,playerArray,jackpotWon,payoutWon,todaysDate);
break;
case "G":
runGame(totalAmountOfPlayers,totalAmountOfMachines,machineArray
,playerArray,jackpotWon,payoutWon,todaysDate);
break;
}//end switch for menu```
umm I only want enough help to get on the right path...
what do you mean functional and not oop?
I used to code in .js
and c so i know that .js is more functional
Well, so far, everything is in a single function, the "main" function
actually.... this is a very small snippet of this code π¦
Which is static, so no objects or instances involved. Also, I have no idea what "input" refers to, but it's not something that looks to be defined
its a scanner object
yeah, this is why I said the context is going to be important since it looks like (and no offense intended), a fairly complex mess π
Is input defined as a static?
can i drop in text files or .java here?
I'd recommend (if the code isn't under NDA or copyright), to throw it up in a pastebin somewhere
CodeSandbox is an online code editor and prototyping tool that makes creating and sharing web apps faster
Pastebin.com is the number one paste tool since 2002. Pastebin is a website where you can store text online for a set period of time.
Having a look now
thank you π¦
i have other pages
but that's the core
i made a static object called data pass, but thats been my most recent last ditch effort
so a new instance of TestClass is created on each loop and assigned to dataPass
That, doesn't seem like what you want to do
?? no... I wanted to have some way to send data to the runGame method
and i thought about building a object to send to it and ripping it apart in rungame
and thats what dataPass was
but i tried it different ways and couldn't succeed
You could simply make runGame static, and you wouldn't need to create an instance of TestClass to call runGame()
Same with oddsCheck()
umm..... this may be really ignorant, but i have this impression that static means it can't change values?
heh, no that's C π
well
not even really
but no, in Java, "static" means there is only a single copy of a variable, function or class
And that single copy/value is attached to its containing class, TestClass in your case
so.... I think you might have helped my brain click.... does that mean that a static function will pull data from the last place it received it?
And there is only ever a single value for a static "thing" in a JVM π
no
a static function just means it is not attached to an object instance, but rather to the "class definition" object... that can be confusing, hence why I didn't explain it that way initially
So, You wrote this TestClass, and when you compile that code, what javac and jvm do in the back room is create a class definition (which you can access with the TestClass.class static variable btw π ).
So TestClass.class is an "instance" of you class definition, and you can now go and create object "instances" of TestClass using the method you did with: TestClass dataPass = new TestClass();
oh god does that mean the same is true for all my other static objects at the top?
dataPass is now an instance of TestClass, with its own "instance" variables (anything that was declared as not being static)
yup π
But that's ok
It's not "The Java Way", but it's not technically wrong either
hmmm..... I think you helped me get my thoughts in order, I am going to make a new class for runtime data and have it hold object fields
thanks!
Anyone here have experience in developing Adobe suite plugins?
not me π¦
if anyone has free time, I am having an issue with a strip of my code, I almost have it working i think tho, its just sending int data to a class
I am doing it wrong i don't know how tho...
Date dob = new Date(01, 01, 1943);
//--------------
firstName = "Charlie ";lastName= "Willie"; middleInitial= 'D';
legalAge = true; moneyBalance = 5000.00;
Player charlie = new Player(firstName,lastName,middleInitial,dob,legalAge,moneyBalance);
playerArray[0] = charlie;
//updates runtime data```
Date uses int values, the problem is that it is asking me to input the players dob but this is the only hardcoded player
I assume he wants you to update the constructor call to include the dob?
oh, its already there
whats your question?
you want the user to type a dob in? Parse it with https://docs.oracle.com/javase/8/docs/api/java/sql/Date.html#valueOf-java.lang.String-
why are you using arrays like that... use an arraylist
I tried in #tech-support two days ago and hope, that in here, I may get answers about a problem/error I run into whenever I try to execute Java itself or a Java based program on my PC...
Since its #development, I'll guess that here are a ton of ppl familiar with the world of Java.
i got the arrays to work just fine, they have not been the issue.... I have mostly coded in C
im on the final stretch now
I am using methods in a method sheet for datavalidation and I am getting a stringlength error
if anyone wanted to know i ended up doing ``` private static boolean verifyword(String word){
word = word.trim();
if(word == null || word.equals(""))
return false;
if(!word.matches("[a-zA-Z]*"))
return false;
return true;
}
public static String theWord() {
int i=0;
int x = 0;
String word = "";
do{
try{
do {
i=1;
word = input.nextLine();
if(verifyword(word)==true){
x=1;
}
}while(x==0);
}
catch(Exception e){
System.out.println("Invalid input, try again: ");
i=0;
}
}while(i==0);
return word;
}```
Hi guys. I am searching for someone who knows C language. I have defined 2D dynamic array and I need to pass it into function. I tried double pointer metod, but I got stuck on pointer decay. Does anyone know how to get it working?
Easy solution: Put your dimension and your pointers into a struct, pass the whole struct into the function
I'm not sure if making a struct when he doesn't know how to use pointers properly is good advice, he's probably going to pass by copy.
@nocturne galleon yes I am; I havent been on Discord for a while I have get someone to teach me how to tho
Hey guys
Im havin this class:
package preferences;
public class Settings {
public final int universe_limit = 15;
public int subnet = 0;
private String projectname = "last-project";
// ArtNet Settings:
public final int unicast_limit = 20;
public UniverseOut[] universe_out = new UniverseOut[unicast_limit];
public UniverseOut[] getUniverse_out() {
return universe_out;
}
public void setUniverse_out(UniverseOut[] universe_out) {
this.universe_out = universe_out;
}
public int getUniverseLimit() {
return universe_limit;
}
public int getSubnet() {
return subnet;
}
public void setSubnet(int subnet) {
subnet = subnet;
}
public int getUniverse_limit() {
return universe_limit;
}
public int getUnicastLimit() {
return unicast_limit;
}
public String getProjectname() {
return projectname;
}
public void setProjectname(String projectname) {
projectname = projectname;
}
}
(Java)
and i wanna save it with XMLEncoder. It saves it. No big deal. I looked into the xml file and saw, that he wont save the array of "UniverseOut[] universe_out". Do you know where the problem is?
This is my save-code:
String path = System.getProperty("user.dir");
System.out.println("Project will be saved as \"" + path + "\\" + projectname + ".project\"");
FileOutputStream fos = new FileOutputStream(path + "\\" + projectname + ".project");
XMLEncoder xml = new XMLEncoder(fos);
xml.writeObject(getSettings());
xml.close();
fos.close();```
I finally finished my java project T.T
thank you all for all the help
and i wish i could help : (
@mossy osprey use a debugger and also add the error output
Tbh theres no error at all. It saves the file, but it just saves the other stuff. Imma run the dbugger
https://howtodoinjava.com/java/serialization/xmlencoder-and-xmldecoder-example/ <-- did you add an exception listener?
Actually no
But even with exception listener, no error. gonna run it with debugger now
also your naming doesn't follow camel case. but not sure if that matters. you should read up the documentation of the XMLEncoder really
Where dont i follow conventions? Doont you name final objects in capital letters and everything other with like "peopleCount" or am i wrong?
Also, with debugger it isnt any different. No error, no nothing.
I mean if you put breakpoints in your getter for the property in question (and other properties) does it get called when the writeObject is called?
it's probably due to some weird convention to serialize properties by XMLEncoder (something about Java bean)
Are getters and setters even allowed when serializing an object?
Also, this class should follow all conventions;
package preferences;
import java.io.Serializable;
public class Settings implements Serializable {
/**
*
*/
private static final long serialVersionUID = 2929431155275389116L;
public final int universeLimit = 15;
public int subNet = 0;
public final int effectLimit = 200;
public String projectName = "last-project";
public final int unicastLimit = 20;
public UniverseOut[] universeOut = new UniverseOut[unicastLimit];
}
Well no, i have read that every var/obj should be private
lol
I think that's basically the problem, you need to figure out what the convention is and then follow it
I was gonna say step into the library and see what it's trying to do to ennumerate the properties
I think for arrays of things you need to see "indexed properties" https://docstore.mik.ua/orelly/java-ent/jnut/ch06_02.htm
also probably need to make all of those class variables private
So now i followed the conventions, now im gonna try that indexed properties stuff
lol I'm surprised the IDE doesn't help you with this BS
I mean, i can generate getters and setters, but not the sepcific to set and get an elem from array ._.
switch it to an array list? or really why not?
I could try an array list
Could someone help me with an issue I'm having in c# with connecting to an sql database using sql inserts?
I'm not sure what exactly you mean by "Connecting to an SQL database, using SQL inserts"
Does anyone here that have experience using PMBus/SMBus and I2C for configuring fans on a server PSU from 45 Drives?
@brittle loom you can DM me your question, but please dont "ask to ask" just ask
Anyone here experienced with Unity (Their new input system), I figured out how to do rotation to work with input system (new one) but the issue im running into is both mouse and controller (right joystick) control both players rotation together in sync, while movement doesnt sync the aim thing does, how do i solve this?
this is the script i use for aim thing https://hastebin.com/fekowidipu.cs
not sure what im missing or doing wrong
could someone code me a discord bot that will play a youtube link in a loop
i will whitelist you on the application i made
Most people would want some form of compensation
hi anyone in here that could help me out with xcode?
looking to create a simple app that will allow users to open 3 webpages, from 3 different buttons.
please tag or dm, thank you in advance!
@last ingot swift, iβm using xcode
didnt read that part oops
(you could've also been the maddest lad and write some objective C with xcode)
objective c is the starwars prequels of programming languages
You're lucky to be able to be working with C++, I hope I'll find a job that allows me to do so in the future, awesome language to work with, if you're committed.
(Assuming you're being employed by a corp, not independent)
anyone here go to/been to WGU or UMGC (formerly UMUC)? I'm trying to decide between the two colleges and would love some first-hand input
anyone here good with phpmailer?
@round dome I will panic if a good C++ job is hard to find these days, because it's the only language I am ok with.
I'm learning front end anyone knows how back end works databases and other stuff I wanna become full stack web developer what's best place to learn back end
Or what languages are used in back end at all
Depends
C# is a good place to start I think
but it really depends on the type of backend you want to do
Just like there isn't a single framework for front-end, backend has many different options
@heavy widget canβt go wrong with python π
flask is awesome
Hey guys! Do you think that 2020 MacBook Air configured with i5/16/512 will be good for programming? Iβm mostly writing in C++, Java and Go, and Iβm going to learn Flutter. Mostly using JetBrains IDEs and VS Code.
it is the quad core i5-1030G7 with 1.1GHz base clock, 3.5GHz turbo boost. i would say it will be fine, just as the typical 'lowend' windows laptop
A chromebook would be fine, so a MacBook Air would be great. Have fun!
umh 16gb of ram in 2020..it is low-end, specially if we r talking about java and idea + chrome
and consider that you would not be able to upgrade ram on apple....
it is not "who is better", it is what you use. it's kinda: " Clion is shit, notepad + asm is better, can work even on smart-lamp". and it is not about of 30 tabs, but did you even hear about profiles and several instances of chrome? Also cache makes you workflow run faster, so it is needed as well, and we talking not about hello world level applications, but mid-heavy ones with ability for the laptop to be future-proof and not for 1-2 years and then throwed to the trash.
If you doing nothing serious, 16 gb is enough.
p.s. Clion IDE is on java lol
in pytube ik you can download whole playlists like this

