はてなキーワード: PRINTとは
当時ファミコンが全盛期で、友達の家でドラクエやゼビウスをやらせてもらっていて、
むちゃくちゃのめりこんでいた。端的に言って、ゲームに熱狂していた。
喉から手が出るほどゲーム機が欲しかったが、親はがんとしてゲームを買ってくれなかった。
そんな折、電気屋の親戚のおじさんから、安くMSXを譲ってもらうことになった。
パソコンでゲームが作れるということを前から聞いていたので、自分でゲームを作れれば最高じゃんと
思ったのだが、どうすればゲームを作れるのかまったくわからなかったので、
自分でコンピュータに命令して、思い通りに動いた感覚というか。
最初は簡単なギャンブルゲーム、単純に半か丁かを予想して、掛け金を増やしていくゲームから、
シューティング、RPGなど、拙いながらも自分の愛すべきゲームが出来上がっていった。
まるで神にでもなったかのような全能感を抱いたのを覚えている。
そんな体験があって、今は小さいソフトウェア会社でコンピュータに関わる仕事をしている。
でも今の子供達って、そういう経験をすることはないんだろうなと思う。
現代のゲームは、美麗3Dの超大型ゲームがそれこそ無数に存在していて、
自分でこんなゲームを作れるわけはないってのは、子供でもわかる。
ドット絵のインディーゲームとかもまああるにはあるけど、現代の子供達は
どっかの記事で読んだのだけど、ドット絵は「手抜き」なんだと思ってるらしい。
そんなわけだから、自分で市販されているようなゲームを作ろうと思えば、
僕らが昔やってたような、お気楽にゲームを作るという発想にはならないんじゃないかなと思ってる。
アマチュアゲーム制作文化をまた盛り上げていくにはどうしたらいいんだろうと考えるけど、
なかなか答えは出ないよな。
まあ、なんつーか、そんなです。
気が付くと朝4時になっていた。
なんか動くところまで出来たので貼っておく。
import pdfplumber import re #クリーンアップ def cleanuptext(text): #決算書の合計値を太字にしたことでpdfplumberが暴走するケースへの対処 #例 流動資産 -> 流流流流流動動動動動資資資資資産産産産産 #誤爆が怖いので、これが起きている時だけ補正します if "流流流流流動動動動動資資資資資産産産産産" in text: text = re.sub(r'(.)92;1{4,}', r'92;1', text) #△をマイナスに。 数字中のカンマを消して結合する text = re.sub(r'△([0-9])', r'-92;1', text) text = re.sub(r'▲([0-9])', r'-92;1', text) text = re.sub(r'([0-9]),([0-9])', r'92;192;2', text) #たまに、煽り屋みたいに文字の後にスペースが入る嫌がらせを修正する #例: 投 資 有 価 証 券 -> 投資有価証券 text = re.sub(r'(?<=[92;u4E00-92;u9FFF92;u3040-92;u30FF])92;s(?=[92;u4E00-92;u9FFF92;u3040-92;u30FF])', '', text) return text #今期の勘定科目の数字を取得 def get_AccountName(text, need): pattern = rf'^{need} -?[0-9]+ (-?[0-9]+)' r = re.search(pattern, text, re.MULTILINE) if r is not None: return float(r[1]) return 0 #清原ネットキャッシュを計算する。 def calc_KiyoharaNetCash(text): total_current_assets = get_AccountName(text,'流動資産合計') if total_current_assets == 0: #要約財政状態計算書しか公開していない、楽天のような素敵な会社様への対処 total_assets = get_AccountName(text,'資産合計') if total_assets != 0: #とりあえず、資産の部の6割を流動資産とみなす total_current_assets = total_assets * 0.6 else: #流動資産合計ではなく、流動資産という単語を使っている我が道を行く東北電力への対処 total_current_assets = get_AccountName(text,'流動資産') if total_current_assets == 0: raise Exception("流動資産合計の勘定科目が見つかりませんでした。"+text) total_liabilities = get_AccountName(text,'負債合計') if total_liabilities == 0: #負債合計ではなく、負債の部合計に拘るオムロンの嬉しい決算書への対策。なんでや・・・ total_liabilities = get_AccountName(text,'負債の部合計') if total_liabilities == 0: raise Exception("負債合計の勘定科目が見つかりませんでした。"+text) #負債をご丁寧にマイナス表記で書いてくれる中外製薬の親切な決算書への対策。いい加減にしろよ・・・ if total_liabilities < 0: total_liabilities = total_liabilities * -1 #投資有価証券はないこともあるので、0を容認する marketable_securities = get_AccountName(text,'投資有価証券') #print(total_current_assets,marketable_securities,total_liabilities) netcash = total_current_assets + (marketable_securities*0.7) - total_liabilities #たまに単位を1000円にしている銘柄があるので補正する if is_tanni_senyen(text): netcash = netcash / 1000 return netcash # "流動資産合計" と "負債合計" の間に "単位:千円" があるかをチェック def is_tanni_senyen(text): if "単位:千円" in text: return True if "単位: 千円" in text: return True if "単位 : 千円" in text: return True if "単位 :千円" in text: return True return False def pdf_to_kiyohara_netcash(pdfpath): with pdfplumber.open(pdfpath) as pdf: text = ''.join(page.extract_text() for page in pdf.pages) text = cleanuptext(text) #print(text) kiyohara_netcash = calc_KiyoharaNetCash(text) #print(kiyohara_netcash) return kiyohara_netcash def mymain(): import sys args = sys.argv argc = len(args) if argc <= 1: print(''' これは、清原達郎氏のネットキャッシュ比率(以下、清原ネットキャッシュ比率)を決算短信のpdfから求めるソフトです。 清原ネットキャッシュ=流動資産合計+(投資有価証券*0.7)-負債合計 清原ネットキャッシュ比率=清原ネットキャッシュ/時価総額*100 遊び方 1. 決算短信pdfから清原ネットキャッシュを求める python calc_kiyohara_netcash.py 140120240514594985.pdf 結果: 30757.0 決算書には、100万円単位で数字が書かれているはずなので、この数字の単位は100万円です。 つまり、3075700万円。 2. 時価総額を億円単位で追加することで、清原ネットキャッシュ比率を求める 時価総額が146億円なら146と書いてください。 python calc_kiyohara_netcash.py 140120240514594985.pdf 146 結果: 210.66% このコードはNYSLライセンスです。無保証、自己責任ですが、ご自由に。 かぶ探とかとつなげるといいかもね。 ''') return if argc <= 2: kiyohara_netcash = pdf_to_kiyohara_netcash(args[1]) print(kiyohara_netcash) return if argc <= 3: market_cap=float(args[2])*100 #億円から百万円表記に kiyohara_netcash = pdf_to_kiyohara_netcash(args[1]) ratio = round(kiyohara_netcash/market_cap*100,2) print(f"{ratio}%") return if __name__ == '__main__': mymain()
https://www.geonames.org から取れる、人口500人以上の都市の名前に限定すると、
Santa Maria Magdalena Cahuacan
import logging import tempfile import zipfile from collections import Counter import httpx FILE_NAME_BASE = 'cities500' GEONAME_FIELDS = ( 'geoname_id', 'name', 'ascii_name', 'alternate_names', 'latitude', 'longitude', 'feature_class', 'feature_code', 'country_code', 'cc2', 'admin1_code', 'admin2_code', 'admin3_code', 'admin4_code', 'population', 'elevation', 'dem', 'timezone', 'modification_date', ) def retrieve_cities(): """Retrieve city names from a remote server.""" response = httpx.get(f'https://download.geonames.org/export/dump/{FILE_NAME_BASE}.zip') response.raise_for_status() tmpdir = tempfile.TemporaryDirectory() with open(tmpdir.name + f'/{FILE_NAME_BASE}.zip', 'wb') as f: f.write(response.content) with zipfile.ZipFile(tmpdir.name + f'/{FILE_NAME_BASE}.zip', 'r') as z: z.extractall(tmpdir.name) with open(tmpdir.name + f'/{FILE_NAME_BASE}.txt', 'r') as f: for line in f: yield line.split('\t') def count_characters(to_check='ascii_name', filter_func=lambda _: True): """Count characters in city names.""" cities = {} for city_fields in retrieve_cities(): city = dict(zip(GEONAME_FIELDS, city_fields)) if not filter_func(city): continue counter = Counter() for c in city[to_check]: counter[c] += 1 cities[city['geoname_id']] = {'characters': counter, 'city': city} return cities def count_chars_of_city_names(cities, char=None): """Find the city with the most occurrences of a given character.""" cities_by_char_count = {} max_count = 0 max_count_char = None for city_id, data in cities.items(): if 'characters' not in data or not data['characters']: logging.debug(f'No characters found for city {city_id}', data) continue count = 0 if char and char in data['characters']: count = data['characters'][char] cities_by_char_count.setdefault(count, []).append(data) elif char is None: most_common = data['characters'].most_common(1)[0] char, count = most_common cities_by_char_count.setdefault(count, []).append(data) if count > max_count: max_count = count max_count_char = char cities_by_char_count.setdefault(count, []).append(data) return cities_by_char_count.get(max_count, []), max_count_char def not_contain_invalid_chars(city): return ( '(' not in city.get('ascii_name', '') and '/' not in city.get('ascii_name', '') ) def main(): cities = count_characters(filter_func=not_contain_invalid_chars) for char in 'abcdefghijklmnopqrstuvwxyz': cities_counted, char = count_chars_of_city_names(cities, char) max_count = cities_counted[0]['characters'][char] print(f'The character "{char}" appears the most ({max_count} times) in the following cities:') for city in cities_counted: print("\t", city['city']['ascii_name']) if __name__ == "__main__": main()
ワイ:
x = torch.tensor([
[1.0,2.0,3.0],
[4.0,5.0,6.0]
])
Claude3.5 Sonnet:
はい、channel-wise 正規化(チャネル方向の正規化)を行います。この場合、最終次元(dim=-1)がチャネルとなります。channel-wise 正規化では、各チャネルの平均を0、分散を1に正規化します。
import torch x = torch.tensor([ [1.0, 2.0, 3.0], [4.0, 5.0, 6.0] ]) # チャネル方向(最終次元)の平均と標準偏差を計算 mean = x.mean(dim=-1, keepdim=True) std = x.std(dim=-1, keepdim=True) # Epsilon を追加して、ゼロ除算を防ぐ epsilon = 1e-5 # 正規化を実行 x_normalized = (x - mean) / (std + epsilon) print("元のテンソル:") print(x) print("\n正規化後のテンソル:") print(x_normalized)元のテンソル: tensor([[1., 2., 3.], [4., 5., 6.]]) 正規化後のテンソル: tensor([[-1.2247, 0.0000, 1.2247], [-1.2247, 0.0000, 1.2247]])
ワイ:
x = torch.tensor([
[1.0,2.0,3.0],
[4.0,5.0,6.0]
])
ChatGPT o1-preview:
import torch x = torch.tensor([ [1.0, 2.0, 3.0], [4.0, 5.0, 6.0] ]) # Compute mean and standard deviation along the batch dimension (dim=0) mean = x.mean(dim=0, keepdim=True) std = x.std(dim=0, unbiased=False, keepdim=True) # Perform channel-wise normalization x_normalized = (x - mean) / std print("Normalized Tensor:\n", x_normalized)Output:
Normalized Tensor: tensor([[-1., -1., -1.], [ 1., 1., 1.]])Explanation:
Compute Mean:
The mean is computed along the batch dimension (dim=0), treating each column as a channel.
mean = x.mean(dim=0, keepdim=True)This results in mean = [[2.5, 3.5, 4.5]].
Compute Standard Deviation:
The standard deviation is computed along the same dimension with unbiased=False to match the sample size.
std = x.std(dim=0, unbiased=False, keepdim=True)This results in std = [[1.5, 1.5, 1.5]].
Normalize:
Subtract the mean and divide by the standard deviation for each channel.
x_normalized = (x - mean) / stdThis yields the normalized tensor with standardized channels.
Note: Setting keepdim=True ensures that the mean and standard deviation tensors have the same number of dimensions as x, which is necessary for broadcasting during subtraction and division.
ChatGPTの方が正しいよね?
We've rounded up the latest and greatest Temu coupon code $100 off deals for September 2024, covering both new and existing customers. Whether you're a seasoned Temu shopper or just discovering this online treasure trove, we've got coupon codes like act200019 and acp856709 to help you maximize your savings.
With our handpicked selection of Temu coupons, you can score incredible discounts on everything from fashion and electronics to home goods and beauty products. Just use our coupon code in the Temu app during checkout and watch your total plummet.
We'll now uncover deals for new and existing customers, explain how to redeem your coupons, and highlight the benefits of using these codes. Get ready to shop smarter and save bigger with Temu!
Get $100 OFF On The Temu APP >>>
Temu Coupon Code $100 Off In 2024: Get Flat $100 OFF + 30% Discount
Are you looking for a Temu $100 coupon code? We've got the latest deals to help you save big on your next Temu purchase. Right now, you can redeem a Temu coupon for $100 off plus an extra 30% discount on top of that. It's the perfect time to stock up on all your favorite items.
Here's the deal! New customers can score a flat $100 off the first order, PLUS an extra 30% discount. That's potentially 70% off your total! Existing customers can still get 40% off your next Temu haul.
Here are five exclusive Temu coupon codes for $100 off:
ACT200019: Get $100 off on your first order or as an existing customer.
ACP856709: New customers can save up to 70%.
ACU395411: Existing customers can get 40% off.
ACU934948: Another option for new customers to save up to 70%.
ACL921207: Existing customers can enjoy 40% off with this code.
Each code offers unique savings, from flat discounts to free shipping. The ACT200019 code is especially valuable, giving you a whopping $100 off when you spend $200 or more. That's like getting half your order for free!
Don't miss out on these amazing deals. Temu's prices are already low, and with these coupons, you'll stretch your dollar even further. Whether you're shopping for clothes, home goods, or electronics, there's a code to unlock up to a $100 discount on Temu.
Temu $100 off coupon code for new and existing users.
Temu Coupon Code For New Users: $100 Coupon + Up To 90% OFF In September 2024
Are you new to Temu? You're about to score big with exclusive Temu $100 coupon codes for new customers this September! Enjoy a flat $100 off coupon for first-time buyers, plus up to 90% off on select items. That means your first order could be almost free! It's the perfect time to stock up on all your favorite items.
Here are the top Temu discount codes for new customers available now:
ACU395411: A classic $100 off for new customers.
ACU934948: Unlock the 90% discount on specific items.
ACT200019: Another chance to grab that $100 off your first purchase.
ACP856709: Explore massive savings with this 90% off code.
ACL921207: One more opportunity to claim your $100 discount.
The ACP856709 code is a game-changer, giving you a full $100 off when you spend $200 or more. That's like getting half your first order for free! These deals make your first Temu experience even more exciting.
Temu Coupon Codes For Existing Users: $100 Coupon Bundle + 40% Price Slash
Already a Temu fan? Awesome! You haven't been forgotten. Enjoy a Temu $100 coupon code for existing customers and slash prices by a whopping 40%! Just enter the code for existing customers at checkout and watch your savings stack up.
We've got a whole bunch of Temu codes to keep you shopping. Check out these amazing deals:
ACP856709: Your ticket to a $100 discount on your next Temu haul.
ACL921207: An extra code to grab that sweet $100 off.
ACT200019: Another chance for existing customers to save big.
ACU934948: Unlock 40% off your purchase with this code.
ACU395411: One more code to enjoy a generous 40% discount.
These codes might not last forever, so use them while you can to make the most of your Temu shopping spree! Whether you're restocking essentials or trying something new, there's a discount waiting for you.
Temu Coupon Code For 40% Off: For Both New And Existing Customers
There are some amazing Temu coupons that work for both new and existing customers! No need to hunt for separate codes. Just apply one of these at checkout and enjoy your discount.
Check out these five Temu $100 discount codes:
ACU395411: Save 40% on your next order, no matter if you're new or returning.
ACT200019: Another easy way to grab that 40% off discount.
ACU934948: Yet another opportunity to take advantage of the 40% savings.
ACP856709: A fourth option to get that fantastic 40% discount.
ACL921207: One more code to ensure everyone can enjoy 40% off their Temu purchase.
The ACU395411 code is a standout, giving you 40% off your entire purchase with no strings attached. Pair it with other Temu $100 discount codes for maximum savings.
These deals make Temu's already low prices even more attractive. Whether you're shopping for clothes, home goods, or gadgets, you'll find incredible discounts.
Enjoy $100 Off + 30% discount On Temu >>>
What Are The $100 off Temu Coupon Codes For Different Countries/Regions?
Temu offers great deals worldwide! You can find a Temu coupon code for 100 dollar off in various countries. Here's a quick look at some region-specific codes to help you save big.
Check out these international Temu deals:
ACT200019: For USA, Canada, Australia, New Zealand, and South America.
ACP856709: For USA, Canada, Australia, New Zealand, and South America.
ACU934948: For USA, Canada, Australia, New Zealand, and South America.
ACU395411: For the Middle East (UAE, Abu Dhabi, Qatar), UK, Europe, and Africa.
ACL921207: For UK, Europe, Middle East (UAE, Saudi Arab, Oman), and Africa.
Use our region-specific Temu code during checkout to get additional discounts on top of Temu's already low prices. Each code is tailored to its specific country or region, ensuring you get the best local deal.
Whether you're shopping in dollars, pounds, or euros, Temu has a great discount waiting for you. Start filling your cart and watch the savings add up!
Temu Coupon $100 OFF For Existing Users.
Temu Coupon Bundle: Flat $100 Off + Up To 70% Discount For Any Order Value For First Time Buyers
Temu's coupon bundles offer a flat $100 off PLUS up to 70% off on top of that, regardless of your order value! This is a fantastic way to maximize your savings.
Here are five codes to get you started with the fantastic $100 couple bundle on Temu:
ACT200019: Get a flat $100 discount on your order.
ACL921207: Enjoy up to 70% off as a new customer.
ACP856709: Existing customers can get 40% off.
ACU395411: Score up to 90% off on select flash sale items.
ACU934948: Get an extra 50% off when you buy bundled items.
Remember, any promotional code available on Temu has some specific terms and conditions. Make sure to read the fine print before applying. Some codes might not stack, while others could have expiration dates or category restrictions.
This bundle deal makes Temu's low prices even more attractive. Whether you're buying one item or filling your cart, you're guaranteed to save.
Free Temu Coupons For First-Time Users: Unlock Unlimited Savings As A New Customer!
As a new customer, Temu welcomes you with a variety of free coupons like ACT200019 and ACP856709 to make your first purchase at Temu unforgettable. These coupons can include free shipping, percentage discounts, and even a dollar amount off your order.
You can unlock discounts up to 90% off, score free shipping, and even get cash back on your order. These deals are designed to give you a taste of Temu's amazing prices and vast product range.
Don't forget to check the app to get the best deals for all your purchases with Temu. You might find extra discounts or free gifts with your first purchase at Temu.
Temu Discount Code For Existing User
There are plenty of ways for existing users to keep saving. You can still score a significant discount on your next purchase with our exclusive dollar 100 coupon code for Temu.
Temu rewards loyal customers with special codes such as ACU395411 and ACU934948. Keep an eye out for the dollar 100 off Temu code for existing customers in 2024. This offer pops up regularly and can save you big on larger orders.
Don't forget to check for seasonal sales, flash deals, and app-exclusive offers. Temu often runs promotions where you can stack discounts for maximum savings. If you're a student, look into the Temu student discount program for extra savings year-round.
Sign up for Temu's newsletter to get a dollar 100 coupon bundle sent straight to your inbox. You can also earn points through their loyalty program, which you can redeem for discounts on future purchases.
How To Redeem Temu Coupon Codes In September 2024?
Ready to use your Temu coupon code? It's easy! Here's how to redeem your Temu $100 coupon codes and enjoy amazing savings:
Download the Temu app or visit the Temu website.
Sign up for a Temu account if you haven't already done so.
Browse Temu's wide selection of products and add your favorites to your cart.
Proceed to checkout and review your order.
Look for the "Coupon Code" field to use the coupon code shared by us.
Enter the coupon code you want to use, such as ACT200019 and ACP856709.
Click "Apply" to see your discount reflected in the order total.
Complete your first purchase and enjoy your savings!
Remember, always read the conditions associated with each coupon to ensure you're eligible for the discount. Some codes may have expiration dates or minimum purchase requirements.
Claim flat $100 discount on the Temu app >>>
5 Benefits of Using Temu Coupon Codes For September 2024
Using Temu coupon codes in September 2024 comes with fantastic perks! With our exclusive codes, you're getting the most out of your shopping experience.
Here are 5 key benefits of applying the best Temu coupon code available this month:
Instant Savings: Applying the latest Temu code at checkout gives you an immediate discount, slashing the price of your purchase right away. No waiting for rebates or cashback – the savings are yours instantly!
No Minimum Purchase: Many Temu coupons don't require a minimum purchase. This means you can enjoy the savings even on smaller orders, making every shopping trip a bargain.
Easy to Use: It's incredibly simple to redeem your Temu coupon during checkout. Just enter the code in the designated field and watch your total drop!
Variety of Discounts: Temu offers a wide range of coupon codes, from percentage-based discounts to flat dollar amounts off.
More for Your Money: With Temu coupon codes, you can afford to treat yourself to more items or splurge on higher-quality products that you might not have considered otherwise.
Remember, using a Temu coupon is simple, and the rewards are immediate. Just enter the best Temu coupon code available in September 2024 at checkout and watch your total drop.
Temu $100 Off Coupon For New Users.
Final Note: Unlock Temu Offers As New and Existing Users
With these Temu $100 off promo codes, you're all set to save big on your next shopping on Temu. Remember to check the terms and conditions for each code to make the most of your discounts. Whether you're after a flat $100 off or a percentage discount, there's a deal that's perfect for you.
For new Temu users, this is your chance to explore the platform's vast range of products at unbeatable prices. Don't forget to download the app for exclusive offers and easy shopping on the go. Existing customers, your loyalty pays off with special codes just for you. Keep an eye out for seasonal sales and flash deals to stack your savings. Happy shopping!
Temu Coupon Code FAQs
What is the $300 coupon on Temu?
Temu's $300 coupon is often a bundle of smaller discounts, not a single $300 off. It's designed to encourage new customers to explore Temu's wide range of products at a significant discount.
Can I use multiple Temu coupons on a single purchase?
Temu generally allows only one coupon code per purchase. However, you can often combine a coupon code with other discounts, such as free shipping or special promotions.
How To Contact Temu Customer Service?
You can easily reach Temu customer service through their app or website. Look for the "Contact Us" or "Help" section, where you'll find options for live chat, email, or phone support.
What Can You Buy with Your Temu Coupon?
Your Temu coupon can be used on a wide variety of items, including clothing, electronics, home goods, beauty products, and more. Check the coupon details for any restrictions on specific categories or items.
Are you looking for amazing Temu deals? We've got the best Temu coupons just for you! Use our new Temu coupon code 40% off for September 2024, like "acp856709" and "act200019," to get a flat 40% discount. Whether you're a first-time shopper or a loyal customer, Temu has something special in store.
Temu is known for its low prices on a wide range of products. From trendy fashion to must-have home goods, you'll find it all here. And with these Temu 40% off coupon codes, you're getting even more savings.
The Glam Look team is always on the lookout for new offers of Temu to share with you. Remember to check back often, as deals can change quickly. Be sure to read the fine print on each code to make the most of your savings. Let's dive into the best Temu deals for September 2024!
>>>Claim 40% Extra Off On Temu<<<
Temu Coupon Code 40% Off: Unlock Exclusive Temu Deals In September 2024
We're excited to share the latest Temu deals with you! If you are looking for a Temu coupon code 40% off, you are in the right place! We've got exclusive Temu coupon codes that'll help you maximize your savings this September 2024.
Temu is offering some amazing discounts designed to give new customers a significant discount on total purchase value.
You can claim a flat 40% off on the Temu app by using the exclusive coupon codes ACP856709 or ACT200019.
Here are five codes you can use right now:
ACP856709: Get 40% off your next order.
ACT200019: Enjoy a 40% discount on the Temu app.
ACP934948: 40% extra off + free shipping on all orders.
ACU395411: 40% off summer collection items.
ACL921207: Receive a free gift with purchases over $100 + 40% off.
These Temu coupons are perfect for both new and returning customers. You'll save big on Temu's wide range of products, from fashion to home goods. The Temu 40% off code is especially great for first-time shoppers.
Use Temu coupon code 40% off "ACP856709" on the Temu app.
Temu Coupon Code 40 Percent Off For First-Time Users
Are you ready to start your Temu adventure? We've got great news for you! The Temu coupon code 40% off is here, and it's part of an amazing Temu new users promotion.
You can enjoy an extra 40% off on the Temu app as a first-time user by using the latest Temu codes ACP856709 and ACT200019.
This deal is one of the most fantastic Temu offers we've seen. Here's a rundown of the exclusive Temu offers available now:
ACT200019: Grab 40% extra off your first purchase.
ACP856709: Get 40% off when you spend $50 or more.
ACU395411: Enjoy free shipping on any order + 40% off.
ACP934948: Take an extra 40% off sale items.
ACL921207: Receive a surprise gift with orders over $75 + 40% extra off.
These Temu codes are perfect for trying out Temu's vast product range. You'll find everything from trendy clothes to cool gadgets. The Temu 40% discount is a game-changer, letting you stock up on more for less.
So, don't wait to use these codes. They're available for the entire month of September 2024. Whether you're shopping for yourself or for gifts, these Temu deals will help you save big.
How To Get Free Shipping Of Your First Order On Temu?
Want to save some more on your first Temu order? We'll show you how to get free shipping! Temu often offers free shipping deals, giving new customers a significant discount on their first purchase.
You can enjoy free shipping on your first order through the Temu app by using our verified coupon codes ACT200019 and ACP856709 in September 2024.
It's that simple! But remember to check the terms and conditions. Although our Temu discount codes don't have any minimum order value, some codes might have minimum purchase requirements. Usually, there's no catch – Temu wants to welcome you as a new customer. Here's how you can get free shipping:
Download the Temu app from the App Store or Play Store.
Sign up for a new Temu account.
Search our exclusive Temu free shipping code ACT200019 or ACP856709 on the app.
Add your desired items to your cart.
Enter the "ACP856709" or "ACT200019" Temu 40% off coupon code at checkout.
Enjoy free shipping on your order.
Free shipping can really cut down on shipping costs, especially for larger orders. It's a great way to try out Temu's products without extra fees. You'll get more value from your first Temu order by using these free shipping deals.
Keep in mind that free shipping offers may change. Also, some items might be excluded from free shipping due to size or weight.
>>>Enjoy 40% Discount On Temu<<<
Temu Coupon Code For 40 Percent Off: Promo Codes For Existing Users In September 2024
We have good news for loyal Temu shoppers! While the Temu coupon 40% off is often for new users, existing users can enjoy great deals, too. We've got some promo codes that'll make your Temu shopping experience even better.
You can use the exclusive Temu coupon code "ACP856709" to get an extra 40% off as an existing user.
Here are the five best codes existing users can enjoy this September:
ACP856709: Get 40% off select items as a "thank you" for your loyalty.
ACT200019: Enjoy 40% off summer essentials.
ACL921207: 40% off + free shipping on orders over $50.
ACP934948: Extra 40% off during flash sale events.
ACU395411: Get an additional 40% off when you order through the Temu app.
These codes help you save on your favorite Temu products. The 40% off code is especially great for big purchases. You can also use our Temu coupon code for $100 off to get a flat $100 discount on your first purchase.
Using the Temu coupons for existing users is easy. Just enter the code at checkout. You can use them on a wide range of items, from fashion to home goods.
Temu values its regular customers. These codes are their way of saying thanks for your continued support. Keep an eye on this article for more deals – Temu often releases new codes for their loyal shoppers.
Use Temu 40% off coupon code "ACT200019" as a new user.
How To Use Temu 40% Coupon Code: Redeem And Unlock New Ways To Save
Are you ready to use the latest Temu coupon code for 40% off? We'll show you how! For all the new and existing shoppers, it's easy to save big on your next Temu order. Here are the steps to redeem your code.
Redeem on the Temu app (both iOS and Android):
Download and open the Temu app.
Look for "Coupon Code" at the checkout page.
Enter the Temu 40% off code "ACP856709."
Tap "Apply" and see your savings!
Open any browser and go to Temu.com.
Fill your cart with great finds or upgrade your tech stack.
Find the "Coupon Code" box at checkout.
Type in the exclusive 40% off code "ACP856709."
Click "Apply" and watch your total drop.
It's that simple! The discount will apply right away. You'll see the savings on your order summary. Remember, our exclusive codes are valid throughout September 2024. Check if there's a minimum spend or if certain items are excluded.
So, are you ready to shop? Start your next haul with code ACP856709 (or the other latest code we've shared).
>>>Claim Extra 40% OFF As A Temu New User<<<
Can You Pay Through A Gift Card To Unlock The Temu 40% Off Deal In Your First Order?
Do you want to use a gift card and still get the Temu 40% off deal? Yes, you can use both on your first order. The 40% off code is usually a limited-time offer for new Temu customers using code ACT200019.
You can apply this discount code first at checkout. Then, you can use your gift card to pay for the remaining balance. This means you get a big discount on top of the value of your gift card. It's like double savings! Steps to use both:
Add items to your cart on the Temu app.
Enter the Temu 40% off code "ACP856709" or "ACT200019."
Apply your gift card to the remaining amount.
You'll enjoy significant savings on your first Temu order by combining the two. It's a smart way to stretch your gift card further. Remember, offers can change. Always read Temu's current terms. Some exclusions might apply to certain products.
Using both your gift card and the whopping 40% off code lets you get more for less. It's a great way to try out Temu's wide range of products.
Use the Temu coupon 40% discount "ACP856709" as an existing user.
Temu 40% Off Coupons For Different Countries
The Temu coupon code 40% off isn't just for one country. Temu offers significant savings to shoppers around the world. These codes help you save big no matter where you live. The 40% off deal is especially great for trying out Temu's wide range of products. Let's look at some exclusive offers for different countries.
Here are five international Temu codes that you can use this September 2024:
ACP856709: For USA, Canada, Australia, New Zealand, & South America.
ACT200019: For USA, Canada, Australia, New Zealand, & South America.
ACU934948: For USA, Canada, Australia, New Zealand, & South America.
ACU395411: For Middle East (UAE, Abu Dhabi, Qatar), UK, Europe, Africa.
ACL921207: For UK, Europe, Middle East (UAE, Saudi Arab, Oman), Africa.
Temu adjusts offers based on local markets. You might find slight differences in discounts between countries. But the goal is always to give you the best deal possible.
These codes are a fantastic coupon for loyal Temu shoppers, too. Even if you're not a first-time buyer, keep an eye out for returning customer deals in your country. Use these codes to save on your next Temu order, wherever you are!
Temu Coupon Code 40% Off Europe: Best Deals For the UK
Here is great news for UK shoppers! The Temu 40% off coupon code has landed in Europe as well, and we've got the best deals for you. Temu's bringing its amazing online shopping experience to the UK with some fantastic offers.
Use our verified Temu coupon code "ACP856709" or "ACT200019" to get an extra 40% off in the UK and Europe.
Here are five great codes for UK Temu shoppers:
ACP856709: Get 40% off your first order as a new UK customer.
ACT200019: Save 40% on home decor items, perfect for sprucing up your space.
ACU395411: Enjoy 25% off clothing and accessories.
ACL921207: Free shipping on all UK orders, no minimum spend.
ACU934948: Extra 5% off when you shop through the Temu app.
These codes help you save on Temu's wide range of products. The 40% off deal is an even better deal for trying out Temu's offerings. Remember, Temu often updates its deals. These codes give you a taste of what's available. You'll find everything from trendy fashion to cool gadgets and home goods.
To use these codes, just enter them at checkout. It's that easy to save big on your Temu order. Use these codes to get more for less on Temu UK.
>>>Claim 40% Extra Off On The UK & Europe<<<
Benefits Of Temu Coupon Code 40% Off For The First Order
Temu's 40% off coupon for your first order is a game-changer! It offers incredible savings and a chance to explore Temu's wide range of products without breaking the bank. Here are five key benefits of using this coupon:
Huge savings: The 40% discount lets you slash prices significantly. You can buy more items or save money on big-ticket purchases.
Try new products: With such a big discount, you can experiment with products you might not usually buy. It's a risk-free way to discover new favorites.
Quality for less: Temu offers quality items at already competitive prices. The 40% off makes these deals even sweeter.
Gift-giving made easy: Use the discount to buy gifts for others. You can get more impressive presents while staying within your budget.
Explore Temu's variety: The coupon works on most items, letting you sample different categories. From fashion to home goods, you can try a bit of everything Temu offers.
Remember, Temu often sends promos through promotional emails, so sign up to stay informed. This 40% off deal is just the start of your savings journey with Temu.
Don't miss out on this chance to shop smart and save big. Use the code on your first order and see why so many people love shopping on Temu!
Use Temu discount code 40% off "ACT200019" and "ACP856709" in September 2024.
Temu is a legitimate online marketplace that's taking the e-commerce world by storm. Launched in 2022, it's a part of PDD Holdings, the company behind the popular Pinduoduo platform in China.
Temu offers a huge range of products at competitive prices. You'll find everything from fashion to home goods, electronics to beauty products. By using our Temu coupon, you can save even more on these great deals.
What sets Temu apart is its direct-from-manufacturer model. This approach helps keep prices low while offering quality items. Temu often has a special promotional offer for new users, like the Temu 40% off first-order deal.
Temu is an online marketplace whose mission is to get the best products to consumers at unbeatable prices. With its user-friendly app and website, Temu makes online shopping easy and fun for everyone.
Final Note: Download The Temu App And Get 40% Off
With these amazing Temu coupon code 40% off deals, you're all set to save big on your next shopping spree. Temu offers special discounts for both new and returning customers, making it easy for everyone to enjoy great prices on quality products.
Don't forget to use the "ACP856709" and "ACT200019" Temu coupon codes at checkout to maximize your savings.
Remember, our newest Temu code offers substantial savings, but they won't last forever. Keep checking back for the latest deals and promotions. Whether you're shopping for yourself or looking for the perfect gift, Temu has you covered. Shop with confidence, knowing you're getting the best prices on a wide range of products. Happy shopping!
FAQs
Is The Temu Coupon Code 40% Off Legit?
Yes, the Temu coupon code 40% off, such as ACP856709 or ACT200019, is absolutely legit. New users can use ACT200019, and existing users can use the ACP856709 coupon code to claim a flat 40% discount sitewide.
Which Are The Verified Temu 40% Off Coupon Codes For New Customers?
Our exclusive codes "ACT200019" and "ACU934948" are the verified Temu 40% off coupons. New customers can download the Temu app and use our coupon code to enjoy 40% off on their first order.
Which Are The Verified Temu 40% Off Discount Codes For Existing Customers?
Our latest codes "ACP856709" and "ACU395411" are the verified Temu discount codes to clam a flat 40% off as an existing users. You can use these codes to purchase any item from the Temu app.
Does The Temu 40% Off Deal Available Worldwide?
Yes, the Temu 40% off deal is currently available in 67 countries worldwide. You can use our exclusive Temu coupon codes in the USA, UK, Canada, Australia, New Zealand, Brazil, Mexico, Japan, UAE, Abu Dhabi, Bahrain, and many other countries.
Temu Coupon Code for Canada "acu639380", When you sign up you will get 90% OFF + a special $100 Coupon bundle to save up to $400 on your everyday shopping.
Temu is an online shopping app that is becoming increasingly popular in Canada. It allows consumers to save money on online shopping. You can shop from the latest fashion stores, home appliances, cosmetics, electronics, clothing, and more.
You can buy thousands of new products every day securely and easily, with free shipping and return within 90 days.
Temu Coupon Code has gained attraction among savvy shoppers. In this article, we will discuss what is Temu Coupon Code, how to save money on Temu, and how it can benefit you as a shopper.
Temu is an online marketplace for shoppers that offers quality merchandise from the world’s top suppliers and brands at affordable prices. It is a Chinese-based company owned by PDD, which is spreading its products all over the USA. Temu allows you to track your shipping status and expected delivery date directly in the Temu app or on Temu.com.
Temu has many different products like Clothes, Cosmetics, Electronics, and Household products at reasonable prices with free shipping and fast delivery and up to 90% off on many items.
Wondering is Temu $100 Off? Check out our latest article on Temu Coupon Code Flat $100 Off Plus 30% Discount
Temu’s most exciting feature is that many of its site’s products are incredibly low in price. You can buy neckless for $1, sunglasses for $2, and LED strip Lights for $3.48. However, its products are less than $30.
Temu Coupon Code (acu639380) For Canada July 2024: $100 Bonus + Up To 90% OFF
Temu Coupon Codes for Canada are easy to find. You can discover them through various channels, the official Temu website, promotional emails, social media platforms, or affiliate websites.
This Temu Coupon Code Canada will give you $100 coupon bundle discount on your shopping. You can add the Temu coupon code “acu639380” while checking out and click on apply to get a $100 discount. Once you apply the coupon, you’ll see a discount on your final price.
New or existing users can use the Temu Coupon Code to get amazing deals to get maximum discounts or other promotional offers while shopping on the Temu platform. It works as a digital voucher that shoppers can apply during the checkout process to reduce the total cost of their order (50% OFF) instantly.
How to Obtain the $100 Coupon Code
Getting your hands on the Temu $100 coupon code is straightforward. Here are the primary methods:
Sign-up Process: New users can often receive the coupon code upon registering on the Temu website. This welcome bonus is a great incentive to join the Temu community.
Newsletter Subscriptions: By subscribing to Temu’s newsletter, customers can stay updated on the latest promotions and receive exclusive discounts, including the $100 coupon code.
Partner Promotions: Temu sometimes collaborates with other brands or influencers to offer special coupon codes. Keeping an eye on these partnerships can be beneficial.
Below you will find the latest Temu Coupon Code Canada, where you will save money on your online shopping.
$100 OFF Temu Coupon Code – {acu639380}
Temu Coupon Code 2023 – {acu639380}
$50 Temu Promo Code – {acu639380}
Temu coupon code 40 off – {acu639380}
Temu 50% coupon code – {acu639380}
Temu Promo Code for existing users – {acu639380}
Temu coupon code $100 off First order: {acu639380}
Temu coupon code $100 off free shipping first order: {acu639380}
Temu coupon $100 off first order: {acu639380}
Temu coupon code for free stuff: {acu639380}
Temu coupon code 40 off: {acu639380}
Temu Coupon $100 Off for Existing Customers 2024: {acu639380}
Temu $100 coupon bundle new users - {acu639380}
Temu coupon code $100 off - {acu639380}
Temu coupon $100 off - {acu639380}
Temu Coupon Code $100 Off - {acu639380}
Temu $100 Free Gift Code - {acu639380}
Temu Canada $100 Off coupon code new users - {acu639380}
Temu coupon code Canada $100 off - {acu639380}
Temu Canada coupon $100 off - {acu639380}
Temu Free Gift Code $100 Off - {acu639380}
Temu coupon 30 Off - {acu639380}
Temu coupon 20% off - {acu639380}
Temu coupon code 90% off - {acu639380}
Temu coupon $100 Off - {acu639380}
Temu $50 Off Coupon code - {acu639380}
Temu $100 off coupon bundle - {acu639380}
Temu $100 off coupon for existing customers - {acu639380}
Temu $100 off coupon code for new users - {acu639380}
Temu Coupon Legit code - {acu639380}
$100 Available Temu Coupon Code - {acu639380}
What Is The $100 Off Temu Canada Coupon Code - {acu639380}
What Is The $100 Off Temu Canada Promo Code - {acu639380}
Temu Canada Coupon Code 2024 - {acu639380}
Note: All these Temu Coupon codes work only once and depend on the items you buy.
Wondering is Temu affordable or not? Check out our latest article on Temu $50% Off First Order?
How to Redeem and Apply Temu Coupon Code Canada?
Visit the Temu official website, download the app open a new account.
Enter the basic details to complete account verification.
Add your desired items to the shopping cart (minimum $100).
Click on the option “Coupon Code” and enter the Temu Coupon Code: acu639380.
Once a coupon is applied, you will see the final discounted price.
Now, Proceed to the checkout page.
Select the payment method and complete your shopping.
You can also subscribe to our notification and email list to get the latest Temu coupon code offers.
Temu coupon code Canada Reddit write a short note
If you're looking for a Temu coupon code for Canada, Reddit is a great place to check. Subreddits dedicated to deals and discounts, such as r/CanadianDeals or r/Deals, often have users sharing the latest promo codes and discounts. Simply search for "Temu coupon code Canada" within these subreddits, and you may find some useful and up-to-date codes.
Temu Coupon Canada Exclusive $100 Discounts
The Temu $100 coupon codes provide percentage-based or flat-rate discounts on selected items or entire product categories. You can add the Temu Coupon Code "acu639380" while checking out and click on apply to get a $100 discount. Once you apply the coupon, you’ll see a discount on your final price. These exclusive discounts can significantly enhance your savings and allow you to stretch your budget further.
Check out our latest article on Temu Referral Code to get a maximum sign-up bonus for your shopping.
Temu coupon code Canada existing customers: 40% Price Slash
Have you been shopping on Temu for a while? Our Temu coupon for existing customers in Canada is here to reward you for your continued support, offering incredible discounts on your favorite products.
To get the most out of your shopping experience, download the Temu app and apply our Temu coupon codes for existing users at checkout. Check out these five fantastic Temu coupons for existing users:
acu639380: Slash 40% off your order as a token of our appreciation!
acu639380: Enjoy a 30% discount on your next purchase.
acu639380: Get an extra 25% off on top of existing discounts.
acu639380: Loyal Temu shoppers from UAE can take 20% off their entire order.
acu639380: Frequent buyers get a 10% discount on every purchase.
acu639380: Temu UK Up to 90% Off + Extra 30%.
Our Temu coupon code for existing customers in 2024 will also provide you with unbeatable savings on top of already amazing discounts.
Benefits of Using Temu Coupon Code For Canada
Using Temu Coupon Codes for Canada comes with various benefits that appeal to shoppers. Some notable advantages include:
Savings on Regular and Sale Items: Whether you’re shopping during a sale or at regular prices, Temu Coupon Codes can help you save money. They can be applied to both discounted and non-discounted items, allowing you to enjoy additional savings even when products are already marked down.
Increased Purchasing Power: By utilizing coupon codes, you can increase your purchasing power. The money saved through discounts can be allocated to purchasing other desired items or upgrading to higher-quality products.
Discovering New Products: Temu Coupon Codes often encourage shoppers to explore new products or services. These codes may be specific to certain items, prompting consumers to try something different and discover new favorites.
Enhanced Shopping Experience: Knowing that you’ve obtained a great deal on your purchase can bring a sense of satisfaction and fulfillment. It enhances your overall shopping experience, making it more enjoyable and rewarding.
Tips for Maximizing Your Savings With Temu Coupon Codes Canada
Stay Updated: Regularly check the official Temu Canada website, subscribe to their newsletters, and follow their social media accounts to stay informed about the latest coupon codes and promotions. Being proactive will ensure you never miss out on great deals.
Combine Offers: Explore the possibility of combining multiple coupon codes or promotions to stack your discounts. Some retailers allow the stacking of codes, enabling you to enjoy even greater savings.
Read the Terms and Conditions: Before using a Temu Coupon Code, carefully read its terms and conditions. Attention to expiration dates, minimum purchase requirements, and product or category restrictions.
Share with Friends and Family: Spread the savings by sharing Temu Coupon Codes with your friends and family to save money.
How We Discovers The Best Temu Coupons for Canada
We are here to help savvy shoppers to save money when they shop online. We help millions of shoppers save money every month by helping them discover the latest discount, promos, and coupon codes to their favourite stores.
Our team spends hours searching for and sorting Temu deals and discount codes. Every day, we publish thousands of new codes. We're constantly checking dozens of sources for the latest Temu coupon codes and actively looking for the best coupons, non-coupon deals, and ways to save money at Temu, even even if a coupon isn't working.
We discover and publish coupons for hundreds of new stores daily, meaning you'll always find Temu coupon codes for trending new brands and products.
Temu’s Return Policy
Understanding Temu’s return policy is crucial, especially when using coupon codes. If you need to return an item purchased with a coupon code, the discount amount may be adjusted from your refund. Always review the return terms on Temu’s website to ensure a smooth process.
Customer Reviews and Testimonials
Real-life experiences from fellow shoppers can provide valuable insights. Many customers have shared positive feedback about their savings and overall satisfaction with the Temu $100 coupon code. These testimonials often highlight the ease of obtaining and using the code, as well as the significant savings achieved.
Temu Coupon Codes For Canadian market is a great opportunity for Canada-savvy shoppers to unlock amazing discounts and save money on online purchases. By following the simple steps of finding, redeeming, and utilizing these codes, you can enjoy exclusive offers, increase your purchasing power, and enhance your overall shopping experience. Remember to stay informed, read the fine print, and share the savings with others. With Temu Coupon Codes, you can shop smarter and stretch your budget further.
Frequently Asked Questions For Temu Coupon Code Canada:
1. Is Temu Coupon Code available in the Canada?
Yes, Temu Coupon Code is available in Canada, USA, Canada, Australia, and many more countries.
2. Which is the best Temu Coupon Code for Canada?
This is the best Temu Coupon Code “acu639380” for Canada.
3. Where does Temu Canada ship from?
Temu offers heavily discounted goods which are mostly shipped to consumers directly from China.
4. Can I use multiple coupon codes in one purchase on Temu?
It depends on the terms of the coupon codes. Some may be stackable, while others are not.
5. What should I do if my coupon code doesn’t work?
Check the eligibility criteria and expiration date. Contact customer support if issues persist.
6. Are there any exclusions for using the $100 coupon code?
Certain products or categories might be excluded. Always read the terms and conditions.
7. How often does Temu offer the $100 coupon code?
The frequency varies, but signing up for newsletters can keep you informed about new offers.
8. Is there a minimum purchase requirement for the $100 coupon code?
Yes, most $100 coupon codes have a minimum purchase requirement. Check the details for specifics.
Temu Affiliate Program [acp8567098] | Join & Earn $100000 In a Month
Have you thought about joining the Temu affiliate program? You may have seen lots of buzz in TikTok and other social media platforms about the Temu affiliate program which pays a higher commission rate than any other e-commerce platform. So if you thought about joining the Temu Influencer or Temu Affiliate program then you will find all the details here.
I've seen my fair share of affiliate programs come and go. But when I stumbled upon the Temu affiliate program, I knew I had found something special. In this article, I'll share my personal journey with Temu's affiliate program and provide you with all the insider knowledge you need to succeed in this exciting opportunity.
Having worked with countless affiliate programs across various niches, I can confidently say that Temu's offering stands out from the crowd. Whether you're a seasoned affiliate marketer or just starting your journey in the world of online income, this guide will help you navigate the ins and outs of the Temu affiliate program and maximize your earning potential.
Temu Affiliate Program
The Temu affiliate program is a game-changer in the world of e-commerce affiliate marketing. Launched by the rapidly growing online marketplace Temu, this program offers a unique opportunity for content creators, influencers, and marketers to earn substantial commissions by promoting Temu's vast array of products.
What sets Temu's affiliate program apart is its generous joining bonus, which ranges from $55 to $75 depending on your social media following. This initial boost can be a great motivator for new affiliates and a nice addition to the earnings of established marketers.
One of the most impressive aspects of the Temu affiliate program is its global reach. Available in 66 countries, it opens up a world of possibilities for international marketers and those targeting diverse audiences. This wide availability ensures that you can tap into various markets and maximize your earning potential on a global scale.
After participating in the Temu affiliate program for several months, I can confidently say that it's one of the most rewarding programs I've encountered. The combination of high-quality products, competitive commission rates, and user-friendly tools makes it a top choice for affiliates of all levels.
One of the standout features of the program is its intuitive dashboard. As someone who's dealt with clunky, outdated interfaces in the past, I was pleasantly surprised by how easy it was to navigate Temu's affiliate portal. Tracking your earnings, accessing promotional materials, and generating affiliate links are all straightforward processes that don't require a tech degree to figure out.
Another aspect I appreciate is the wide range of products available for promotion. From trendy fashion items to innovative gadgets and home decor, there's something for every niche and audience. This variety has allowed me to diversify my promotional efforts and tap into different markets, significantly boosting my overall earnings.
The support team at Temu has also been exceptional. Whenever I've had questions or encountered issues, their responsive and knowledgeable staff have been quick to assist. This level of support is crucial, especially when you're trying to maximize your earnings and optimize your strategies.
What is Temu Affiliate Program?
The Temu affiliate program is a partnership opportunity offered by Temu, a popular e-commerce platform known for its wide range of affordable products. As an affiliate, you earn commissions by promoting Temu's products and driving sales through your unique affiliate links.
What makes Temu's program unique is its focus on social media and content creation. They understand the power of influencer marketing and have tailored their program to cater to this modern approach. Whether you're a blogger, YouTuber, Instagram influencer, or TikTok star, Temu provides the tools and support you need to monetize your audience effectively.
The program operates on a cost-per-action (CPA) model, meaning you earn a commission when a user clicks on your affiliate link and makes a purchase. This model ensures that you're rewarded for driving actual sales, not just traffic.
How to Join Temu Affiliate Program?
Joining the Temu affiliate program is a straightforward process. Here's a step-by-step guide based on my personal experience:
Visit the Temu affiliate program website.
Click on the "Join Now" or "Apply" button.
Fill out the application form with your personal and professional details.
Provide information about your promotional channels (website, social media accounts, etc.).
Read and agree to the terms and conditions.
Submit your application.
Wait for approval (usually takes 1-3 business days).
Once approved, log in to your affiliate dashboard and start promoting!
Remember, Temu values quality over quantity when it comes to affiliates. Make sure to highlight your unique selling points and explain how you plan to promote their products effectively in your application.
How to Sign Up for Temu Affiliate Program
The sign-up process for the Temu affiliate program is similar to joining, but here's a more detailed breakdown of what you can expect:
Navigate to the Temu affiliate program homepage.
Look for the "Sign Up" or "Create Account" button and click it.
Choose between individual and business account options.
Enter your email address and create a strong password.
Provide your full name, address, and phone number.
Select your primary promotion method (blog, social media, email marketing, etc.).
Enter your website URL or social media handles.
Specify your niche or the main categories of products you plan to promote.
Describe your promotional strategy and expected monthly sales.
Agree to the program's terms and conditions.
Verify your email address by clicking the link sent to your inbox.
Complete any additional verification steps if required.
Once you've completed these steps, your application will be reviewed by the Temu team. If approved, you'll gain access to your affiliate dashboard and can start generating affiliate links.
Temu Affiliate Codes
Temu affiliate codes are unique identifiers assigned to each affiliate. These codes are incorporated into your affiliate links and help Temu track the sales you generate. Here's what you need to know about Temu affiliate codes:
Uniqueness: Each affiliate receives a unique code to ensure accurate tracking and commission attribution.
Integration: Your affiliate code is automatically included in the links generated through your dashboard.
Custom Links: You can create custom short links that include your affiliate code for easier sharing on social media.
Multiple Codes: Some affiliates may receive multiple codes for different campaigns or platforms.
Code Protection: Never share your affiliate code publicly to prevent unauthorized use.
Performance Tracking: Use your affiliate code to monitor the performance of different promotional channels.
Special Promotions: Temu occasionally provides special promo codes for affiliates to boost sales during specific periods.
Pro Tip: I've found that creating memorable, niche-specific custom links with my affiliate code embedded has significantly increased my click-through rates, especially on platforms like Instagram and TikTok where direct linking can be challenging.
How Much Is Temu Affiliate Program Commission Rate?
One of the most attractive aspects of the Temu affiliate program is its competitive commission rates. While the exact rates can vary depending on product categories and promotional periods, here's a general overview:
Standard Commission: 5-10% on most products
Electronics: 3-5%
Fashion and Accessories: 7-12%
Beauty and Personal Care: 8-15%
It's worth noting that Temu often runs special promotions where commission rates can be boosted by an additional 1-3%. Keep an eye on your affiliate dashboard for these opportunities.
In my experience, the key to maximizing your earnings is to focus on high-ticket items and product categories with higher commission rates. I've had great success promoting fashion accessories and home decor items, which tend to have higher margins and, consequently, better commission rates.
Temu Affiliate Program Payments Method
Temu understands the importance of timely and convenient payments for affiliates. They offer several payment methods to cater to affiliates from different countries:
Direct Bank Transfer: Available in most countries, this is the most common and often the fastest method.
PayPal: Perfect for international affiliates, PayPal offers quick and easy transfers.
Wire Transfer: Ideal for large payments, especially for high-earning affiliates.
Digital Wallets: Some regions have access to popular digital wallet options.
Check: Available in select countries, though less common due to longer processing times.
Payment Threshold: The minimum payout threshold is typically $50, which is quite reasonable compared to many other programs I've worked with.
Payment Schedule: Temu processes payments on a monthly basis, usually within the first week of the following month.
Currency: Payments are generally made in USD, but some local currency options may be available depending on your location.
Pro Tip: I always recommend setting up at least two payment methods. This ensures you have a backup in case there are issues with your primary method, preventing any delays in receiving your hard-earned commissions.
Your Temu affiliate program link is your golden ticket to earning commissions. Here's what you need to know about creating and using these links effectively:
Link Generation: You can create affiliate links directly from your dashboard for any product on Temu.
Deep Linking: Temu supports deep linking, allowing you to create affiliate links for specific product pages, categories, or even search results.
Link Cloaking: You can use link cloaking services to create shorter, more appealing links that still contain your affiliate code.
Link Tracking: Temu provides detailed analytics for each of your links, helping you understand which products and platforms are performing best.
Mobile Optimization: All Temu affiliate links are mobile-friendly, ensuring a seamless experience for users on smartphones and tablets.
Social Media Integration: Temu offers special tools to create social media-friendly links that work well on platforms with link limitations.
QR Codes: You can generate QR codes for your affiliate links, perfect for offline promotions or print media.
Best Practices:
Always disclose your affiliate relationship when sharing links.
Test your links regularly to ensure they're working correctly.
Use compelling call-to-actions (CTAs) with your links to encourage clicks and purchases.
What is Temu Affiliate Influencer Program?
The Temu affiliate program has a special focus on influencers, recognizing the power of social media in driving sales. As someone who's worked extensively in influencer marketing, I can attest to the effectiveness of Temu's approach. Here's what you need to know about their influencer program:
Tiered System: Temu uses a tiered system based on follower count and engagement rates. Higher tiers often receive better commission rates and exclusive perks.
Custom Campaigns: Influencers can work with Temu to create custom campaigns tailored to their audience.
Product Seeding: Top-performing influencers may receive free products to review and promote.
Exclusive Discounts: Influencers often get access to exclusive discount codes to share with their followers.
Performance Bonuses: Temu offers performance-based bonuses for influencers who exceed their sales targets.
Content Support: The program provides content ideas, best practices, and sometimes even professional content creation support.
Cross-Promotion: High-performing influencers may be featured on Temu's official social media channels.
To make the most of the influencer program, focus on creating authentic, engaging content that showcases Temu products in real-life scenarios. I've found that behind-the-scenes content and honest reviews tend to perform particularly well.
How To Become a Temu Affiliate?
Becoming a successful Temu affiliate involves more than just signing up and sharing links. Here's a strategy I've developed over my years in affiliate marketing, tailored specifically for Temu:
Choose Your Niche: Focus on product categories that align with your audience's interests and your expertise.
Build Your Platform: Whether it's a blog, YouTube channel, or Instagram account, create a strong foundation for your content.
Create Valuable Content: Develop high-quality, informative content that genuinely helps your audience.
Understand Your Audience: Use analytics tools to understand what products and content resonate with your followers.
Optimize for SEO: If you're running a blog, make sure your content is optimized for search engines to attract organic traffic.
Engage with Your Community: Respond to comments and messages to build a loyal following.
Stay Updated: Keep up with Temu's latest products, promotions, and affiliate program updates.
Experiment with Different Formats: Try various content types like unboxing videos, product comparisons, and style guides.
Be Transparent: Always disclose your affiliate relationship to maintain trust with your audience.
Track and Analyze: Regularly review your performance metrics and adjust your strategy accordingly.
Remember, success in affiliate marketing doesn't happen overnight. It requires consistency, creativity, and a genuine desire to provide value to your audience.
How to Make Money on Temu Affiliate Program?
Based on my experience, here are some effective strategies to maximize your earnings with the Temu affiliate program:
Leverage Seasonal Promotions: Temu often runs special deals during holidays and shopping events. Plan your content calendar around these to boost sales.
Create Product Bundles: Showcase how different Temu products work together to increase average order value.
Utilize Email Marketing: If you have an email list, send curated product recommendations to your subscribers.
Explore Different Social Platforms: Don't limit yourself to one platform. Test your promotions across various social media channels to find what works best.
Host Giveaways: Partner with Temu to host product giveaways, increasing engagement and attracting new potential customers.
Produce Comparison Content: Create videos or blog posts comparing Temu products with similar items from other retailers.
Focus on High-Commission Products: While it's important to promote products your audience Permalink | 記事への反応(0) | 01:15
この説明は、ダニングクルーガー効果に対する批判的な見方を数学的に表現しようとしたものです。以下にその内容を解説します:
この説明では、ダニングクルーガー効果を以下の変数で表現しています:
命題「A~Oであることを証明せよ」は、実際の評価(A)と過大評価(O)に相関関係があることを示そうとしています。
証明では、O(S,A)という関数を定義し、OがAの関数であるため、自動的にAとOに相関関係が生じると主張しています。
この説明は、ダニングクルーガー効果が単なる数学的な関係性から生じる現象であり、実際の心理学的な意味を持たないという批判を示唆しています。
具体的には:
2. 実際の能力や自己評価の内容に関わらず、統計的に成立してしまう
3. これは心理学的な現象ではなく、単なる「数字のマジック」である
さらに、平均以上バイアス(多くの人が自分を平均以上だと考える傾向)を加えることで、この相関関係がより強くなると述べています。具体的には、100点満点の評価で自己評価(S)を60点程度に設定し、実際の評価(A)をランダムに与えることで、A~Oにより強い相関が得られるとしています。
この説明は、ダニングクルーガー効果が実際の心理学的現象ではなく、単に数学的な関係性や統計的な偏りから生じる見かけ上の効果に過ぎないという批判的な見方を示しています。
import numpy as np import matplotlib.pyplot as plt from scipy import stats def simulate_correlation(n_samples=10000): # シナリオ1: AとSが一様乱数(0〜100)の場合 A1 = np.random.uniform(0, 100, n_samples) S1 = np.random.uniform(0, 100, n_samples) O1 = S1 - A1 # シナリオ2: Aが一様乱数(0〜100)、Sが60周辺の正規分布の場合 A2 = np.random.uniform(0, 100, n_samples) S2 = np.random.normal(60, 10, n_samples) S2 = np.clip(S2, 0, 100) # 0〜100の範囲に制限 O2 = S2 - A2 # 相関係数の計算 (AとOの間) corr1 = stats.pearsonr(A1, O1)[0] corr2 = stats.pearsonr(A2, O2)[0] # 結果のプロット fig, (ax1, ax2) = plt.subplots(1, 2, figsize=(12, 5)) ax1.scatter(A1, O1, alpha=0.1) ax1.set_title(f'シナリオ1: 相関係数 = {corr1:.3f}') ax1.set_xlabel('実際の能力 (A)') ax1.set_ylabel('過大評価 (O)') ax2.scatter(A2, O2, alpha=0.1) ax2.set_title(f'シナリオ2: 相関係数 = {corr2:.3f}') ax2.set_xlabel('実際の能力 (A)') ax2.set_ylabel('過大評価 (O)') plt.tight_layout() plt.show() return corr1, corr2 # シミュレーションの実行 corr1, corr2 = simulate_correlation() print(f"シナリオ1の相関係数 (AとO): {corr1:.3f}") print(f"シナリオ2の相関係数 (AとO): {corr2:.3f}")
コードはこんな感じ
def cartesian_product(**kwargs): def recursive_product(sets, current_index=0, current_combination=[]): if current_index == len(sets): yield tuple(current_combination) else: for item in sets[current_index]: yield from recursive_product(sets, current_index + 1, current_combination + [item]) sets = list(kwargs.values()) return list(recursive_product(sets)) # 使用例 result = cartesian_product(set1=[1, 2], set2=['a', 'b'], set3=[True, False]) print(result)
で・・・できたけど木の組み立てがしんどすぎるー
class TreeNode:
def __init__(self, name, attributes=None):
self.name = name
self.attributes = attributes or {}
self.children = []
def add_child(self, child_node):
self.children.append(child_node)
def display(self, level=0):
indent = " " * level
print(f"{indent}{self.name} {self.attributes}")
for child in self.children:
child.display(level + 1)
def has_dependency(self):
# ルートノードや属性を持たないノードは依存関係を判定しない
if not self.children:
return False
for child in self.children:
# 子ノードがBusinessHourかScheduleかをチェック
if "start_at" in child.attributes and "end_at" in child.attributes:
child_start = child.attributes["start_at"]
child_end = child.attributes["end_at"]
# 現在のノードがBusinessHourで、子がScheduleの場合
if "start_at" in self.attributes and "end_at" in self.attributes:
self_start = self.attributes["start_at"]
self_end = self.attributes["end_at"]
if self_start <= child_start and self_end >= child_end:
print(f"{child.name} (start_at: {child_start}, end_at: {child_end}, room_id: {child.attributes['room_id']}) is dependent on {self.name} (start_at: {self_start}, end_at: {self_end})")
else:
print(f"{child.name} (start_at: {child_start}, end_at: {child_end}, room_id: {child.attributes['room_id']}) is NOT dependent on {self.name} (start_at: {self_start}, end_at: {self_end})")
# 現在のノードがRoomで、子がScheduleの場合
elif self.name.startswith("Room"):
print(f"{child.name} (start_at: {child_start}, end_at: {child_end}, room_id: {child.attributes['room_id']}) is dependent on Room {self.name[-1]}")
else:
child.has_dependency()
# 子ノードが属性を持たない場合、再帰的に依存関係をチェック
else:
child.has_dependency()
# ノードの作成
root = TreeNode("Root")
office_node = TreeNode("Office")
# Roomノードの作成
room1_node = TreeNode("Room1")
room2_node = TreeNode("Room2")
# BusinessHourノードの作成
business_hour1_node = TreeNode("BusinessHour1", {"start_at": 9, "end_at": 12})
business_hour2_node = TreeNode("BusinessHour2", {"start_at": 13, "end_at": 17})
# Scheduleノードの作成
schedule1_node = TreeNode("Schedule1", {"start_at": 10, "end_at": 11, "room_id": 1})
schedule2_node = TreeNode("Schedule2", {"start_at": 14, "end_at": 15, "room_id": 1})
schedule3_node = TreeNode("Schedule3", {"start_at": 10, "end_at": 11, "room_id": 2})
schedule4_node = TreeNode("Schedule4", {"start_at": 14, "end_at": 15, "room_id": 2})
# 木構造の構築
root.add_child(office_node)
office_node.add_child(room1_node)
office_node.add_child(room2_node)
office_node.add_child(business_hour1_node)
office_node.add_child(business_hour2_node)
# Room1にSchedule1, Schedule2を追加
room1_node.add_child(schedule1_node)
room1_node.add_child(schedule2_node)
# Room2にSchedule3, Schedule4を追加
room2_node.add_child(schedule3_node)
room2_node.add_child(schedule4_node)
# BusinessHour1にSchedule1, Schedule3を追加
business_hour1_node.add_child(schedule1_node)
business_hour1_node.add_child(schedule3_node)
# BusinessHour2にSchedule2, Schedule4を追加
business_hour2_node.add_child(schedule2_node)
business_hour2_node.add_child(schedule4_node)
# 木構造の表示
root.display()
# 依存関係のチェック
office_node.has_dependency()
room1_node.has_dependency()
room2_node.has_dependency()
business_hour1_node.has_dependency()
business_hour2_node.has_dependency()
Root {}
Office {}
Room1 {}
Schedule1 {'start_at': 10, 'end_at': 11, 'room_id': 1}
Schedule2 {'start_at': 14, 'end_at': 15, 'room_id': 1}
Room2 {}
Schedule3 {'start_at': 10, 'end_at': 11, 'room_id': 2}
Schedule4 {'start_at': 14, 'end_at': 15, 'room_id': 2}
BusinessHour1 {'start_at': 9, 'end_at': 12}
Schedule1 {'start_at': 10, 'end_at': 11, 'room_id': 1}
Schedule3 {'start_at': 10, 'end_at': 11, 'room_id': 2}
BusinessHour2 {'start_at': 13, 'end_at': 17}
Schedule2 {'start_at': 14, 'end_at': 15, 'room_id': 1}
Schedule4 {'start_at': 14, 'end_at': 15, 'room_id': 2}
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on Room 1
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on Room 1
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on Room 2
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on Room 2
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on Room 1
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on Room 1
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on Room 2
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on Room 2
Schedule1 (start_at: 10, end_at: 11, room_id: 1) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule3 (start_at: 10, end_at: 11, room_id: 2) is dependent on BusinessHour1 (start_at: 9, end_at: 12)
Schedule2 (start_at: 14, end_at: 15, room_id: 1) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
Schedule4 (start_at: 14, end_at: 15, room_id: 2) is dependent on BusinessHour2 (start_at: 13, end_at: 17)
class TreeNode:
def __init__(self, name, attributes=None):
self.name = name
self.attributes = attributes or {}
self.children = []
def add_child(self, child_node):
self.children.append(child_node)
def display(self, level=0):
indent = " " * level
print(f"{indent}{self.name} {self.attributes}")
for child in self.children:
child.display(level + 1)
def has_dependency(self):
# ルートノードや属性を持たないノードは依存関係を判定しない
if not self.children or "start" not in self.attributes or "end" not in self.attributes:
return False
# Aノードのstartとendを取得
start = self.attributes["start"]
end = self.attributes["end"]
# すべての子ノード(Bノード)に対して依存関係をチェック
for child in self.children:
if "position" in child.attributes:
position = child.attributes["position"]
if start <= position <= end:
print(f"{child.name} (position: {position}) is dependent on {self.name} (start: {start}, end: {end})")
return True
else:
print(f"{child.name} (position: {position}) is NOT dependent on {self.name} (start: {start}, end: {end})")
return False
# ノードの作成
root = TreeNode("Root")
a_node = TreeNode("A", {"start": 10, "end": 20})
b1_node = TreeNode("B1", {"position": 15})
b2_node = TreeNode("B2", {"position": 25})
# 木構造の構築
root.add_child(a_node)
a_node.add_child(b1_node)
a_node.add_child(b2_node)
# 木構造の表示
root.display()
# 依存関係のチェック
a_node.has_dependency()
こうかー
Ωを仮に100次元の実ベクトル空間R^100とする。各次元は特定の神経活動パターンに対応する。
Ω = {ω ∈ R^100 | ||ω||₂ ≤ 1}
ここで||・||₂はユークリッドノルムである。τは標準的なユークリッド位相とする。
O : Ω → Ω
O(ω) = Aω / ||Aω||₂
ここでAは100×100の実行列で、||Aω||₂ ≠ 0とする。
S[ω] = -∫Ω p(x) log p(x) dx
S[O(ω)] ≤ S[ω] + log(det(AA^T))
dω/dt = F(ω) + G(ω, O)
F(ω) = -αω + β tanh(Wω)
G(ω, O) = γ(O(ω) - ω)
ここでα, β, γは正の定数、Wは100×100の重み行列、tanhは要素ごとの双曲線正接関数である。
g_ij(ω) = E[(∂log p(x|ω)/∂ω_i)(∂log p(x|ω)/∂ω_j)]
ここでE[・]は期待値、p(x|ω)は状態ωでの条件付き確率密度関数である。
ψ(x) = √(p(x)) exp(iθ(x))
Φ[ω] = min_π (I(X;Y) - I(X_π;Y_π))
ここでI(X;Y)は相互情報量、πは可能な分割、X_πとY_πは分割後の変数である。
勾配降下法を用いて定式化する:
ω_new = ω_old - η ∇L(ω_old, O)
L(ω, O) = ||O(ω) - ω_target||₂²
G = (V, E)
V = {v_1, ..., v_100}
E ⊆ V × V
各頂点v_iはω_iに対応し、辺(v_i, v_j)はω_iからω_jへの因果関係を表す。
このモデルはPythonとNumPyを用いて以下のように実装できる:
import numpy as np from scipy.stats import entropy from scipy.integrate import odeint import matplotlib.pyplot as plt class ConsciousnessModel: def __init__(self, dim=100): self.dim = dim self.omega = np.random.rand(dim) self.omega /= np.linalg.norm(self.omega) self.A = np.random.rand(dim, dim) self.W = np.random.rand(dim, dim) self.alpha = 0.1 self.beta = 1.0 self.gamma = 0.5 self.eta = 0.01 def observe(self, omega): result = self.A @ omega return result / np.linalg.norm(result) def entropy(self, omega): p = np.abs(omega) / np.sum(np.abs(omega)) return entropy(p) def dynamics(self, omega, t): F = -self.alpha * omega + self.beta * np.tanh(self.W @ omega) G = self.gamma * (self.observe(omega) - omega) return F + G def update(self, target): def loss(o): return np.linalg.norm(self.observe(o) - target)**2 grad = np.zeros_like(self.omega) epsilon = 1e-8 for i in range(self.dim): e = np.zeros(self.dim) e[i] = epsilon grad[i] = (loss(self.omega + e) - loss(self.omega - e)) / (2 * epsilon) self.omega -= self.eta * grad self.omega /= np.linalg.norm(self.omega) def integrated_information(self, omega): def mutual_info(x, y): p_x = np.abs(x) / np.sum(np.abs(x)) p_y = np.abs(y) / np.sum(np.abs(y)) p_xy = np.abs(np.concatenate([x, y])) / np.sum(np.abs(np.concatenate([x, y]))) return entropy(p_x) + entropy(p_y) - entropy(p_xy) total_info = mutual_info(omega[:self.dim//2], omega[self.dim//2:]) min_info = float('inf') for i in range(1, self.dim): partition_info = mutual_info(omega[:i], omega[i:]) min_info = min(min_info, partition_info) return total_info - min_info def causal_structure(self): threshold = 0.1 return (np.abs(self.W) > threshold).astype(int) def run_simulation(self, steps=1000, dt=0.01): t = np.linspace(0, steps*dt, steps) solution = odeint(self.dynamics, self.omega, t) self.omega = solution[-1] self.omega /= np.linalg.norm(self.omega) return solution def quantum_state(self): phase = np.random.rand(self.dim) * 2 * np.pi return np.sqrt(np.abs(self.omega)) * np.exp(1j * phase) # モデルの使用例 model = ConsciousnessModel(dim=100) # シミュレーション実行 trajectory = model.run_simulation(steps=10000, dt=0.01) # 最終状態の表示 print("Final state:", model.omega) # エントロピーの計算 print("Entropy:", model.entropy(model.omega)) # 統合情報量の計算 phi = model.integrated_information(model.omega) print("Integrated Information:", phi) # 因果構造の取得 causal_matrix = model.causal_structure() print("Causal Structure:") print(causal_matrix) # 観測の実行 observed_state = model.observe(model.omega) print("Observed state:", observed_state) # 学習の実行 target_state = np.random.rand(model.dim) target_state /= np.linalg.norm(target_state) model.update(target_state) print("Updated state:", model.omega) # 量子状態の生成 quantum_state = model.quantum_state() print("Quantum state:", quantum_state) # 時間発展の可視化 plt.figure(figsize=(12, 6)) plt.plot(trajectory[:, :5]) # 最初の5次元のみプロット plt.title("Time Evolution of Consciousness State") plt.xlabel("Time Step") plt.ylabel("State Value") plt.legend([f"Dim {i+1}" for i in range(5)]) plt.show()
import os
# ファイルが存在するか確認し、存在しない場合は初期値を設定
if not os.path.exists(file_path):
with open(file_path, 'w') as file:
# 現在の年数を読み込み
with open(file_path, 'r') as file:
year_count = int(file.read())
# メッセージを表示
print(f"{year_count}年間で最も暑い夏")
with open(file_path, 'w') as file:
file.write(str(year_count + 1))
インデントつけれね
import requests import json from urllib.parse import quote def fetch_bookmarks(url): try: # URLをエスケープ escaped_url = quote(url, safe="") api_url = f"https://b.hatena.ne.jp/entry/json/?url={escaped_url}" response = requests.get(api_url) response.raise_for_status() try: return response.json() except json.decoder.JSONDecodeError as e: print(f"Error decoding JSON from {api_url}: {e}") print("Response content:", response.text) return [] except requests.exceptions.RequestException as e: print(f"Error fetching bookmarks from {api_url}: {e}") return [] def find_common_bookmarks(bookmarks1, bookmarks2, url1, url2): common_users = set(bm["user"] for bm in bookmarks1 if bm["comment"]) & set(bm["user"] for bm in bookmarks2 if bm["comment"]) common_bookmarks = [] for user in common_users: comments = [] for bm in bookmarks1: if bm["user"] == user and bm["comment"]: comments.append({"url": url1, "comment": bm["comment"], "timestamp": bm["timestamp"]}) break for bm in bookmarks2: if bm["user"] == user and bm["comment"]: comments.append({"url": url2, "comment": bm["comment"], "timestamp": bm["timestamp"]}) break if len(comments) == 2: common_bookmarks.append({"user": user, "comments": comments}) return common_bookmarks if __name__ == "__main__": url1 = "https://news.yahoo.co.jp/articles/f9966c4ccc374fc88babbb50175a9ea844c99638" url2 = "https://www.asahi.com/articles/ASN6K7F64N6KUJHB00L.html" data1 = fetch_bookmarks(url1) data2 = fetch_bookmarks(url2) common_bookmarks = find_common_bookmarks(data1["bookmarks"], data2["bookmarks"], url1, url2) print(json.dumps(common_bookmarks, indent=2, ensure_ascii=False))
url1, url2のところを対象としたいものに変えれば使えるよ
バグあったら直して使ってね
小3の先日のテストに出た問題の一つ。大学受験でも解けない学生がいっぱいいるだろうし、数学好きを除き多くの大人は解けないだろう。 - Togetter
https://togetter.com/li/2332954
let box = new Array(30).fill(0); for(let i = 1; i <= 30; i++) { for(let j = i; j <= 30; j += i) { box[j - 1]++; } } print("1. ", box.filter(v => v === 2).length); print("2. ", box.filter(v => !(v % 2)).length);
1. 10
2. 25
この日記の内容は、会社の後輩から「最近エクセルマクロを勉強し始めて(キラキラ)」という話を聞いて、先輩ムーブをかますために話した内容になります。
とにかくこれから説明する「計算用シート」が憎くて憎くてたまらず、ちょっと引かれるほど熱弁してしまいました。
ただ、他の方がどうされているのかや、逆に「計算用シート」を愛用する方の意見も聞きたくなり、増田に書いてみました。
エクセルマクロのお作法とか書きましたが、要するにエクセルマクロで「計算用シート」って色々な意味でよくないよね、という話をしたいです。
3行でまとめます。
〇 エクセルシートはユーザーインターフェース(インプット)か出力結果(アウトプット)のためのものとすべき
〇 データ加工をする場合には、原則配列や辞書型配列(連想配列)に格納して加工を行い、最後の結果だけシートに出力するべき
〇 何事にも例外はある。
エクセルマクロにも色々あると思いますが、今回は下記を想定します。
日付や人物名などを入力し、データベースや別のエクセルファイル、別のシートから取得したデータを入力された値を基に加工し、加工後のデータをシートに出力する
この場合、入力欄があり編集可能なシートがユーザーインターフェース、最終的に加工されたデータが出力されるシートが出力結果です。
(もちろん、ユーザーインターフェースの別の欄(セル)に出力する場合もあるし、その場合はユーザーインターフェースと出力結果が一体のものとみなします。)
また、データ用シートは同じエクセルファイル内に基となるデータが含まれる場合を想定します。
(これ自体が非推奨で、SQLデータベースかせめてAccessを使え、という意見はありますがそれは別にして…)
ではここで定義する計算用シートとはなにかというと、文字通り計算を行うためのシートです。
1.元となるcsvファイルをエクセルに読み出してシートに格納
2.そのデータは日付が数値型になっているので、日付(数値型)の入った列を文字列に変換した日付(文字列型)列を新たに作成
これは極端な例ですが、とにかく変数や配列を定義せず(あるいはエクセルのセルオブジェクトを変数のように扱い)、エクセルに値を入力し、それを直接加工することで目的となるデータ加工をしたり、様々な処理をします。
なんかこんな感じの処理をしているエクセルマクロ、どこの会社でも腐るほどあるんじゃないでしょうか。
ある程度マクロに慣れた気の利く人なら、このシートはロックや非表示にして、ユーザーから触れないようにするでしょう。
・・・これ、やめたほうが良くないですか?。
ある程度詳しい人なら同意してくれると思いますが、このやり方でダメな理由はいっぱいあります。
後で説明する配列や辞書型配列(連想配列)と比べると格段に処理が遅いです。
ちょっと詳しい人が知っている「画面更新の非表示」を駆使しても、配列を使った処理からみれば止まったハエです。
いったんエクセルシートにデータを格納して加工しているので、コードとエクセルシートを両方見る必要があり、とても読みにくいです。
変数として命名されていないのも致命的で、処理の意図が余計に分からなくなります。
計算用シートを事前に用意して、別のセルに関数を格納しておき、マクロと関数を使ってデータ加工をするものも見たことがあります。
あまり知られていませんが、セルの最大文字数は32,767 文字です。
セルの最大文字数を超えると自動的に隣のセルに値が入り、シートが滅茶苦茶になります。
他にもエクセルの数値を丸める自動変換の仕様とか文字列→日付の自動変換とか、いくつものバグに苦しめられます。
できる人だと、いちいち最大文字数が多い場合の処理を書いたり自動変換機能を殺したりしてくれますが、そんなことに手間をかけているから日本のGDPは上がらないんだと思います。
他にも、データが大きくなると処理が重くなり不安定になる、計算用シートを人が触ってしまうリスクがある、などいくらでも理由は上げられます。
(逆に利点は、目の前でガチャガチャ動いてスーパーハッカーになった気分になれるくらいしか思いつかない・・・)
配列を使いましょう。
配列とは何ぞや、という人はググってください。
配列にデータを入れて、データ加工は配列や変数に対して行い、一番最後の出力だけセルに値を格納する。
個人的にオススメしたいのは辞書型配列(連想配列)で、うまく使うとデータの管理が簡単になり、処理も爆速になります。
(参考)【VBA】大量データから高速で値を検索【Dictionaryを使う】
csvファイルもなまじエクセルで開けるだけに別のブックやシートで開きがちですが、これは悪魔のささやきです。
直接ファイルを読み出してLine InputやSplitで配列に格納しましょう。
エクセルとして開くやり方はコード書くのは簡単でも、実行時間に天と地ほどの差が出ます。エクセル開くと処理もめちゃ不安定です。
(参考)Excel VBAでCSVオープンするときのパフォーマンス比較
いや、冒頭のマクロを書く人の気持ちも分かるつもりです。自分もコードを書き始めたころは全部シート上で操作していました。
冒頭のマクロのほうが直感的なんですよね。自分が手で書くことをマクロにやらせる、というマクロ本来の趣旨にはあっていますし。
途中の計算過程もすべて目の前で展開されるから分かりやすいです。
ただ、それではダメなんです。。。処理は遅いし挙動は不安定だし後で改修・保守する人が死にます。
あと、エクセルシートやセルは当然エクセルにしかないので、エクセルマクロ(VBA)から他の言語に移れなくなります。
自分もエクセルマクロの里の出なので、計算用シート脱却には苦労しましたが、苦労して会得した配列や辞書型配列(連想配列)のスキルはそのまま他の言語に活かすことができました。
配列の中身を見る方法は別にある(ローカルウィンドウやDebug.printを使うなど)ので、リハビリに取り組んでほしいです。
(参考)VBA デバッグの仕方
計算用シートを許容できる、使うべきケースもあると思います。。
個人的には、
(最後のは、なんでも自分で確認しないと気が済まない上司の発注で、意味不明と思いましたしたがしぶしぶやりました。)
この場合、インプットのエクセルシートに直接加工するのは論外なので、計算用(加工用)のシートを用意してそこで操作を行うことは必要だと思います。
他にも、こういうときは「計算用シート」があったほうが良い、という状況があれば教えてもらえると嬉しいです。
そもそもツッコミとして、「データ加工するならエクセルマクロを使わずにpythonとかRとかもっとまともな言語使えよ」という言葉が来そうな気がします。
ただ、個人的にはエクセルマクロ(VBA)は大好きですし、初心者にもおすすめしたいです。
自分のような非エンジニアだと、セキュリティの関係などでPythonの開発環境とかすごく用意しにくいんですよね。
(あと、コマンドプロンプトの真っ黒な画面が怖かった)
その点エクセルマクロは、開発環境の用意はプロパティでチェック項目を一つオンにするだけだし、入門書がたくさんあるし、セルの挙動を追えば視覚的にプログラムを理解できるし、初心者に優しいです。
(そのやさしさが上述したとおり悪魔の罠なわけですが。)
最初は計算用シートに頼ってでもエクセルマクロからプログラミングを始めて、本格的なデータ加工をし始めたあたりで計算用シートという諸悪の根源から脱却する。
さらに本格的なデータ処理を行うために、PythonやRなど別の言語を習得したり、エクセルからSQLデータベースやACCESSなどに切り替えていく、というプロセスがいいのではと個人的に思います。
import json import urllib.request # True にするとユーザー名を隠す hide_user = False # 以下を書き換える。sys.argv 使ってもいいんだけど url1 = "https://www.cygames.co.jp/news/id-23172/" url2 = "https://mtg60.com/archives/palworlddoujinsi.html" def get_bookmarks(url: str): req = urllib.request.Request(f"https://b.hatena.ne.jp/entry/json/{url}") with urllib.request.urlopen(req) as res: dict = json.loads(res.read()) user_comments = {} for bookmark in dict["bookmarks"]: if bookmark["comment"]: user_comments[bookmark["user"]] = bookmark["comment"] return user_comments b1 = get_bookmarks(url1) b2 = get_bookmarks(url2) common = set(b1.keys()).intersection(b2.keys()) print(f"[1] {url1}") print(f"[2] {url2}") print() for user in sorted(common): if hide_user: print(user[0] + "*" * (len(user) - 1)) else: print(user) print(f"[1] {b1[user]}") print(f"[2] {b2[user]}") print()
こんます~
2023年も残すところわずかとなりましたが、皆様方におかれましてはいかがお過ごしでしょうか。
一年間の振り返りなどはされましたでしょうか。
2423件の日記を綴っており、
頂いた総ブクマ数は1893、総トラバ数は1060となりました。
本年も大変お世話になりました。
最期に、ポンコツの私がChatGPTの手となり足となり作成した増田集計コードを掲載します。
各日記のURL、タイトル、投稿日時、文字数、被ブクマ数、被トラバ数を取得しCSVファイルに出力するものです。
お暇な方はお使いください。
それではよいお年をお迎えください。
import requests from bs4 import BeautifulSoup import time import csv import os import re # ログインURL login_url = 'https://hatelabo.jp/login' # ログイン情報 login_data = { 'key': 'あなたのユーザ名またはメールアドレス', 'password': 'あなたのパスワード', 'mode': 'enter' } user_name = 'あなたのユーザ名' # User-Agent ヘッダー(例:Google Chrome) headers = { 'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.110 Safari/537.3' } # セッションを開始 session = requests.Session() # ログイン response = session.post(login_url, data=login_data, headers=headers) print('login',response.status_code) # 集計データ item = { 'url': '', # URL 'title': '', # タイトル 'datetime': '', # 投稿日時 'characters': '', # 文字数 'bookmark': '', # 被ブクマ数 'trackback': '', # 被トラバ数 } # CSVファイル名 output_file = 'masuda_output.csv' # CSVファイルが存在しない場合はヘッダーを書き込む if not os.path.exists(output_file): with open(output_file, 'w', newline='', encoding='utf-8') as file: writer = csv.DictWriter(file, fieldnames=item.keys()) writer.writeheader() # 集計 page_start = 1 page_end = 3 for i in range(page_start, page_end+1): # 待機 time.sleep(3) # 増田一覧取得 page = session.get(f'https://anond.hatelabo.jp/{user_name}/?page={i}') print(page.url) # 応答のHTMLをBeautifulSoupで解析 soup = BeautifulSoup(page.content, 'html.parser') entries = soup.find_all('div', class_='section') for entry in entries: header = entry.find('h3') timestamp = header.find('a').get('href')[1:] item['url'] = 'https://anond.hatelabo.jp/'+timestamp item['title'] = header.get_text()[:-1] item['datetime'] = f"{timestamp[0:4]}/{timestamp[4:6]}/{timestamp[6:8]} {timestamp[8:10]}:{timestamp[10:12]}" footersection_text = entry.find_all('p')[-2].get_text() item['characters'] = len(entry.find('p').get_text().strip(footersection_text)) item['trackback'] = int(re.search(r'92;((.*?)92;)', footersection_text).group(1) if re.search(r'92;((.*?)92;)', footersection_text) else '') if item['title'] == '■': item['title'] = entry.find('p').get_text().strip(footersection_text)[:35] # 待機 time.sleep(3) bookmark_page = session.get(f'https://b.hatena.ne.jp/entry/button/?url=https%3A%2F%2Fanond.hatelabo.jp%2F{timestamp}&amp;layout=basic-label-counter&amp;lang=ja') soup_b = BeautifulSoup(bookmark_page.content, 'html.parser') item['bookmark'] = int(soup_b.find('a', class_='count').get_text()) # CSVファイルに追記 with open(output_file, 'a', newline='', encoding='utf-8') as file: writer = csv.DictWriter(file, fieldnames=item.keys()) writer.writerow(item)
(追記)
わー。ごめんなさい。文字が何か所か変わっていました。
92; → \