• Breaking News

    Wednesday, February 7, 2018

    What is your go-to text editor in 2018 and why? Ask Programming

    What is your go-to text editor in 2018 and why? Ask Programming


    What is your go-to text editor in 2018 and why?

    Posted: 07 Feb 2018 04:41 PM PST

    Mine is vs code. I have switched from sublime to the git and terminal integration. Also love the ide-like features.

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

    Handling slow infinite loop in python without stack overflow

    Posted: 07 Feb 2018 11:14 AM PST

    Hello, I am learning python and I have a pretty simple function that gathers crypto prices from multiple exchanges (using their APIs), and prints/writes the values to the terminal and to a txt file. The function loops every 3 seconds (i've done the loop by both calling the function, and doing a while True:). If the price for a particular currency on an exchange moves more than X % (I'm just playing around here), it calls a function that prints something to the effect of "[currency] price changed by [amount]% on [exchance]" and then goes back to my main loop.

    However, after less than an hour I get a python error (stack overflow) that I am not able to capture using try: except:.

    I have implimented a counter that increments after each loop, and creates a new txt document after 500 loops, but I have not figured out how to keep the terminal from crashing.

    Is there a way to clear the stack memory? Is there a better way to do this than using a loop?

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

    What is a good language to learn alongside VB?

    Posted: 07 Feb 2018 07:31 PM PST

    I'm currently a IT student and, for some reason, the intro to programming class has us learning Visual Basic as our first language. I have some very basic understanding of python, but I'm severely out of practice. I was curious if you all had any suggestions for a language that I could study in my downtime. I'm not sure I'll ever actually use programming for a career, so I'd be more inclined to proactively study if I could do something fun with it.

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

    any concept on multithreading in java

    Posted: 07 Feb 2018 03:45 PM PST

    i need a concept where it is possible to explain multithreading in java through programming Thank you.

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

    Best way to create a program or web form that you can select certain things and it will pull up a result based on selections?

    Posted: 07 Feb 2018 03:32 PM PST

    I need a bit of help here.. trying to figure out what the best way to do what I am looking for be it a program/web form/database etc.. For example, you have (Version 1) a selection of 10 packages with 10 different items in each package and you can check off let's say 1-10 of the packages in the program or web form.. it will compare it to (Version 2) a selection of 20 packages with 5 items in each package (100 items total so same as Version 1 but packaged differently) and will return the result of which (Version 2) packages you will need to include all the items you selected from the (Version 1) packages...

    Hopefully that's not too confusing but was hoping to find some help to see I can even begin to do something like this... Thanks in advance for any help...

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

    QA test cases management

    Posted: 07 Feb 2018 07:04 PM PST

    What tools are you folks using for QA? We're using JIRA for project management but after things get to QA the process becomes super manual.

    It's okay that the testing is manual but there are no test cases, no records of test passes and the success rate or bugs found. When a bug shows up in production we can't easily answer a question like "when was component X last tested?"

    It would be great to add some structure to the testing.

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

    Is it smart to turn files to ZIP to save space?

    Posted: 07 Feb 2018 06:59 PM PST

    So i have tons of documents, codes, videos, pictures, etc on my external hard drive and it's nearly full. Is it smart to turn most of the files into ZIP files to save more space?

    submitted by /u/MRK-01
    [link] [comments]

    CREATE simple PYTHON PROGRAM:

    Posted: 07 Feb 2018 06:01 PM PST

    The credit plan at a car company specifies a 10% down payment and a 15% annual interest rate. Monthly payments are 6% of the listed purchase price minus the down payment. Write a program that takes the purchase price as the input. The program should display a table with appropriate headers of payment schedules for the lifetime of the loan. Each row of the table should contain the following items: ▪ the month number (beginning with 1) ▪ the current total balance owed ▪ the interest owed for that month ▪ the amount of principal owed for that month ▪ the payment for that month ▪ the balance remaining after payment The amount of interest for a month is equal to balance * (rate / 12). The amount of principal for a month is equal to the monthly payment minus the interest owed.

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

    Having trouble calling a method

    Posted: 07 Feb 2018 05:33 PM PST

    I'm creating a code that takes in 2 values from the user. it takes in the number of drinks, and if it's hot or cold. It then sends these values to a separate method to go through an if statement to calculate the price (cold drinks are $1.50, hot is $2.50). It seems to take in the values entered, but doesn't do anything with them. I'll list the important parts of the code bellow. Any help is appreciated.

     System.out.println("How many drinks?"); drinksInput = scnr.nextInt(); System.out.println("hot or cold?"); drinkType = scnr.next(); drinksPrice = getDrinkPrice(drinksInput,drinkType); System.out.println("Given the number of drinks: " + drinksInput); System.out.println("As well as the type of drink: " + drinkType); System.out.println("The total cost is: " + drinksPrice); 
    public static double getDrinkPrice(int drinks, String type) { double price = 0.0; if(type == "hot"){ price = 2.50*drinks; } else if(type == "cold"){ price = 1.50*drinks; } else{ System.out.println("invalid drink type"); } return price; } 
    submitted by /u/Jasonkills07
    [link] [comments]

    Python - Zipping select files and folders in a directory

    Posted: 07 Feb 2018 04:17 PM PST

    Hi all,

    I have a directory, in which I have some select files and folders that I'd like to zip. Is there a way that I can specify which files/folders are to be in the zip folder?

    I've seen a lot of guides, but they only incorporate an array of folders or files separately and I've never seen both specified together with Zipfile.

    Thanks for your help in advance!

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

    Best way to cache DB entries? Using MySQL and Java

    Posted: 07 Feb 2018 03:55 PM PST

    I want to know if there is a best practices for caching a lot of MySQL entries and bulk inserting them into the db. Let me explain:

    Right now, I currently generate the MySQL insert/update string to do the work, then append that to a file on the hdd, and every 15 minutes I pull that back up into memory, loop through it and add each line as a batch entry, prep the file for the next batch of entries, then commit that to MySQL.

    Don't get me wrong, the way I am doing it now works, but I have a few long term concerns. The amount of entries is growing almost daily. Right now before pushing it to the DB the file has gotten in the neighborhood of 15 MB, keeping in mind this is purely text. This file is only going to get bigger and bigger and entries are going to be inserted faster and faster.

    Is there a better way to go about doing this? Just to note I dump it to a file to save on memory, hdd space isn't an issue but the program already uses a ton of memory.

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

    [Java] What is/are the best way(s) to organize or plan out your code?

    Posted: 07 Feb 2018 08:16 AM PST

    I'm creating a Freecell game as an assignment. I've planned it in such a way that I have:

    • a card class, which creates a type card
    • a deck class, which creates a new deck and a method that can shuffle them
    • a parent pile class, which keeps the piles needed
    • child pile classes, which have differing functions depending on the pile
    • a main class to play the game

    It's the way that makes the most sense to me, but I'm new to object-oriented programming. I'm concerned that my methods will be too long, or that it's not a good organization of my code.

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

    [C] Sprintf warning - format not a string literal and no format arguments

    Posted: 07 Feb 2018 03:38 PM PST

    EDIT: I used sprintf to concatenate the two strings btw.

    I am a beginner at C and my program works completely fine at the moment but I get "format not a string literal and no format arguments" warning on my sprintf lines. I tried fixing them with sprintf("%s%s",fileOrig,path); but my program just crashes in those cases without any warning.

    for example:

    sprintf(filepath + strlen(filepath),de->d_name); 

    or

    sprintf(fileOrig,path); 

    Any help to solve this would be greatly appreciated. Thank you for reading!

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

    API Doc Generation (PHP)

    Posted: 07 Feb 2018 03:17 PM PST

    Hey folks,

    At the moment my company is using Swagger for doc generation from a JSON file and it's about 3000 lines long and a huge mess. I've been considering either moving to Apiary for modular-style documents or converting everything to inline Docblocks and generating documentation based on the actual API itself.

    Has anyone had any experience generating API docs form Docblocks? Is this something that can be done with Swagger?

    Any input and recommendations are appreciated.

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

    HTML page not being populated with Data, PHP

    Posted: 07 Feb 2018 03:12 PM PST

    Probably a fairly simple issue but... I've set up a while loop pretty perfectly (no syntax errors and so on) to get values from a DB to output to an HTML page however when I go to said page it doesn't give any text, and I don't know why it's doing this I get this is vague but it's a really vague error given there isn't actually any error codes to base it off... I'll post code below. Thanks!

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

    I need help figuring out what I need to know to make this project.

    Posted: 07 Feb 2018 02:29 PM PST

    So basically I want to make a program that takes in a sound, from speaker, microphone, or file. It then uses the amplitude and frequency to make a visual representation of the song, like a loud deep bass song would have a large blue dot, etc whose size changes as the amplitude of the sound changes.

    What do I need to know to make this?

    I would prefer is the programing language used is C#.

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

    GNU - Do I have to open source my own derivative work?

    Posted: 07 Feb 2018 02:04 PM PST

    I think about releasing something under GNU license, and I'm the sole author. Others could use it, but would have to open source any derivative work under the same license.

    Does this also apply to myself? Or can I still make derivative closed source versions from my own code under a different license?

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

    Saving a timestamp in php to SQL

    Posted: 07 Feb 2018 01:34 PM PST

    I have pre set databases with timestamp set as the registration date and i need to save the current time to the customer when it is created currently it is saving at blank :( here is my php code https://pastebin.com/hRAj41nH thanks !!

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

    Which DBMS to transition to?

    Posted: 07 Feb 2018 12:48 PM PST

    Our company is currently using visual pro/5, and we think it is outdated.

    We want to be able to complete every function(A/R, purchasing, Sales, Inventory management, etc.), and be able to make any kind of reports that we could theoretically want.

    I have looked a few places and found (DB2, SQLite, PostgreSQL) are fairly inexpensive, supposedly good choices.

    If you needed a complex DBMS for 50-70 people that wasn't expensive (think Oracle, or really anything over $20000ish a year, what solution would you come up with?

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

    If statement match list of words against single word in table cell.

    Posted: 07 Feb 2018 08:25 AM PST

    I have a list of 3 words that I need to compare against the content of a table cell (text only). Basically I don't have much programming experience and javascript is new to me. We have a localhost dashboard at work that I am trying to modify to change the background color of a cell that that is a match for any of the 3 words, this is to indicate priority level of that order. the current code uses a rowcallback to run a few if statements on each row so to find a single word and change the color is like this: if (data['Order status'].includes('MSPT')) { $('td:eq(5)', row).addClass(ProblemSeverity.ORANGE.cssClass); }; the column is called order status and its 5th from the left.

    Secondly if the cell contains any other words other than the 3 from my list it should be yellow instead of orange. Lastly any cells in that column that don't contain any text should be left white (no color change).

    Not really expecting anyone to solve the problem for me but rather looking for some guidance or any kinda hints how to acomplish this task. Thanks!

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

    Toy hardware

    Posted: 07 Feb 2018 11:17 AM PST

    < If this isn't the right place to ask I apologize, if this is the case I would appreciate you pointing me in the right direction. >

    I'm an product design uni student creating my final project. My final goal is to create a game with physical foam swords that can detect when they've hit the opponent. Think of this as physical lasertag. I'll ultimately be creating an functional model as proof on concept.

    As I imagine it now the opponent would wear a vest, once the vest detects that its been hit by a weapon then the vest would change colors to detect a hit. So if this takes additional worn hardware this is okay. In fact, this will probably need face protection too so if the hit detection technology can be fit in there that would be viable aswell.

    My question to you guys is: what sensors do you think I need to use to make this?

    TL;DR: what hardware sensors should I use to detect when a foam sword hits a person? (armor with sensors in it can be used)

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

    Custom USB drivers?

    Posted: 07 Feb 2018 09:25 AM PST

    Hello, I have a mouse with 12 buttons.. I bought it mainly to play games like WoW where you have a lot of key bindings.. Problem is, software delivered with this mouse SUCKS.

    How can I code my own "driver/software" for this mouse? I just need a way to be able to react to any of the buttons presses.

    Whats the best language to use (needs to support windwos only). Is there some guide/tutorial with simple example code?

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

    ITSec Student: University Homework: Code a Malware (WIN) Any concept ideas?

    Posted: 07 Feb 2018 02:46 AM PST

    Since I need to code a Malware for a class in university, I was wondering if someone could come up with a Malware concept and design ideas with some technical references.

    I'm lacking at the design of it.

    My plans yet: C&C Server - Client(Malware) TCP Connection: Boost.Asio or alternate? Client establish connection to C&C server. Send Heartbeat to keep connection. If above not possible, delete
    Client sends OS information (Vers. etc.) Client waiting for command.

    Should I implement all contained commands into the client? Like: Keylogger, Telnet and Ransome techniques

    Is it possible to detect hooks, which has been attached to my malware (like AV does)?

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

    Which path to choose?

    Posted: 07 Feb 2018 01:57 AM PST

    I have to paths in a new start-up company. I'm still in the college second year.

    PHP with CodeIgniter

    JAVA with Android

    I'm struggling between these 2. When considering the future and everything what will be the best path to follow?

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

    No comments:

    Post a Comment