Skip to content

Instantly share code, notes, and snippets.

View cosminpopescu14's full-sized avatar
🎯
Focusing

Cosmin Popescu cosminpopescu14

🎯
Focusing
View GitHub Profile
<?php
echo json_encode("Göktürk-X-șpțâăîșțâ", JSON_UNESCAPED_UNICODE);
using System;
using System.Xml;
using System.Xml.Linq;
namespace ConsoleApp22
{
class Program
{
static void Main(string[] args)
{
@cosminpopescu14
cosminpopescu14 / average_in_stack.c
Created December 19, 2018 22:31
Compute avreage on a stack
// ConsoleApplication22.cpp : This file contains the 'main' function. Program execution begins and ends there.
//
#include "pch.h"
#include <iostream>
struct Stack
{
@cosminpopescu14
cosminpopescu14 / fetch_demo.html
Created December 23, 2018 11:40
simple fetch post demo
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
</head>
<body>
<script>
let clicks = 0;
const url = `fetch.php`;
Methode 1
<p:dataTable var="entry" value="#{hashMap.entrySet().toArray()}">
<p:column headerText="key">
<h:outputText value="${entry.key}" />
</p:column>
<p:column headerText="value id">
<h:outputText value="${entry.value.id}" />
</p:column>
</p:dataTable>
let story = "really very basically bla bla ba afara este frig. Ana are mere. Javascript drives me very mad. But basically it is used everywhere. Very Ana Ana Ana really";
let overUsedWords = ["really", "very", "basically", "Ana"];
let storyWords = story.split(" ");
let freq = {}
for (storyWord of storyWords)
{
for(overUsedWord of overUsedWords)
{
using System;
using System.Collections.Generic;
namespace ConsoleApp28
{
public class Intrebare
{
public string intrebare;
public List<string> raspunsuri = new List<string>();
}
fail: Microsoft.EntityFrameworkCore.Database.Command[20102]
Failed executing DbCommand (1ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE TABLE [Categories] (
[Id] int NOT NULL IDENTITY,
[UserCodeAdd] nvarchar(20) NOT NULL,
[UserCodeLastChange] nvarchar(20) NULL,
[AddedDate] datetime2 NOT NULL DEFAULT (CURRENT_TIMESTAMP),
[LastChangeDate] datetime2 NULL,
[ParentId] int NULL,
[Code] nvarchar(50) NOT NULL,
@cosminpopescu14
cosminpopescu14 / square_surface.html
Created June 1, 2019 06:11
Compute square surface
<html>
<label>Introduceti dimesiunea laturii patratului </label><input type ="text" id="laturaPatrat"/><br/>
<button type="button" onclick="calculeazaArie()">Calculeaza arie</button>
<p id="rezultat"></p>
<script>
function calculeazaArie() {
let dimensiune = document.getElementById("laturaPatrat").value //citim ceea ce am introdus in text box
@cosminpopescu14
cosminpopescu14 / unsafe_string.cs
Created July 8, 2019 04:27
from Microsoft docs
char[] chars = { 'w', 'o', 'r', 'd' };
sbyte[] bytes = { 0x41, 0x42, 0x43, 0x44, 0x45, 0x00 };
// Create a string from a character array.
string string1 = new string(chars);
Console.WriteLine(string1);
// Create a string that consists of a character repeated 20 times.
string string2 = new string('c', 20);
Console.WriteLine(string2);