• Breaking News

    Sunday, January 24, 2021

    Ultimate noob question. Can I program/compile with a shit 150 dollar laptop? Are there online compilers so I can actually run programs? Ask Programming

    Ultimate noob question. Can I program/compile with a shit 150 dollar laptop? Are there online compilers so I can actually run programs? Ask Programming


    Ultimate noob question. Can I program/compile with a shit 150 dollar laptop? Are there online compilers so I can actually run programs?

    Posted: 24 Jan 2021 07:46 PM PST

    I mostly want to write math programs.

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

    Can someone suggest me a good constraint satisfaction problem that I could model?

    Posted: 24 Jan 2021 06:04 PM PST

    So i am actually running out of ideas i tried looking up on net but only problems on there are nqueens and other trivial problems so could someone suggest me any problems which will be hard to model?

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

    Looking for some feedback for this UI Configuration tool I'm building

    Posted: 24 Jan 2021 01:11 PM PST

    https://imgur.com/uWd3zia

    I'm building this tool where you can upload a piece of JSON and it will generate an easily readable UI dashboard that can edit the JSON. Supports nested arrays, objects, etc... You can then give this dashboard to any non technical person to edit the data.

    Planning to build a hosted version where you can access this data on this dashboard through an API.

    Looking for any feedback.

    Some background on why I've decided to build this:

    In one of my previous jobs, to handle frequent configurations by stakeholders, we put raw JSON files in S3 buckets where stakeholders would have a JSON editor UI to write to the bucket. This was not the best solution since business stakeholders weren't technical and there weren't a ton of verification.

    My questions:

    • Have you guys ever needed to handle configurations or quick data updates from a client/stakeholder? How did you guys handle those situations?
    • Would something like this be useful for you?
    • If this would be useful, what would need to be a core functionality before you would pay for it? User management? Edit history? other?

    Thanks a ton.

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

    Code not running.

    Posted: 24 Jan 2021 07:42 PM PST

    I want to set up cryptocurrency prices on my touchbar according to the guide on this website: https://medium.com/@croopto/touch-bar-cryptocurrency-ticker-7b9b8aa1bddf

    However, after I click on run script, I receive the following message: AppleScript Error: Can't get item 2 of {" \"Helvetica Neue\""}.

    Can someone Please help?

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

    How to preload the next Reddit post by making a chrome extension

    Posted: 24 Jan 2021 02:35 PM PST

    When I press the N key the next Reddit post is shown to me I was wondering how that works and can I make a chrome extension that will help me preload the next post or any other suggestion also is there a resource where I can see how Reddit works as a programmer

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

    Problem converting code into a class - python

    Posted: 24 Jan 2021 12:45 PM PST

    edit: solved. I needed to use self.method to call an internal method.

    This is my class

    class anomaliCheck:

     def __init__(self, host, username, password): self.host = host self.username = username self.password = password def anomali_webCall(self, apiCall, header, data): baseuri = 'https://' + self.host + '/api/v1/' uri = baseuri + apiCall r = requests.post(uri, data=data, verify=False, headers=header) return json.loads(r.content) def get_token(self): auth = {'username': self.username , 'password': self.password } auth = json.dumps(auth) 
    submitted by /u/letais
    [link] [comments]

    Confused about a leetcode solution, how can we know len(X) == len(W)?

    Posted: 24 Jan 2021 07:16 PM PST

    My question is at the bottom. The post first states the leetcode question, the given solution, and then the part of the solution that I am unclear about. Thanks in advance for any help!

    Leetcode Question

    Given a blacklist B containing unique integers from [0, N), write a function to return a uniform random integer from [0, N) which is NOT in B.

    Optimize it such that it minimizes the call to system's Math.random().

    Note:

    1. 1 <= N <= 1000000000
    2. 0 <= B.length < min(100000, N)
    3. [0, N) does NOT include N. See interval notation).

    Example 1:

    Input: ["Solution","pick","pick","pick"] [[1,[]],[],[],[]] Output: [null,0,0,0]

    Example 2:

    Input: ["Solution","pick","pick","pick"] [[2,[]],[],[],[]] Output: [null,1,1,1]

    Example 3:

    Input: ["Solution","pick","pick","pick"] [[3,[1]],[],[],[]] Output: [null,0,0,2]

    Example 4:

    Input: ["Solution","pick","pick","pick"] [[4,[2]],[],[],[]] Output: [null,1,3,1]

    Explanation of Input Syntax:

    The input is two lists: the subroutines called and their arguments. Solution's constructor has two arguments, N and the blacklist B. pick has no arguments. Arguments are always wrapped with a list, even if there aren't any.

    ________________________________________________________________________________________

    Provided solution

    Intuition

    Re-map all blacklist numbers in [0,N−len(B)) to whitelist numbers such that when we randomly pick a number from [0,N−len(B)), we actually randomly pick amongst all whitelist numbers.

    For example, for N=6 and B=[0,2,3] a remapping could look like this:

    {0: 4, 1: 1, 2: 5}

    Algorithm

    Split B into two blacklists, X and Y, such that X contains all blacklist numbers less than N−len(B) and Y contains the rest.

    Use Y to create W, a list of all whitelist numbers in [N−len(B),N).

    Define a HashMap M, where M[i]=i by default (when there is nothing assigned to M[i] yet), but M[i] can also be assigned some other value.

    Now, iterate through all numbers in X, assigning M[X[i]]=W[i]. Note that len(X)==len(W).

    M[0]...M[N−len(B)−1] now maps to all whitelist numbers, so we can randomly pick in [0,N−len(B)) to get a random whitelist number.

    The implementation below optimizes this algorithm in various ways, but the overall idea remains the same.

    class Solution { Map<Integer, Integer> m; Random r; int wlen; public Solution(int n, int[] b) { m = new HashMap<>(); r = new Random(); wlen = n - b.length; Set<Integer> w = new HashSet<>(); for (int i = wlen; i < n; i++) w.add(i); for (int x : b) w.remove(x); Iterator<Integer> wi = w.iterator(); for (int x : b) if (x < wlen) m.put(x, wi.next()); } public int pick() { int k = r.nextInt(wlen); return m.getOrDefault(k, k); } } 

    ________________________________________________________________________________________

    My question is regarding the section around the portion of the solution which states "Note that len(X) == len(W)". How can we know this to be true? It's not quite clicking for me. What are the properties of X and W that necessitate their lengths are equal?

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

    Would it be honorable to expand my programming ability by learning HolyC and TempleOS?

    Posted: 24 Jan 2021 10:44 PM PST

    Basically, I just write software as a hobby, I wanted to have a career at one point but it doesn't sound fun anymore. So I'm not tied to any stack or language for the sake of a career. So I want to learn something new and I think it would be nice to remember Terry by learning his tools.

    submitted by /u/To-The-Dream
    [link] [comments]

    Looking for help with an AR based app!

    Posted: 24 Jan 2021 08:07 PM PST

    Hello! I hope this is okay to post here, as I really know very little about coding and have never come to this subreddit before. What I do know very well is wine. I am currently the lead sommelier at a large Miami Beach resort, and I have a plan for an app to make wine buying easier. I have a clear vision for the application's function and design and am ready to get to work on it immediately. If you think you would be able to help me with this, please send me a message and we can talk!

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

    How should I go about creating my automated tests?

    Posted: 24 Jan 2021 03:40 PM PST

    So I'm not sure how to do this and I find I'm wasting a lot of time with it. Generally, I try to do TDD but all these things are just strategies and nothing in this realm is actually set in stone. I find that most things have an approach and nothing is a recipe.

    Right now I'm just writing a REST API with Rust. In general, I do integration testing for my controllers, I do most scenarios envisioned for each HTTP code that my methods may send and do unit testing for custom code that I may create but usually not for CRUD operations on repositories or database services. Those things are mostly boilerplate so I don't see a good reason to go deeper into them.

    Anyway, how do you guys go about this? I'd appreciate if you posted your opinions.

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

    Cloud-based filesystems?

    Posted: 24 Jan 2021 07:22 PM PST

    This is a pretty general programming/computing question. Is it possible, common, viable, or practical to create a filesystem (similar to Finder on macOS for example) on the cloud? or on a server? where multiple computers can access and store files on this filesystem? Sorry, I'm not sure if this is super obvious and whatnot.

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

    Beginner: Advice for my first project?

    Posted: 24 Jan 2021 10:13 AM PST

    The Project:

    I have a huge set of data that currently exists as an excel spreadsheet. I currently use the manual filters and sort-by functions that excel provide to search through my data-set. I thought it would be a great idea to make this data searchable by creating some kind of interface. I want to keep it very simple: a main interface that consists of 3 drop down boxes - as soon as you hit search it will take you to a new page with the data results based on your choices in the drop down boxes.

    The Challenge:

    I have 0 programming experience! My knowledge at this stage is that I need a front-end for the interface and somehow need to hook that into my back-end dataset. For me this poses 4 key questions:

    1. What programming languages do I need to use?
    2. Do I create the front-end or back-end first?
    3. How do I put the excel data into a real database?
    4. Where the hell do I start?

    I'm looking for as much guidance as possible, I think this will be a great learning experience for me but have absolutely no idea where to start!

    Thanks!!!

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

    What is the difference betwen JWT and Bcrypt?

    Posted: 24 Jan 2021 06:21 AM PST

    JWT is commonly found in java, javascript while Bcrypt is more common in rails projects. are they used for the same thing? authentication or authorization?

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

    Log File Syntax Highlighter for MAC OSx?

    Posted: 24 Jan 2021 04:41 PM PST

    Hey there! Hopefully, I'm in the right subreddit, just wondering if anyone out there knows of any tools that I could install for my terminal to have better syntax highlighting for log files while I'm working/debugging something.

    Currently I just "tail -f var/logs/*" for work and would love to have something that made critical errors in the back end more readable. Any help would be appreciated! Thank you :)

    submitted by /u/New-Muffin-8716
    [link] [comments]

    Cannot open source file "pch.h"

    Posted: 24 Jan 2021 02:59 PM PST

    Hi, super new to programming and am trying to follow guide for my university work in C++ Visual Studio 2019. I have been asked to implement the following:

    #include"pch.h"

    #include<iostream>

    usingnamespacestd;

    intmain()

    {

    cout << "Hello World!";

    return 0;

    }

    I know this should be really basic, but when I run this as a C++ Windows Console Application, I am greeted with "cannot open source file "pch.h"." Any help would be greatly appreciated.

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

    Are there any webpage archiving solutions that actually save the content as its stored in the browser RAM?

    Posted: 24 Jan 2021 02:33 PM PST

    I'm looking for something that'd let me go to a website in a browser, click a button, and save a snapshot of the page as its saved in the browser RAM. Possibly even saving javascript execution state.

    And then possibly reload that RAM copy to the browser at a later time from disk?

    Current solutions I've tried seem to try to patch JS and other files to update references to make them all local. I want something that does none of these hacks, but instead uses a modified browser or separate viewer that can just load the state from an archive file/memory dump instead of trying to repull everything from the original network source or requiring URL hackery in JS files to get it to read local files.

    I've tried various solutions like savepage, and WARCs with WARC player to view content, and I had high hopes for WARCS but they fail to save pages with Javascript and Canvas elements.

    I'm wondering if I'd be better off creating a VM with Firefox installed, going to a webpage, and pausing the VM, and distributing these backups. Or does there exist a browser that can dump and reload tab states?

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

    [Java] Adding a String of Integers

    Posted: 24 Jan 2021 02:15 PM PST

    I have a string filled with numbers that are separated by "+" signs. Is there a way I can declare and integer that is equal to the "total" of the string?

    This is the approach I was taking because I am using a ListView in JavaFX and need to extract the individual prices for each index:

    String str ="$10$30$2$3"; String newStr = str.replaceAll("[$]", "+"); //newStr is "+10+30+2+3" int x = ? //How to make 'x' the total of the added integers within the string? 

    Any help is greatly appreciated!

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

    Using Spring, how would I extract information from a .json file?

    Posted: 24 Jan 2021 02:05 PM PST

    I want to later use React as a front end tool to display the information from a JSON file. Spring is used as a backend tool to potentially write the information to a database.

    I created an

    @ Entity object with the object (implemented Getter & Setter methods) , have a service dedicated to the object, and a repository for CRUD operations. How would I extract the information from the .json file with the individual columns (i.e. ID, address, email..etc)?

    My JSON file looks like this: (A table of foods)

    [{"id":1,"Food":"Apples - Sliced / Wedge","Calories":553},
    {"id":2,"Food":"Wine - Red, Metus Rose","Calories":890},
    {"id":3,"Food":"Lighter - Bbq","Calories":198}...

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

    Find and replace in console

    Posted: 24 Jan 2021 12:45 PM PST

    Hi all, so just a heads up I'm not a programmer but I'm beginning to dabble a bit. Not really I'm a pretty big noob.

    I'm trying to do a find and replace inside of dev console to alter the DOM, then save the changes.

    The issue is, the things I want to alter are in a textbox inside of an iframe.

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

    Creating a "My Account" service

    Posted: 24 Jan 2021 08:13 AM PST

    Hi everyone, I am currently creating a website for the company I am working for. Thus, we would like to add a section to the website where our customers could manage their orders and also direct chat with us. We are working on shopify to develop the site but it doesn't propose any option for this kind of service. This is why I think my team and I will have to code this part of the site. I am myself kind of a begginer in the matter but my associates know better. So if you have any idea on how we could manage to create this personal space for our customers it would be a pleasure to receive your answer.

    Thank you for your time and attention 😘😘

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

    Question about recursion and depth first search

    Posted: 23 Jan 2021 10:49 PM PST

    I see many examples on leetcode where either solutions will either involve using the provided function in a recursive manner, but there is also many times where people create "helper" dfs functions that the provided function will call out to.

    Is there a general rule of thumb to know when you need to create a helper function or can go without it?

    Example: https://leetcode.com/problems/diameter-of-binary-tree/discuss/101132/Java-Solution-MaxDepth

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

    Anyone deal with Tumblr exports before?

    Posted: 24 Jan 2021 05:30 AM PST

    Each of my tumblr posts corresponds to a single image, but in the export it saves the posts as a random number from the tumblr post. I have 1083 so it would take a while manually

    It saved the pictures here: C:\Users\RMcD\Downloads\Relating to Me\tumblr\media
    The XML is here C:\Users\RMcD\Downloads\Relating to Me\tumblr\posts\posts.xml

    For the below example it has saved the image as: "167940285013.jpg", I want to change the name from 167940285013.jpg to the UNIX timestamp (if I can just do that it's ok), and change the date taken in EXIF to then too

    <post id="167940285013" url="https://rmcd94.tumblr.com/post/167940285013" url-with-slug="https://rmcd94.tumblr.com/post/167940285013/cebu-city" type="photo" date-gmt="2017-11-27 13:33:23 GMT" date="Mon, 27 Nov 2017 13:33:23" unix-timestamp="1511789603" format="html" reblog-key="Zi4QglY0" slug="cebu-city" state="published" is_reblog="false" tumblelog="rmcd94" width="2592" height="1944">
    <photo-caption><p>Cebu City</p></photo-caption>
    <photo-url max-width="1280">https://66.media.tumblr.com/bb6d00768f22bf755bac40f01ba1c680/tumblr_p02wbjToaV1qa80doo1_1280.jpg</photo-url>
    <photo-url max-width="500">https://66.media.tumblr.com/bb6d00768f22bf755bac40f01ba1c680/tumblr_p02wbjToaV1qa80doo1_500.jpg</photo-url>
    <photo-url max-width="400">https://66.media.tumblr.com/bb6d00768f22bf755bac40f01ba1c680/tumblr_p02wbjToaV1qa80doo1_400.jpg</photo-url>
    <photo-url max-width="250">https://66.media.tumblr.com/bb6d00768f22bf755bac40f01ba1c680/tumblr_p02wbjToaV1qa80doo1_250.jpg</photo-url>
    <photo-url max-width="100">https://66.media.tumblr.com/bb6d00768f22bf755bac40f01ba1c680/tumblr_p02wbjToaV1qa80doo1_100.jpg</photo-url>
    <photo-url max-width="75">https://66.media.tumblr.com/bb6d00768f22bf755bac40f01ba1c680/tumblr_p02wbjToaV1qa80doo1_75sq.jpg</photo-url></post>

    So I know I want to get the name of the image file -> remove .jpg -> search for the "unix-timestamp" after when it finds that posturl and then rename the post id to that. I tried searching for other people who did it to find a guide but I couldn't find it

    In some of the images I have the slug as a more accurate date: </photo-url></post><post id="95324387068" url="https://rmcd94.tumblr.com/post/95324387068" url-with-slug="https://rmcd94.tumblr.com/post/95324387068/764-2014-08-20-2359" type="photo" date-gmt="2014-08-21 00:15:57 GMT" date="Thu, 21 Aug 2014 01:15:57" unix-timestamp="1408580157" format="html" reblog-key="a4j9Q9CF" slug="**764-2014-08-20-2359**" state="published" is_reblog="false" tumblelog="rmcd94" width="1000" height="750"><photo-caption><p>764 - 2014-08-20-2359</p></photo-caption><photo-url max-width="1280">

    If you can link me to a guide or something that tells me how to do that

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

    What programming language is needed for creating games like. Microsoft Flight Simulator 2020

    Posted: 23 Jan 2021 10:47 PM PST

    Hey all,

    I'm very new to programming

    I wanted to know

    What programming language and or skills is needed for creating games like. Microsoft Flight Simulator 2020 & city car driving simulation

    I'm interested in creating a game like this,

    Is it possible for me to create something like this for free

    kind regards

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

    No comments:

    Post a Comment