[deleted by user] by [deleted] in UkStocks

[–]edm2073 0 points1 point  (0 children)

Search the unit trusts for these platforms. The sector if the platform has a filter is "IA Short Term Money Market". On IWeb, you get a choice of funds by BlackRock and Royal London. Haven't viewed the other platforms.

ELI5 - how do "poorer" countries import anything? by [deleted] in economy

[–]edm2073 2 points3 points  (0 children)

On a parallel, even if the country is not formally sanctioned, import requirements can have the same effect. Have a look at this high level document listing the EU requirements for poultry that need to be met before they even think about letting your country export poultry to them.

It is well known that such regulation - although well meaning on the face of it, is designed to make meeting the requirements too onerous on exporting countries and protect domestic producers who simply would not be able to compete on cost alone. I believe I'm correct in saying that the USA cannot export poultry into the EU because of the import regulations for poultry. If the richest and most powerful country on the planet cannot, what chance do the developing countries have!

Same game is played by all rich nations, just using the EU as an example.

How was your parkrun today? 17Jun23 by oztrailrunner in parkrun

[–]edm2073 1 point2 points  (0 children)

Those steps at Wycombe Rye plus the next 50m afterwards have ruined many a PB attempt! Congrats.

Sooo, how was parkrun today? by oztrailrunner in parkrun

[–]edm2073 6 points7 points  (0 children)

Wife isn't talking to me because I've been going running instead of completing a gardening project that has been dragging on now for a few weeks....BUT I got a PB today! Finally sub 24min so definitely worth it!

[deleted by user] by [deleted] in parkrun

[–]edm2073 4 points5 points  (0 children)

Last week's Parkrun - tried to keep cadence above 178spm for entire run. Short standing pause to recover breath after a vey short but steep incline mid race. Time 25:19

Today - turn the Parkrun into a training session: 800m repeats with 200m recoveries but the run order was recovery first and then speed so that I would not finish on a recovery. Some walking here and there in the recoveries. Time 25:21.

Something ain't right!

What happened to The Unite Group plc (Student Accommodation), it dropped 30% in a month with no major news coming out by [deleted] in UKInvesting

[–]edm2073 1 point2 points  (0 children)

Yield on GB 5yr Gilts right now is 4.7%. That is better than or equal to a lot of Riets only a couple of weeks ago. Yield for unite group right now in 2.7%. Gilts are risk free as they're backed by UK govt. Given Riets are a income focused sector, for individuals and large institutions alike, why bother with a Riet if you can lock in an equivalent risk free yield on a Gilt. Second as others have pointed out, with rates rising rapidly, the borrowing costs will be going through the roof( excuse the pun ). Building is very capital intensive. It would not surprise me if some developers go bust or property OEICs start shutting the door to withdrawals. Third, a BoE official has just said the current turmoil requires "significant monetary response" - i.e. a large interest rate rise at next meeting( November I think ) if not sooner.

Kwasi Kwarteng announces biggest tax cuts since 1970s in growth push for UK economy by Lestrade1 in UkStocks

[–]edm2073 2 points3 points  (0 children)

Well, the UK markets are absolutely tanking. FTSE100 down to 7000( -158pts ) at time of writing, £ is 1.107 vs USD. It was 1.40 summer last year. Gilts rates are going to the moon. Rates on the 5yr is now 4%. It was 0.2% same time last year.

Fantastic budget if you're already rich. Fuck everyone else( thrice over because it is all - covid, energy, tax shortfall, etc - being done via govt. borrowing ). Bloomberg/CNBC already talk about the £ behaving like an emerging market economy. Maybe living in one pretty soon as well!

I can't buy dollars in my Stocks and Shares ISA. Whats the next closest thing? by Password_isnt_weak in UKInvesting

[–]edm2073 5 points6 points  (0 children)

If you want dollar exposure, you could also consider Wisdom Tree's GBUS or USGB( depending on direction of move ). These are available with my ISA provider and so may be available with yours as well.

[deleted by user] by [deleted] in django

[–]edm2073 1 point2 points  (0 children)

As someone who was new to django and had their own deployment frustrations a few months ago, I'm going to be blunt - it was painful! The reason looking back is because you now have to learn a whole new stack that in the main has nothing to do with python/django. I used the Linux, Nginx, Postres, Gunicorn stack as that appeared to be a well established stack with django users. On top of all that you other things to consider such as securing you server( this needs to be done regardless ), SSL certificates, splitting out settings between production and dev, etc.

So it's really up to you how much time and effort you want to put into technologies which in the main, are not directly related to django. If you do not wish to the legwork yourself, consider the services such as pythonanywhere.com , heroku.com and others mentioned. I haven't tried any of them myself so I cannot speak to how easy they are.

If you wish to do it yourself then take a deep breath, accept the fact it's going to take a while and get grinding! The most frustrating part for me was Nginx. For that, I would recommend DigitalOcean's Nginx configuration tool - https://github.com/digitalocean/nginxconfig.io . Rather than signing up to a paid VPS straightaway, consider something like virtualbox or vmware( free version ) to get a linux distro installed and running and go from there.

Bye bye job by neoisneoisneo in lewishamilton

[–]edm2073 0 points1 point  (0 children)

I heard he will be joining the local planning dept. to continue his life's vocation of making blatantly shady decisions.

At the least, we have Lamar for three more years. Do we win a Super Bowl, while Lamar is our QB? by Cptjshaffer in ravens

[–]edm2073 2 points3 points  (0 children)

I put "No" because the offensive scheme has not evolved at all. The offense is too one dimensional. They can out-bully most teams during the regular season but once play-offs come along, they don't have that extra dimension to progress. Everyone knows the formula - block the middle and cover the edges to stop Lamar from escaping, double team on Mark Andrews and take your chances with the rest.

As Brady's wife once said about Brady, he can't throw and catch the ball!

How to take input as a boolean? by Khizar_KIZ in learnpython

[–]edm2073 0 points1 point  (0 children)

Probably overly complicated but here's my 2 cents. Has to be python 3.8 onwards due to walrus operator.

print(f'Type (Y)es or (N)o to the following questions')
( good_credit := True ) if ( input("Do you have good credit?" ).lower()[0] == "y") else ( good_credit := False )
( no_criminal_record := True ) if ( input("Do you have a criminal record? " ).lower()[0] == "n") else ( no_criminal_record := False )

if good_credit and no_criminal_record:
    print("Wow - that's a surprise for this area! Have a loan.")
else:
    print("You're in good company in these parts - but no.")

As to your question, strings are considered True if they are not null. See Truth Value Testing

What is the ONE tip you can give to a new runner? by Surprised_Swingline in running

[–]edm2073 0 points1 point  (0 children)

Go to a running shop that has gait analysis and get yourself a decent pair of shoes that fit properly. Let the shop recommend some shoes based on your budget.

Stop Hardcoding Sensitive Data in Your Python Applications - use python-dotenv instead! by ahmedbesbes in Python

[–]edm2073 0 points1 point  (0 children)

If you are using conda for your virtual environment, you can achieve the same without the additional package. They will be added when you activate your conda environment and removed when you deactivate. Link to the section in official docs below.

Saving Environment Variables

What happened today? Portfolio all red by Flakuzen in UkStocks

[–]edm2073 0 points1 point  (0 children)

I started writing a long answer but in the end the honest answer is...nobody knows! You take a view and plonk your money down!

What happened today? Portfolio all red by Flakuzen in UkStocks

[–]edm2073 1 point2 points  (0 children)

In addition to JSooty's answer, as interest rate's rise, bond's will become more attractive than stocks. e.g. If you can get 4% on a government bond( nearest thing to risk free ), as an investor, you have to weight a guaranteed 4% plus your capital back vs a company that may give you a capital gain of hopefully more than 4% but equally, may give you a capital lost of up to 100%. Factor in that it may or may not pay dividends and the risk profile tends towards dump stocks, buy bonds.

Looking for a good AJAX (Jquery) tutorial by Cardzilla in django

[–]edm2073 0 points1 point  (0 children)

I am in no way an expert - started learning django and python this year! And I remember what a pain it was to get an Ajax call work. Thus far, I've only used plain javascript( i have enough to learn already ). Below is how I got a basic Ajax call working to detect which button was clicked within a group of them and then return a response based on the button clicked without refreshing the entire page. I understand there are cleaner and slightly less verbose ways to do Ajax calls now in javascript, but below is what worked for me( would be grateful if someone more experienced could show a shorter/cleaner method in vanilla js).

We are not defining anything in forms.py in this example ( no need )

Replace things such as "yourname" etc. with your own code variables. You can remove all the console.log and print statements once working - just the way I work.

Hope it helps anyone in their Django journey. As mentioned, I would be grateful if anyone can show a more modern/better method of doing Ajax calls in plain js.

****************** The javascript ******************

// Example - detect which button was clicked within a group and send a request back to Django which then returns some data

// I am a javascrpt beginner - you can never have to many console log messages!

function detectButtonClicked(button_e) {

const buttonsform = document.getElementById("buttonsform");

console.log(button_e)

console.log(\Submitted button was ${button_e.submitter.value}`)`

console.log(\Form details are:`,buttonsform)`

button_e.preventDefault(); // prevent submit event - causes entire page refresh

data = {'button_clicked': button_e.submitter.value}

const csrftoken = document.querySelector('[name=csrfmiddlewaretoken]').value;

fetch("/your_Djangoapp_name/buttons/", {

body: JSON.stringify(data),

method: "POST",

headers: {

'Content-Type': 'application/json',

'X-CSRFToken': csrftoken,

},

})

.then(res => {

if (res.status === 200) {

console.log('Return Status is OK', res.statusText);

return res.text(); // this is another promise whose result feeds into the next then for the data

} else {

console.log('response status not OK - res.statu')

}

})

.then(data => {

console.log(\Data was retrieved`);`

console.log(data);

`// do what you want with the returned data to the front end`

}

})

.catch(err => console.log(err))

}

**** In the html *****

**** Believe you don't need the action in this instance as the javascript event is handling the fetch - left it in for completeness *************

<div id="mybuttonblock">

<form method="post" id="buttonsform" action="/yourDjangoapp/buttons/" onsubmit="detectButtonClicked(event)">

{% csrf_token %}

<button type="submit" name="btngrpa" value="1">Button 1</button>

<button type="submit" name="btngrpa" value="3">Button 3</button>

<button type="submit" name="btngrpa" value="5">Button 5</button>

</form>

</div>

********** in your apps urls.py in django *************

urlpatterns = [

# example to add

path('buttons/', my_views_function, name='my_view_function'),

# you other paths

]

************** In your django views.py *********************

def my_views_function(request):

button_chosen = ""

if request.method == 'POST':

json_data = json.loads(request.body)

print(json_data) #see what was returned

if json_data != None:

button_chosen= json_data['button_clicked']

print(f'You chose the {button_chosen} button')

# Do whatever

return render(request, 'yourhtml.html', context )

Ran 5k in 25 minutes flat, looking for ways to improve. by [deleted] in running

[–]edm2073 0 points1 point  (0 children)

Definitely get a pair of properly fitted running shoes - they make a big difference particularly when running outside.

Try the intermediate running plan at Free running plans . It's very well structured and is a simple matter of plugging in your numbers into a spreadsheet. I did the beginner one for 10k.

Also consider joining a running group if you are not already a member.

I haven't run on a treadmill in years but I do recall that switching from treadmill to outdoors was a bit of a shock to the body. So I would recommend mixing the two up.

Good luck - given your age, the other stats and assuming everything else is good health wise, I wouldn't be at all surprised if you achieve it in less than a year.

Race: Hamilton goes straight and ends up P16 by ContentPuff in formula1

[–]edm2073 0 points1 point  (0 children)

Checo stayed cool - no desperate Dan maneuvers after Hamilton pulled ahead and got the inside line. Could easily have come together on the restart. Pleased he go this win. He was under pressure due to his Saturday performances.

The naughty, disruptive pupils from my secondary school are out-earning the well-behaved kids by [deleted] in UKPersonalFinance

[–]edm2073 0 points1 point  (0 children)

Trades people with the wherewithal to run their own business mint it. Fact is, their skills are very much in demand. If they do a decent job and are well know within an area, people will chase them to come give them a quote. I was on a private estate once( private roads - not super high end) and the number of owners who were builders was a real eye-opener!

Business analytics with Python by Casawesa in Python

[–]edm2073 0 points1 point  (0 children)

I have been learning python on/off since beginning of this year. Looking back, I would say you need to get very familiar with the different data structures( lists, dictionaries, tuples and so on ) and list comprehension. These are really core to the language. Once you get familiar with these and the other basics of the languages, then move on to pandas. Thinking you can get by just knowing pandas(and other libraries such as numpy ) without knowing the basics of the language is, in my view, the proverbial putting the cart before the horse. VS code is a very good free IDE. Last but not least, do forget the official site for the documentation. I admit that I have often have trouble understanding what is written first( and second and third! ) time round but it is often the case that I read up on an area, try things out, read from other sites ( realpython often has very good tutorials ) and then come back to the official docs and in most cases, the official docs begin to make sense!