• Breaking News

    Friday, March 4, 2022

    How often do you use switch? Ask Programming

    How often do you use switch? Ask Programming


    How often do you use switch?

    Posted: 04 Mar 2022 08:54 AM PST

    How often do you use switch in your code?
    What is good use case of switch? Can you replace switch with something else except condition?

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

    Is there a way to directly "execute in-app actions" through a script/shell?

    Posted: 04 Mar 2022 08:12 AM PST

    I am trying to make AIs that play games against the game AI. I've done this for simple games like chess/go etc.

    This time, I want to make one for a video game called "Age Of Civilizations 2". But I can't seem to find a way to "let the program play as the player." i want to have function in my code that, when called, replicates a button click in the game. Is it possible to do this? {Eg, define function recruit(num,province)}

    In general, the question is can in-application actions be called from external commands? Are buttons in applications mapped to shell commands? Like, a shell command, that when entered, opens a specific menu in a specific application, or reads a specific value in the application?

    (Apologies if this is not the right sub, I'll remove it if it isn't.)

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

    Google Foobar Challenge - help

    Posted: 04 Mar 2022 02:01 PM PST

    I was looking up "ArrayList java" and was invited to a google foobar challenge. I have 7 days to complete a coding challenge, however I can't figure out where to start. The Terminal looks something like this after I type help...

    Use the following shell commands:

    • cd- change directory [dir_name]
    • cat - print file [file_name]
    • deleteme - delete all of your data associated with foobar
    • edit - open file in editor [file_name]
    • feedback - provide feedback on foobar
    • less - print a file a page at a time [file_name]
    • ls - list directory contents [dir_name]
    • request - request new challenge
    • status - print progress
    • submit - submit final solution file for assessment [file_name]
    • verify - runs tests on solution file [file_name]

    Keyboard help:

    • Ctrl + S - save the open file [when editor is focused]
    • Ctrl + E - close the editor [when editor is focused]

    Toggle between the editor and terminal using ESC followed by TAB, then activate with ENTER.

    foobar:~/ [myGmail]$ ls

    minion-work-assignments
    journal.txt
    start_here.txt

    I requested a challenge and it was saved to some something called /home/myGmail I don't know how to access the challenge and can not request another. I have 7 days to figure out how to access and complete the challenge.

    (For context - myGmail is my actual gmail adress which I replaced. I have Java experience, however I am unfamiliar with older style terminals. Any help is appreciated!)

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

    Any way to edit source code on Google Docs

    Posted: 04 Mar 2022 02:00 PM PST

    I don't know much about practical coding, just the basics, but on Google Docs, if you start a line with a dash and hit the space bar, it will automatically create a bulleted list, same with a number and then a period.

    Is there a way I could make it so that another character has the same effect, such as this one: ↳

    This is for taking notes in a class

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

    Does allocating more resources make programs run faster?

    Posted: 04 Mar 2022 01:54 PM PST

    I'm currently playing with fractal generation, which is extremely computationally intensive by nature. Through PyCharm, it takes roughly 2 hours to generate a 4k by 4K pixel image using my PC that has a 10th gen i9, RTX2080 Ti, and 64Gb of RAM.

    Is there a way to allocate more resources such as RAM, CPU cores, etc., that would make my program run faster?

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

    What softwares or coding languages could be useful for someone that wants to automate tasks on large bodies of texts?

    Posted: 03 Mar 2022 10:07 PM PST

    For instance, mass editing, finding duplicates on a large database, that kind of stuff. Would you say Excel is enough for such things or are there anything I can learn programming wise to make my life easier?

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

    How does Clearbit Reveal figure out my company?

    Posted: 04 Mar 2022 12:43 PM PST

    Clearbit Reveal (https://clearbit.com/reveal) uncovers the companies behind anonymous website visits. They even correctly identify my company when I visit them from my home desktop. How do they get this information?

    They say their algorithm works to identify and validate matches, based on Clearbit's processing and application of machine learning to hundreds of millions of new data points each month, along with multiple signals from traffic patterns, geolocation, manual QA and more. (https://clearbit.com/blog/ip-intelligence-for-remote-work).
    I really struggle to come up with what these data points are.

    Anyone else have any ideas?

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

    does a software/code exist to translate english to french of a whole column?

    Posted: 04 Mar 2022 08:48 AM PST

    so been working on a webpage with razor code html, all text is done via layouts so we can easily switch from english to french, i did everything on excel to then just copy paste in the layouts and i did all the english already, started using google tanslate 1 row at a time, but i have like 500 lines to do, was wondering if there was an app or easy code i could to do translate the whole column instead?

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

    Is there a concept of "synthetic" in Programming (related to implementing tracing)

    Posted: 04 Mar 2022 11:14 AM PST

    I'm wondering if the word "synthetic" has a specific meaning in programing. I know that React has "synthetic events", but I'm not sure whether the word has other accepted/common usages.

    I'm asking because I want to use the term to describe something in my tracing implementation using the OpenTracing Java API library.

    I'm trying to connect distributed spans in a situation where I don't have access to the correct parent context on my request, but can get the correct parent span id from somewhere else. So I have an active span I want to connect to its parent span, but to do that I need to build a SpanContext object that has the correct data. I can do that by extracting a SpanContext from a fake HTTP request that has the correct parent span id (that I'm getting from that other place)on its headers. I want to name the fake HTTP request "syntheticRequest" and the extracted context "syntheticContext". Does that make sense? Or does it mean something I don't mean? Am I overthinking this?

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

    Licensing code

    Posted: 04 Mar 2022 10:34 AM PST

    I made a Java application which uses the JFreechart and JSerialComm libraries and I would like to publish its source code on GitHub. I really don't know if I can choose my own license or use the one provided with those libraries (LGPL). Can you please help me?

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

    Explain the difference of AngularJS and Angular 2 or CLI?

    Posted: 04 Mar 2022 03:52 AM PST

    What options are there for code sharing in C++ from a project/source-control layout perspective?

    Posted: 04 Mar 2022 09:15 AM PST

    I'm faced with the problem of migrating a series of C++ applications and libraries from Visual Source Safe (VSS) into Git (I think migrating to Subversion would probably be the more sensible option but that's been outright rejected on political grounds).

    That got me wondering how organizations which may have many libraries worth of shared code handle distribution and what the project/source-control layout looks like.

    Things we want our solution to accomplish:

    1. Ensure that the process to go from zero code on your machine to building the application is as simple as possible.

    2. Ensure that the process for making modifications to shared code is:

    i. easily debuggable, and

    ii. has low cognitive overhead

    Things we've thought about:

    1. A monorepo containing all of the legacy applications and libraries.

    • This most mirrors the layout of the code base within VSS, but comes with all of the potential pitfalls of a monorepo (performance, primarily, I believe).
    • I can't believe most organizations that have C++ code bases with a bunch of shared code are using monorepos, but I just don't know what's most common.
    • Code sharing is at the source level.

    2. Generate nuget packages which contain .lib files for each possible build configuration and the library's headers.

    • Dependent projects would be required to download the appropriate nuget packages from the store and extract them.
    • Changes to any of the dependencies would have to go through the process of making the change in the library, building, and either publishing a nuget package to a local store (and then going through the process treating it like it's a normal package version) or copying the artifacts into your local directory for testing. Then once the changes are ready to be published, you'd have to wait for a CI build and then update the nuget version that your project is set to pull.
    • There seems to be a lot of manual configuration management here.
    • Code sharing is at the binary + headers level.

    3. Git submodules for each of the dependencies.

    • Submodules are incredibly painful to use and the cognitive overhead introduced by them seems greater than option (1) or (2).
    • Code sharing is at the source level.

    4. Applications and libraries are in separate repos and dependent projects expect their dependencies to be cloned as siblings with relative paths for includes and project references.

    • Code sharing is at the source level.
    • It is non-trivial to ensure that all of the repositories are on the appropriate commits.

    Note that this entire discussion centers around using Visual Studio as the build tool (hence the consideration of nuget packages).

    So my specific question is: how is code sharing of dependencies owned by the org handled in C++ projects generally?

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

    Uncaught Error: Element ref was specified as a string (content) but no owner was set. This could happen for one of the following reasons:

    Posted: 04 Mar 2022 08:47 AM PST

    So I will no longer use micro froentend to include this part of this electron application, so I did copy the source files into the main project. Installed packages, etc but when I went to run, I got this error on console (full error here):

    Uncaught Error: Element ref was specified as a string (content) but no owner was set. This could happen for one of the following reasons:

    1. You may be adding a ref to a function component

    2. You may be adding a ref to a component that

    3. You have multiple copies of React loaded

    it seems i didn't have any duplicate react version loaded: https://pastebin.com/P5wCPd6q

    I didn't have in the source code ref set to a string, only 3 uses like this (full source code here):

     return <div ref={drop} style={styles}> 

    How do I fix this?

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

    Hi all, im trying to use python to save audit, sigin and compliance logs for office365 but im getting too many redirects messages.... anyone know what i may be doing wrong? thank you https://bpa.st/CBSQ

    Posted: 04 Mar 2022 05:54 AM PST

    Paying For Help Programming a Huion Mini Keydial KD100

    Posted: 04 Mar 2022 05:45 AM PST

    My Huion Mini Keydial KD100 does not work right with Google Docs, Google Sheets, etc... All the Google Suite products, it doesn't work right. For Example, the button I have programmed to make text Bold doesn't work, button programmed for Italic doesn't work, the button programmed for Undo works, but it Undoes the last TWO things I did instead of the last ONE thing, when I copy a URL and paste it in the URL field, it's pastes it twice.

    I don't know if it's even possible for someone to be able to fix this, but I will pay anyone that thinks they can do it. I really like this product, I just want it to work with the Google products. I emailed support at Huion and all they said was, yeah it doesn't work well with Google. That was it. So I don't think Huion is going to fix it anytime soon.

    If you understand these things and think you can fix it, Im willing to work out a fee for your work. Please let me know. Thank You!

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

    Does anyone know of an implementation of the conversion from a Quaternion to Euler Angles in all of the 12 different possible sequences?

    Posted: 04 Mar 2022 05:17 AM PST

    Basically, the title!

    I want to have an implementation of all of the possible 12 sequences (ZXY, ZYX, YZY, etc.).
    Also, specially if they are well tested!

    I don't really mind in which language it is (given that it's not assembly or an esolang), I just would love to have a well-tested open-source implementation so I can get the code.

    Thanks!

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

    can someone help me write a program? c programming language - beginner

    Posted: 04 Mar 2022 10:46 AM PST

    (keep in mind English is not my native language) I've just recently gotten into programming and today in school we had to write a program in C programming language. "find the biggest number that 2 imported numbers can be divided by". i know how to write half of the program but the rest is driving me crazy. So far we only know 4 loops. if-else, for, While and Do-While (please use these only) This was supposed to be written using Do-While and If-Else. I am just a beginner. (I am so bad at explaining, sorry)

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

    Those of you who code on a desktop setup, do you enjoy coding on a notebook?

    Posted: 04 Mar 2022 04:43 AM PST

    So, I'm a developer and in all the yeras so far i have exclusively worked on my desktop setup. It's a pretty beefy machine, and I have 3 27" screens hooked up to it.

    But recently I've really been thinking about getting a notebook to code a bit on the couch. I really enjoy digging into docs and doing some PoC codes, and I think it would be great to do this in a comfy environment outside of the working area.

    I have a company 14" screen notebook, but that's definitely a bit too small, so I recently went to a store to get a feel for how 15.6 might work, and I think it might just work out.

    So, those of you who have both: Do you enjoy working on a notebook for longer periods as well? Or do you usually go back to your dev machine after 30 minutes because you hate the smaller screen size? I think performance-wise it would not be a big deal. I'm working fullstack in web development and cloud, so I can get around containerization and having stuff run remotely if things get tight pretty well.

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

    What programming language is Adobe Acrobat programmed in?

    Posted: 04 Mar 2022 04:30 AM PST

    Hi there,

    I Just wanna know out of curiosity, what language is Acrobat programmed in, I would like to see if I can make my own type of application similar to Adobe Acrobat, even though I know it will most likely be a long and hard process, just something I'd like to work towards and perhaps make it open source

    Edit: To add to my question, do any of you know how I can perhaps begin to reverse engineer Acrobat? And do you think i should even go this route. I don't want to reverse engineer and copy their code and what not, would like to just take a look and see what I can find

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

    What microprocessor would you recommend as a step up from the 6502?

    Posted: 04 Mar 2022 12:21 AM PST

    I came across this YouTube playlist about the 6502 chip, and how to wire it up manually to perform computation. As far as I can tell, it can only manage 16-bit addressing, which is about 16Kbytes of RAM.

    Ideally I'd like to replicate this project but with 32 bit addressing (still on a RISC architecture ideally).

    Do bitboard 32-bit processors exist?

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

    [Swift] How to round corners of cells in Collection View?

    Posted: 04 Mar 2022 03:35 AM PST

    I have a grid of cells in Collection View. I would like to adjust the corner radius of all individual cells in the collection view, to make them rounded.

    [Here is what the collection view looks like](https://imgur.com/a/LNH8NW1)

    [Here is what the code currently looks like](https://imgur.com/a/fwgAXj1)

    I found [this previous answer](https://stackoverflow.com/questions/13505379/adding-rounded-corner-and-drop-shadow-to-uicollectionviewcell) on Stack Overflow, though I don't know *where* I would put it, what sorts of steps are required first, or if there are alternative ways of doing it (programmatically, or via the story board)

    Thank you!!

    submitted by /u/confused-bingo
    [link] [comments]

    I am having trouble understanding how I can authenticate user devices simply using an OTP.

    Posted: 04 Mar 2022 03:04 AM PST

    We have built a system where a user controls external devices (android) using a CMS.

    How can the user authenticate these devices using a one time password rather than enter a username and password like we currently do.

    I am having trouble understanding the concept of how to implement this with it still being secure to a brute force attack or something similar.

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

    Installing FFmpeg on Windows

    Posted: 04 Mar 2022 02:52 AM PST

    I have tried so many times but still haven't figured out how. Can someone help me?

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

    No comments:

    Post a Comment