Internet Radio i Televizija - Kutak za druzenje

MODERATOR
Učlanjen(a)
25.03.2010
Poruka
22.745
Na Mtel mi dosta kanala nije radilo preko njihovog G4YU Box-a pa sam putem Email kontaktirao doticne i mogu reci da je sve islo glatko i dobro sto se tice komunikacije mojih pitanja i njihovih odgovora svaka im cast.....

Danas stiglo dobio sam drugi Box MOVE...

Screenshot_20260211_171512_Photos.jpgScreenshot_20260211_171516_Photos.jpgScreenshot_20260211_171519_Photos.jpgScreenshot_20260211_171523_Photos.jpg

Ima Arene ABS ... Adrenalin... Tenis itd... i mnogo drugih TV kanala samo za te arene da bi ih gledao morao bi da placam vise taj paket..... meni dovoljno ove sto imam ;)

Ako je neko imao slican problem kontaktirajte Mtel

Pozdrav
 
MODERATOR
Učlanjen(a)
25.03.2010
Poruka
22.745
Primjer DSL komande
Zdravo svijete koristeci UTF-8 kodiranje je

5a647261766f207376696a657465
to_hex("zdravo svijete")
5A 64 72 61 76 6F 20 73 76 69 6A 65 74 65

Python

text = "Ovo je test recenica"

hex_output =

text.encode("utf-8").hex()

print(hex_output)

Ako zelis sa razmakom izmedju HEX brojeva citljivije

Python

text = "Ovo je test recenica"

hex_output = "".join(f"{b:02X}" for b in text.encode("utf-8"))

print(hex_output)

Ili ako bi to radio u JavaScriptu

JavaScript


let text = "Ovo je test recenica";

let hex = Array.from(new

TextEncoder().encode(text))

.map(b =>

b.toString(16).padStart(2, "0"))

.join(" ");

console.log(hex);

Ova skripta cita tvoju DSL komandu i izvrsava je

Python

def run_dsl(command):

if command.startswith("TO_HEX(") and command.endswith(")"):

text = command[7:-1].strip('')

return " ".join(f"{b:02X}" for b in text.encode("utf-8"))

else:

return "Nepoznata komanda"

Primjer koristenja

dsl_command = 'TO_HEX("Zdravo svijete")'

result = run_dsl(dsl_command)

print(result)

Python
def to_hex(text):
return " ".join(f"{b:02X}" for b in text.encode("utf-8"))

def to_bin(text):
return " ".join(f"{b:08b}" for b in text.encode("utf-8"))

def to_dec(text):
return " ".join(str(b) for b in text.encode("utf-8"))

def from_hex(hex_string):
bytes_data = bytes.fromhex(hex_string)
return bytes_data.decode("utf-8")

def run_dsl(script):
results = []
lines = script.strip().split("\n")

for line in lines:
line = line.strip()

if line.startswith("TO_HEX("):
text = line[7:-1].strip('"')
results.append(to_hex(text))

elif line.startswith("TO_BIN("):
text = line[7:-1].strip('"')
results.append(to_bin(text))

elif line.startswith("TO_DEC("):
text = line[7:-1].strip('"')
results.append(to_dec(text))

elif line.startswith("FROM_HEX("):
text = line[9:-1].strip('"')
results.append(from_hex(text))

else:
results.append("Nepoznata komanda: " + line)

return "\n".join(results)


Primjer

dsl_script = """
TO_HEX("Zdravo")
TO_BIN("Hi")
TO_DEC("A")
FROM_HEX("48 65 6C 6C 6F")
"""

print(run_dsl(dsl_script))

TO_HEX("tekst")
TO_BIN("tekst")
TO_DEC("tekst")
FROM_HEX("48 65 6C 6C 6F")
vise linija kokomandi
itanje iz fajla


Level 3

Varijable → SET x = "tekst"
Koristenje varijabli → TO_HEX(x)
PRINT komandu
FROM_HEX
Jednostavni REPEAT (mini petlja)


Python
import re

variables = {}

def to_hex(text):
return " ".join(f"{b:02X}" for b in text.encode("utf-8"))

def to_bin(text):
return " ".join(f"{b:08b}" for b in text.encode("utf-8"))

def to_dec(text):
return " ".join(str(b) for b in text.encode("utf-8"))

def from_hex(hex_string):
return bytes.fromhex(hex_string).decode("utf-8")

def resolve_value(value):
value = value.strip()
if value.startswith('"') and value.endswith('"'):
return value.strip('"')
elif value in variables:
return variables[value]
else:
return value

def run_dsl(script):
output = []
lines = script.strip().split("\n")
i = 0

while i < len(lines):
line = lines.strip()

# SET var = value
if line.startswith("SET"):
match = re.match(r'SET (\w+) = (.+)', line)
if match:
var, val = match.groups()
variables[var] = resolve_value(val)

# PRINT value
elif line.startswith("PRINT"):
value = line[6:].strip()
output.append(resolve_value(value))

# TO_HEX
elif line.startswith("TO_HEX("):
val = resolve_value(line[7:-1])
output.append(to_hex(val))

# TO_BIN
elif line.startswith("TO_BIN("):
val = resolve_value(line[7:-1])
output.append(to_bin(val))

# TO_DEC
elif line.startswith("TO_DEC("):
val = resolve_value(line[7:-1])
output.append(to_dec(val))

# FROM_HEX
elif line.startswith("FROM_HEX("):
val = resolve_value(line[9:-1])
output.append(from_hex(val))

# REPEAT n
elif line.startswith("REPEAT"):
count = int(line.split()[1])
block = []
i += 1
while lines.strip() != "END":
block.append(lines)
i += 1
for _ in range(count):
output.append(run_dsl("\n".join(block)))

i += 1

return "\n".join(output)


PRIMJER

dsl_script = """
SET ime = "Sota"
PRINT ime
TO_HEX(ime)

REPEAT 2
PRINT "Bilo sta"
TO_BIN("OK")
END
"""

print(run_dsl(dsl_script))

SET auto = "Bilo koji"
PRINT auto
TO_HEX(auto)

REPEAT 3
PRINT "Gas!"
END

Level 4 itd... itd....

Od obicnog TO_HEX("tekst") pa na dalje CLI alat .. web app itd...

To_Hex("to bi bilo to")
74 6f 20 62 69 20 62 69 6c 6f 20 74 6f
Pozdrav
 
Natrag
Top