Ir ao conteúdo

Nova versão do LURL (Tiny-URL).

Boa noite,

Na primeira versão do LURL (Tiny-URL), o usuário João, sugeriu que em vez de eu gerar um identificador aleatório, que poderia causar problemas quando o banco de dados se tornasse muito grande, eu poderia utilizar o campo ID, pois o mesmo é Auto Increment, e por isso ele se auto incrementa, não permitindo que existam dois campos com o mesmo identificador.

Já pensava em acatar a idéia do João a bastante tempo mas sempre estava com preguiça, até que alguns dias atrás uma amiga pediu ajuda para fazer um script para conversão de números entre bases. Após ajudar a mesma, ficou fácil. Só passar o código para PHP, modificar algumas funções antigas e pronto.

Foi necessário criar dois novos métodos importantes:
[code lang=”php”]
function convertDecimalTo($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 convertDecimalTo($y,$newBase,$str,$letters); } else { if (strlen($str) == 0) { $str = $letters{$decimal} . $str; } return $str; } } function convertBaseToDecimal($value,$newBase,$letters) { $sum = 0; $len = strlen($value); $end = $len-1; for ($x=$end;$x>=0;$x–) {
$sum = $sum + strpos($letters,$value{$x}) * pow($newBase,($end – $x));
}
return $sum;
}
[/code]

As demais modificações você pode ver aqui:
LURL (Tiny-URL) com Identificador apartir do ID em PHP 4

Assim que for possível vou fazer as alterações na versão para PHP5 onde é utilizado classes.
Matheus Bratfisch

PS: Vou criar uma página para o LURL na sessão Code em breve.

LURL (Tiny-URL) com gráfico e estatísticas para PHP4
LURL (Tiny-URL) com gráfico e estatísticas para PHP5

Publicado emAprendendoCodeMySQLphp

6.493 Comentários

  1. Слушайте кто знает Отец не выходит из штопора Дети напуганы В больницу тащить страшно Короче, только это реально спасло — нарколог на дом с выездом Дал рекомендации и успокоил семью В общем, вся инфа по ссылке — вывод из запоя на дому недорого https://kapelnicza.narkolog-na-dom-volgograd13.ru Нарколог на дом — это реальный выход Перешлите тем кто в такой же ситуации

  2. Волгоград, всем привет Муж просто потерял себя Жена в истерике В больницу тащить страшно Короче, только это реально спасло — наркологическая помощь на дому круглосуточно качественно Осмотрел и поставил капельницу В общем, не потеряйте контакты — врач нарколог на дом анонимно и круглосуточно https://lechenie.narkolog-na-dom-volgograd013.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  3. ThomasvernE ThomasvernE

    Принимаем заявки круглосуточно, уточняем состояние и подбираем безопасный формат помощи.
    Ознакомиться с деталями – vyvod-iz-zapoya-cena-himki

  4. Реутов, всем привет Близкий человек уже несколько дней в запое Жена в истерике Таблетки не помогают Короче, только это реально спасло — вызвать нарколога на дом реутов с опытом Приехал через 40 минут В общем, телефон и цены тут — нарколог на дом реутов цены нарколог на дом реутов цены Нарколог на дом — это реальный выход Перешлите тем кто в такой же ситуации

  5. Казань, всем привет Отец не выходит из штопора Соседи стучат в стену Нужен врач прямо сейчас Короче, только это реально спасло — нарколог услуги цены адекватные Приехал через 40 минут В общем, жмите чтобы сохранить — выезд нарколога на дом https://klinika.narkologicheskaya-pomoshh-v-kazani016.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  6. Всем привет из Питера Задолбался я уже искать нормальную кухню То сроки по полгода обещают Короче, единственные кто не наваривается — кухни в спб на заказ недорого Кромка немецкая В общем, сохраняйте в закладки — кухни в питере от производителя https://kuhni-spb-ptx.ru Проверяйте производителя по этому списку Перешлите тому кто ищет

  7. Слушайте кто хочет заработать А жить на что-то надо Объехал кучу сайтов Короче, реально рабочий вариант — вакансии казахстана с проживанием Проживание и питание часто включены В общем, жмите чтобы не потерять — найти работу в казахстане найти работу в казахстане Найдите нормальную работу Перешлите тому кто ищет работу

  8. Народ всем привет Задолбался я уже искать нормальную кухню То сроки по полгода обещают Короче, реальные мужики с цехом — кухни на заказ спб с доставкой Замер на следующий день В общем, жмите чтобы не потерять — купить кухню на заказ в спб https://kuhni-spb-kqd.ru Проверяйте производителя по этому списку Перешлите тому кто ищет

  9. Слушайте кто кухню ищет Объездил кучу салонов — везде перекупы То ЛДСП тонкая как картон Короче, единственные кто не наваривается — кухни на заказ в спб с проектом Сделали за две недели В общем, жмите чтобы не потерять — заказ кухни по индивидуальным размерам в спб https://kuhni-spb-kqd.ru Проверяйте производителя по этому списку Перешлите тому кто ищет

  10. Ugh, moving — such a grind. Dealt with this mess a couple months back, and no joke, it was pure chaos. First you pack a few things, then boom — you realize how much stuff you have. Someone at work mentioned a company, but I decided to look deeper. Long story short, when you’re hunting for reliable moving services around here, do your homework first. Why?, experienced crews make all the difference — particularly on narrow streets. Take me, for example — read reviews for hours — and believe me, I dodged a bullet. By the way, this is the source that finally gave me clarity. southern nevada movers https://movers-in-nevada-pcq.com That one page showed me what I needed. No guessing games — no hidden junk fees. Ended up going with their top pick and the process was smooth. Do your due diligence. Check their license. The right company makes moving boring. Hope this points you in the right direction!

  11. Ugh, moving — such a grind. I just went through it a couple months back, and honestly, I wanted to cry. First you pack a few things, then it hits you like a truck. My buddy used one crew, but I decided to look deeper. Long story short, when you’re hunting for a decent moving company in nevada, don’t settle for the first quote. Here’s the thing, companies based here handle heat and traffic better — particularly on narrow streets. Take me, for example — asked about insurance and extra fees — and I’m not making this up, it was 100% worth it. By the way, this is the source that finally gave me clarity. movers in nevada movers in nevada Just that resource cut through the noise. Rates are transparent — zero BS. Ended up going with their top pick and they showed up on time. Do your due diligence. Ask about equipment. The right company makes moving boring. Wish I had found this sooner!

  12. Здорова, народ Брат снова сорвался Соседи стучат в стену Таблетки не помогают Короче, единственный кто реально помог — наркологическая помощь срочно Приехал через 40 минут В общем, жмите чтобы сохранить — вызвать нарколога недорого https://klinika.narkologicheskaya-pomoshh-v-kazani016.ru Наркологическая помощь — это реальный выход Перешлите тем кто в такой же ситуации

  13. Слушайте кто кухню ищет Фурнитуру ставят китайскую То ЛДСП тонкая как картон Короче, единственные кто не наваривается — кухни в спб на заказ недорого Кромка немецкая В общем, там цены и каталог — кухня на заказ спб от производителя недорого кухня на заказ спб от производителя недорого Проверяйте производителя по этому списку Перешлите тому кто ищет

  14. Люди помогите советом Близкий человек уже несколько дней в запое Соседи стучат в стену Таблетки не помогают Короче, только это реально спасло — вызвать нарколога цена фиксированная Осмотрел и поставил капельницу В общем, жмите чтобы сохранить — помощь нарколога на дому https://klinika.narkologicheskaya-pomoshh-v-kazani016.ru Не ждите пока станет хуже Перешлите тем кто в такой же ситуации

  15. Слушайте кто сталкивался Ситуация критическая Дети напуганы Таблетки не помогают Короче, только это реально спасло — помощь нарколога на дому Осмотрел и поставил капельницу В общем, жмите чтобы сохранить — платный нарколог на дом https://klinika.narkologicheskaya-pomoshh-v-kazani016.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  16. Ugh, moving — such a grind. Had my own horror story a couple months back, and no joke, it was pure chaos. You start with boxes, then suddenly you’re drowning in clutter. My buddy used one crew, but I’m glad I double-checked. Long story short, when you’re hunting for a decent moving company in nevada, do your homework first. Here’s the thing, companies based here handle heat and traffic better — especially with summer temps. I personally — asked about insurance and extra fees — and trust me, that legwork saved my butt. Check this out that finally gave me clarity. nevada long distance movers https://movers-in-nevada-pcq.com Honestly, that list saved me hours of digging. No guessing games — straightforward quotes. Ended up going with their top pick and the process was smooth. So yeah, don’t rush. Ask about equipment. The right company makes moving boring. Wish I had found this sooner!

  17. Oh man, relocating is pure torture. Went through it just a few months back, and honestly, what a disaster. First you grab some boxes, then bam — you realize you have way too much junk. Someone online praised one company, but I dug deeper myself. Anyway: when you’re on the hunt for decent moving services out here, do your research up front. Look, experienced crews are worth every penny — when you’re moving across state lines. I personally — checked their licensing — and trust me, it was totally worth the time. Check this resource that finally made it clear. nevada movers nevada movers Honestly that list saved hours of digging. They show you the costs upfront — straight pricing. I ended up booking with them and no drama at all. Don’t rush into this. Confirm the timeline. A good mover makes moving boring. You got this!

  18. Oh man, relocating is pure torture. Been there just a few months back, and honestly, what a disaster. You think it’s just packing, then suddenly your whole life is in cardboard. Someone online praised one company, but I dug deeper myself. So here’s the deal: when you’re on the hunt for decent moving services out here, don’t just take the first price. The thing is, experienced crews are worth every penny — when you’re moving across state lines. For example — made like five calls — and believe it or not, it was totally worth the time. This is the page that finally made it clear. nevada movers nevada movers Just that link saved hours of digging. No guessing games — no hidden charges. Went with their top recommendation and they killed it. Be smart about it. Ask about equipment. A good mover makes moving boring. Hope this helps you out!

  19. Moving is never fun — been there myself a few months ago, and no joke, I almost lost it. First you grab some boxes, then you’re buried under piles of stuff. Coworker used someone else, but I decided to dig deeper. Long story short: when you’re looking for reliable moving services around here, do your research upfront. Because, experienced crews make everything easier — especially with long distances. What I did — asked about insurance and extra fees — and trust me, I avoided a huge headache. So here’s the link that finally made sense. movers in nevada movers in nevada That one page cut my search in half. No hidden tricks — no surprises. I ended up going with them and they handled it like pros. So don’t rush it. Check their credentials. The right movers make it look easy. Wish I had this info earlier!

  20. Ребята кто ищет работу То вообще без опыта не берут Пересмотрел тысячи вакансий Короче, реально рабочий вариант — вакансия в казахстане с обучением Оплата вовремя В общем, там все вакансии — казахстан работа казахстан работа Найдите нормальную работу Перешлите тому кто ищет работу

  21. Moving is seriously stressful — just went through it a while back, and I swear, what a nightmare. You start packing, then it hits you out of nowhere. A friend recommended one crew, but I wanted to verify everything. So here it is: when you’re looking for movers in nevada, do your research upfront. The thing is, nevada based movers know the local routes — especially in summer heat. For example — called about five places — and trust me, I avoided a huge headache. Check this out that put everything in one place. moving companies nevada moving companies nevada Just that source saved hours of scrolling. Everything is transparent — clear breakdowns. Scheduled the whole move and they handled it like pros. Be smart about this. Ask about equipment. A solid moving company turns stress into routine. Good luck with your move!

  22. Слушайте кто хочет заработать Вечно то зарплата копейки Работодатели только время тратят Короче, единственный где есть нормальные предложения — казахстан работа вахтовым методом Зарплаты реальные В общем, жмите чтобы не потерять — сайт работы в казахстане https://rezyume.trudvsem.kz Не сидите без денег Перешлите тому кто ищет работу

  23. Реутов, всем привет Близкий человек уже несколько дней в запое Родственники не знают что делать Таблетки не помогают Короче, единственный кто реально помог — нарколог на дом срочно Дал рекомендации и успокоил семью В общем, не потеряйте контакты — нарколога на дом реутов https://klinika.narkolog-na-dom-moskva-tfb.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  24. Слушайте кто знает Отец не выходит из штопора Жена в истерике Таблетки не помогают Короче, только это реально спасло — нарколога домой с препаратами Приехал через 40 минут В общем, жмите чтобы сохранить — нарколога на дом волгоград https://czena.narkolog-na-dom-volgograd013.ru Нарколог на дом — это реальный выход Перешлите тем кто в такой же ситуации

  25. Ugh, moving — such a grind. Dealt with this mess a couple months back, and I swear, it was pure chaos. It seems simple enough, then it hits you like a truck. My cousin recommended another, but I’m glad I double-checked. Basically, when you’re hunting for movers in nevada, compare at least three options. Why?, experienced crews make all the difference — particularly on narrow streets. Like I did — asked about insurance and extra fees — and trust me, I dodged a bullet. So here’s the link that helped me decide. nevada moving company https://movers-in-nevada-pcq.com That one page saved me hours of digging. Prices are right there — straightforward quotes. Ended up going with their top pick and the process was smooth. So yeah, don’t rush. Check their license. Quality service is gold. Good luck with the move!

  26. Ugh, moving — such a grind. Dealt with this mess a couple months back, and honestly, I wanted to cry. It seems simple enough, then boom — you realize how much stuff you have. Someone at work mentioned a company, but I decided to look deeper. Basically, when you’re hunting for reliable moving services around here, don’t settle for the first quote. Why?, local nevada movers know the routes — especially with summer temps. I personally — read reviews for hours — and trust me, I dodged a bullet. So here’s the link that made everything click. moving companies nevada moving companies nevada Honestly, that list saved me hours of digging. Rates are transparent — no hidden junk fees. Ended up going with their top pick and the process was smooth. So yeah, don’t rush. Check their license. The right company makes moving boring. Wish I had found this sooner!

  27. Ugh, moving — seriously the worst. Had my own horror story a couple months back, and I swear, I wanted to cry. First you pack a few things, then suddenly you’re drowning in clutter. Someone at work mentioned a company, but I didn’t trust them blindly. Basically, when you’re hunting for a decent moving company in nevada, don’t settle for the first quote. Why?, experienced crews make all the difference — particularly on narrow streets. I personally — asked about insurance and extra fees — and trust me, it was 100% worth it. Check this out that finally gave me clarity. nevada moving services https://movers-in-nevada-pcq.com That one page showed me what I needed. No guessing games — no hidden junk fees. I booked through them and the process was smooth. So yeah, don’t rush. Confirm the timeline. Good movers turn chaos into routine. Hope this points you in the right direction!

  28. Oh man, moving is brutal. Went through it just a few months back, and seriously, I nearly lost my mind. Seems easy enough, then suddenly your whole life is in cardboard. A friend hired a different crew, but I dug deeper myself. Basically: when you’re on the hunt for a reliable moving company in nevada, do your research up front. Look, nevada based movers know the local roads — especially in Vegas traffic. Me, I did this — made like five calls — and trust me, that legwork saved me a ton. This is the page that finally made it clear. movers nevada movers nevada Honestly that list cut my search in half. Rates are transparent — straight pricing. Scheduled my whole move and they killed it. Be smart about it. Ask about equipment. Quality service is everything. Good luck with your move!

  29. Moving is seriously stressful — had to deal with this a recently, and I swear, I almost lost it. You start packing, then it hits you out of nowhere. A friend recommended one crew, but I wanted to verify everything. Anyway: when you’re looking for reliable moving services around here, don’t grab the first option. Look, experienced crews make everything easier — especially with long distances. I personally — read through tons of reviews — and believe me, it was absolutely worth it. This is the resource that put everything in one place. moving companies nevada moving companies nevada Honestly, that list cut my search in half. Everything is transparent — straightforward rates. Booked through that link and they handled it like pros. Take your time. Ask about equipment. A solid moving company turns stress into routine. Good luck with your move!

  30. Moving is always a hassle — had to deal with this a few months ago, and honestly, what a nightmare. It seems easy at first, then it hits you out of nowhere. A friend recommended one crew, but I decided to dig deeper. Long story short: when you’re looking for reliable moving services around here, compare at least a few. Because, nevada based movers know the local routes — especially for cross-town moves. I personally — called about five places — and believe me, it was absolutely worth it. Check this out that helped me lock in a good choice. movers nevada movers nevada That one page showed me exactly what I needed. No hidden tricks — no surprises. I ended up going with them and they handled it like pros. Take your time. Check their credentials. Quality service is worth every dollar. Hope this helps!

  31. Слушайте кто знает Брат снова сорвался Дети напуганы Таблетки не помогают Короче, врач приехал и поставил систему — врач нарколог на дом с гарантией Приехал через 40 минут В общем, телефон и цены тут — наркологическая помощь на дому в волгограде https://czena.narkolog-na-dom-volgograd013.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  32. Люди подскажите Отец не выходит из штопора Дети напуганы В больницу тащить страшно Короче, только это реально спасло — нарколог на дом круглосуточно без выходных Приехал через 40 минут В общем, вся инфа по ссылке — вызов нарколога на дом круглосуточно https://czena.narkolog-na-dom-volgograd013.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

  33. Здорова, народ Муж просто потерял себя Дети напуганы Таблетки не помогают Короче, только это реально спасло — нарколога домой с препаратами Приехал через 40 минут В общем, телефон и цены тут — вызвать врача нарколога https://kodirovanie.narkolog-na-dom-volgograd013.ru Звоните прямо сейчас Перешлите тем кто в такой же ситуации

Deixe um comentário

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