Skip to content

Instantly share code, notes, and snippets.

💭
:)

Cosmin Popescu cosminpopescu14

💭
:)
Block or report user

Report or block cosminpopescu14

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View FlattenArrayWithFlatMap.java
int[][][] threeDimArr = { { { 1, 2 }, { 3, 4 } }, { { 5, 6 }, { 7, 8 } } };
var flattenedArray = Arrays.stream(threeDimArr)
.flatMap(Arrays::stream)
.flatMapToInt(Arrays::stream);
flattenedArray.forEach(System.out::println);
View ExploringAsyncAwaitAndLinqCSahrp_CompilerCode.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using System.Security;
using System.Security.Permissions;
using System.Threading.Tasks;
View DateSlotsWorking.js
const neatCsv = require('neat-csv');
const fs = require('fs')
const file = "C:\\Users\\cosmi\\Desktop\\events.csv";
fs.readFile(file, async (err, data) => {
if (err) {
console.error(err)
return
}
View DateSlots.js
const neatCsv = require('neat-csv');
const fs = require('fs')
const file = "events.csv"
fs.readFile(file, async (err, data) => {
if (err) {
console.error(err)
return
}
View Demo.php
<?php
class User {
public int $id;
public string $name;
/**
* @return int
*/
public function getId(): int
View test.cs
using Xunit;
using System.Linq;
using System.Collections.Generic;
using FluentAssertions;
namespace Anabi.InstitutionsImporter.Tests
{
public class InstitutionImporterTest
{
[Fact]
View Bench.java
//this performs horribly. It's a programming error in the file :)
package com.company;
import java.io.IOException;
import java.nio.charset.Charset;
import java.nio.charset.StandardCharsets;
import java.nio.file.Files;
import java.nio.file.OpenOption;
import java.nio.file.Paths;
View ReadFileInParallel.cs
string[] AllLines = File.ReadAllLines(path); // incarca mult memroia procesului.
//Console.WriteLine(AllLines);
Parallel.ForEach(AllLines, line =>
{
float x = float.Parse(line.Split("\t")[0]);
float y = float.Parse(line.Split("\t")[1]);
float res = x / y;
View GenerateRandomPairsAndWriteInFile.cs
using System;
using System.Diagnostics;
using System.IO;
using System.Security.Cryptography;
namespace Bench
{
class Program
{
private static readonly Random random = new Random();
@cosminpopescu14
cosminpopescu14 / InfoAboutJava.java
Created Oct 31, 2019
Get details about JVM using MXBean
View InfoAboutJava.java
package com.company;
import java.lang.management.ManagementFactory;
import java.util.HashMap;
public class Main {
public static void main(String[] args) {
// write your code here
You can’t perform that action at this time.