Ir al contenido principal

Ralsina.Me — El sitio web de Roberto Alsina

Publicaciones sobre python (publicaciones antiguas, página 96)

Brute Force Works

Last ni­gh­t, Juan­jo Conti twee­ted this:

Or, in en­glis­h: "U­sing exac­tly on­ce the di­gi­ts 1,3,4 and 6, and any of the four ba­sic ope­ra­tion­s, ob­tain 24."

I first spent a cou­ple of mi­nu­tes thi­nking about it and then it hit me: the­re is no point in thi­nking this sort of pro­ble­m, be­cau­se:

  1. Bru­­te fo­r­­cing it wi­­ll take le­ss ti­­me

  2. What you do whi­­le "thi­nki­n­­g" it is sort of la­­me, is­n't it?

So, he­re is a mo­re-o­r-­le­ss ge­ne­ral so­lu­tion for any of the­se pro­ble­ms.

from __future__ import print_function, division
import itertools

numbers = ['1','3','4','6']
target = 24

# Having '' as an operation allows for solution (14-6)*3, which
# may or may not be valid depending on rule interpretation.
operations =  ['*','/','+','-','']


for nums in itertools.permutations(numbers):
    for ops1 in itertools.combinations_with_replacement(operations, 3):
        for ops2 in itertools.permutations(ops1):
            for t in (t1, t2):
                s = t.format(*(nums+ops2))
                    if eval(s) == target:
                except (ZeroDivisionError, SyntaxError, TypeError):

Of course you can make it solve any problem of this class by adjusting numbers and target. There is also a possible extra solution if eval(s) == -tar­get where you just need to add a unary - to the expression, but who cares.

Did I miss so­me­thin­g? Is this rea­lly a ge­ne­ral so­lu­tio­n?

FLOSS Decision Making in Action

If you are rea­ding this the­re is a good chan­ce you are in­vol­ved so­me­how in open sour­ce de­ve­lo­p­men­t, or so­ftwa­re de­ve­lo­p­ment in ge­ne­ra­l. One thing lo­ts of peo­ple ask me when they know I ha­ve lead this sort of pro­jec­ts for a long ti­me is "how do you de­ci­de things?". To whi­ch I ha­ve all sor­ts of bad an­swers like:

  • "I­­t's a co­n­sen­­sus thi­n­­g"

  • "It ha­­ppens or­­ga­­ni­­ca­­ll­­y"

  • "So­­­me­­ti­­mes it just ha­­ppen­s"

  • "A­­na­r­­ch­­y!"

  • "You do what you do"

So, now he­re I ha­ve an AWE­SO­ME exam­ple of FLO­SS de­ci­sion making in ac­tio­n, whi­ch is ... all of the abo­ve.

So­me con­tex­t: Niko­la is a sta­tic si­te ge­ne­ra­to­r, so it deals wi­th rea­ding and wri­ting tex­tual da­ta from disk. It's al­so an in­ter­na­tio­na­li­zed pro­jec­t, whi­ch su­ppor­ts mul­ti­lin­gual si­tes and trans­lated da­ta. It al­so runs un mul­ti­ple pla­tfor­ms, like Win­do­ws, OS­X, Li­nu­x, etc.

And to make that more fun, it also works on Python 2.7, and 3.3 or later. Which means it has to handle two different models on how to work with unicode data, in the same codebase. And that's not fun. So, we have been floating around the idea of deprecating python 2.7. And so, when s2hc_johan walks in with a unicode problem...

14:23:16 <s2hc_johan> I don't have a site with sections, but I tested it for the other case
14:35:42 <s2hc_johan> strange it worked for a while broken again, probably because I've got åäö in it now.
14:35:45 <s2hc_johan>
14:36:17 <s2hc_johan> if you wrap data with unicode it works, but I'm not sure that works in python3
14:36:37 <ChrisWarrick> s2hc_johan: how do you wrap it with unicode?
14:36:48 <s2hc_johan> unicode(data)
14:37:05 <s2hc_johan> but is that valid in  python3?
14:37:11 <ChrisWarrick> s2hc_johan: this is wrong on so many levels
14:37:16 <ChrisWarrick> s2hc_johan: please don’t do that, ever
14:37:48 <ChrisWarrick> s2hc_johan: This won’t work in Python 3 either.  You must have an actual encoding, and use the decode method.   try: foo = foo.decode('utf-8'); except AttributeError: foo = foo  # python 3
14:38:02 <s2hc_johan> what do you mean, that is like my standard when I get strnage data in, undoce(data) data.encode(whatever) data.decode(whatever) :)
14:38:23 <s2hc_johan> one of them ussually work
14:39:22 <ChrisWarrick> s2hc_johan: unicode() assumes ASCII, it never works right
14:39:32 <s2hc_johan> true
14:39:40 <ChrisWarrick> s2hc_johan: encode/decode with a specified encoding is fine
14:40:00 <ChrisWarrick> s2hc_johan: but you might need a try/except for Python 3 if it could have Unicode data already
14:40:16 <s2hc_johan> I'm a bit confused in this case since the output comes from json.dumps
14:40:34 <s2hc_johan> thought that would produce a unicode object
14:40:51 <ChrisWarrick> s2hc_johan: not necessarily on python 2
14:41:05 <ralsina_> if isinstance(thing, utils.str_bytes): thing=thing.decode('utf8')
14:41:15 <ralsina_> that works in py2 and py3
14:42:12 <ChrisWarrick> easier to ask for forgiveness imo
14:43:07 <ralsina_> maybe we should have helpers in utils enforce_unicode and enforce_bytes
14:43:13 -GitHub[nikola]:#nikola- [nikola] Aeyoun pushed 1 new commit to feed-previewimage:
14:43:13 -GitHub[nikola]:#nikola- nikola/feed-previewimage 4b79e20 Daniel Aleksandersen: Deprecated RSS_READ_MORE_LINK and RSS_LINKS_APPEND_QUERY...
14:44:58 <Aeyoun> Or upgrade to Py3.
14:45:11 <ChrisWarrick> ++
14:45:47 <Aeyoun> Unicode in Py27 is a nightmare. It tries as hard as it can to kill you at every turn.
14:48:09 -travis-ci:#nikola- getnikola/nikola#6426 (feed-previewimage - 4b79e20 : Daniel Aleksandersen): The build is still failing.
14:48:10 -travis-ci:#nikola- Change view:
14:48:10 -travis-ci:#nikola- Build details:
14:48:27 <ralsina_> ok, let's consider py3-only seriously.
14:48:40 <ralsina_> 1) Is there any distro commonly used with py3 < 3.3 ?
14:48:55 <ralsina_> 2) Do we just stop using py2, or we deprecate slowly?
14:49:15 <ralsina_> 3) Do we just start doing py3-only code, or we actively de-hack the codebase?
14:49:21 <ralsina_> That's my 3 questions :-)
14:50:13 <SteveDrees> Unicode is a nightmare
14:50:53 <SteveDrees> different python versions just changes where the pain point is
14:50:53 <s2hc_johan> which one is better isinstance... or hasattr('decode', ..)
14:51:02 <ralsina_> isinstance
14:51:08 <s2hc_johan> oki then
14:51:10 <ralsina_> hasattr is evil in itself
14:51:26 <s2hc_johan> just going to feed the kids then I'll make another pr
14:51:28 -GitHub[nikola]:#nikola- [nikola] Aeyoun pushed 1 new commit to feed-previewimage:
14:51:28 -GitHub[nikola]:#nikola- nikola/feed-previewimage 4c950ac Daniel Aleksandersen: flake8
14:52:13 <Aeyoun> ralsina_: user survey? pip download data?
14:52:33 <gour> ralsina_: create some poll at website/mailing-list about it?
14:53:18 <ralsina_> dude, I offered free shirts and I got only 10 requests ;-)
14:53:30 <ralsina_> so, how many answers do you expect about that sort of thing?
14:53:43 * gour thought shirts are jsut for devs :-(
14:53:47 <Aeyoun> ralsina_: release a unchanged version on pip that is flagged as py3 only. see how many downlaod it versus previous version in same amount of time.
14:53:51 <ralsina_> gour: go add yourself dude
14:54:18 <ralsina_> gour: TO THE SHIRT LIST! I just notced that sounded very rude :-)
14:54:43 <gour> ralsina_: where it is?
14:54:43 <Aeyoun> ralsina_: or one py27 version number and and one version py3 only version number at the same time.
14:55:17 <ralsina_> gour:
14:55:17 <gour> found it
14:56:00 <gour> ralsina_: wonder if xxl is too large or xl is enough
14:56:00 <Aeyoun> ralsina_: american or european sizes by the by?
14:56:03 <ralsina_> Aeyoun: that reflects how many people use py2.7 by reflex. I know *i* do because it's "python" and not "python3"
14:56:20 <ralsina_> Aeyoun: no idea about sizes to be honest... probably american
14:56:21 <Aeyoun> American sizes are … a big bigger. I’m probably a XS/S american but M european. :P
14:56:28 <Aeyoun> *bit bigger
14:56:39 <gour> ok
14:56:57 * gour submitted request
14:57:17 <ralsina_> So, what I would prefer to do is make people use py3 if they can. And it seems to me that pretty much everyone can, regardless of whether they still use py2 by defect.
14:57:26 <ralsina_> by default*, spanishism leaked there.
14:57:52 <ChrisWarrick> technically, using py2 is a defect
14:57:59 <ralsina_> So, if we all agree that most users *could* run nikola in py3... then let's do it.
14:58:02 <Aeyoun> Agreed.
14:58:15 <gour> sites won't stop working :-)
14:58:26 <Aeyoun> ralsina_: act on data not dev agreement?
14:58:42 <ChrisWarrick> guess we could change our docs/webiste to highlight 3.x
14:58:59 <ralsina_> Aeyoun: the only data we'd need is to know how many people have py2.7 and no py3.3
14:59:14 <ralsina_> not how many are *using* 2.7 instead of 3.3
14:59:38 <ChrisWarrick> micro-survey via ml?
14:59:39 <ralsina_> How about: let's announce that, unless lots of people complaint, we deprecate py2 by end of october
14:59:45 -travis-ci:#nikola- getnikola/nikola#6429 (feed-previewimage - 4c950ac : Daniel Aleksandersen): The build was fixed.
14:59:46 -travis-ci:#nikola- Change view:
14:59:46 -travis-ci:#nikola- Build details:
14:59:47 <Aeyoun> Mac is shipping with Py2.7 and no Py3. BUT MacPorts and Homebrew offer painfree Py3 installs.
14:59:58 <ralsina_> ok, mac is a good point
15:00:25 <ChrisWarrick> it’s not like we have Homebrew/MacPorts/Fink-based install instructions for them…
15:00:27 <Aeyoun> ralsina_: we could add a deprecation message every time `nikola` is run and ask people to bitch in a bug?
15:00:32 <Aeyoun> ChrisWarrick: hehe. ;)
15:00:50 <ralsina_> "I see you have python3 installed but I am running on 2.7 ... dude, what's wrong with you?"
15:00:51 <Aeyoun> Or maybe once per 24 hour rather  than every time its run.
15:01:00 <ralsina_> doit timed tasks :-)
15:01:12 <Aeyoun> ralsina_: "Don’t get in the way of progress! Upgrade to Py3 and save a developer’s mind today!"
15:01:32 <ralsina_> "niec unicode you have there, would be a shame something happened to it.. switch to python 3!"
15:01:39 <ChrisWarrick> ralsina_: hey, let’s start with a Google Docs survey on the ML.  One question: what Python version and OS are you using for Nikola? 2.7/3.3/3.4/3.5; Windows/OS X/[other: linux/bsd distro]
15:01:57 <gour> "Free t-shirt foreveryone switching from py2.7 to py3.3"
15:01:58 <ChrisWarrick> ralsina_: Just don’t require a Google account like you did last time.
15:02:00 <ralsina_> Second question: "Do you have python 3.3 or later installed?"
15:02:03 <Aeyoun> How much code can be removed with dropping Py27? Lowers maintenance cost and increases performance. That is also an important datapoint.
15:02:11 <ralsina_> ChrisWarrick: I needed to know who was asking for the shirt :-)
15:02:21 <ChrisWarrick> ralsina_: good point
15:02:25 <ralsina_> Aeyoun: not all that much, really
15:02:47 <ChrisWarrick> Aeyoun: it would need to start with a huge rewrite to remove all of our pointers in nikola.utils
15:03:00 <ralsina_> Aeyoun: there are a number of tiny hacks, which were a pain to get right but they always amount to one if and/or one decode :-)
15:03:26 <ralsina_> We can just turn a bunch of helpers in utils into noops
15:04:52 <gour> py3-only nikola is going to become v8?
15:05:15 <Aeyoun> gour: seems like a likely outcome. you’re following the discussion live.
15:06:34 <ChrisWarrick> if we do v8, we’ll have to merge the early tasks garbage
15:07:03 <ralsina_> Is it technically backwards-incompatible if we just stop working on py2.7?
15:07:21 <ralsina_> gour: welcome to open source software: behind the code.
15:07:30 <gour> ralsina_: :-)
15:07:35 <Aeyoun> Someone call in a documentary crew!
15:07:43 <ralsina_> Aeyoun: we have logs!
15:07:51 <Aeyoun> Oh, wait. This is already logged for prosperity.
15:07:57 <ralsina_> I am totally posting this somewhere as "this is how decisions are made in FLOSS"
15:08:40 <ralsina_> Ok, who creates the poll and who posts it in the blog, and who makes sure it appears on planet, and who sends it to the list?
15:08:49 <ralsina_> I would do it but I have work to do :)
15:08:51 <ChrisWarrick> ralsina_: I’ll do it
15:08:57 <ralsina_> ChrisWarrick: you rock dude!
15:09:01 <ChrisWarrick> ralsina_: should be really simple
15:09:03 <ralsina_> Ok, we have a plan!
15:09:17 <ralsina_> Let's consider the poll results in ... a week?
15:09:25 <Aeyoun> Let the logs show we’re all in favor of this plan of action. ;-)
15:09:29 <ralsina_> aye
15:09:51 <ralsina_> Also: can I do the "shame on you" thing on nikola build? It sounds like fun :-)
15:10:27 <ChrisWarrick> ralsina_: for the python version question: radiobox vs checkbox?
15:10:28 <gour> ralsina_: you can mention that Nikola (Tesla) was always for innovation ;)
15:10:44 <Aeyoun> "You’re using FIVE YEAR OLD SOFTWARE. Update your system."
15:11:00 <ralsina_> Aeyoun: I am totally getting at least 5 different comments there
15:11:01 <Aeyoun>
15:11:05 <ralsina_> ChrisWarrick: checkbox... maybe 2?
15:11:23 <ralsina_> ChrisWarrick: one for python version, one for operating system
15:11:32 <ChrisWarrick> ralsina_: ?
15:11:38 <ralsina_> ChrisWarrick: two questions
15:11:54 <ChrisWarrick> ralsina_: there will even be three questions (py2/3 used, OS, has py3)
15:11:57 <ChrisWarrick> ralsina_: and checkboxes it is
15:12:02 <ralsina_> right
15:12:05 <ralsina_> awesome
15:14:44 <ralsina_> Copied / Pasted for posterity

The­re you go, half an hour la­te­r, we ha­ve a plan to (ma­y­be) de­pre­ca­te it.

Now go vo­te he­re: Should Niko­la su­pport py­tho­n2.7? Gi­ves us da­ta to de­ci­de!

Nikola v7 finally out!

I am th­ri­lled to an­noun­ce ver­sion 7 of Niko­la, a sta­tic si­te and blog ge­ne­ra­tor is ou­t, wi­th a ba­zi­llion fea­tu­res and bu­gfixes (see be­lo­w).

You can get it at all the usual pla­ce­s, and he­re's the re­lea­se an­noun­ce­ment

He­re's the new fea­tu­res, the bu­gfixes list would make the post too long :-)

  • Added UNS­LU­GI­FY_­TI­TLES op­tion for making ti­tles fe­tched via the fi­le­na­me re­gexp pre­ttier (Is­sue #1282)

  • New de­pen­den­cie­s: na­tsort (na­tu­ral sor­ting in ga­lle­rie­s) and da­teu­til (re­pla­ces py­tz)

  • Niko­­­la.­­co­­­m­­man­­ds are now the use­­r-­­frien­d­­ly wra­­ppers from co­n­­so­­­le (Is­­sue #1177)

  • Add a gi­thu­b_­de­ploy co­m­mand to de­ploy to Gi­tHub pa­ges (Is­sue #1208)

  • Re­­mo­­­ve tidy fi­l­­ter (it was bro­­ken due to tidy being an­­cien­­t) (Is­­sue #1164)

  • Added GE­NE­RA­TE_R­SS se­tting to allow di­sa­bling RSS in Niko­la (Is­sue #1236)

  • Li­nk lis­­tings raw sou­r­­ces if CO­­­P­­Y_­­SOU­R­­CES is True (Is­­sue #1214)

  • Mu­ch mo­re po­wer­ful niko­la plu­gin co­m­mand (Is­sue #1189)

  • Mo­­­re po­­we­r­­ful co­n­­so­­­le mo­­­de allo­­ws ac­­ce­ss to all niko­­­la co­­­m­­man­­ds (Is­­sue #830)

  • New `RO­BO­TS_EX­CLU­SION­S` op­tion lis­ting re­sour­ces to ex­clu­de from site­map and in­clu­de in new ge­ne­ra­ted /ro­bo­ts.­txt (Is­sue #804)

  • Ge­­ne­­ra­­te si­te­­ma­­pi­n­­dex co­n­­tai­­ning RSS and si­te­­map fi­­les (Is­­sue #804)

  • Su­­pport hooks in te­m­­pla­­tes, for use by plu­­gins (Is­­sue #896)

  • Use rea­d­­li­­ne if avai­­la­­ble (Is­­sue #1238)

  • Re­pla­ced REA­D_­MO­RE_­LI­NK wi­th IN­DEX_­REA­D_­MO­RE_­LI­NK and RSS_­REA­D_­MO­RE_­LI­NK (Is­sue #1222)

  • Added rea­­di­n­­g_­­ti­­me, re­­mai­­ni­n­­g_­­rea­­di­n­­g_­­ti­­me, pa­­ra­­gra­­ph_­­coun­­t, re­­mai­­ni­n­­g_­­pa­­ra­­gra­­ph_­­count tags for REA­­D_­­MO­­­RE_­­LI­NK (Is­­sue #1220)

  • Add ca­­no­­­ni­­cal li­nk in lis­­tings.

  • Added su­­pport for new me­­ta fi­­les that are the sa­­me fo­r­­mat as 1-­­fi­­le me­­ta­­da­­ta, allo­­wing for grea­­ter fle­­xi­­bi­­li­­ty (Is­­sue #954)

  • Co­­­lo­r­­box is now in­­te­r­­na­­tio­­­na­­li­­zed (Is­­sue #1205)

  • Added LO­­­GO­­_URL and SHO­­W_­­BLO­­­G_­­TI­­TLE=­­True se­­ttings to fa­­ci­­li­­ta­­te sho­­wing off lo­­­gos (Is­­sue #1122)

  • Crea­­te au­­to­­­ma­­tic sto­­­ry in­­dex pa­­ges for su­­bfo­l­­de­r­s, too (Is­­sue #793)

  • New Slo­­­vak tran­s­­la­­tion by To­­­máš Prékop

  • Created a Ma­­rk­­do­­w­­nEx­­ten­­sion plu­­gin cla­ss (Is­­sue #1175)

  • The ba­­se the­­me pro­­­du­­ces pro­­­pe­r­­ly se­c­­tio­­­ned and se­­man­­tic HT­­M­­L5 (Is­­sues #1123, #1137)

  • The ba­­se the­­me co­­­mes wi­­th a new sty­­lish look by de­­fault (Is­­sue #1137)

  • The ba­­se the­­me su­­ppo­r­­ts Ri­­gh­­t-­­to­­-­­Le­­ft by using ::­­di­­r(­r­­tl) CSS4 ru­­les and <h­t­­ml di­­r="­r­­tl"> tags whe­­re va­­lid (Is­­sue #1146)

  • Boots­­trap 2 up­­dated to 2.3.2 (via Is­­sue #1137)

  • Added FO­R­­CE_I­­SO­­8601 se­­tting that cu­­rren­­tly makes new_­­post use ISO 8601 da­­tes (via Is­­sue #1156)

  • Added su­­pport for TZ spe­­ci­­fied in post da­­te (Is­­sue #1118)

  • Make niko­la init ask about the si­te’s se­ttings (Is­sue #1080)

  • Use na­­tu­­ral so­r­­ting for fi­­les and fo­l­­ders list in lis­­tings and ga­­lle­­ries (Is­­sue #1144)

  • Added in­­va­­rian­­ce tes­­ting (Is­­sue #672)

  • Plu­­gins can in­­ject te­m­­pla­­tes in the sys­­tem (Is­­sue #1139)

  • niko­la im­por­t_wor­dpress now has a --­­q­­tran­s­­la­­te op­tio­n, to par­se pos­ts in the qtrans­la­te wor­dpress plu­gin for­mat and turn them in­to mul­ti­lin­gual Niko­la pos­ts (Is­sue #1072)

  • niko­la con­so­le allo­ws for in­ter­pre­ter choi­ce via -b, -i, -p; mo­reo­ve­r, su­pport for bp­y­thon is not de­pre­ca­ted an­y­mo­re (Is­sue #1126)

  • re­ti­red tag for pos­ts has been re­pla­ced wi­th pri­va­te (via Is­sue #686)

  • Chan­­ged the de­­fault TRAN­S­­LA­­TIO­N­S_­­PA­­TTERN to "{­­pa­­th}.{­­lan­­g}.{ex­­t}". (Is­­sues #990, #829)

  • Ba­­ckwa­r­­ds co­m­­pa­­ti­­bi­­li­­ty wi­­th v5 is bro­­ken. Added ba­­ckwa­r­­d­s-i­n­­co­m­­pa­­ti­­ble chan­­ges. (Is­­sue #829)

  • Added a CON­TEN­T_­FOOTE­R_­FOR­MA­TS con­fig op­tio­n. It is us­ed to for­mat the CON­TEN­T_­FOOTER va­ria­ble pro­per­l­y, for com­pa­ti­bi­li­ty wi­th the Trans­la­ta­ble Se­ttings fea­tu­re. The va­ria­ble takes a dic­t, the ke­ys of whi­ch are lan­gua­ges, and va­lues are (args, kwargs). (Is­sue #1112)

  • Ce­r­­tain se­­ttings are now tran­s­­la­­ta­­ble. As of no­­w, the se­­ttings are: BLO­­­G_AU­­THO­­­R, BLO­­­G_­­TI­­TLE, BLO­­­G_­­DES­­CRI­P­­TIO­­N, LI­­CEN­SE, CO­N­­TEN­­T_­­FOOTE­­R, SO­­­CIA­­L_­­BU­­TTO­N­S_­­CO­­­DE, SEA­R­­CH_­­FO­R­­M, BO­D­­Y_EN­­D, EX­­TRA_HEA­­D_­­DA­­TA, NA­­VI­­GA­­TIO­­N_­­LI­NKS, REA­­D_­­MO­­­RE_­­LI­NK (the up-­­to­­-­­da­­te list is avai­­la­­ble in SI­­TE.­­TRAN­S­­LA­­TA­­BLE_SE­­TTINGS) (Is­­sues #851, #1057, #1061, #1112)

  • New Po­s­­­­tho­­­r() re­­turns me­­ta 'au­­tho­­­r' or BLO­­­G_AU­­THOR (Is­­sue #1117)

  • Ship ba­se-­­ji­n­­ja, boots­­tra­­p-­­ji­n­­ja, boots­­tra­­p3-­­ji­n­­ja wi­­th Niko­­­la (Is­­sue #1104)


  • Re­­mo­­­ve old me­ss­a­ges le­­ft over for ba­­ckwa­r­­ds co­m­­pa­­ti­­bi­­li­­ty: (Is­­sues #829, #1105)

    • "Mo­­­­­re po­­s­­­ts abou­­­t", re­­­pla­­­ced by "Mo­­­­­re po­­s­­­ts about %s"

    • "Po­­s­­­te­­­d", re­­­pla­­­ced by "Po­­s­­­te­­­d:"

    • "A­­l­­­so avai­­­la­­­ble in", re­­­pla­­­ced by "A­­l­­­so avai­­­la­­­ble in:"

  • Re­­mo­­­ve old "s­­l_­­SI", "tr_­­TR" lo­­­ca­­le alia­­ses (u­­se "s­­l" and "tr") (Is­­sue #829, #1105)

  • New op­­tion RSS_­­PLAIN to op­­tio­­­na­­lly strip HT­­ML from RSS fee­­ds (Is­­sue #1107)

  • Su­­pport co­n­­tent key in co­m­­pi­­le­r­s' crea­­te_­­post (Is­­sue #1098)

  • Use se­tup­tool­s’ ex­tras fea­tu­re. Use pip ins­ta­ll niko­la[ex­tra­s] to ins­ta­ll Niko­la wi­th ex­tras (re­­qui­­re­­men­­ts-ex­­tra­s.­­txt, for­mer­ly re­­qui­­re­­men­­ts-­­fu­­ll.­­txt -- no­te the na­me chan­ge!) (Is­sue #1089)

Nikola Logo Contest!

So you ha­ve de­sign ski­ll­s? Want to make a li­ttle mo­ney whi­le doing a good thin­g? Then join the con­tes­t! the­re is a 200 US do­llars gua­ran­teed pri­ze, and the con­test wi­ll be ju­dged by a group of Niko­la de­ve­lo­per­s.

So­me gui­dan­ce:

  • The na­­me Niko­­­la co­­­mes from Niko­­­la Tes­­la, so thi­nk co­n­­ce­p­­ts co­n­­ne­c­ted to that

    • The Wa­­r­­­den­­­cl­­­y­­­ffe to­­­wer

    • Tes­­­la Coils

    • Li­­­gh­­­tning

    • Ele­­c­­­tri­­­ci­­­ty

    • Ea­­r­­­ly 20­­­th cen­­­tu­­­ry

  • I ho­­­pe the lo­­­go wo­­­rks we­­ll in a va­­rie­­ty of fo­r­­ma­­ts so, keep it si­m­­ple. B/W is good.

  • A drawing wi­­thout the word Niko­­­la is good, but a good de­­sign wi­­th the word in it could be good al­­so.

The con­test las­ts a week, you ha­ve 4 da­ys for the qua­li­fying roun­d.

And re­mem­be­r: it has to be be­tter than the­se

Nikola is now more compatible with Sphinx

So­me­ti­me­s, you need to use the sa­me text in mo­re than one pla­ce. For exam­ple, you may want to use frag­men­ts of your so­ftwa­re ma­nuals in your so­ftwa­re's si­te.

If you are part of the Py­tho­n-­ver­se then it's like­ly that your do­cs are wri­tten using Sphi­nx. Ǹiko­la and Sphi­nx sha­re roots in reS­truc­tu­re­dText so they are al­ready com­pa­ti­ble in many im­por­tant wa­ys.

Ho­we­ve­r, Sphi­nx adds a who­le bun­ch of ex­ten­sions to reS­truc­tu­re­dText and Sphi­nx users use the­m. So, wha­t's a dev to do? He'­ll wri­te co­de. So I wro­te a niko­la plu­gin whi­ch adds su­pport for a lar­ge chunk of the Sphi­n­x-s­pe­ci­fic ma­rku­p.

How big a chunk? Qui­te big sin­ce it adds su­pport for over 35 ex­ten­sion­s, ro­les and di­rec­ti­ves (no, toc­tree is not one of them ye­t).

This wa­y, you may be able to en­joy a good do­cu­men­ta­tio­n-s­pe­ci­fic tool and a (if I may say so mysel­f) good web­si­te tool from co­m­mon sour­ce­s.


Contents © 2000-2023 Roberto Alsina