• Breaking News

    Wednesday, January 15, 2020

    Hi! I'm looking for some cool code that would look good on the background of a picture for a Tshirt? (And make sense?) Ask Programming

    Hi! I'm looking for some cool code that would look good on the background of a picture for a Tshirt? (And make sense?) Ask Programming


    Hi! I'm looking for some cool code that would look good on the background of a picture for a Tshirt? (And make sense?)

    Posted: 15 Jan 2020 03:18 PM PST

    My boyfriend is a programmer and I thought it would be cool to make a custom T shirt for him... I have no idea about coding however so I was hoping someone would point to me to some code that I can put in the background of the picture. Much thanks!

    Got it thanks to everyone who replied!

    Mission complete! Will post a photo once the Tshirt is made! Thank you everyone for your kind responses!

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

    Issues with painting objects in Java

    Posted: 15 Jan 2020 03:38 PM PST

    So after some time trying to teach myself swing through all-knowing Google and repeatedly ending up with nothing, I decided it's time for me just to ask for some help.

    I'm having issues with painting shapes onto a JFrame, what I want to do is to set up a "rectangle" class with a constructor and have it be painted onto the window once declared and when its position has been updated.

    Here's the source code,

    import javax.swing.*; import java.awt.*; import java.lang.*; public class Main { public static void main(String[] args) { SwingUtilities.invokeLater(new Runnable(){ public void run(){ createGUI(); } }); } public static void createGUI(){ JFrame f = new JFrame("AAAAAAAAAAAAAAA"); JPanel panel = new JPanel(); panel.setBorder(BorderFactory.createLineBorder(Color.black)); f.setVisible(true); f.setSize(250,250); Rect rect = new Rect(20,20,50,50); f.add(rect); //rect.setX(100); } } class Rect extends JPanel{ private int x, y, width, height; private Color color; private final int OFFSET = 1; public Rect (int x, int y, int width, int height){ this.x = x; this.y = y; this.width = width; this.height = height; color = new Color(255, 0, 0); repaint(x,y,width+OFFSET, height+ OFFSET); } // ==< Getters >== \ public int getX(){ return x; } public int getY(){ return y; } public int getWidth(){ return width; } public int getHeight(){ return height; } // ==< Setters >== \ public void setX(int xPos){ final int CURR_X = x; final int CURR_Y = y; System.out.print("moving square, "); if (CURR_X != xPos){ repaint(x, y, width+OFFSET, height+OFFSET); x = xPos; repaint(x, y, width+OFFSET, height+OFFSET); } } public void paintComponent(Graphics g){ System.out.print(" painting,"); super.paintComponent(g); g.setColor(color); g.fillRect(x,y,width,height); } 

    }

    When run it outputs, a red square on the frame like it should with the console outputing:

    painting, painting, 

    However, if I uncomment rect.setX(100); no square is visible on the window and the console outputs,

    moving square, painting, 

    Additionally, if I modify the setter value to 51 (or anything close to the original x position) a red rectangle appears on the screen (most likely two squares over each other, but I tried changing the color in the middle of the setX method and "both" changed) instead of not being drawn at all.

    Is it one issue causing this? a couple? or did I just mess everything up catastrophically?

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

    Beginner Question: When someone refers to a shell script, do they refer to bash?

    Posted: 15 Jan 2020 02:46 PM PST

    Additionally, I believe zsh is another "shell" that people can download to engage their terminal (aka command-line) with.

    If the language of bash is called bashscript, what is the language of zsh called?

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

    Any college students feel like their professors are out of touch with current technology?

    Posted: 15 Jan 2020 10:11 PM PST

    Asked my prof what full stack programming was, he had no idea. Also his website has no CSS whatsoever.

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

    Is it okay to only use bash and vim? Do you actually need an IDE?

    Posted: 15 Jan 2020 09:53 PM PST

    I started using bash because it looks cool.

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

    Is python's pip3 analogous to javascript's npm, analogous to apple's homebrew, as in they are all managers of stuff that you download?

    Posted: 15 Jan 2020 03:11 PM PST

    How would I go about coding this project?

    Posted: 15 Jan 2020 04:22 AM PST

    Hey yall, I'm not asking for a full on guide but just general way points.

    I work at a restaurant and my boss had asked me to code an app/tool for him.

    The app will do the following:

    Get the latest 30 days of resturant reports (Each day has its own report - items sold, money made etc, employee hours)

    Analyze those 30 days - be it collectively (all averages of the last 30 days or per day average)

    Output the result into an excel sheet.

    How would I go about doing this? I'm thinking about python since it's pretty easy to code and although I've never done anything of this magnitude I'd still like some guidelines :

    What tools can I use with python to import data from a PDF file, or alternatively (not sure if I can get it) a json file?

    How can I output the result into a readable and organized excel file?

    Thank you.

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

    I have a conundrum with this code for my COP3223 class

    Posted: 15 Jan 2020 07:39 PM PST

    I don't know what to do with my program which is supposed to simulate a payroll for my class

    int main()

    {

    int x = 0, y = 0, z = 0;

    int product;

    printf("Enter your Employee's number :") ;

    scanf("%d", &z);

    printf("Enter your hourly pay :");

    scanf("%d" , &x) ;

    printf("Enter your number of hours worked :") ;

    scanf("%d" , &y) ;

    printf("\n\n");

    product = x * y;

    printf("Thank you!\n");

    printf("Here is your paycheck!\n\n\n");

    printf("\t\t\t\-----------------------------------\n");

    printf("\t\t\t Total Gross Pay %d", product ) ;

    This all works when I build and Run the code but when I enter a decimal number into hourly pay it shoots to the end of the program and doesn't work along with giving me a gross pay of 0

    I've tried entering %f instead %d into hourly pay. This allows me to enter a decimal number into place such as "4.4"

    But, This shoots out an incorrect product "gross pay" such as 36909876 when 4.4 is entered into hourly pay and 4 is entered into hours worked

    Any Help would be appreciated

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

    Data retrieval problem I'm facing

    Posted: 15 Jan 2020 03:49 PM PST

    So here's the issue. I'm calling an API for data, which requires a query parameter that specifies the time frame you want the data from like such: 0..15 - which means give me all the data created now to 15 minutes ago. Problem is that the API only gives me 1000 entries back for each call I give it even if there is more than 1000 pieces of data to be retrieved, so I have to make smaller queries that give me <1000 entires like this 0..2, 3..5, 6..10, 11...15 to make sure I get all the data from now to 15 minutes ago. Is there a way I can dynamically find those intervals, or some sore of optimizations I can do to find those intervals where I get less than 1000 entires? I think a recursive solution would work best, but I'm having a hard time coming up with psuedo code. The API does return a count of how many actual items it created in that timeframe, so I check to see if it's greater than 1000 to decide whether I needed to break up my interval into smaller chunks.

    Basically, I need to get data from an api for the filter: 0..15 - now to 15 min ago, and if that interval has greater than 1000 entries, I need to break that interval into smaller intervals with less than 1000 entries that span the entire 15 minutes. Is there a way to do that dynamically?

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

    Is it possible to upload flat file with SSIS into CosmosDB?

    Posted: 15 Jan 2020 11:47 AM PST

    Long story Short i've been strugling for a couple days because i cannot seem to do this task i always get this stupid error

    [ODBC Destination [42]] Error: Open Database Connectivity (ODBC) error occurred. SQLExecute returned error while inserting row 1 

    I created in CosmosDB a container that has 4 attributes all DT_WSTR, even with only 1 attribute i cannot upload the file i've already checked for the schema to has the same datatype but i cannot seem to be able to upload this simple flat file to ODCB Destination

    i've already checked the mapping and it all matches i have to ignore the one that cosmosDB creates by default

    help please

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

    [Java] javafx TableView is not reading an integer from my class.

    Posted: 15 Jan 2020 09:23 AM PST

    I set up a tableview to display the data of the users registered into the application.Everything worked fine until I decided to add the "id" column to it.It is not working. The id column is not empty, it shifts all the data to the other columns to the left, messing up the whole thing. I can't really see what I am doing wrong. It looks the same as with the other variables to me.

    Related Classes:

    AdminStage : https://pastebin.com/u81BPytY
    UserIO : https://pastebin.com/y8uJrtzG
    User : https://pastebin.com/5n1x1AhR
    Admin : https://pastebin.com/5gtfEaZm

    What is happening : https://prnt.sc/qo5mps

    Thank you in advance.

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

    i want to try a project with some friends but we don't know where to start !

    Posted: 15 Jan 2020 09:50 AM PST

    We are programming students first year college and we want to start doing something together as a team but we don't know how stuff works working as a team.

    1.we want to know where can we get for example projects ideas for beginners?

    2.how can we work together on the same code ?!

    1. how to separate our work ?!

    i hope someone understands what i'm looking for :) .

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

    what is the best way to make cross-platform apps?

    Posted: 15 Jan 2020 03:19 PM PST

    I have $1000 growth fund from work that expires on Feb. 2nd. What do I buy?

    Posted: 15 Jan 2020 05:30 AM PST

    Is it really necessary to get a Bachelor's degree?

    Posted: 15 Jan 2020 02:14 PM PST

    I am currently a Computer Information Systems major with a concentration in programming/software development. Unfortunately, I have run into an issue where I am unable to pay the remaining $1500 balance for classes this semester. But I was thinking, I technically don't need a Bachelor's for programming, right? I am a super beginner at coding, not too bad, but I'm still learning a couple languages to see what works best for me.

    For those that do not have a Bachelor's degree, what certificates do you have, if any? If you taught yourself, then how long/how hard was it to teach yourself?

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

    Articles that are obligatory reading

    Posted: 15 Jan 2020 09:50 AM PST

    Hey guys In your opinion what articles or content is an obligatory reading to make anyone a better programmer? I think that When good enough software is best by Yourdon is a great piece of writing.

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

    Sorry if this is stupid, trying to remember my old iPhone password and need some help.

    Posted: 15 Jan 2020 06:39 PM PST

    So I recently came across my old iPhone 4 and I'm trying to unlock it but can't remember the password. There are a few things I do know though.

    1) the code is a 4 digit code 2) a number cannot be repeated in a possible 4 digit combo 3)this is the part I need help with, the way I set my passcode was it used the numberpads letters and made a 4 letter word with respect the the 2nd point. This means that for example you could make the word MILE because it uses 6453, but could not make the word MILK 6455 because you'd have to press 5 twice.

    I want to find a way to get all possible 4 letter word combinations and I feel as if a program would be the fastest way for me to do so but, I have next to no experience with programming so I don't even know how to start on something like this, or how difficult it would be. Can anybody help me out with this?

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

    What's the point of creating a string class in C#

    Posted: 15 Jan 2020 11:49 AM PST

    I'm looking through an app made with Xamarin Forms for my work, and they put a structure of a string in the resources file and I'm confused why they would do something like this:

    public static string WelcomeMsg{ get { return ResourceManage.GetString("Welcome!", resource); } } 

    instead of just a simple

    public static string WelcomeMsg = "Welcome!"; 

    and then call the same WelcomeMsg.

    Thanks!

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

    My boyfriend asked me if I want to learn how to code

    Posted: 15 Jan 2020 07:14 PM PST

    My boyfriend works as a programmer. Recently he messaged me and asked if I want to learn how to code. I am not really into it but agreed. He asked if it is ok to try doing this while we are having sex. Basically he will code and show me this while I will ride his cock. So.. would this even work?

    submitted by /u/Dry-Fudge
    [link] [comments]

    Powershell text file - split text into blocks and remove them if they contain certain word

    Posted: 15 Jan 2020 11:05 AM PST

    I have a text file with this text

    <Bread Text text apple>

    <Food text apple>

    <Food text Name>

    <Food text Name>

    <Name text example>

    <Bread Text text text>

    <Food text text>

    <Food text apple>

    <Food text apple>

    <Name text 121312>

    <Bread Text text >

    <Food text text>

    <Food text Name>

    <Food text Name>

    <Name text 2.1.1>

    <Bread Text text apple>

    <Food text text>

    <Food text Name>

    <Food text apple>

    <Name text example>

    <Bread....

    I want them to "split" into text blocks as you can see in the screenshot. From <Bread... until next <Bread.. starts

    https://imgur.com/VCpHcEJ

    So each block can be seen as one. If the block contains the "apple", remove the complete block

    Solution should look like

    <Bread Text text >

    <Food text text>

    <Food text Name>

    <Food text Name>

    <Name text 2.1.1>

    <Bread...

    because it is the only block that doesnt contain apple

    My first idea was

    (Get-Content 'C:\text.txt') -notmatch 'apple' | Set-Content 'C:\text.txt'

    but this one just removes the lines with apples but not the block.

    my current idea looks like this

    $Path = "text.txt"

    $block = "<Bread(.*)<Bread"

    #I think thats wrong but how do i "copy" from <Bread until next <Bread starts)

    $string = Get-Content $Path

    $result = [regex]::match($string, $block).Groups[1].Value

    $result

    but how do I remove the result in Set-Content

    You can give me an another solution of course thank you

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

    Some problems for the Young students

    Posted: 15 Jan 2020 09:51 AM PST

    Hey guys. I am a 3rd semester student of computer science and I want to find a way to earn money or experience from Internet. Also, i study on my free time so I wanna know some interesting topics for my future.

    Thanks :p

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

    How to parallelise a serial top down merge sort

    Posted: 15 Jan 2020 09:40 AM PST

    Hi I was wondering if anyone knew a method to do this.

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

    Need help converting this C# console app into VB form (not console)

    Posted: 15 Jan 2020 09:39 AM PST

    using System; using System.Security.Cryptography; using System.Text; using System.Net; using System.IO; namespace pwned_search { class Program { static void Main(string[] args) { Console.InputEncoding = Console.OutputEncoding = Encoding.UTF8; Console.Write("Enter the password to check: "); string plaintext = Console.ReadLine(); SHA1 sha = new SHA1CryptoServiceProvider(); byte[] data = sha.ComputeHash(Encoding.UTF8.GetBytes(plaintext)); // Loop through each byte of the hashed data // and format each one as a hexadecimal string. var sBuilder = new StringBuilder(); for (int i = 0; i < data.Length; i++) { sBuilder.Append(data[i].ToString("x2")); } string result = sBuilder.ToString().ToUpper(); Console.WriteLine($"The SHA-1 hash of {plaintext} is: {result}"); // get a list of all the possible passwords where the first 5 digits of the hash are the same string url = "https://api.pwnedpasswords.com/range/" + result.Substring(0, 5); WebRequest request= WebRequest.Create(url); Stream response = request.GetResponse().GetResponseStream(); StreamReader reader = new StreamReader(response); // look at each possibility and compare the rest of the hash to see if there is a match string hashToCheck = result.Substring(5); while (true) { string line = reader.ReadLine(); if (line == null) { Console.WriteLine("That password was not found."); break; } string[] parts = line.Split(':'); if (parts[0] == hashToCheck) { Console.WriteLine("Password has been compromised -- DO NOT USE!"); break; } } Console.ReadKey(); // pause until key press } } } 

    Any help would be appreciated it
    For extra info:
    I would like a text box for the user to search for a password and it to output below if its been compromised

    submitted by /u/LADD-
    [link] [comments]

    Todo application on Github not creating issues when requested

    Posted: 15 Jan 2020 09:31 AM PST

    Hi all, I'm trying to use this todo application on Github which makes a new issue whenever it finds specific words in pushed code, but when I make commits or new files in my test repository it does not create new issues.

    I have copied and pasted the following code which is the example code given in the "Usage" section of the readme but it still did nothing:

    /** * @todo Take over the world * @body Humans are weak; Robots are strong. We must cleans the world of the virus that is humanity. */ 

    Is my repository set up incorrectly? Am I not typing it correctly? I have tried multiple variations and none have created an issue automatically.

    Sorry if this is the wrong place to ask this or if I asked it incorrectly, I'm new to programming.

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

    No comments:

    Post a Comment