• Breaking News

    Friday, June 18, 2021

    How difficult would it be to make your own virtual printer software? Ask Programming

    How difficult would it be to make your own virtual printer software? Ask Programming


    How difficult would it be to make your own virtual printer software?

    Posted: 18 Jun 2021 11:27 AM PDT

    It would exist to show up in the Printers & scanners say in Windows 10 or whatever.

    It is in fact just a bridge to a web server/uploads to it.

    The intent is so that the printer shows up in Chrome.

    I'm trying to figure out what I have to do to make this work.

    Maybe it already exists?

    Ooh maybe this Microsoft thing universal cloud printing api

    updates

    So far I have found out about WSD Printers and CUPs

    Actually TCP/IP would probably work with some port

    Looks like I'll try IPP then maybe CUPs

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

    Solving algorithmic problems: why is it better to first solve the problem recursively and only then transform the solution to an iterative approach?

    Posted: 18 Jun 2021 11:30 AM PDT

    Hi,

    A general question about solving algorithmic problems. Why solving a problem first in recursive way (if a problem can be solved in a recursive way) is better than immediately trying to solve using an iterative way (loop or explicit stack)?

    Thanks

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

    I'm having issues running python in VSCode, when it can't find a module to import and run a program but in the same terminal when I run the pip install it says requirements already satisfied

    Posted: 18 Jun 2021 10:01 AM PDT

    My python file has a couple imports for matplotlib and numby, and whenever I try to run the file from VSCode it says it can't find the module named matplotlib, and errors out.

    Here is a pic of my code: https://i.imgur.com/yCIKNt4.png

    When I run "pip install matplotlib" it says that all the requirements are satisfied: https://i.imgur.com/n4zJmcn.png

    and here is the interpreter for python it's running (it always defaults to 3.8 on opening too): https://i.imgur.com/fXehEA9.png

    I've tried running pip uninstall and then reinstalling the module but that doesn't work at all either. What should I do?

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

    Decrypting the IQLL ransomware

    Posted: 18 Jun 2021 04:32 PM PDT

    This morning, I received a call from my sister, who informed me that her computer had been attacked by ransomware, and that a payment of $700/$490 (within 72 hours) was needed for the key. I was able to trace down the .exe malware that was used to spread the virus, through analysis I was able to remove it all, but the files were still encrypted with the extension IQLL. I've tried a few things (Safe mode, Photorec, Reset PC, Emsisoft, and so on), but none of them have worked so far. Is there anyone who knows how to decrypt these files legitimately?

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

    Simplest ES6 method to import a big collection of exported functions

    Posted: 18 Jun 2021 05:07 PM PDT

    suppose I have 30 exports in a file

    when I need to import them in another javascript file, what is the simplest es6 way to do it?

    // fileB const { func1, func2 ... } = require('./fileA')

    do I need to put commas after every import inside the { }? There must be a better way to do this.

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

    This is a bit of a tangent(still programming related). A few years back there was a guy trying to write his own game but it turned out it was basically a giant collection of if else statements, he went by y{something}dev. I think his name was like a genre of anime, does anyone remember?

    Posted: 18 Jun 2021 07:20 PM PDT

    Is there a templating engine that is safe to expose to users?

    Posted: 18 Jun 2021 06:46 PM PDT

    While including logic that is pulled from Javascript. For example, if you expose Vue then you'll have chaos. Is there anything that you can expose (similar to Handlebars) that allows users to customize HTML pages with logic without injecting their own Javascript?

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

    Need to build a web application that will have to be embedded in multiple 3rd party mobile apps. Will this be possible/ideal in Flask? What front-end components would be good to enable this.

    Posted: 18 Jun 2021 06:45 PM PDT

    Assuming that the external mobile apps we want to be embedded into provide the necessary embed frames, etc.

    From my research so far, it looks like there's no reason Flask shouldn't be able to do this, and it's more contingent on the front-end we end up using.

    So assuming Flask is able to build the necessary kind of PWA, my next question would be the best kind of front-end that would be ideal for this. Is just baseline HTML/CSS/JS enough, or would I actually have to incorporate the use of a framework like React Native, or something along those lines?

    People who've undertaken similar projects - is there any concern that comes to mind? Would the web-app itself be mobile device agnostic (i.e. works across both Android/iOS devices - only concern regarding integration would be the android/iOS specific parts in creating the frame for the embedding).

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

    Using math to become a better programmer?

    Posted: 18 Jun 2021 07:25 AM PDT

    Hi ! I'm wondering if there's any books or specific maths subjects that can help me become a better programmer.. I'm transferring universities this year, (into an art-based coding program) and am taking college level math courses for the first time (algebra, calc, etc). I'm thinking there's no better time than now to improve my math skills. (I always struggled in high school math but was strong in other subjects, and never had any issue with logic-based questions— think all A's with a D in Maths :/ ) So any books on calculus, algebra, or logic based math, even "thinking" mathematically will be a huge help! ♡

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

    Is CloudSim relevant?

    Posted: 18 Jun 2021 06:42 PM PDT

    I'm taking a Cloud Computing class but I'm afraid it's out of date. We are learning to use a software called CloudSim and it's latest release was 2013. I get the principles would be similar, but I'm starting to think this class may not be the best use of my time & I don't even need the class, I was just curious (scholarships covered costs). I'm interested in cloud computing, but this is an online class and it has all been uninterpretable videos and links to other educational materials.

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

    Does a reference to a mutable object passed to a function mean that it's necessarily non-deterministic?

    Posted: 18 Jun 2021 02:20 PM PDT

    I was disagreeing with someone about the following Java snippet

    class Foo { private int val; int getVal() { return val; } void setVal(int val) { this.val = val; } } class App { private static int getValFromFoo(Foo f) { return f.getVal(); } public static void main (String[] args) { Foo foo = new Foo(); System.out.println(getValFromFoo(foo)); // 0 foo.setVal(10); System.out.println(getValFromFoo(foo)); // 10 } } 

    I believe that getValFromFoo is deterministic (and, for the record, also pure and idempotent).

    If you take the definition of deterministic to be "A function is considered deterministic if it always returns the same result set when it's called with the same set of input values", which we both agreed was a fine definition

    They stated

    Any method that relies on changeable state is by definition non-deterministic, because the state of the object is not considered "input values" to the function, since they are not values input to the function by the caller

    I think that's wrong. The fundamental disagreement, I think, is about what constitutes the "same set of input values". They seem to be working on the presupposition that the same reference means the same input, since the reference is the argument supplied to the function. I believe the argument in each case can be considered as foo0 and foo1 and, while the reference is the same on each invocation, the two should not be considered "the same". I believe the state of the object passed to the function is an input, it's just an indirect / implicit one.

    Determinism to me, in an intuitive sense, is about whether you can determine what the output will be given you know what the function does and what the input will be. It's about being able to predict, with certainty, the result. In our case there is no randomness and no uncertainty.

    I'm sure this has been discussed before but I couldn't find anything when searching for it. What do you think? I'd be interested in any reputable citations if there are any too.

    submitted by /u/bears-repeating
    [link] [comments]

    Chatbot Development and deployment question

    Posted: 18 Jun 2021 09:57 AM PDT

    I have a chatbot made in python , I have the whole frontend ready now all I want to do is to connect both of these ... I tried flask and fetch API but I am running into network errors and the API is failing

    How can I do it ...is there any other way ? P.S I don't wanna go with Django I also want to make it deployment ready

    Is there a way I can make both of these (front end and backed) talk with each other

    (Any link to a website or GitHub repo is also appreciated)

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

    [Python] In a dictionary, replacing a key's value with a list

    Posted: 18 Jun 2021 07:07 AM PDT

    I have a massive nested dictionary of arbitrary length and depth that I'm traversing through. Somewhere in the middle, I have a dictionary (will call this dictionary1). One of the keys inside the dictionary1 CURRENTLY has for its value another nested dictionary (dictionary2). I want to replace dictionary2 with a list.

    Note, I don't want to take the contents of dictionary2 and convert them into a list. I have a list already created in another part of my program with completely different data, and I'd like to replace entirely the dictionary2 that's CURRENTLY the value for that key, and place the list I currently have.

    I tried the update method but predictably, it throws an error because its expecting a dictionary (which as 2 items, a key and a value) and is instead finding a list (over a dozen items).

    For more info: I used a recursive function to navigate down into this massive dictionary until it finds the part I want to replace. When it gets there, I need to know how to replace it.

    The general format of the relevant section is:

    ...{'fuchsia': {'type': string, 'enum': { NESTED DICTIONARY2 } ...

    My recursive function basically just does a "for all in..." statement, and if it gets to another dictionary, it calls itself and continues in that fashion. I just don't know what to do when I successfully get to the part I want to replace.

    Thoughts?

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

    What do I need? barAppliction

    Posted: 18 Jun 2021 07:51 AM PDT

    Hello, I just finished my first year of programming and am thinking of writing a program for my friends house bar. I am not sure what the best approach is for this.

    So the scenario is as follows. People would come in and register for a membercard. This membercard will be used to buy drinks. Everytime an order is placed a picture is taken.

    So far I have learned some Java, working with spring and interacting with SQL Datbases. I can write basic HTML. Is it possible to do everything with java and html or would i need to learn some other languages? Also I don't know how to interact with the hardware. What hardware would you recommend and what would be best to interact with them? I would like to keep it as cheap as possible. I have some experience with Linux also. If someone could point me to where and what exactly i should be looking for that would be of great help!

    Thank you

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

    Help with JavaScript in chrome dev tools console

    Posted: 18 Jun 2021 11:34 AM PDT

    hey,

    So basically I have a problem and i need some help to solve it.

    here is a command :

    document.querySelector('selector').__reactProps$rq1jfnzwgw.children.props.onVerify('some text','foo-bar') 

    So I am trying to make a bot that will go the the website and run this command, however the command changes each time as the part __reactProps$rq1jfnzwgw changes the last 10 digits each time.

    So it always starts with __reactProps$ then there is random 10 letters and numbers.

    How would i make the command automatically set the last 10 digits in __reactProps$rq1jfnzwgw change to the correct value from the website. Because when you type the command in dev tools the correct text does show up and autocompletes when you press enter. Is there a way I can edit the command so it will do this ?

    Thanks in advance :)

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

    How to optimize the amount of items to deliver given store performance

    Posted: 18 Jun 2021 09:09 AM PDT

    Hello,

    I am working with a dataset like this one:

    store_id address city date item quantity type
    3 addr city 01-01-2021 A 2 Delivered
    3 addr city 01-01-2021 A 2 Sold
    4 addr city 01-01-2021 B 5 Delivered
    5 addr city 01-01-2021 C 4 Sold

    Items listed here are food boxes, which are distributed to local stores. This means that a store either sells them all, or some of them are discarded as unedible after a certain amount of time. For each unsold item, there is a penalty for both the store and the producer as the former will receive less supply in the future and the producer loses a small amount of money.

    As my internship, I am asked to find the "sweet spot": the ideal amount of delivered items to each store so that the unsold items are minimized.

    Is there a specific methodology to tackle this problem? I am kind of lost here.

    Thank you,

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

    [Fortran] Need a friend to help and guide me with code writing in Fortran

    Posted: 18 Jun 2021 05:59 AM PDT

    Hello there!

    I am an undergraduate student in Physics. We are being taught Fortran programming in the class, but the quality of teaching is not so good. And I am aware of the wonderful resources related to programming that are available on the internet, but I wanted a friend to help me understand things. I am going through a very difficult phase of my life and it is difficult to keep myself motivated to study anything, so I just want someone to discuss the Fortran Programming and help me solve the problems.

    P.S.: The problems are maths and physics oriented, like matrix addition and stuff like that.

    Also, I won't be able to be available for you in the long run, as I mentioned, my mental state isn't quite well. I am going through depression and a difficult phase, though I am trying my best to cope up. But because of this I don't like interacting or sharing things outside my close friend circle. I hope you respect that. I would be really grateful if someone could help me and be my studybuddy.

    P.S.: For now I will need this help only for a day or two. So, I mean it won't be a regular studying thing.

    I am sorry if you think I am being selfish, but I really need help and have been reminded again and again that it's okay to reach out to people, and though it is difficult for me to do so, I am trying my best. And I am being brutally honest with my state so no one feels I gave a false image to receive help.

    Thank you for reading :) Will be looking forward to your help :)

    Note: I am from India. GMT + 5.30 . I am available in Chat (Discord- to be specific)

    submitted by /u/Drowning-moon
    [link] [comments]

    How to make a "heatmap" of intersections of polygons? [python or matlab]

    Posted: 18 Jun 2021 01:45 PM PDT

    I want to take N arbitrary polygons, find the area where the highest number of polygons intersect and color it a dark color, then the area where the next highest number intersect and color it slightly lighter and on.

    So, for example if you have 4 polygons, in the darkest shade of blue fill in areas where all 4 polygons intersect, then in a slightly lighter shade fill in areas where any 3 intersect, then in an even lighter shade fill in areas where any 2 intersect, then in the lightest shade fill in areas where there is at least one polygon not already filled in.

    1. List all polygons
    2. Check for, then compute the area where all 4 intersect, then 3 (any combination), then 2 (any combination)
    3. Plot polygons in lightest shade
    4. Plot 2 intersections on top of polygons, then 3 intersections on top of 2 intersections, then 4 intersections on top of 3 intersections

    I figure a package like shapely might be the best way to achieve this, but I am not sure what the code would look like

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

    Blacking out anything that's not handwritten.

    Posted: 18 Jun 2021 01:28 PM PDT

    Let's say I have a page in my textbook, that I filled out. Is there a way to automatically black out anything that's not handwritten?

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

    How Would I Do This?

    Posted: 18 Jun 2021 01:27 PM PDT

    I want to loop 2 commands to run forever.

    How would I make a .bat or .cmd file run Command1 for 3600 seconds. After Command1 ends, Command2 runs for 3600 seconds. After Command2 ends, it loops back to Command1.

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

    [C++] How to parse chess coordinates, e.g. B3, A5, into char and int?

    Posted: 18 Jun 2021 01:13 AM PDT

    Hi,

    I can't believe I'm asking something that's probably very simple, but I haven't been able to come up with a good solution for this...

    Assuming I get a series of comma separated chess coordinates, how do I parse them into a letter and a number?

    I got to the point where I got each individual pair, so given that I have an std::string s that is equal to something like "A3", how do I split this into a char and int?

    Doing things like: char c = s[0]; int i = std::stoi(s.substr(1,1));

    is not the prettiest thing in the world.

    Alternatively, if I have something like "B3,A5" and you have a better suggestion we can start from there instead of tokenizing it.

    Thanks!

    Edit:

    Few clarifications:

    • AFAIK using atoi is bad practice since this is C and not used in C++.
    • You can assume correctness of input.
    submitted by /u/this_is_mineee
    [link] [comments]

    EOF Error and random invalid syntax errors (python)

    Posted: 18 Jun 2021 11:55 AM PDT

    Edit: I have added math.sqrt to the last line, but it says can't convert complex to float? do you know what it might be? How to fix please.

    def q2(my_list): entryNum = 1 curTime = 0 Tstamp = "" default = 12*3600 error = 0 summer = 0 for entry in my_list: if entryNum > 20: break Tstamp = entry['Time'][11:16] curTime = (int(Tstamp[0])*10+int(Tstamp[1]))*3600 + (int(Tstamp[3])*10+int(Tstamp[4]))*60 - default error = speed(float(entry['x']),float(entry['y']),curTime) - float(entry['vx']) print("Maximum error is: ", error) summer += (speed(float(entry['x']),float(entry['y']),curTime) - float(entry['vx'])**(1/2)/20 entryNum += 1 print("Root-Mean-Squared-Error is: ", sqrt(summer)) 
    submitted by /u/l3adarse
    [link] [comments]

    Help using and interpreting external information in python code

    Posted: 18 Jun 2021 11:14 AM PDT

    Hi everyone, I am a fairly new programmer with about a years worth of experience teaching myself python and tinkering with small projects. I would like to make my own alarm clock application with a twist. I want to somehow send myself a reminder every night asking what time I would like to wake up the next day (the alarm itself would then come from a raspberry pi with a small speaker that way the code could run continually). I have already successfully created the alarm clock code and picked the alarm sounds, figured out how to set it, etc... but I am not sure how to go about doing the text reminders and using them to then set the alarm. I thought about maybe using the smtplib and email.message libraries as I have used them before to make a bot that alerts me when certain products reach a certain price. However, after the pi sends me a text asking what time I would like to wake up, how would I then be able to reply to the "code" and have it take the information in my message and use it to manipulate the alarm code to set it?

    I also thought about even doing it though discord by making a kind of bot, though I tried this and it did not work like I thought it would. I am wondering if any of you who are a bit more experienced have any suggestions on an easier way than those I talked about. I am just brainstorming a bit and hitting a wall. Anything is appreciated, thabks in advance!

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

    No comments:

    Post a Comment