64 bites számok R-ben

Az érdekes problémák érdekes tanulságokhoz vezetnek.

Kiindulás: írtam egy modellt, amiben használok UNIX időbélyegeket az időpontok megjelölésére. Ebben nincs semmi ördöngősség, egy szám, ami az 1970 január 1. óta eltelt másodpercek segítségével jelzi az időt. A helyzet azonban az, hogy ezek nagy számok, annyira nagyok, hogy egy átlagos számítógép nem nagyon tud vele mit kezdeni, nem fér el a szokásos 32 biten, mert azon csak 2^32-1 számot tudnak megmutatni. Erre készítettek egy csomagot, ami úgy ábrázolja a 64 bites számokat, hogy az első 32-t és a második 32-t külön veszi, és egy listaként tartja számon. Bravúros megoldás, és rettentően jól működött, míg csak tárolni kellett. A használata már nehezebb volt.

Amikor egyenletes mintát szerettem volna venni a rendelkezésre álló időintervallumból, elsőre azt kértem, válasszon ki véletlenül n darab számot 1és N közül, ahol N>2^31-1. Erre hibát adott, de én furfangos vagyok, és kértem n darab véletlen számot 0 és 1 közül, majd beszoroztam N-nel – de ezek eredménye mind 0, mert véletlenszám 64 bitesre konvertálása során a törtszámok egészig csonkolódnak. Ennek oka, hogy a csomag először a másik, nem 64bites számot is átkonvertálja ugyan olyanra, mint az eredeti – ami viszont egészekre van kitalálva, tehát az átkonvertált számnak is egésznek kell majd lennie. Erre van ám egyszerű megoldás, vegyünk 1 és 2^31-1 közt egyenletesen mintát. Ekkor a lehetséges számok intervallumának felét fedtük le. Ha ezt felszoroznánk kettővel, akkor vennénk a teljes intervallumról… de nem, mert az csak 2^32-1ig menne. De az ötlet nem rossz, vegyünk nagy egész számokat, amíg a szükséges minta nem nagyobb a meglévő számoknál, és osszuk el azokat a számokat egyenletesen 1 és N közt!
-No, hát melyik legyen ez a szám?
-2^31-1!
-Nem jó! Az R nem tud ilyen hosszú vektort lefoglalni. Pech, jöhet az alternatíva-keresés az időbélyegek helyett…

No, sebaj, az R 3.0.0 már ismeri a 2^31-1 elemnél hosszabb vektorokat, de csak 64 bites rendszeren. Hmmmm… öcsém alszik, és a vasa megfelel a kritériumnak. Essünk neki.
Nem, nem működött (természetesen). A számokkal sem boldogult el, ráadásul a használt csomagok (az hagyján hogy int64, de a plyr és a doParallel) még híján vannak a friss verzióhoz tartozó változatnak, így azzal kváti semmit nem tudtam kezdeni laikusként. Pedig de szép is lett volna!

A megoldás
A bit64 csomag, és annak a megoldásai. Zseniálisan egyszerű lett tőle a dolgom 🙂

Via: 64 bites számok R-ben

383 Responses to 64 bites számok R-ben

  1. Pingback: viagra non prescription

  2. Pingback: cialis professional

  3. Pingback: is cialis generic

  4. Pingback: cialis 20mg

  5. Pingback: Pfizer viagra canada

  6. Pingback: Discount viagra

  7. Pingback: viagra cialis

  8. Pingback: price of cialis

  9. Pingback: prices of cialis

  10. Pingback: discount cialis

  11. Pingback: online pharmacy viagra

  12. Pingback: online pharmacy viagra

  13. Pingback: viagra 100mg

  14. Pingback: buying ed pills online

  15. Pingback: buying ed pills online

  16. Pingback: best non prescription ed pills

  17. Pingback: cialis 10 mg

  18. Pingback: online pharmacy

  19. Pingback: Buy cheap cialis

  20. Pingback: levitra cost

  21. Pingback: levitra dosage

  22. Pingback: online casino

  23. Pingback: wind creek casino online games

  24. Pingback: viagra online pharmacy

  25. Pingback: online casino real money usa

  26. Pingback: slot games online

  27. Pingback: tadalafil 20

  28. Pingback: cash loan

  29. Pingback: cash payday

  30. Pingback: payday loans

  31. Pingback: viagra prescription

  32. Pingback: real money online casinos usa

  33. Pingback: best real money casinos

  34. Pingback: cialis 5 mg

  35. Pingback: online roulette spielen paypal

  36. Pingback: casino games with three dice

  37. Pingback: Casinos 2020

  38. Pingback: 20 cialis

  39. Pingback: cialis 20

  40. Pingback: cialis internet

  41. Pingback: cialis buy

  42. Pingback: viagra online pharmacy

  43. Pingback: slots real money

  44. Pingback: best online casino for money

  45. Pingback: online casino games for real money

  46. Pingback: online casino real money us

  47. Pingback: cheapest viagra online

  48. Pingback: sildenafil dosage

  49. Pingback: online pharmacy viagra

  50. Pingback: tadalafil 20 mg

  51. Pingback: tadalafil cialis

  52. Pingback: cialis 5 mg

  53. Pingback: cialis buy cialis

  54. Pingback: play for real online casino games

  55. Pingback: online casino games real money

  56. Pingback: lowest price generic viagra

  57. Pingback: buy cialis online usa

  58. Pingback: Viagra 200mg tablets

  59. Pingback: Viagra 120mg coupon

  60. Pingback: Viagra 100mg medication

  61. Pingback: Viagra 120 mg tablet

  62. Pingback: Viagra 120mg online

  63. Pingback: cheap Viagra 120mg

  64. Pingback: Viagra 25mg no prescription

  65. Pingback: cheap Viagra 130mg

  66. Pingback: generic cialis online

  67. Pingback: Viagra 50 mg otc

  68. Pingback: cost of Viagra 100mg

  69. Pingback: Cialis 20 mg prices

  70. Pingback: Cialis 80mg uk

  71. Pingback: Cialis 60mg tablets

  72. Pingback: Cialis 20 mg no prescription

  73. Pingback: buy generic viagra

  74. Pingback: buy Cialis 10mg

  75. Pingback: Cialis 20 mg tablets

  76. Pingback: order viagra

  77. Pingback: Cialis 10mg united kingdom

  78. Pingback: Cialis 10 mg united states

  79. Pingback: Cialis 80mg otc

  80. Pingback: Cialis 60mg price

  81. Pingback: sildenafil 120 mg tablets

  82. Pingback: order tadalafil 40 mg

  83. Pingback: levitra 10 mg price

  84. Pingback: lasix 40 mg canada

  85. Pingback: furosemide 100 mg united states

  86. Pingback: where can i buy propecia 1mg

  87. Pingback: lexapro 20mg online pharmacy

  88. Pingback: viagra pills

  89. Pingback: finasteride 1mg prices

  90. Pingback: buy generic viagra

  91. Pingback: abilify 10mg medication

  92. Pingback: actos 15 mg coupon

  93. Pingback: aldactone 100mg price

  94. Pingback: allegra 120 mg coupon

  95. Pingback: allopurinol 300mg for sale

  96. Pingback: where can i buy amaryl 1 mg

  97. Pingback: ampicillin 250mg online

  98. Pingback: antabuse 500 mg coupon

  99. Pingback: order antivert 25mg

  100. Pingback: arava 20 mg pharmacy

  101. Pingback: strattera 40 mg purchase

  102. Pingback: cialistodo.com

  103. Pingback: where to buy viagra in pattaya

  104. Pingback: aricept 10 mg canada

  105. Pingback: arimidex 1 mg canada

  106. Pingback: tamoxifen 20 mg tablets

  107. Pingback: ashwagandha 60caps without prescription

  108. Pingback: cvs cialis

  109. Pingback: cheapest atarax 10 mg

  110. Pingback: augmentin 500/125mg online pharmacy

  111. Pingback: cost of avapro 150mg

  112. Pingback: cost of avodart 0,5 mg

  113. Pingback: order baclofen 10 mg

  114. Pingback: where to buy bactrim 400/80mg

  115. Pingback: benicar 40 mg tablets

  116. Pingback: generic cialis overnight delivery

  117. Pingback: buy Biaxin 500mg

  118. Pingback: buspar 10 mg purchase

  119. Pingback: lowest price on cialis

  120. Pingback: calcium carbonate 500mg tablet

  121. Pingback: usa viagra online

  122. Pingback: cheapest casodex

  123. Pingback: catapres 100mcg medication

  124. Pingback: ceclor coupon

  125. Pingback: ceftin 250 mg coupon

  126. Pingback: celebrex cheap

  127. Pingback: celexa prices

  128. Pingback: how to purchase cephalexin

  129. Pingback: cipro 250 mg australia

  130. Pingback: claritin 10mg usa

  131. Pingback: real money casino online

  132. Pingback: win real money online casino for free

  133. Pingback: slot machine

  134. Pingback: casino online usa

  135. Pingback: real casinos online no deposit

  136. Pingback: online casino real money

  137. Pingback: slots online

  138. Pingback: casino online gambling

  139. Pingback: best online casinos that payout

  140. Pingback: real casino online

  141. Pingback: veterans car insurance quotes usaa

  142. Pingback: cheap liability car insurance quotes

  143. Pingback: cheap car insurance

  144. Pingback: viagra without presc canada

  145. Pingback: owners car insurance

  146. Pingback: online car insurance quotes

  147. Pingback: cheap liability car insurance quotes

  148. Pingback: top car insurance quotes companies

  149. Pingback: insurance for car

  150. Pingback: car insurances

  151. Pingback: sr22 insurance

  152. Pingback: bad credit personal loans

  153. Pingback: Buy generic viagra online

  154. Pingback: northwest payday loans

  155. Pingback: check cashing near me

  156. Pingback: viagra online pharmacy

  157. Pingback: installment loans installment loans

  158. Pingback: quick loans for bad credit near me

  159. Pingback: bad credit loans in md

  160. Pingback: payday loans without credit checks

  161. Pingback: personal loans nj

  162. Pingback: cbd oil and anxiety

  163. Pingback: cbd oil for sale

  164. Pingback: cbd oil for sale colorado springs

  165. Pingback: buy viagra professional

  166. Pingback: does cbd oil help tinnitus

  167. Pingback: how can i get sildenafil prescription online

  168. Pingback: viagra in south korea

  169. Pingback: best cbd oil for pain and inflammation

  170. Pingback: cbd oil benefits

  171. Pingback: canadian drugstore viagra

  172. Pingback: best cbd oil for pain reviews

  173. Pingback: prescription viagra online usa

  174. Pingback: cbd oil side effects

  175. Pingback: best cbd oil for pain for sale

  176. Pingback: viagra price in us

  177. Pingback: write college essays

  178. Pingback: buy viagra in japan

  179. Pingback: essay writing service

  180. Pingback: essay writer reviews

  181. Pingback: online essay writing service

  182. Pingback: my homework now

  183. Pingback: my homework now

  184. Pingback: should schools have homework

  185. Pingback: generic otc viagra

  186. Pingback: are essay writing services legal

  187. Pingback: buy a essay

  188. Pingback: essay writing service uk best

  189. Pingback: 200 mg viagra india

  190. Pingback: cheapest cleocin

  191. Pingback: Canadian healthcare viagra sales

  192. Pingback: clomid over the counter

  193. Pingback: clonidine 0,1 mg prices

  194. Pingback: clozaril price

  195. Pingback: Buy cheap viagra

  196. Pingback: buy colchicine

  197. Pingback: symbicort inhaler online

  198. Pingback: cialis dubai

  199. Pingback: combivent united states

  200. Pingback: coreg 25mg pharmacy

  201. Pingback: cialis online

  202. Pingback: buy compazine

  203. Pingback: how to buy coumadin 2mg

  204. Pingback: Canadian pharmacy viagra

  205. Pingback: cozaar 50mg pills

  206. Pingback: buy an essay

  207. Pingback: viagra sale singapore

  208. Pingback: https://researchpaperssfk.com

  209. Pingback: custom essay writing cheap

  210. Pingback: where to buy crestor

  211. Pingback: psychology dissertation

  212. Pingback: Generic viagra usa

  213. Pingback: help me write a compare and contrast essay

  214. Pingback: where can i buy cymbalta

  215. Pingback: reviews of essay writing services

  216. Pingback: online thesis

  217. Pingback: good thesis

  218. Pingback: dapsone caps pharmacy

  219. Pingback: how to write my paper

  220. Pingback: ddavp pills

  221. Pingback: how to purchase depakote 250 mg

  222. Pingback: diamox 250mg without a prescription

  223. Pingback: cheapest differin

  224. Pingback: diltiazem cheap

  225. Pingback: doxycycline 100 mg without a prescription

  226. Pingback: dramamine without a doctor prescription

  227. Pingback: elavil prices

  228. Pingback: erythromycin pills

  229. Pingback: etodolac no prescription

  230. Pingback: flomax coupon

  231. Pingback: flonase nasal spray generic

  232. Pingback: garcinia cambogia caps online pharmacy

  233. Pingback: geodon purchase

  234. Pingback: hyzaar no prescription

  235. Pingback: imdur 60 mg online

  236. Pingback: generic cialis cost

  237. Pingback: cialis for sale

  238. Pingback: imitrex 25 mg cheap

  239. Pingback: cheapest imodium 2mg

  240. Pingback: my response

  241. Pingback: other

  242. Pingback: does viagra make you bigger

  243. Pingback: imuran united states

  244. Pingback: indocin canada

  245. Pingback: lamisil 250mg online pharmacy

  246. Pingback: levaquin 250mg australia

  247. Pingback: lopid cost

  248. Pingback: lopressor 25mg without prescription

  249. Pingback: order luvox

  250. Pingback: macrobid online

  251. Pingback: meclizine without a prescription

  252. Pingback: buy viagra in singapore

  253. Pingback: mestinon 60mg cheap

  254. Pingback: erectile dysfunction

  255. Pingback: how to buy micardis

  256. Pingback: online pharmacy canada

  257. Pingback: online pharmacies of canada

  258. Pingback: mobic 15mg no prescription

  259. Pingback: Azulfidine

  260. Pingback: motrin 400 mg uk

  261. Pingback: canadian pharmacies online prescriptions

  262. Pingback: nortriptyline online

  263. Pingback: dp viagra

  264. Pingback: periactin 4 mg online

  265. Pingback: phenergan purchase

  266. Pingback: plaquenil 400mg cost

  267. Pingback: prednisolone 5 mg united kingdom

  268. Pingback: prevacid 30 mg united states

  269. Pingback: prilosec otc

  270. Pingback: proair inhaler 100mcg cheap

  271. Pingback: procardia otc

  272. Pingback: proscar prices

  273. Pingback: protonix 40 mg prices

  274. Pingback: canadian pharmacy viagra

  275. Pingback: provigil pills

  276. Pingback: pulmicort coupon

  277. Pingback: how to buy pyridium

  278. Pingback: reglan 10 mg pharmacy

  279. Pingback: remeron 15 mg pills

  280. Pingback: retin-a cream no prescription

  281. Pingback: revatio 20 mg cost

  282. Pingback: risperdal otc

  283. Pingback: where to buy robaxin 500 mg

  284. Pingback: rogaine 5% without prescription

  285. Pingback: seroquel for sale

  286. Pingback: singulair over the counter

  287. Pingback: skelaxin 400 mg coupon

  288. Pingback: spiriva pills

  289. Pingback: tenormin coupon

  290. Pingback: thorazine 100mg purchase

  291. Pingback: toprol united states

  292. Pingback: tricor 160 mg united kingdom

  293. Pingback: buy valtrex

  294. Pingback: vantin purchase

  295. Pingback: verapamil cheap

  296. Pingback: voltaren australia

  297. Pingback: wellbutrin 150 mg for sale

  298. Pingback: zanaflex 2 mg without a prescription

  299. Pingback: cialis 2.5

  300. Pingback: zithromax 250 mg usa

  301. Pingback: Get More Information

  302. Pingback: next page

  303. Pingback: zocor online pharmacy

  304. Pingback: zovirax 400mg over the counter

  305. Pingback: cheapest zyloprim 300mg

  306. Pingback: different kinds of viagra

  307. Pingback: zyprexa 15 mg usa

  308. Pingback: cheap zyvox 600mg

  309. Pingback: sildenafil canada

  310. Pingback: tadalafil uk

  311. Pingback: how to purchase furosemide

  312. Pingback: escitalopram 5 mg australia

  313. Pingback: aripiprazole 20mg medication

  314. Pingback: pioglitazone without prescription

  315. Pingback: spironolactone 100 mg cheap

  316. Pingback: where to buy fexofenadine

  317. Pingback: glimepiride 1mg online

  318. Pingback: cheapest meclizine

  319. Pingback: leflunomide 20 mg tablets

  320. Pingback: atomoxetine 18 mg price

  321. Pingback: donepezil online pharmacy

  322. Pingback: anastrozole tablet

  323. Pingback: cheapest irbesartan 150 mg

  324. Pingback: dutasteride no prescription

  325. Pingback: where to buy olmesartan

  326. Pingback: buspirone prices

  327. Pingback: clonidine 0.1mg purchase

  328. Pingback: cefuroxime tablets

  329. Pingback: celecoxib price

  330. Pingback: buy citalopram

  331. Pingback: cialis pills

  332. Pingback: cephalexin over the counter

  333. Pingback: 10 mg generic cialis

  334. Pingback: ciprofloxacin 250mg price

  335. Pingback: cheapest loratadine

  336. Pingback: buying cialis with dapoxetine

  337. Pingback: clindamycin online pharmacy

  338. Pingback: clozapine uk

  339. Pingback: buy viagra generic cost

  340. Pingback: prochlorperazine price

  341. Pingback: purchase cialis australia

  342. Pingback: carvedilol 12.5 mg uk

  343. Pingback: cheap warfarin

  344. Pingback: rosuvastatin 10mg united kingdom

  345. Pingback: desmopressin mcg uk

  346. Pingback: divalproex 250mg without a doctor prescription

  347. Pingback: trazodone 25mg coupon

  348. Pingback: tolterodine price

  349. Pingback: buy acetazolamide 250mg

  350. Pingback: cialis everyday

  351. Pingback: buy fluconazole 200mg

  352. Pingback: phenytoin 100mg tablet

  353. Pingback: where to buy oxybutynin 2.5mg

  354. Pingback: cheapest doxycycline

  355. Pingback: bisacodyl 5 mg online pharmacy

  356. Pingback: best places to buy viagra online

  357. Pingback: venlafaxine 75 mg purchase

  358. Pingback: amitriptyline uk

  359. Pingback: permethrin price

  360. Pingback: 141genericExare

  361. Pingback: where to buy cialis online with online consultants

  362. Pingback: where to buy erythromycin 250mg

  363. Pingback: zzhvwukp

  364. Pingback: estradiol tablet

  365. Pingback: buy etodolac

  366. Pingback: fluticasone 50 mcg uk

  367. Pingback: alendronate 70 mg purchase

  368. Pingback: where can you buy cialis

  369. Pingback: nitrofurantoin 100 mg over the counter

  370. Pingback: wat kost sildenafil 100mg

  371. Pingback: ivermectin 6 pack what is

  372. Pingback: glipizide tablets

  373. Pingback: generic viagra fda approved

  374. Pingback: how to purchase isosorbide

  375. Pingback: how to buy sumatriptan 100mg

  376. Pingback: cialis 25 anni

  377. Pingback: loperamide without a prescription

  378. Pingback: cialis farmacia precio

  379. Pingback: azathioprine cheap

  380. Pingback: propranolol australia

  381. Pingback: viagra 100mg dosage

  382. Pingback: lamotrigine otc

  383. Pingback: terbinafine without a doctor prescription

Comments are closed.