If you look at the source code of some HTML sites, they use some giant alphabets to comment out or to provide their site name. Something where you write the word and it converts to to HTML like below:
<!--
------
-
---
-
------
!-->
anyone know how to create these types of comments?
Just Google "Big ASCII text art" and you'll find several online generators.
For example, here's one from bigtext.org:
_ _
/ \ __| | __ _ _ __ ___
/ _ \ / _` |/ _` | '_ ` _ \
/ ___ \ (_| | (_| | | | | | |
/_/ \_\__,_|\__,_|_| |_| |_|
Here's another website that lets you customize the font and a few other things. Example (using the font 'tinker-toy'):
O o
/ \ |
o---o o-O oo o-O-o
| || | | | | | |
o o o-o o-o-o o o
Related
I've been trying to get U-Boot to work in QEMU for the sifive_u machine. I've tried using both the built in OpenSBI 'BIOS' and building my own OpenSBI, but I keep running into the same issue.
I'm building U-Boot using the riscv64 toolchain from the Arch repos:
➜ u-boot git:(0b0c6af387) riscv64-linux-gnu-gcc --version
riscv64-linux-gnu-gcc (GCC) 9.2.0
Copyright (C) 2019 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
➜ u-boot git:(0b0c6af387) export CROSS_COMPILE=riscv64-linux-gnu-
➜ u-boot git:(0b0c6af387) export ARCH=riscv
➜ u-boot git:(0b0c6af387) make sifive_fu540_defconfig
...
➜ u-boot git:(0b0c6af387) make
I've tried to run this as follows:
➜ opensbi git:(master) ✗ qemu-system-riscv64 -M sifive_u -m 256M -bios default -display none -serial stdio -device loader,addr=0x80200000,file=../u-boot/u-boot.bin
OpenSBI v0.5 (Oct 9 2019 12:03:04)
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : SiFive Freedom U540
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 5
Current Hart : 1
Firmware Base : 0x80000000
Firmware Size : 96 KB
Runtime SBI Version : 0.2
PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
U-Boot 2020.01 (Jan 20 2020 - 18:14:27 +0000)
CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: exception code: 7 , Store/AMO access fault , epc 8023cbdc , ra 8020c670
### ERROR ### Please RESET the board ###
I've also tried bundling U-Boot as a payload into my own build of OpenSBI:
➜ opensbi git:(master) ✗ export CROSS_COMPILE=riscv64-unknown-elf-
➜ opensbi git:(master) ✗ make PLATFORM=sifive/fu540 FW_PAYLOAD_PATH=../u-boot/u-boot.bin
➜ opensbi git:(master) ✗ qemu-system-riscv64 -M sifive_u -m 256M -bios none -display none -serial stdio -device loader,addr=0x80000000,file=./build/platform/sifive/fu540/firmware/fw_payload.bin
OpenSBI v0.5-32-gc0849cd
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : SiFive Freedom U540
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 5
Current Hart : 1
Firmware Base : 0x80000000
Firmware Size : 100 KB
Runtime SBI Version : 0.2
PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
U-Boot 2020.01 (Jan 20 2020 - 18:14:27 +0000)
CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: exception code: 7 , Store/AMO access fault , epc 8023cbdc , ra 8020c670
### ERROR ### Please RESET the board ###
I've tried looking at the offending instruction (which I presume is at 0x8023cbdc) based on the error message:
➜ u-boot git:(0b0c6af387) riscv64-unknown-elf-objdump --start-address=0x8023cbdc -d ./u-boot | head -8
./u-boot: file format elf64-littleriscv
Disassembly of section .text_rest:
000000008023cbdc <memset+0x40>:
8023cbdc: fee7bc23 sd a4,-8(a5)
It's a store, so it's plausible that this is indeed accessing an invalid location; I'm trying to get GDB working so I can examine what's actually happening in more detail, but that's causing issues of its own...
Has anyone had any success with this?
UPDATE
I've managed to fix this specific error by changing the amount of memory with -M 2G; I presume the address it's trying to access lies outside the 256M range, but I'm not sure what it's doing that requires this much RAM.
Now I'm getting the following error:
➜ opensbi git:(master) ✗ qemu-system-riscv64 -M sifive_u -m 8G -bios default -display none -serial stdio -device loader,addr=0x80200000,file=../u-boot/u-boot-dtb.bin
OpenSBI v0.5 (Oct 9 2019 12:03:04)
____ _____ ____ _____
/ __ \ / ____| _ \_ _|
| | | |_ __ ___ _ __ | (___ | |_) || |
| | | | '_ \ / _ \ '_ \ \___ \| _ < | |
| |__| | |_) | __/ | | |____) | |_) || |_
\____/| .__/ \___|_| |_|_____/|____/_____|
| |
|_|
Platform Name : SiFive Freedom U540
Platform HART Features : RV64ACDFIMSU
Platform Max HARTs : 5
Current Hart : 1
Firmware Base : 0x80000000
Firmware Size : 96 KB
Runtime SBI Version : 0.2
PMP0: 0x0000000080000000-0x000000008001ffff (A)
PMP1: 0x0000000000000000-0xffffffffffffffff (A,R,W,X)
U-Boot 2020.01 (Jan 20 2020 - 21:40:02 +0000)
CPU: rv64imafdc
Model: SiFive HiFive Unleashed A00
DRAM: 8 GiB
MMC: exception code: 5 , Load access fault , epc fffadbd6 , ra fffadbd2
### ERROR ### Please RESET the board ###
qemu-system-riscv64: terminating on signal 2
Again it's similar (although a load this time); interestingly, the address fffadbd6 isn't part of U-Boot so I've no idea what's happening here; I very much doubt it's running off the end, because then I would expect undefined behaviour as opposed to consistently getting the same bad load.
i try to find a command line to convert files .txt to .pdf using a tool that most computer running on mac and linux have, like (i think) cupsfilter. but I can't seem to control the width of the output
I don't understand how cupsfilter choose the format it chould print, like how much characters define the width in the text file, it seems to be 80. But the output of 80 characters width on a A4 size page looks absurdely huge..
if my text looks like this :
|_| |_| | || |_ | | / . \ | |
_ _ _ _ _ _ _ _ _ _ _ _ _| || _|| |_ \ / | | |
/_ _ || |\_ _ \| ._ _| \ \ / /| || ( ] || | | _ \ / . \ | | |
/_ _ /|_|\_ _ \ \ _ _| \_/\_/ |_| \ _ _||_| |_| |_| \_ _/ |_ _|
the command cupsfilter file.txt > file.pdf will give me the same look, but in huge, in pdf format
however, if my text is longer it will look like this :
_ _ _ _
|_| |_| | || |_ | |
/ . \ | |
_ _ _ _ _ _ _ _ _ _ _ _ _| || _|| |_
\ / | | |
/_ _ || |\_ _ \| ._ _| \ \ / /| || ( ] || | | _ \
/ . \ | | |
/_ _ /|_|\_ _ \ \ _ _| \_/\_/ |_| \ _ _||_| |_| |_|
\_ _/ |_ _|
I would tel cupsfilter to consider a page width to be more than 80 characters long, or to use another tool to do that ?
I want print "/" separator inside output title.
curl -s http://cd0a4a.ethosdistro.com/?json=yes \
| jq -c '.rigs|."0d6b27",."50dc35"|[.version,.driver,.miner,"\(.gpus)\(.miner_instance)"]|#csv' \
| sed 's/\\//g;s/\"//g' \
| gawk 'BEGIN{print "version" "," "GPU_driver" "," "miner" "," "gpu"} {print $0}' \
| csvlook -I
The output is like this :
| version | GPU_driver | miner | gpu |
| ------- | ---------- | -------- | --- |
| 1.2.3 | nvidia | ethminer | 22 |
| 1.2.4 | amdgpu | ethminer | 11 |
But I want separator in between the numbers inside gpu title like this :
| version | GPU_driver | miner | gpu |
| ------- | ---------- | -------- | ---- |
| 1.2.3 | nvidia | ethminer | 2/2 |
| 1.2.4 | amdgpu | ethminer | 1/1 |
You're doing a lot of unnecessary calls just to process the data. Your commands could be drastically simplified.
You don't need to explicitly key into the .rigs object to get their values, you could just access them using [].
You don't need the sed call to strip the quotes, just use the raw output -r.
You don't need the awk call to add the header, you could just output an additional row from jq.
So your command turns into this instead:
$ curl -s http://cd0a4a.ethosdistro.com/?json=yes \
| jq -r '["version", "GPU_driver", "miner", "gpu"],
(.rigs[] | [.version, .driver, .miner, "\(.gpus)/\(.miner_instance)"])
| #csv' \
| csvlook -I
Since you already use string interpolation for that specific field, simply include the character you need (slash /) inside the string, like this:
curl ... | jq -c '... [.version,.driver,.miner,"\(.gpus)/\(.miner_instance)"] ...'
In your case (the complete line):
curl -s http://cd0a4a.ethosdistro.com/?json=yes | jq -c '.rigs|."0d6b27",."50dc35"|[.version,.driver,.miner,"\(.gpus)/\(.miner_instance)"]|#csv' | sed 's/\\//g;s/\"//g' | gawk 'BEGIN{print "version" "," "GPU_driver" "," "miner" "," "gpu"} {print $0}' | csvlook -I
Here are some suggestions for simplification:
use the --raw-output option to jq to remove extraneous back-slashes
there is no need to remove the quotes, csvlook does it for you
no need for awk to add a title line, use a sub-shell
no need to specify rigs implicitly, use .[]
Here is an example:
(
echo version,GPU_driver,miner,gpu
curl -s 'http://cd0a4a.ethosdistro.com/?json=yes' |
jq -r '
.rigs | .[] |
[ .version, .driver , .miner , "\(.gpus)/\(.miner_instance)" ] |
#csv
'
) |
csvlook
Output:
|----------+------------+----------+------|
| version | GPU_driver | miner | gpu |
|----------+------------+----------+------|
| 1.2.3 | nvidia | ethminer | 2/2 |
| 1.2.4 | amdgpu | ethminer | 1/1 |
|----------+------------+----------+------|
Given a string, for example 'imgur', how can I generate large ASCII text like the following? Thanks.
_
(_)
_ _ __ ___ __ _ _ _ _ __
| | '_ ` _ \ / _` | | | | '__|
| | | | | | | (_| | |_| | |
|_|_| |_| |_|\__, |\__,_|_|
__/ |
|___/
You can use ASCII text generator like FIGlet which uses FIGlet fonts. TOIlet is like FIGlet and can use FIGlet fonts but as additional capabilities including Unicode handling, colour fonts, filters and various export formats. Specific logos may need to be created as their own font.
Here are some links:
FIGlet: http://www.figlet.org/
TOIlet: https://apps.ubuntu.com/cat/applications/toilet/
FIGlet fonts: http://www.figlet.org/fontdb.cgi
FIGlet web demo: http://www.kammerl.de/ascii/AsciiSignature.php
so I am working on a game where if you touch one side of a box, you'll be propelled in that direction.
* For example: Let's say I hit the left side of the box, I should be propelled to the left.
One way I could do this, is split the box into 4 instances where each instance is on the left, right, top & bottom sides.
Is there a way for me to embed instances/ access parts of an instance, etc.
OR if there is a better way to do this can you tell me how?
I guess the answer to your question is yes; what you want to do is have a single container MovieClip with 4 internal MovieClips that will be your hit targets.
I would go for the following setup; i.e. use triangles.
------------
|\ top /|
| \ / |
| \ / |
| \ / r|
|left\/ i|
| /\ g|
| / \ h|
| / \ t|
| / \ |
|/ bottom \|
------------
if you were to do it based on coordinates, as Adam Harte mentioned, handle it like a 9-slice grid. if you imagine the centre box oversized, that will give you maximum hit areas.
-----------------
| | | |
| | T | |
-----------------
| | | |
| L | | R |
| | | |
-----------------
| | B | |
| | | |
-----------------
You could just test the x and y position of the touch inside the the box when they touch it. Something like this pseudocode:
function onTouchDown(){
if(touchX < halfBoxWidth)
{
// We touched the left side, so go left.
}
else
{
// We touched the right side, so go right.
}
}