• Breaking News

    Tuesday, February 8, 2022

    Does anyone else have a small feature they made that no one will ever notice that you're still really proud of? Ask Programming

    Does anyone else have a small feature they made that no one will ever notice that you're still really proud of? Ask Programming


    Does anyone else have a small feature they made that no one will ever notice that you're still really proud of?

    Posted: 08 Feb 2022 09:02 AM PST

    I'm a full stack guy at my company and work on tons of different things, but this table page selector I made just makes me happy every time I see it lol. It looks super professional and works perfectly for every situation it's thrown into. Before this they just used numbered links. Does anyone else have a small thing like that?

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

    Freshie at College CS, need help with this question in a past year Python exam paper I can't solve. Any help is greatly appreciated!

    Posted: 07 Feb 2022 10:34 PM PST

    When to use SQL database and no-SQL?

    Posted: 08 Feb 2022 07:39 AM PST

    I know that we use SQL when we our data is more relational in nature, but what does that mean?

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

    Why is a mobile Search function difficult?

    Posted: 08 Feb 2022 09:17 AM PST

    I'm consistently baffled by the lack of a search function on the mobile apps and/or websites for digital media companies, with The Atlantic and The Ringer being two primary examples. With the amount of content these types of sites generate, a search function seems like a logical must-have for the end user. I'm confused further when I see that they have search functions when viewed from a desktop browser, indicating they've established a framework for searching their library.

    As someone with no programming experience, I was hoping this community could give me insight on the challenges to implementing this and why it may be more difficult on mobile platforms. Thank you.

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

    As a fresher that's looking to apply for "MERN Stack Developer" Jobs , can you please tell me what could be considered as a project that i can put on my my resume(Please read description for more clarification regarding the question) ?

    Posted: 08 Feb 2022 08:44 AM PST

    I'm a self taught MERN stack developer and I learned mostly from reading documentations , Freecodecamp lectures and a couple of Udemy courses. While learning from freecodecamp and udemy I built the projects most of the time by watching the video , understanding the concept and then writing the code by myself (only looked at code when I got stuck). I would like to know if these projects are good enough to put on my resume or should I create something from scratch ? So I'm a little confused if these are good enough to put as projects or not ? Any advice and suggestion regarding this and also as a fresher how should I apply for jobs would be helpful . I have a degree in CS.

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

    I want to get a job. What's going to get me a job in programming.

    Posted: 08 Feb 2022 08:25 AM PST

    I don't care, as long as it has potential to make 20/hr in 6 months, I don't care if it pays 15/hr initially.

    I like python, I like programming in this way. I like Arduino. I don't know where to begin to get a setup for web development, but I'll find out.

    I won't even get looked at due to my experience being completely unrelated. I don't care what it is, I want to do programming, or data analysis.

    What can I do that says "this guy wants to work in this field and he has proven he can" within my city or remote. I cannot relocate is my caveat.

    I should mention I've been learning by doing hackerrank puzzles. I try to figure it out without using answers, I'll find guides in how to use certain function keywords.

    What certification (which I can self learn and pass) can almost guarantee me an entry level position without a CS Degree.

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

    What is the equivalent to getBoundingClientRect for the pointer event?

    Posted: 08 Feb 2022 08:21 AM PST

    In Google Chrome, there is an unfortunate bug(?) where the area that an element can be hovered over does not always line up with the element's computed size.

    HERE IS AN IMAGE OF THE PROBLEM

    The left Hello is not being hovered, but the right Hello IS being hovered.

    And yet, the 2 have the same getBoundingClientRect size, except for a small fraction of a difference.

    I would like to have the pointer event size in code, or it would be real nice if I could draw a border around that secondary size.

    Is this possible?

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

    How to avoid IP bans when programming bots?

    Posted: 08 Feb 2022 08:06 AM PST

    I saw a YouTube tutorial about programming an Instagram bot. I wanted to try it out myself so I downloaded a webdriver and started working on it. My intents with this bot weren't malicious at all (it would check basic things like "who do I follow that doesn't follow me back", etc.). it just seemed like an interesting project that I wanted to try. Turns out I got IP banned from Instagram because of too many login requests. I understand that they have to do this, my question is: What to do next time I try to program a bot so that I don't get IP banned? Do you have any good practices that keep you from getting banned? Thanks

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

    C/C++ system() function

    Posted: 08 Feb 2022 07:02 AM PST

    What this function can do except color, sleep, date? I just couldn't find information about it

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

    I have an interview for the position of a selenium tester next week, so I cannot understand why JUnit is used in Selenium? Can somebody help me with this or share some valuable resources asap as I need to prepare this for my interview.

    Posted: 08 Feb 2022 03:07 AM PST

    Codeblocks and visual studio error

    Posted: 08 Feb 2022 06:45 AM PST

    Yesterday i was doing a school project on codeblocks and saw that one colleague was using sleep function, so i decided to try it. But i was warned that i need gcc++ 11,and i thought i need to uninstall codeblocks and install it again with gcc++11(i know now that was stupid and it wasn't needed). I reinstalled codeblocks but when i tried to launch it i was getting api-ms-win-crt-string-l1-1-0.dll error(file missing from computer). I tried using this Youtube video and this one, but nothing worked. However, when i tried using command processor as the last video said, the result was that Windows foundcorrupted files but couldn't fix them(the link is the analysis result). After that i tried the last mettod used in the same video, but i couldn't find the downlevel file(even after searching it 3 times). Is that caused by a virus? Also what else could i do to fix codeblocks?

    Now for visual studio, i tried to use it as an alternative, but everytime i try to build it or start debugging, this error shows up: the System can't find the file specified, and here is the build log:

    Build started... 1>------ Build started: Project: project test, Configuration: Debug x64 ------ 1>C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.CppCommon.targets(693,5): error MSB6006: "CL.exe" exited with code -1073741515. 1>Done building project "project test.vcxproj" -- FAILED. ========== Build: 0 succeeded, 1 failed, 0 up-to-date, 0 skipped ==========

    What cam i do to fix at least one of them?

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

    How did a programmer create a programming program without a programming program?

    Posted: 08 Feb 2022 05:52 AM PST

    Genuinely curious.

    Edit: Thank you all for the answers! It's really interesting learning about it!

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

    How can I fully understand minimax code? (not how minimax works)

    Posted: 08 Feb 2022 12:21 AM PST

    I could fully understand how minimax works . But when I look minimax code by other programmer , I didnt understand it enough

    Why? because I felt it difficult to follow the movement of the recursive function to the end.

    Also I can understand simple recursive function like fibonacci recursive .But if the recursive function is complex , I cant

    question

    How can I fully understand minimax code? or Can u tell me any tips?

    code (https://thecodingtrain.com/CodingChallenges/154-tic-tac-toe-minimax.html)

    function bestMove() { // AI to make its turn let bestScore = -Infinity; let move; for (let i = 0; i < 3; i++) { for (let j = 0; j < 3; j++) { // Is the spot available? if (board[i][j] == '') { board[i][j] = ai; let score = minimax(board, 0, false); board[i][j] = ''; if (score > bestScore) { bestScore = score; move = { i, j }; } } } } board[move.i][move.j] = ai; currentPlayer = human; } let scores = { X: 10, O: -10, tie: 0 }; function minimax(board, depth, isMaximizing) { let result = checkWinner(); if (result !== null) { return scores[result]; } if (isMaximizing) { let bestScore = -Infinity; for (let i = 0; i < 3; i++) { for (let j = 0; j < 3; j++) { // Is the spot available? if (board[i][j] == '') { board[i][j] = ai; let score = minimax(board, depth + 1, false); board[i][j] = ''; bestScore = max(score, bestScore); } } } return bestScore; } else { let bestScore = Infinity; for (let i = 0; i < 3; i++) { for (let j = 0; j < 3; j++) { // Is the spot available? if (board[i][j] == '') { board[i][j] = human; let score = minimax(board, depth + 1, true); board[i][j] = ''; bestScore = min(score, bestScore); } } } return bestScore; } } 
    submitted by /u/user927310931
    [link] [comments]

    I am running a website, but I'm confused about whether I should incorporate Geolocation testing for your website or not? And if yes, then can we do geolocation testing using JUnit?

    Posted: 08 Feb 2022 03:30 AM PST

    It'd be great if you could drop your suggestions!

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

    Best place to host flask-application?

    Posted: 08 Feb 2022 02:43 AM PST

    Hi, I am currently doing a flask project for a small app. My initial intention is just to share this app with my friends and hopefully get some feedback on how I can improve it even further. With that said it would be nice to show them an actual website rather than the GitHub code. Are there any free places where I can host my code and get it to work as intended?

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

    Preserving passed friend's Facebook data

    Posted: 07 Feb 2022 07:55 AM PST

    The recent decline of facebook brought to mind an issue that's personal to me and I'm sure others too...

    A really close friend of mine passed away in 2015, much of his recent life is documented on facebook. In fact the only reason I ever log on anymore is to visit his page. I'm worried there may be a time his photos and posts will not be available in a future without facebook. Are there any solutions for people in this situation or ways to grab these objects without manually scraping?

    submitted by /u/data-punk
    [link] [comments]

    How can I remove / filter this garbage from html?

    Posted: 07 Feb 2022 11:31 PM PST

    I am trying to automate my flashcard creation using Yomichan to import information into Anki cards to make Japanese vocab flashcards. The final problem remaining is...

    Yomichan pulls the sentence data from sources such as Duolingo like this :

    &lt;iframe src="https://www.googletagmanager.com/ns.html?id=GTM-TX6Z97C" height="0" width="0" style="display:none;visibility:hidden"&gt;&lt;/iframe&gt;Write this in JapaneseThis is difficult.Correct solution:これは<strong>難しい</strong>です。

    The only thing I want to keep on the Anki side is "これは<strong>難しい</strong>です。"

    So I either need to add something in Yomichan or Anki that will remove everything but the clean sentence. How can I do this?

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

    Mode function in OCaml

    Posted: 07 Feb 2022 10:33 PM PST

    I am trying to implement a mode function in OCaml. One that returns the element with the most occurrences in the input list. This is what I have so far but it is not working, can someone please guide me in the right direction/help me correct the error?

    let mode (l: 'a list) : 'a = match l with | [] -> failwith "Error" let rec aux l ((cur_el, cur_num) : 'a * int) ((max_el, max_num) : 'a * int) = match l with | [] -> if cur_num > max_num then cur_el else max_el | hd :: tl -> if hd = cur_el then cur_num = cur_num + 1; if cur_num > max_num then max_el = cur_el in List.sort compare(l) ;; 

    I am fairly new to OCaml so sorry in advance if I made any rookie mistakes.

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

    I have a user who needs to input two numbers that matches the position of a file in a list and delete it. And this is the code it tried but have not been able to make it right

    Posted: 08 Feb 2022 02:15 AM PST

    string[] jpg = Directory.GetFiles(@"D:\Image", "*.jpg");

    string[] png = Directory.GetFiles(@"D:\Image", "*.png");

    int count = 1;

    string no = "No";

    string name = "Name and location of file";

    string type = "Type of File";

    string typeoffilejpg = "image/jpeg";

    string typeoffilepng = "image/png";

    Console.WriteLine("{0}{1}{2}", no.ToString().PadRight(50, ' '), name.ToString().PadRight(50, ' '), type.ToString().PadRight(50, ' '));

    foreach (string file in jpg)

    {

    Console.WriteLine("{0}{1}{2}", count++.ToString().PadRight(50, ' '), file.ToString().PadRight(50, ' '), typeoffilejpg.ToString().PadRight(50, ' '));

    }

    foreach (string file in png)

    {

    Console.WriteLine("{0}{1}{2}", count++.ToString().PadRight(50, ' '), file.ToString().PadRight(50, ' '), typeoffilepng.ToString().PadRight(50, ' '));

    }

    Console.WriteLine("Completed Scan!");

    Console.WriteLine("Do you want to delete file? (y/n)");

    string input = Console.ReadLine();

    if (input == "y")

    {

    Console.WriteLine("Select file to delete. To delete file, type file No<space>file No. Example: 1 3 ");

    int indextoremove = int.Parse(Console.ReadLine());

    Console.WriteLine("Do you really want to delete? <Y/N> ");

    string secondinput = Console.ReadLine();

    if (secondinput == "y" )

    {

    if (indextoremove <= jpg.Length && File.Exists(jpg[indextoremove - 1]))

    {

    string pathToFileToDelete = jpg[indextoremove - 1];

    File.Delete(pathToFileToDelete);

    Console.WriteLine("{0} has been deleted successfully", pathToFileToDelete);

    }

    if ((indextoremove - jpg.Length <= png.Length && File.Exists(png[indextoremove - jpg.Length - 1])))

    {

    string pathToFileToDelete = png[indextoremove - 1];

    File.Delete(pathToFileToDelete);

    Console.WriteLine("{0} has been deleted successfully", pathToFileToDelete);

    }

    }

    }

    submitted by /u/Overall-Ideal-2593
    [link] [comments]

    How could you search for eg. adresses on a website?

    Posted: 07 Feb 2022 10:15 PM PST

    I have a project that I am working on and one Feature requires me to look for adresses on a website. So something like "examplestreet 13" whatever with eventually zipcode etc. but most likely street is enough

    So when I heard this requirement I thought that is not really possible. I am located in germany and while there is a requirement for all germany based Websites to put their company adress into the legalnotice/impressum (dont know the english term) there obviously are no laws regarding the html structure or format

    How could you attempt that? Searching for some Keywords like 'street', 'way'.. that are common in adresses in the innerHTML or the classes/id is all I can come up with up. Obviously not so reliable but I assume this is kind of impossible to do anyway? Any advice how to approach something like this?

    Can be either javascript or any other language/tool

    submitted by /u/Visible-Wafer-2842
    [link] [comments]

    Four 8 bit integers get treated as one 32 bit float

    Posted: 07 Feb 2022 02:06 PM PST

    I'm working with a large dataset in Python that contains info describing a 3D point cloud. Each point in the cloud is (x,y,z,c) and each element in a point is a signed 32 bit float. The x y z parts are just coordinates for the point, but c is supposed to be the point's color formatted as RGBA. This value is stored as four unsigned chars for each R G B and A, which makes sense; 8 bits to a char and unsigned means each component can range 0-255. Here's the problem: this is all stored in a 2D Numpy array of 32 bit floats, which means the RGBA value is also seen as a 32 bit float and is not iterable. So when something needs to use that color, it can't grab the R G B A components and throws an exception. I'm sure I could extract each component individually and then put them in a list, but I worry this will be slow and wasteful in terms of memory. That would also mean I have to convert a color every single time it gets processed. The data is already stored correctly: it shouldn't need to be changed. It's just being interpreted wrong and that's what I want to fix.

    So: is there a way to resolve this? I've been Googling for a bit and I don't think I know how to search for an issue like this, it just seems too specific and I'm not sure how to proceed. I think Numpy may have some way of doing it but my brain is twisted into a knot thinking about this so I'm stuck.

    I also don't have any code to show here, this data comes from an external library that generates 3D point clouds with images streamed from a camera so I had nothing to do with the way it's being stored.

    Also possible that I just don't understand the problem, any help or advice is much appreciated.

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

    Help creating a microservice based on Django with mysql database.

    Posted: 07 Feb 2022 12:16 PM PST

    So I'm working on a project in which I create an API where I can take in a ledger, or list of transactions, save all the transactions to a local server, and finally send back a report of the list. When I save one of these big transaction lists, I save each transaction separately with the following fields:

    1. date
    2. information about the transaction
    3. transaction amount

    so my Django model in models.py currently looks like this:

    class Transactions(models.Model):

    date = model.CharField(max_length=200)

    info = model.CharField(max_length=200)

    amount = models.FloatField(max_length=200)

    from here I'd like to add a unique identifier to these transactions to mark them as a part of the list I received (i.e. every transaction on the ledger list I receive has some unique identifier that I assign to it, so its different from other lists I recieve). The problem is that I also want to be able to take new singular transactions and add them to that list of transactions with the same group id. So when a user wants to add a transaction to the list, they must give a date, info, amount and specify the group id.

    so do I update the model in models.py to look like this?:

    class Transactions(models.Model):

    date = model.CharField(max_length=200)

    info = model.CharField(max_length=200)

    amount = models.FloatField(max_length=200)

    groupid = models.PositiveBigIntegerField()

    or do I use UUID somehow for the groupid? or something else entirely?

    I'm very new to this so I'm not quite sure how to go about adding such an id to the transactions of large lists I recieve and asking for an established id to add individual transactions. Any help would be appreciated!

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

    How do I mix graphic design and code?

    Posted: 07 Feb 2022 08:21 AM PST

    Basically I'm learning python and I'm competent in graphic design at least. I want to make a small project including code and art. But I have no idea how to mix these skills?

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

    Am I missing something obvious with my Redshift/Postgres query?

    Posted: 07 Feb 2022 03:05 PM PST

    I am trying to find a way to create a table where it shows each customer profile (71 in total) their top item bought per time frame (10 in total), what that item is, and the time frame that was most popular. Whenever I run this query it shows the top items for a time frame but it shows all the customers as null. I also need a way to display the customer name which is also accessed through the id_table. I'm lost so any direction would be greatly appreciated! I only have read permissions on this DB.

    NOTE: I tried different joins for the second join, a full outer join returns the same thing and a right join returns nothing in all fields. Could this possibly be because st.cust_dbf_id isn't flagged as a key?

    select distinct id_table.name as product_name, pb.recruitment_round, count(pb.purchased), st.cust_dbf_id as cust_profile from product_bought pb join id_table on id_table.dbf_id = pb.dbf_id left join shopper_table st on st.cust_dbf_id = id_table.dbf_id where pb.date >= '2022-01-01' and pb.date <= '2022-01-05' and pb.shopping_time = 4 group by id_table."name", pb.recruitment_round, pb.cust_dbf_id order by count(pb.purchased) desc, pb.recruitment_round limit 1; 
    submitted by /u/LonewolfMcFades
    [link] [comments]

    No comments:

    Post a Comment