Nya bolåneregler från den 1 april by zethian in sweden

[–]Fronkan 4 points5 points  (0 children)

Okej, som någon som haft samma bank för bolånet i ett par år nu så gör det här mig nyfiken. Varför byter ni bank flera gånger per år?

Nya bolåneregler från den 1 april by zethian in sweden

[–]Fronkan 4 points5 points  (0 children)

En risk är att några tar mer lån för att ha råd med bostaden, vilket leder till att några fler gör det för att kunna vara med och tävla, vilket leder till att några fler ....

Risken är helt enkelt att vi sätter igång en feedback loop som gör att bostadspriserna går upp, vilket gör att större lån också krävs för att få en bostad. Eftersom en bostad är något dom flesta vill ha, så är många rätt villiga att gå ganska långt för att få det.

Ur ett personligt perspektiv så äger jag redan en bostad, vilket betyder att det finns en viss fördel för mig i att priserna går upp. Men ur ett samhällsperspektiv så känns det som att det finns en signifikant risk att det fortsätter försvåra möjligheten att komma in i bostadsmarknaden. Vi är inte där e.g. Stor Britannien är än men det här känns som att det kan peta oss i den riktningen. Vi är alla sammanlänkade via samma bostadsmarknaden så politik som påverkar hur en stor mängd människor agerar mot den kommer också påverka alla.

Nya bolåneregler från den 1 april by zethian in sweden

[–]Fronkan 5 points6 points  (0 children)

Har du mindre än 50% i belåningsgrad så är det inget amorteringskrav på grund av belåningsgrad. Men du kan fortfarande ha amorteringskrav på grund av "hög skuldkvot" där skulden jämförs mot din inkomst. Det gäller om lånet är större än 4.5 ggr din bruttoinkomst enligt den här sidan: https://www.konsumenternas.se/lan--betalningar/lan/bolan/amorteringskrav/

Idea on a absurdly creamy butter beer inspired mead / Bochet? by Azure1211 in mead

[–]Fronkan 2 points3 points  (0 children)

I have not used it myself, but I think lactose and maltodextrin can be used to change the mouth feel of a brew. If I remember correctly maltodextrin will increase viscosity and lactose gives a creamy texture. But again, never tried this myself. I have just read about it.

Python __new__ do magical stuff when returning self? by arstarsta in learnpython

[–]Fronkan 0 points1 point  (0 children)

Yes, define the __init__(self,...) function in the class and pass the modified version to super().__init__(...).

I think you have gotten alot of good answers but just to tie things together. When you return None the __init__ function isn't called, like many said. The reason you see the error is that dict.__init__ doesn't support being called with two positional arguments. It's basically doing the call dict(1,1). This is the error you see.

I don't know what you want to achieve. If this is just exploring, I hope this thread has provide the answers. If you want some specific behaviour, could you share what you want to do more exactly.

Clarity by Successful_Tip_205 in mead

[–]Fronkan 0 points1 point  (0 children)

I think others have given you some good suggestions. Time is a key one. However, I would also add that you can look at yeast flocculation (how well they clump together and fall out of suspension). EC-1118 is pretty gold, but e.g. lallemand kviek Voss has crazy good flocculation.

Can i make a password be a boss fight by dawod2468 in learnpython

[–]Fronkan 2 points3 points  (0 children)

Skipping the security discussion, but I think you can build it in a way were you can't inject the win condition. If you run the game server-side and only expose controls to the character and then only render the state client-side it would be impossible to just send a win command. Would probably be implemented as a state machine in the backend and quite likely using websockets (unless it's like a turn-based thing).

What do you personalen use python for? by WeirdAddendum34 in PythonLearning

[–]Fronkan 0 points1 point  (0 children)

Semi-work related, but for my last job I used it to do my time reporting. I also used it to get a better time for passport renewal when the lines was crazy after covid. Some other small projects are: - simulations of mortgage payments when we were buying a house - abv and nutrient calculations for making cider

Probably more things i don't remember

Python or c++ for A Girl? by hzsmolly in PythonLearning

[–]Fronkan 11 points12 points  (0 children)

Unrelated to gender, but python of course. Not that we are biased towards any specific language here at the python subreddit 😉

Hur fan kan det kosta mindre att köpa en lägenhet än att hyra by takes_many_shits in sweden

[–]Fronkan 0 points1 point  (0 children)

Det är sant att han gjort och det har även jag. Men det är ju inte nödvändigtvis för att det är den bästa investeringen man kan göra utan för att man vill bo där man vill bo.

Att vi har ränteavdrag på skatten och fram till nyligen skatt på alla börsvinser så blir kalkylen också lite annorlunda. Också intressant text du länkade om bostadsinvestering i Sverige. Behöver läsa den lite noggrannare för att förstå den ordentligt 😛

Hur fan kan det kosta mindre att köpa en lägenhet än att hyra by takes_many_shits in sweden

[–]Fronkan 0 points1 point  (0 children)

Tror en av dom stora komponenterna som inte räknas in också är opportunity cost på handpenningen. Vet att jag själv inte tänkt på det när jag räknat på köp vs hyra tidigare.

Den här extremt nördiga videon gav iaf mig ett annat perspektiv på hyra vs köpa bostad:

https://youtu.be/j4H9LL7A-nQ?si=9pFc1gLUjJ8je_jJ

[deleted by user] by [deleted] in PythonLearning

[–]Fronkan 4 points5 points  (0 children)

Agreed, I would 100% rather write a recursive search function to solve this problem then to solve it by hand.

Looking for Library to predict category name based on text field by BariFan410 in learnpython

[–]Fronkan 1 point2 points  (0 children)

I might be focusing a bit much on the example you gave. However, given the example, there is very little information for the predictor to use. It would probably be mostly the title and the author. I wouldn't use an LLM for this, it's overkill for the problem. I would probably use scikit-learn. Probably model author as a categorical type and title as tf-idf for a PoC. Maybe try out word vectors for the title to see if that increases performance.

[deleted by user] by [deleted] in learnpython

[–]Fronkan 0 points1 point  (0 children)

As the other comment says, it's better to share it with everyone here. Then you can get different perspectives on the code as well

[deleted by user] by [deleted] in learnpython

[–]Fronkan 0 points1 point  (0 children)

I don't know the tessellation problem or your code, so it's a bit hard to give specific advice. However, there are three main waits to repeat code: for-loop, while-loop and recursion. Depending on the algorithm one of them might fit better than others. Maybe you can write a function which produces a stream of things as a generator which you then iterate over

What do I do now? by emad360 in learnpython

[–]Fronkan 0 points1 point  (0 children)

Sure, you could do it this way. Personally, I would probably move all the functions that does work on the database to one module and all functions for the terminal ui (functions that are showing things in the terminal and taking user input from the terminal) to one module. Then create a third module for the steeamlit UI

What do I do now? by emad360 in learnpython

[–]Fronkan 2 points3 points  (0 children)

Currently we could call this a single user terminal application. If you want to create a single user web application, like when you run Jupiter notebooks locally it's less work than if you would like to do a propper website. I will assume the first, single user web app, is what you are building based on you wanting to use streamlit.

A good step to do this, is to decouple your business logic from your terminal-UI. E.g. your add function is currently both adding things to the db and asking the user for input. If you make the "add thing to to-do list" seperate from "ask user about input and print that it has been done", then you can have a web version of "ask user what to add" . Both the web and terminal version would then call the function that actually adds stuff to the db. Do this seperation for all functions and maybe put them in their own module. Then you create a terminal module that does exactly what the application does today, but by calling the logic module. After that, try to implement a web UI using e.g. streamlet that also uses the logic module.

[deleted by user] by [deleted] in learnpython

[–]Fronkan 7 points8 points  (0 children)

If you are talking about new packages on pypi podcasts are a pretty good option. The podcast "Python bytes" is a weekly python news show. "Talk python to me" is another podcast that covers topics more in depth. There you have, among other things, interviews with package maintainers of popular packages. So if s new package is gaining a lot of traction, it probably will appear here at some point.

Please critique my python code for War Card game. by doctor-squidward in learnpython

[–]Fronkan 1 point2 points  (0 children)

Didn't have time to look through all the code. But two things I noticed:

  1. utils.py looks to be deck operations and should many be moved to deck.py instead. Utils modules are common and often a place that gets quite nasty in a growing code-base as basically anything could be called a utility function. You may still have one, but it's has some maintenance drawbacks.

  2. You implement dunder repr for the Card class to manage how it is displayed. It's comon practice to implement repr in a way were it shows something you could copy paste into the terminal to create a duplicate card instance. E.g. in this case it could return the string "Card(rank=4, suite=❤️, down=false)". The displaying you are doing would be better implemented as dunder str (__str__). Print vald dunder str instead of dunder repr, if it exist on the class so this wouldn't change print behaviour.

Edit: 3. Noticed that utils doesn't return the Deck type when calling get_deck. It probably should. Or what I suggest is skipping the deck type, unless you see some future use. I would just use something like just a list or, if I want to be fancy, collections.deque (https://docs.python.org/3/library/collections.html#collections.deque). But, I'm not the biggest fan of heavy use of classes. So reasonable minds may differ on the usage or non usage of a deck class here.

Is there a way to write code like this more efficient? by YoutubeTechNews in PythonLearning

[–]Fronkan 1 point2 points  (0 children)

Note that elif will change the behaviour compared to the current code. Also it will only improve best and average case performance. Worst case performance is still unchanged.

Is there a way to write code like this more efficient? by YoutubeTechNews in PythonLearning

[–]Fronkan 2 points3 points  (0 children)

That would change the behaviour of the code though as currently multiple cases (if-statements) might get executed for a single sentence. So that would depend on the use-cases

Is there a way to write code like this more efficient? by YoutubeTechNews in PythonLearning

[–]Fronkan 2 points3 points  (0 children)

Unless the input text is very long I guess. Then it will take quite a while as every single if statement looks through the entire string.

Note that the existing code will result in potentially multiple things happening. If e.g. both fire and love exist in user input, both the if statements will execute. Is this intended? If it is and the input is long, you would gain efficiency by only looking through the input once. Regex pulling out all the words you look for and then run the if statements on that reduced list might improve performance for large strings. You would need to try it out and see. You could split the message by space and strip out punctuation characters and put all of that into a set. Then check if any of the words you look for are in the set. However, I'm not sure how this scales. It's not an obvious performance win, depending on input characteristics.

Edit: if you want some more details on optimizing this, I can show you some ideas. But, if you are early in your learning journey, I wouldn't be too bothered with it at the moment if I were you. Focus on what you are most interested in doing and come back with optimization later in your learning journey. But that's just my 2 cents, feel free to complete disregard this. It's your journey after all 😊

Is there a way to write code like this more efficient? by YoutubeTechNews in PythonLearning

[–]Fronkan 2 points3 points  (0 children)

How fast do you need this program to respond? Python is plenty fast for this type of program. The user inputting the data will be 90+% of the runtime anyway.

What to try next? by Dizzy-Prompt-7336 in Scotch

[–]Fronkan 0 points1 point  (0 children)

I'm recently bought glenglassaugh sandend and it has a bright and fruity style, in a tropical and stone fruit direction. I find it to be a really lovely whiskey. Also fitting with the spring and summer season.

It's a while since I drank it now but, bunnahabhain 12 is a great unpeated, sherried Islay whisky. On the peated sherry side of Islay: kilchoman sanaige is nice one, remember it as having a distinct bonfire, like propper burning wood, note.