-
Posts
24 -
Joined
-
Last visited
Reputation Activity
-
MladenM got a reaction from v0nN3umann in I want 2 of my h tags on the same line
<style> h2 { display: inline-block; } </style> add this into html, at the end of the page.
Basicly everyone gave you same solution with different ways of implementing it.
2 of those solution inserted style in tags itself with attribute "style"
i added separate way of inserting style of elements in tags outside.
And best way is to include *.css file. best way is to name it style.css
You can add it like this
<head> <link rel='stylesheet' href='style.css' > </head>
-
MladenM got a reaction from boey in Search for valid URL in python 3.7
You should try @vorticalbox solution and also you should understand why that soltuion works and why is better.
Also would not hurt to learn about HTTP protocol and get request while you on the task. Could be useful.
Cheers.
-
MladenM reacted to SolarNova in Is it illegal to train an Ai on copyrighted images
The material itself is whats copyrighted, nothing else, just the material. Anything made with its use is not subject to that materials copyright, such as AI learning, art (in any form), or works influenced by it.
-
MladenM reacted to Mira Yurizaki in Is it illegal to train an Ai on copyrighted images
No, because as you claim, it's for educational purposes which is protected under fair use.
Some fun trivia, the first image to be used to create the JPEG standard was a scan of a Playboy centerfold. (Playboy magazine obviously wasn't pleased but they didn't have a case)
-
MladenM reacted to boey in Search for valid URL in python 3.7
I managed to solve it. It was a time pressure exercise, but I ended up using webbrowser and opening 5000 tabs in windows.
-
MladenM reacted to vorticalbox in Search for valid URL in python 3.7
yeah you should try my solution out will use basically use no ram, only problem is it has to do one at a time perfect use case to learn threading
-
MladenM reacted to vorticalbox in Search for valid URL in python 3.7
Not true you do not need to open any web browser you can make HTTP requests inside python
Assuming the website returns an error code E.G 404, for invalid pages this will work
import requests for number in range(10000): r = requests.get('http://www.123.com/%d' % number) if r.status_code == requests.codes.ok: print('Valid') else: print('not valid') -
MladenM got a reaction from wasab in Python sound editing software
Its possible but why would you do that? sounds complicated and it will probably be pretty slow to do with python.
I dont know anything about audio, but good place to start is here:
https://pypi.org/search/?q=audio
https://pypi.org/search/?q=sound
-
MladenM reacted to Mira Yurizaki in I want 2 of my h tags on the same line
Don't use headers for content like this. Use <p> tags and separate <span> tags as necessary.
EDIT: Since I believe you're using header tags for styling, you should learn how to style HTML:
https://www.w3schools.com/html/html_styles.asp (this method is discouraged, but for the sake of having it)
https://codeburst.io/how-to-style-your-website-with-css-e72e7046fda5
https://developer.mozilla.org/en-US/docs/Learn/HTML/Forms/Styling_HTML_forms
-
MladenM reacted to v0nN3umann in I want 2 of my h tags on the same line
<h2 style="display:inline">Total price </h2><h1 style="display:inline"/> Should also work.
But I would use a separate CSS-File for the styling
-
MladenM reacted to grimreeper132 in How do you get Python Script working on Notepad++
yea I think the install was dodgy or something like that
-
MladenM reacted to mariushm in C++ program
C++ allows you to type numbers in your source code text using various bases, not just decimal.
If the number has a 0 at the beginning, it's assumed you're typing it in Octal, base 8 , so you can only type numbers between 0 and 7 after the first 0 ... ex 040 is translated into 32, because the value 32 is 40 in octal, base 8.
You can also type number in base 16, hexadecimal, by placing "0x" before the number ... ex 0x64 is 100 in decimal.
Some compilers also allow binary, where you can type a byte value (0..255 or -127..127) by saying which bits are on or of, placing "0b" before the sequence of bits ... ex 0b10101010 is 170 in decimal.
In your particular code, simple solution would be to change *100 to *10 and just say +[number]
-
MladenM reacted to mariushm in C++ program
Ah, if you add more than 1 number at the end , then you'll have to add one number at a time, or multiply the original number by 10/100/1000 and so on, as many zeros as the number of digits.
You can determine the number of digits by repeatedly dividing the number by 10 and checking if rest is 0
// append 15 to 1234 => 123415
int basenumber = 1234;
int number = 15;
int counter = 1;
int temporary = 0;
temporary = number;
while (temporary >10) {
counter = counter + 1;
temporary = temporary / 10;
}
while (counter > 0) {
basenumber = basenumber * 10;
counter = counter - 1;
}
basenumber = basenumber + number;
... something like this ... i'm writing it directly in the forum here, so it may have errors.
-
MladenM got a reaction from Hi P in Programming languages and their use
Likewise, I am working on cython skills hobbie wise.
-
MladenM reacted to Dat Guy in Programming languages and their use
If Python was the only language I knew, it would be my second best language as well.
-
MladenM reacted to Hi P in Programming languages and their use
I began with Python and really liked it as well, I still use Python time to time whenever I need to automate a simple task rather quickly
But as soon as I began to learn C and C++ they stuck with me, I don't know why... although I'm still a complete beginner there's something about those languages that I really liked, I just don't know what it is.
I'm trying to learn a bit of everything (language wise, the fundamentals) before focusing on something, I really liked the desktop development path (windows specifically with C#) but everywhere I see there's people saying that's a dead end career path... so I'm still trying to find my niche
-
MladenM got a reaction from Dat Guy in Programming languages and their use
Python is second best language for everything.
Anyway its mostly question of speed of development vs speed of compiuting.
When it comes to compiuting, c is best but its very very slow to develope in. Pretty hard work.
When it comes to speed of development python is fastest to develope in, but pretty slow when it comes to compiuting.
You can work on backend web dev with c (and some websites like google now do) or with java but most reasonable option for most websites are django or js, because they dont have billions of request and responses.
Google had pretty nice philosophy, python where we can, c where we must. Most of google was in python code and still is.
-
MladenM reacted to wasab in Compiling Python Scripts
Python scripts are interpreted, not compiled. You just need to grab python from it's official website and then run it with python3 <your script file> from the command line.
-
MladenM reacted to iCantThinkOfAName in Compiling Python Scripts
Yeah, thats what I meant, I don't really have a background in coding so compile seemed like the best thing to say. I did mess about with py installer, but don't understand how to add the dependency scripts.
-
MladenM reacted to Mira Yurizaki in Compiling Python Scripts
If you're asking how to create a standalone Python app so you don't need a Python environment to run it: https://www.pyinstaller.org/
Otherwise, you don't typically compile Python scripts, you run them through an interpreter.
-
MladenM reacted to AnotherMax in import .py project to another project
Assuming all '.py' files are in the same directory, and 'file_to_import.py' is simply made up of a bunch of function I'd do:
from file_to_import import function_name_1, function_name_2 from file_to_import import * # Imports all functions from 'file_to_import' I wouldn't do the import with the ` * ` as it's a bit ambiguous.
If you have a directory structure like:
- main.py - utils \ - thingy.py If you want to import 'thingy.py' functions into the 'main.py' you can do:
from utils.thingy import function_name_1, function_name_2 -
MladenM reacted to wasab in Programming - Real world projects to practice
Try coding exercises in K&R. Don't worry about real-world projects. I find these often do poorly in honing your problem solving and debugging skills because people write so many good APIs, you can literally reuse other people's code for common problems. Instead, try a coding challenge that tests your problem-solving skills the hard way.
for example, this exercise(3-3) from K&R.
Give yourself handicaps such as not having access to the c standard library. I spent 30 minutes on this problem.(im self-teaching myself c programming at the moment to prepare myself for my next semester college course that will involve a lot of low-level system programming) I learn a lot of the ins and outs doing this like truly understanding what arrays are in c, how the address is handled, and many quirks with the language like compilers do not even bother checking if your array is out of bounds, none of which can be easily noticed if you go straight coding real-world stuff.
-
MladenM reacted to Paragon Fable in Programming - Real world projects to practice
Once you have the core concepts down, the details of the language are a secondary concern at best. Unless you're working on something that's very performance critical (most things aren't) don't sweat the small stuff. I once worked on a console game project in C++ and I'd not touched C++ in over a decade (since school) so it was basically a new language at this point but because I had 10+ years of experience in a dozen other languages I learnt on the fly and was still faster and turning out solid solutions because I was a more experienced engineer, not because I knew the details of a language more intimately. For any areas I knew were performance critical I'd just ask one of the C++ vets what best practice was.
IMO, being a good programmer means you're a good software engineer. Most of time in the "real world" as a programmer you're working as a team, and being a good engineer on a team means:
1) You can communicate well - some basic drawing skills help here - sometimes what you make is visual and you need to draw shit out to communicate well.
2) You have a good general CS vocabulary and can simplify when necessary.
3) Good knowledge of design patterns and strong solution design skills.
4) You have a unique area of expertise that adds value to the team (UX/UI, DB design, Digital Signal Processing, Machine Learning, Realtime 3D, Micro Service API Design & Documentation etc).
Learn how to draw basic model, flow and sequence diagrams. Also keep in mind that while communicating with other code slinging peers is important, you'll often need to communicate with non technical people as well (artists, designers, business stakeholders etc). Being able to simplify on the fly and use appropriate metaphors will go a long way too. If you don't know what design patterns are then hit up some books, lots around on the subject. Solution design comes with experience as it's mostly researching what existing technologies are available for you to leverage that get you closer to the project goals without building everything from scratch (and know when a from scratch solution is actually best) and what potential pitfalls your custom implementation of those technologies might have. Unique expertise is again hard when you're new but it's typically something you're really passionate about being "the best" at. Don't sweat it now, but earmark things you work on that scratch that "fuck yeah this is cool" itch and run with them when you have some free time.
I know it's tricky getting experience working in a team when you're new but best bet would be to throw yourself into a game jam or startup/tech jam or group challenges (with friends or randoms) as MladenM mentioned. Also, I guarantee working in a team with engineers who are more experienced than you and you will learn shit so much faster. Something I wish knew when I first started coding.
-
MladenM reacted to Unimportant in Programming - Real world projects to practice
Try to write a C++ console application that plays a wave sound file. (The hard way, not by using the winapi "playsound" function)
Open the file and parse the header to get the sound format/bitrate, etc. Teaches basic file IO and parsing. Read the contents of the file to memory (hint: std::vector) Use SDL audio to play back the audio. Teaches including and linking against a external library, reading documentation in figuring out how to use said library, etc. Write a neat RAII lock to engage when handling callbacks. Basic sample rate conversion when the wave file sample rate and the sample rate you got from SDL don't match (simple sample duplication/dropping will suffice). That'll get you going for a fair bit.
-
MladenM reacted to Twoflower in CD drive headphone stand
I had an idea for a headphone stand that fits into the cd drive bay so I made a 3d model on solidworks and had it printed. It's not perfect, but it's my first time using 3d printing and I'm pretty proud of how it came out.
The idea came about because I didn't want to waste desk real estate on a stand, and I'm not allowed to screw holes into the walls of my apartment.
Let me know what you guys think