• Breaking News

    Monday, December 6, 2021

    In languages that need ";" at the end of lines, what does ";" really do? Ask Programming

    In languages that need ";" at the end of lines, what does ";" really do? Ask Programming


    In languages that need ";" at the end of lines, what does ";" really do?

    Posted: 06 Dec 2021 07:43 AM PST

    I imagine that ; tells the interpreter "hey bro the code of this line ends here". But what is it really doing behind the scenes?

    Is this something inherited from old analog systems like "\" supposedly would tell mechanic calculators to go back to the start of the line ?

    submitted by /u/plzhelpmeHelloWorld
    [link] [comments]

    How Much Would It (Vaguely) Cost to Build A Website Like This?

    Posted: 06 Dec 2021 03:45 PM PST

    There are photo hosting websites like Pixieset.com and Aryeo.com that I have come across.

    I know this question is open ended, but how much would a website like that generally cost? What goes into the cost of building/programming a website for a photo/video/content delivery website for photographers/videographers.

    I'm assuming the owner of the site would have to pay for something to maintain all the data going in and out. I'm a completely clueless noob on how these things operate so sorry for the ignorance.

    submitted by /u/Careful_Driver
    [link] [comments]

    How involved would a project like this be?

    Posted: 06 Dec 2021 08:42 PM PST

    I'm in the mechanical engineering field with limited programming experience outside of data manipulation.

    How involved would a personal project involving a Lilypad Arduino and some sort of user interface (screen or just buttons) with the capability of playing audio prompts, recording and storing audio responses, storing other data from sensors, and sending all of this over Wifi to some storage device?

    Trying to get a feel for how much work this would be with limited experience before I take it on fully. Open to any suggestions you may have.

    Apologies for any false assumptions I don't have much experience in this field. My data experience is in Matlab and Python if that matters.

    submitted by /u/Pridecopa23
    [link] [comments]

    How to get redirected process outputs while not skipping parts where it asks for user input in C#?

    Posted: 06 Dec 2021 07:31 PM PST

    My team is creating a game for our school capstone project in which the players enter their source code and test it then the game will check if the players' source code is able to meet the desired output using the computer's own prepared inputs.

    The problem I currently have here is that when I try to use StandardOutput.ReadLine() it will only print the first Console.WriteLine() of the player's source code, and if I used StandardOutput.ReadToEnd() it will print everything and skips the Console.ReadLine() part. I tried looping the StandardOutput.ReadLine() but I'm not sure if I'm doing it right.

    Here's the part of my code where it gets the redirected output

    public void RecieveOutput() { string standard_output; while ((standard_output = playerCode.StandardOutput.ReadLine()) != null) { txtStatus.text += standard_output; } } 
    submitted by /u/DarkTech1399
    [link] [comments]

    Can i convert ASL to HLA

    Posted: 06 Dec 2021 07:24 PM PST

    Is it possible to convert assembly language to high level assembly?

    submitted by /u/Dependent-Being5962
    [link] [comments]

    Trying to get back into Java.

    Posted: 06 Dec 2021 06:00 PM PST

    So I'm trying to back into Java and need to know a good free learning site, thank y'all.

    submitted by /u/Kaputuncle
    [link] [comments]

    Question about Huffman coding

    Posted: 06 Dec 2021 05:10 PM PST

    I understand how to do the encoding in my research

    But I have thing I dont know at decryption

    Target : ADBCBABCBBCE

    You can change the order and encode

    B 001 0 C 010 10 A 000 110 D 011 1110 E 100 1111 

    Result

    110 1110 0 10 0 110 0 10 0 0 10 1111 

    Question

    1 . If you think about it in a real example, when you decrypt it, you don't know the binary assigned to these characters, right?

    how can u decryption this?

    110 1110 0 10 0 110 0 10 0 0 10 1111 
    submitted by /u/User012340
    [link] [comments]

    Android studio problem rounding decimal variables to integers when declaring them.

    Posted: 06 Dec 2021 05:02 PM PST

    Hello Reddit programmers, I come to ask for your help: I ​​have created a java program that runs fine for me, I decided to turn it into an android application. Basically my program splits "double" variables at declaration time. For instance:

    double Weight = 56000; // * This is the Weight in kilograms

    double Size = 164; // * This is the size in centimeters

    double BMI = (Weight / 1000) / ((Height / 100) * (Height / 100));

    The problem is that in java it divides it as a "double" without generating problems, but when I do the same in Android Studio it rounds the variables at the time of the mathematical operation:
    "(Weight / 1000) / ((Size / 100) * (Size / 100)); "

    In a nutshell java does this:

    "(Weight / 1000) / ((Size / 100) * (Size / 100));"

    "(56000/1000) / ((164/100) * (164/100));"

    "(56) / ((1.64) * (1.64));"

    "(56) / (2.6896);"

    "(20.820939916 ...)"

    Which is the correct result.

    But now Android Studio does them this way:

    "(Weight / 1000) / ((Size / 100) * (Size / 100));"

    "(56000/1000) / ((164/100) * (164/100));"

    // Here for no reason Android Studio rounds what should be 1.64 to 1.00

    "(56) / ((1.00) * (1.00));"

    "(56) / (1);"

    "(56)"

    That the result is all nonsense, and the error is that those that become "double" decimals seem to be rounded directly to an "int" integer.

    I would like to know how I can fix or modify something so that the results of android are like those of java.

    submitted by /u/gaterto
    [link] [comments]

    The software is purposellly written poorly so that only a few people would understand its logic. Is it possible to change such culture? How?

    Posted: 06 Dec 2021 12:05 PM PST

    Hi all. Hope everyone is safe and sound.

    Lead engineers used very complex logic and applied no best practices when developing the software. Currently, only they know the code inside out. For other programmers, it is a nightmare to work with it.

    It feels like those lead engineers wanted to have absolute job security and make them impossible to replace because only they can advise how to fix a broken issue.

    Does the situation sound familiar to anyone? Is there anything that could be done to minimise the influence of those lead engineers and change the company's culture?

    submitted by /u/108876
    [link] [comments]

    The break statement causes all loops to exit. True or False?

    Posted: 06 Dec 2021 03:41 PM PST

    This is a question on our test. Without additional context, is this statement objectively true or false?

    submitted by /u/wet-badger
    [link] [comments]

    Does anyone have any advice on how to maintain .property files in a monolith architecture in a Java enterprise environment?

    Posted: 06 Dec 2021 01:56 PM PST

    So the problem is as follows:

    We need to be able to run our monolith system locally in order to debug and do development on our laptops. This requires that we have a specific dev patch for our .properties files in order to change the domain name and api endpoints to ones that will work on our local machines. This patch changes a lot in our .properties files and is hard to keep track of. If we don't do this we cannot run our code locally as it will not deploy in our local tomcat server.

    The problem is that these configs change daily as there are over 200+ people making changes to them and often times will break our patches meaning that we then have to research why the patch broke, resolve it, and share a new patch in our team channels. This sucks up a massive amount of time on a tight deadline environment. It also fosters bad habits as developers will run versions of master multiple weeks old because they don't have time to deal with researching a patch fix.

    My hope is that there exists a way to maintain the .property files in a way where this isn't required anymore. My immediate thought is spring profiles but I thought I'd also ask here to see if anyone had similar experiences and could weigh in.

    submitted by /u/ReadingTheAir
    [link] [comments]

    Why do switch statements in most languages have wildly different syntax than other conditionals?

    Posted: 05 Dec 2021 10:47 PM PST

    Languages like c# will use this for most conditionals:

    if (x) { Something(); } else { SomethingElse(); } 

    But will use syntax like this for switches:

    switch (x) { case true: Something(); break; case false: SomethingElse(); break; } 

    Why is this? I've never understood it.

    submitted by /u/_subpar_username_
    [link] [comments]

    Should Visual Studio ever be installed on a *server*?

    Posted: 06 Dec 2021 01:41 PM PST

    IT guy here. Always looking to learn and change my perspective. I'm of the mind that Visual Studio should never be on a server, whether it is DEV, TEST, PROD or some other environment.

    Here's my take and experience...

    • You should be able to promote easily from DEV to TEST to PROD or across environments. Therefore, all environments should look similar
    • A DEV server is to serve other developers. For instance, someone working on a client can connect to the DEV server. As such, there is an expectation that it be online and as such, nobody should be WRITING CODE on the server
    • If you are developing on a server that means you are also pulling/pushing code. This likely means that multiple people are pulling/pushing code. In my experience with GIT, you cannot have multiple users working from the same repository and maintain security/integrity (ie for a blame).

    Therefore, All code writing for the server should be done locally using Visual Studio's local debugging and IIS, if needed. Then deployed to the development server.

    I would love to hear comments on this and reasons why it might be a good idea to have Visual Studio on a server.

    submitted by /u/THEJOATMON
    [link] [comments]

    Difference between Elasticsearch and OpenSearch?

    Posted: 06 Dec 2021 07:38 AM PST

    Didn't find proper answer on the internet that why asking here. Basically what I understanded from my reasearch, that if you planning to host search engine on AWS cloud it's better to use OpenSearch as it is Amazon product.

    submitted by /u/TiPSYDiPSYY
    [link] [comments]

    Can anyone suggest a simple cloud-based database for a beginner?

    Posted: 06 Dec 2021 11:07 AM PST

    Hi all. I have limited programming skills, but willing to learn.

    RN, I use Google Sheets, but I am willing to switch to any simple cloud-based database program. (I use Mac which seems limiting).

    In Sheets, I have 5 text columns (easy).

    For a 6th column, I need a pop-up menu in each cell with ~35 multi-select checkboxes of text values.

    When I select these checkboxes, and then hit save or go, these text values should output corresponding numeric values. These values then concatenate into each cell. The values would have a single comma between them and no spaces between them.

    Example:

    My checkboxes for my one cell or record are Dog (=1) Cat (=2) Bird (=3) Frog (=4)

    I select Dog, Cat, Frog

    The result in the one cell should be: 1,2,4

    I need to do this for each record or row and then export everything as a .csv

    I'm willing to try anything for novices and the solution doesn't have to be a spreadsheet one. Thanks for any suggestions.

    submitted by /u/starlesstimes
    [link] [comments]

    C

    Posted: 06 Dec 2021 06:21 PM PST

    Can any type c code for vector space module extraction of world (d1 d2 d3) from txt file to another file using fopen and array making ….

    submitted by /u/AdAdventurous9600
    [link] [comments]

    Processing - Help with clicking images!!

    Posted: 06 Dec 2021 10:28 AM PST

    I'm trying to have a click counter every time I click on an image.

    I've loaded the images and set up the counter but I don't know how to set the conditions!

    I'm using Processing.3

    submitted by /u/TLinston
    [link] [comments]

    C# default instancing of a class within the same class

    Posted: 06 Dec 2021 10:22 AM PST

    So I want to have a compile time default instance of a class to quickly give to accessors

    so:

    public class Foo{ public T Prop1 public T Prop2 public Foo(T prop1, T prop2){ } public static Empty = ? (I want this to be a Foo{Prop1=default1, Prop2=default2}) } 

    The benefit would be in multiple functions in many other classes where I want to have a default case (which needs to be there at compile time)

    bar (T attri, Foo inFoo = Foo.Empty) 
    submitted by /u/Sir_lordtwiggles
    [link] [comments]

    Is there an open source trusted library that implements a secure protocol for Yao's millionaire problem?

    Posted: 06 Dec 2021 04:40 AM PST

    I would not like to reinvent the wheel, I'm looking for a secure and tested implementation.

    submitted by /u/Plepsie
    [link] [comments]

    How to customize react-fine-uploader?

    Posted: 06 Dec 2021 04:17 AM PST

    I'm trying to use react-fine-uploader in my project, and I couldn't find the right way to customize its styles. I'm also trying to have the access to files before they are sent to the server, but I haven't figured out how to do that, because official docs don't cover either of those topics in detail. I hope somebody with the experience with this library could help.

    submitted by /u/duskomacek_
    [link] [comments]

    Creative ways to make money from coding WITHOUT having any customers?

    Posted: 06 Dec 2021 07:16 AM PST

    I'm not talking about the regular stuff you see in every blog post about it: "develop a smartphone app, open a programming blog", and so on.

    For example, make your stock trades automatic (algo-trading and so on).

    In that case, you have to be familiar with stock trading and how to earn from it, of course.

    Any other ideas?

    The more it is niche-related, the better.

    submitted by /u/PopCorona
    [link] [comments]

    Can you `pip install py_pol`?

    Posted: 06 Dec 2021 02:52 AM PST

    I want to play around with the py_pol [pypi link] package, but installation fails because of some other package ("h5py")...

    Are you able to install this package successfully....?

    It seems this package is exactly what I need and is kinda specialized... so no real alternatives around (other than hard coding everything myself)

    EDIT: The error output is 1500 lines long, so here's just the start:

    [BUNCH OF REQUIREMENT STUFF WHICH WORKS] Using legacy 'setup.py install' for h5py, since package 'wheel' is not installed. Installing collected packages: h5py, dill, sympy, nbsphinx, hickle, Click, py-pol Attempting uninstall: h5py Found existing installation: h5py 3.6.0 Uninstalling h5py-3.6.0: Successfully uninstalled h5py-3.6.0 Running setup.py install for h5py ... error ERROR: Command errored out with exit status 1: command: /usr/bin/python3 -u -c 'import io, os, sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-o2l8jwy9/h5py_4f93d8c52fe842eb968c789734f360f4/setup.py'"'"'; __file__='"'"'/tmp/pip-install-o2l8jwy9/h5py_4f93d8c52fe842eb968c789734f360f4/setup.py'"'"';f = getattr(tokenize, '"'"'open'"'"', open)(__file__) if os.path.exists(__file__) else io.StringIO('"'"'from setuptools import setup; setup()'"'"');code = f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record /tmp/pip-record-kd5jmm6h/install-record.txt --single-version-externally-managed --user --prefix= --compile --install-headers /home/douglas/.local/include/python3.9/h5py cwd: /tmp/pip-install-o2l8jwy9/h5py_4f93d8c52fe842eb968c789734f360f4/ Complete output (1431 lines): 

    EDIT2: pip install wheel does not resolve the issue

    submitted by /u/giwidouggie
    [link] [comments]

    Storing JSON data in a database? Or parse it out? - Data is potentially very complex (Warhammer 40k Rosters)

    Posted: 06 Dec 2021 02:35 AM PST

    So I'm starting to prototype an army roster system for Warhammer 40k.

    The front end will be react (and probably redux), and I have a JWT-driven account system ready to use.

    I'm wondering how I should store the rosters from the front-end. Should I parse each list into a set of different tables, like one tables for units or detachments, etc. Or should I just store each list as a blob of text?

    submitted by /u/Ratstail91
    [link] [comments]

    Help Me Find Keywords

    Posted: 06 Dec 2021 02:02 AM PST

    I'm trying to find more information about a programming method/architecture for data-intensive processing (like image processing), but I can't find the right combination of keywords to see examples of what I'm looking for. Please help :)

    The general concept to separate your high-level data/metadata from your lower level processing.

    For example, if I had a large 2D array of floating point numbers. I might create a class which might store: the array its self, the dimension sizes, names of dimensions, the min/max values, a name for the data... etc, etc

    Now if I want to process a lot of these data classes, its doesn't make sense to make an array of these large classes, which depending on the processing function might not use 99% of the data (lets say I just want the average max value of all the arrays). But instead I want a preprocessing step that takes all the objects max values, puts those into an array, and then is able to do very fast operations on this data.

    In short, I want the high-level data container because its useful to have all this metadata and make decisions on how to best optimize the data storage/layout in order to make the processing faster, and I don't want to manage just "pure arrays" because I lose all this nice information.

    ---

    The concept is sort of a data-oriented approach, but in my searches I can't find architectures which support this high-level data container with an optimization step to align all the data according to the processing that's about to happen (like a DAG of processing steps).

    Does this fit into an established architecture paradigm? I'd love to see code examples, or just high level description about how they design such a system because I don't know enough to do it (quickly) with my current knowledge and it would help a lot to build on someone else's experience. Especially because these architecture decisions are very hard to change later on.

    submitted by /u/polylambda
    [link] [comments]

    No comments:

    Post a Comment