My worldbuilding goal is to create a logistical system for my ancient human civilization. Generally, this civilization needs to urgently deliver certain goods in bulk to the continental center, frequently return to retrieve more, and then head back to the center, creating a continuous cycle. Since land transportation and a lack of modern technology massively hamper efficiency, I decided on maritime shipping and designed this hydrological system to justify their ancient logistics. Consider the following: Massive, circular continent Large inland sea at the center Emanating from the inland sea ar
Kierowca z Glasgow omal nie zderzył się z autem, które zajechało mu drogę. Nagranie z kamery oddał policji. Zarzut usłyszał jednak on: "obraźliwe zachowanie" na tle rasowym, bo w aucie mruknął obelgę pod adresem drugiego kierowcy - okna były zamknięte. Szukał sprawiedliwości, a sam trafił przed sąd.
I want to time how long a function takes to execute by using a decorator. My issue is that I want the decorator to return the time value it measured along with the return value of the function. How can I achieve this? Another thing is that I expect the time taken to execute the function to be less than 1 second for small input values. However it shows more time than that. What could cause this? def measure_time(func): def wrapper(): import timeit time = timeit.timeit('func()', globals={'func':func}, number=1) return time return wrapper @measure_time def get_num(): listt = [] for i in range(n+1
I want to time how long a function takes to execute by using a decorator. My issue is that I want to decorator to return the time value it measured along with the return value of the function. How can I achieve this? Another thing is that I expect the time taken to execute the function to be less than 1 second for small input values. However it shows more time than that. What could cause this? def measure_time(func): def wrapper(): import timeit time = timeit.timeit('func()',globals={'func':func},number=1) return time return wrapper n=int(input('Please enter your number: ')) @measure_time def
sorry I am a little bit new to python and I have a problem here. at the same time I want to return my list(listt) not print and print it outside the functions before the execution time being returned. I can not kind of figure out how the decorator works and also how to print listt outside the function as I don't want the time of printing be calculated and listt is now local. another thing is I feel like the time for small numbers should be below 1 second but now it returns more than that. Could you please help me fix this problem? I am sorry for this noobish question def measure_time(func): de
미국 10월 생산자물가지수(PPI) 가 전년 동월 대비 6.5% 상승함 전년 동월 대비 상승률은 2022년 11월 이후 최고치를 기록함 예상치 6.6%를 밑돌았지만, 이전 수치인 6.3%보다 높아짐 전월 대비 PPI 상승률은 0.3% 로, 예상치 0.4%를 밑돎 9월 전월 대비 상승률은 기존 1.3%에서 1.4%로 상향 수정됨 10월 생산자물가와 9월 수정치 전년 동월 대비 상승률은 6.3%에서 6.5%로 높아져 2022년 11월 이후 최고치를 기록했으나, 예상치 6.6%에는 못 미침 전월 대비 상승률은 0.3%로 예상치 0.4%보다 낮았으며, 9월 수치는 1.3%에서 1.4%로 상향 …
git archive で作成した zip ファイルを AWS CodePipeline のビルドのソースとして使う場合はDOSタイムスタンプをUTCで作成すべき 要約 zip ファイルには DOS タイムスタンプと拡張タイムスタンプがある DOS タイムスタンプはタイムゾーン無しのタイムスタンプ 拡張タイムスタンプはUTCで格納されたタイムスタンプ AWS C...
Сегодня – обещанная история о том, как я получил повышение благодаря книге. Ситуация, скорее, забавная – о пользе совпадения интересов с начальником. Слышали, наверное, шуточные рекомендации – увлекайся тем же, чем занимаются вышестоящие, и общность увлечений может открыть новые пути развития карьеры. У меня получилось почти так же, но совпадение вышло случайным. Работал я ИТ-директором (это главный над программистами и системными администраторами). Всё было хорошо, но вдруг сменился директор предприятия – мой непосредственный руководитель. С предыдущим начальником у меня всё было хорошо – я н
Представьте: под новый год ваши родители принесли с работы подарочный набор. В нём вас ждёт один-единственный киндер-сюрприз, штук десять нормальных конфет и целая россыпь “Буревестников”, “Ромашек”, “Цитронов” и “Ласточек”. Этот опыт внезапно роднит вас с владельцами независимых кинотеатров в США тридцатых годов. В этом материале я расскажу о судебном процессе, который продлился 10 лет и определил современный облик киноиндустрии. Читать далее
Policjanci z CBZC zatrzymali troje obywateli Nigerii w wieku od 29 do 32 lat, podejrzanych o oszustwa metodą BEC (przejmowanie firmowej poczty i podmiana numerów rachunków bankowych w korespondencji z kontrahentami) oszukiwali firmy w Australii, Słowacji, Portugalii, USA i Niemczech.
Дорогой читатель! Сегодня мы разберёмся, как устроены .deb-пакеты в Linux, и убедимся, что никакой магии в них нет. Превратим небольшой C++ - сервер в устанавливаемый пакет, добавим конфиг и systemd-юнит, разберёмся с зависимостями и обновлениями. Затем автоматизируем сборку и опубликуем пакет в своём APT-репозитории - чтобы устанавливать его одной командой. Интерактивный учебник - Открыть учебник Материалы статьи - Код и примеры на GitHub А ловко ты это придумал....
When using tokenize to remove a line from source code, untokenize adds back in blank lines for all those lines which I have removed: import tokenize as t from io import StringIO source_code = """a = 'one' b = 'two' c = 'three' d = 'four' e = 'five' """ modi_toks = [] toks = t.generate_tokens(StringIO(source_code).readline) for tok in toks: if not ( 1 < tok.start[0] < 4): modi_toks.append(tok) modi_source = t.untokenize(modi_toks) print(f"{source_code=}") print(modi_source) I have tried writing only (tok.type, tok.string) to the new tokens list but that then causes the white space between the '
When using tokenize to remove a line from source code untokenize adds back in blank lines for all those lines which I have removed, see example: import tokenize as t from io import StringIO source_code = """a = 'one' b = 'two' c = 'three' d = 'four' e = 'five' """ modi_toks = [] toks = t.generate_tokens(StringIO(source_code).readline) for tok in toks: if not ( 1 < tok.start[0] < 4): modi_toks.append(tok) modi_source = t.untokenize(modi_toks) print(f"{source_code=}") print(modi_source) I have tried writing only (tok.type, tok.string) to the new tokens list but that then causes the white space b
W hotelu przy parku rozrywki Phantasialand w niemieckim Brühl instalacja dozująca podała do basenu za dużo chloru. System wykrył problem i wysłał alarm e-mailem, ale wiadomość nie dotarła, bo trwała akurat awaria usługi Exchange w chmurze Microsoftu. Cztery osoby trafiły do szpitala.
I'm building an Android app that sets the currently playing track's album art as the **lock screen** wallpaper (minSdk 26, targetSdk 36). Each time the track changes, it sets a new static bitmap on the lock screen only. On HyperOS and ColorOS devices, the lock screen customisation (clock style, lock screen widgets, depth effect) resets to the phone maker's default whenever my app changes the wallpaper. Setting the same image by hand through the system wallpaper picker keeps the customisation. Device(s) where this happens: - REDMI Note 15 Pro 5G (25080RABDG), Android 15 (API 35), HyperOS 2.0 (O
Android 앱 몇 개를 혼자 만들면서 클로드 코드에 구현과 테스트를 맡겨 왔습니다. 그동안 "통과"라는 보고가 실제로는 아무것도 지키지 않던 경우를 모아서 정리했습니다. 테스트 3,066개가 다 통과한 채팅 앱에, 기기에서 DB 열기가 실패하는 코드가 남아 있었음 "E2E 100% 통과"의 출처는 expect()가 하나도 없는 러너 7개였음 버그 수정을 되돌려도 테스트 13개가 그대로 통과 대비 검사기는 텍스트 9,318개 중 59.6%만 재고 실패 0건을 냄 "크래시 없음"의 근거는 실행 시간 857ms뿐. 몽키 테스트를 돌리니 15번째 이벤트에서 죽음 …
Lekarze z Uniwersytetu Medycznego we Wrocławiu opisali 30-latka, u którego cztery miesiące po wykonaniu czerwonego tatuażu pojawiły się wysypka, łysienie plackowate i bielactwo. Biopsje wykazały zniszczenie gruczołów potowych, także poza tatuażem. Włosy odrosły, ale utrata pocenia jest trwała.
Oi pessoal! Sou dev solo no Uruguai e há alguns meses estou construindo o Balak City, uma cidade multiplayer de mundo aberto que roda direto no navegador, no PC e no celular. Quero contar...
В моём детстве у родителей на кухне была тяжеленная чёрная сковородка (скорее всего, чугунная). У неё была съёмная ручка, и на ней отлично получалось жарить семечки. А вот яичница к ней прилипала похлеще пальцев к суперклею. Но долгое время все жили в парадигме «по-другому не бывает». Оказалось, ещё как бывает! Примерно в 1995 году у нас появилась первая тефлоновая сковорода, и процесс готовки просто преобразился. И не только у нас. Тефлон был настоящим культурным феноменом: о нём сочиняли анекдоты, о нём ходили легенды, а людей, с которых всё как с гуся вода, на какое-то время стали называть
У меня есть друзья, которые присылают голосовые на три минуты. Содержание обычно умещается в одно предложение, но чтобы его достать, нужно прослушать «короче, слушай, тут такое дело…». Голосовое не пробежишь глазами, на созвоне его не включишь, а ночью рядом со спящим человеком тем более. В какой-то момент я решил ответить им так же неудобно. Получился pleasejusttext.me: пишешь ответ текстом, а на выходе MP4, где мультяшные руки не спеша набирают его на телефоне. Меня заставили слушать, пусть теперь смотрят. Как это устроено
FBI ostrzega, że atakujący aktywnie używają ARTEX, otwartoźródłowego frameworka AI do hakowania. Narzędzie koordynuje modele językowe, najczęściej chińskie, i prowadzi atak od rekonesansu po kradzież danych. W niektórych przypadkach od wyboru celu do uzyskania dostępu mijają 3 godziny.