python – How to write this 7-nested loop in a better way while keeping (or improving) performance?

I’m doing a challenge online, and I have to sum all of the digits to the power of two for numbers from 0 to 1.000.000.0 then I have to find if the sum is inside a given set of integers and if this is true put this number inside a list . At the end I wrote this messy solution to solve the problem :

for a in range(10):
    l = a*a
    for b in range(10):
        l += b*b
        for c in range(10):
            l += c*c
            for d in range(10):
                l +=d*d
                for e in range(10):
                    l += e*e
                    for f in range(10):
                        l += f*f
                        for g in range(10):
                            l += g*g
                            if l in set : list.append(a*1000000+b*100000+c*10000+d*1000+e*100+f*10+g) 
                            l -= g*g
                            if g == 9 : 
                                l -= f*f
                                if f == 9 :
                                    l -= e*e
                                    if e == 9 :
                                        l -= d*d
                                        if d == 9 :
                                            l-= c*c
                                            if c == 9 :
                                                l-= b*b
                                                if b == 9 :
                                                    l-= a*a

But even if It’s good enough in terms of performance it is also very bad written.

I tried this but it’s slower :

from itertools import product
for a,b,c,d,e,f,g in product(range(10),repeat=6):
    k = a*a + b*b + c*c + d*d + e*e + f*f + g*g
    if k in set : list.append(a*1000000+b*100000+c*10000+d*1000+e*100+f*10+g)

I don’t find a way to mantain ( or improve ) efficiency and at the same time writing it in a better way. How could it be achieved?

stm32f7 – Stm32F767ZI SPI Multibyte Write and Read

I have a question about the SPI peripherical in the STM32F767ZI MCU (used in Nucleo144).
I trying to use the SPI peripherical for a future project, so i have implemented a simple test program to see how the SPI peripherical work on STM32F767ZI.
I’m using the LL libraries and I configured the SPI to working with the interrupts. To test the SPI communication I use a nRF24L01+ device so I try to write and read some registers.
I’m able to send and receive one byte of data, but i’m unable to write and read multibyte datas. I think that the problem is the NSS pin, that is managed in hardware. His behavior it’s different from those behavior that is show on the nRF24L01+ datasheet (chapter 8.3.2 SPI Timing). In this diagram, the CSN signal remain low for all trasmission time in both write and read case.
In my case, the NSS signals, go from low to high every 8 bit transmission, as can you see in the next two images:

write data acquisition

read data acquisition

Is the NSS signal the problem, and in the affirmative case, how i resolve? The STM32 documentation it’s not clear for me, so i don’t know how to solve this problem.
I read about manage the NSS via software, is this the correct way to solve this problem?

Write 500 Words Article with Copyscape Premium Proof for $15

Write 500 Words Article [ with Copyscape Premium Proof ]

We are team of 20 article writers with fluent English.

We can handle any topic of articles, including but not limited:

  • Affiliate Marketing
  • Blogging
  • Business
  • Celebrity
  • Diet
  • DIY
  • Education
  • Family
  • Fashion
  • Finance
  • Fitness
  • Food
  • Health
  • Internet Marketing
  • Investment
  • Lifestyle
  • Marketing
  • Parenting
  • Pet
  • Photography
  • Quiting
  • Self Help
  • Sports
  • Technology
  • Travel
  • Weight Loss

What made our gig special is we guarantee all articles we produce will be Copyscape Premium passed.We will provide the proof in screenshot.

.

SUPolicy to allow custom service to read and write from Internal Storage

I’m setting up custom service with custom sepolicy using this as a base:
How to fix SELinux "avc: denied" errors when launching DNSCrypt as init.d script?

My issue is that I want config and log files to be read and written (respectively) from the internal storage /sdcard aka /storage/self/primary

What are my options?

mac – I want to write a script to open a fixed URL + whats in the clipboard. Ex: Open Safari to Url+clipboard contents “https://site.com/clipboard contents”

Will this applescript work?

Tell Application "Safari" to open location
"http://www.site.com/"
end tell

Tell Process "Safari"
   Keystroke "l" using command down

Tell application "System Events" to key code
124 using command down

Tell Process "Safari"
   Keystroke "v" using command down
   Keystroke return
end tell

sql – How to write inner join using posts_clauses?

Can someone please show me how I can achieve the same result with this SQL:

SELECT *
FROM wp_2_posts
INNER JOIN wp_2_icl_translations
ON wp_2_icl_translations.element_id = wp_2_posts.id
AND wp_2_icl_translations.language_code = 'en'
WHERE wp_2_posts.post_type = 'properties';

Using posts_clauses ? In other words I’d like a posts_clauses filter to perform the same query as the one shown above in SQL.

I am trying to query posts that are only in English.

I will translate and write a perfect article in Thai for you 500 words for $10

I will translate and write a perfect article in Thai for you 500 words

You know that the internet is the perfect opportunity to attract the ideal client.

If you are ever in need of a Thai article you have come to the right place!
I will write any Thai article on any given subject. 

The services I provide for you are:

  • Well written article/blog/text
  • Fast delivery
  • Basic research for all topics

The extra’s I can provide are:

  • Extra words for cheap prices
  • Extra fast delivery
  • References & Citations
  • Stock Photos 

.

I will write a 500-word SEO original post for $5

I will write a 500-word SEO original post

Thanks for reaching out! I can imagine that you are looking for SEO optimized Content Writing Services to rank your business on Google. You have come to the right place

Here’s what you get when you order from me:

100% original blog post using SEO best practices. In the order details, please provide any links you wish for me to include. Also, please specify the goal of your blog post and where it will be published so i can optimize the content for your target audience. 

All articles are completely yours once the order is delivered and finalized.


Areas of expertise:

1) Article (on any topic)

2) Blog post

3) Guest post

4) Creative writing

5) Website content

With over 5 years of experience and certifications from top content creation agencies, you can be assured of quality and highly professional work.

Please tell me your brand’s tone/audience, so I can match my writing style accordingly. As a freelance writer, I aim to produce content that is strictly consistent with the client’s brand

NOTE: I am open to short term and long term projects.

Contact Me or PLACE YOUR ORDER NOW.

Thank You.

.(tagsToTranslate)writing(t)seo(t)editing(t)blog(t)article(t)write

write and publish a guest post on Reddit, Reddit. com DA 91 With permanent strong backlink for $5

write and publish a guest post on Reddit, Reddit. com DA 91 With permanent strong backlink

PERMANENT REDDIT GUEST POST BACKLINKS SERVICE

Why Reddit is Best?

Check out the Reddit Domain Metrics:

√√ Domain Authority (DA) : 91

√√ Page Authority (PA) : 90

√√ Trust Flow (TF) : 75

√√ Citation Flow (CT) : 86

√√ Domain Rating (DR) : 95

Please Note…

*** The Link will not be Erase.

*** The Link will Get Indexed in Google,So You can Get all the SEO Juice Shooting up Your SERPs Ranking.

*** The Turnaround Time is 1-2 days.

*** I can link to Your Homepage, Commercial Pages or Blog posts and etc.

*** I can use whatever Anchor Text you want.

*** 400-600Words Quality SEO Optimized Article by Hand Writing or Collect From Your Website.

This Service Gets you a Permanent DA91 TF75 CF86 PA87 DR95 Backlink from Reddit, These Backlinks Works Like a Charm. A few of these Backlinks can Skyrocket Your Rankings Depending on the Competition. You Send us the Link and we flip it to Reddit, Simple As That.

Note: We will only do the Reddit Link Submission on Our New Reddit Account. We will Also Read Your Website Content then we will Add Content Related Image and Few Words Like Guest Post.

Reminder: Due the Nature of this Service we will not able to refund once the work has been started.

Have Questions: Please send us Private Message If you have Any Questions Regarding This Service.

Frequently Asked Question :

Q: Are these Links Permanent?

A: Yes, All links are Permanent.

Q: Do you Accept Gambling, illegal, Adult Porn or Drugs Related Websites?

A: We accept all Niches which are Supported and Accepted on Reddit.

Q: What is your Refund Policy and Ranking Guarantee?

A: No Ranking Gurantee and No Refunds once the order is started. We are willing to replace links on backlink service if your link is deleted/removed by the mods on Reddit.

Q: Are these links Permanent?

A: Yes, all links are Permanent.

Please Order Me

.(tagsToTranslate)Guest(t)po(t)Reddit(t)Reddit(t)g(t)guest(t)posting

how to write a function to show lists of running processes or while loop functions in php

Please i have a while loop function that am using to insert data into my database periodically, for some reasons i found out that while loop is more easy to use than cronjob, while loop runs without anyone having to visit the site, but my problem is that once a while loop is started it keeps running even if you delete the codes from your php file, it keeps running, and if you amend the code with new values and start it again both the old loop and the new one keeps running.
My question is how can i write a php function that will list out all current running loop processes in my webhost or server and then use another code to end or stop or remove it from running?

Below is my code

$date = date('Y-h-m H:i:s');
$counter = 0;
while($counter < 10){

    $wpdb->query("INSERT INTO a_boy (username, password) VALUES ('cash', $date)");
    $counter + 1;
    sleep(60);
}