Ir ao conteúdo

Mudança de base numérica com Python.

Boa noite,

Algum tempo já venho pensando em mudar o método utilizado pelo Little URL, já que o mesmo atualmente cria strings aleatórias para cada registro, porém seria melhor criar os endereços utilizando uma base (16,32,64) pois assim não corresse o risco do gerador entrar em loop já que cada endereço registrado possui um número único no banco de dados. (Chave primária). Hoje uma amiga perguntou como ela faria um programa para mudar a base de um número manualmente, aproveitei que ela me lembrou disso e resolvi fazer.

[code lang=”python”]
def convert(decimal,newBase,str,letters):
if decimal >= newBase:
x = decimal % newBase
y = decimal / newBase
str = letters[x] + str
if y < newBase: str = letters[y] + str return convert(y,newBase,str,letters) else: if len(str) == 0: str = letters[decimal] + str return str let = "0123456789ABCDEF" print convert(17,16,"",let) [/code] A váriavel let, são os valores utilizados na criação da base. Por exemplo ao se utilizar uma base binária, os valores deveriam ser 01 e assim consecutivamente. Espero que goste, Matheus

Publicado emAprendendopython

2.203 Comentários

  1. Mi diverto su crazy time da qualche mese e onestamente mi trovo abbastanza bene. Non ci credevo tanto all’inizio perche ne avevo provati altri che promettevano tanto e poi si rivelavano una delusione, tipo tempi di prelievo assurdi. Qua pero la registrazione e stata velocissima, bastano pochi dati, e il deposito minimo e ragionevole, parliamo di cifre basse.

    Quello che mi ha colpito subito e la varieta di giochi. Hanno tipo piu di mille giochi, roba di Pragmatic Play, NetEnt, Evolution per il live. Ho giocato parecchio a Gates of Olympus che ogni tanto sgancia delle vincite assurde, e anche Sweet Bonanza non e male. Una cosa che mi ha dato fastidio e che certi giochi caricano lenti da telefono, soprattutto con connessione non perfetta.

    Per il live casino e il punto forte secondo me. Croupier veri di Evolution funzionano alla grande, e il game show Crazy Time e una bomba — ti tiene li a guardare anche quando non giochi. Tra l’altro potete dare un’occhiata alle offerte attuali su crazy time prima di registrarvi. L’offerta iniziale prevede giri gratis e un bonus sul primo deposito con wagering sui 30x circa, che non e poco ma perlomeno te lo dicono subito nelle condizioni.

    I prelievi su crazy time me li hanno pagati entro due giorni tramite e-wallet. Accettano le carte principali, Neteller, anche crypto se vi piace quel mondo. Ho testato con la carta e e stato leggermente piu lento, ma niente di drammatico. Il supporto risponde abbastanza in fretta via chat, anche se non sempre capiscono al volo il problema.

    In generale con crazy time mi sto trovando bene, qualche difetto c’e — l’app potrebbe migliorare e certi bonus hanno condizioni un po’ strette — ma per noi italiani va senza problemi particolari. Se cercate qualcosa di affidabile con un buon catalogo, dategli una chance.

  2. nonebet_gykr nonebet_gykr

    I’ve been using Nonebet for about six months now, mostly on the train home, and might as well dump some thoughts since someone asked me the other day. Getting an account took no time — email and a password, that’s it, although the KYC bit hit me later, which every licensed site does anyway. Min deposit was around $10 which suits me.

    Game selection is huge — somewhere north of 2,500 slots and tables from memory. Play’n GO stuff is everywhere, so Gates of Olympus and Sweet Bonanza are sitting right on the front page. My go-to is the Megaways stuff because the volatility suits me. NetEnt back catalogue is there as well. Live dealer side runs on Evolution, which means real croupiers, roulette running 24/7 plus Crazy Time which I watch more than I play.

    Bonus-wise the offer was 100% to $500 with 150 spins, rollover sits at 40x which is about average. There was a no-deposit spins offer for a while but don’t count on it. Terms change fairly often so check the current ones on wyns online casino before you claim anything. What did get on my nerves was the max bet rule while wagering — breached it once without noticing and the balance got voided. Lesson learned.

    Withdrawals have been fine, mostly. Crypto came back in under an hour both times, e-wallets took about a day, but the Visa one took three business days which felt long. Deposits are instant via card, Skrill, Neteller or crypto.

    Their live chat answered me at 2am, not just a bot loop after the first canned reply. No app for Nonebet that I’ve found — it’s just the mobile browser, works well enough on the Android. It’s a Curacao licence, which isn’t the ACMA, obviously, make of that what you will for us down here.

Deixe um comentário

O seu endereço de e-mail não será publicado. Campos obrigatórios são marcados com *