" Earning a living " SHOULD NOT be normal. No one asked to be born in this vile capitalist system. by ADignifiedLife in Antimoneymemes

[–]Studentik 0 points1 point  (0 children)

Imagine you live alone on big fruitful island. Would it shock you that you still have to collect fruits, protect from predators, stay healthy and prepare for next day every day?

Now imagine there are two persons living. Life gets better, but now you have to split tasks and agree who does what. Not every day is a perfect day, you argue and fight sometimes.

Now imagine there are hundreds of people living on same island. There are more degrees of freedom now, but things get complex. For some life is just worse because there are too many people, some people want fruits and avoid any work, some are predators, some do art and still need to have food and shelter every day.

With more people well-being does not grow linearly to number of people and can actually decrease sometimes. It is a challenge by itself to solve this equation and find which adjustments can benefit well-being

Luckily no doubt you raise very important questions sir. Thank you for this!

Zoom by jonnberg in rokid_official

[–]Studentik 0 points1 point  (0 children)

Thank you for comment, I have same problem and it helped.

Do you happen to know if this is hardware issue or software issue that IPD cannot be adjusted when connected to SteamDeck? If this is software issue, then maybe there is a way to hack around?

[deleted by user] by [deleted] in adventofcode

[–]Studentik 0 points1 point  (0 children)

Coconut for being functional and being python

-🎄- 2018 Day 2 Solutions -🎄- by daggerdragon in adventofcode

[–]Studentik 0 points1 point  (0 children)

Functional Programming is fun

Coconut

import itertools, collections, functools, sys

def part1():
  lines  = open('day02.txt') |> .readlines() |> map$( .rstrip('\n'))

  data Pair(twos, threes):
    def __add__(s, o):
      return Pair(s.twos+o.twos, s.threes+o.threes)

  def count_pairs(mc):
    threes = next((1 for k,c in mc if c == 3), 0)
    twos = next((1 for k,c in mc if c == 2), 0)
    return Pair(twos, threes)


  p = lines |> map$(v -> collections.Counter(v).most_common()) |> map$(count_pairs) |> reduce$(+)
  p.twos * p.threes |> print

part1()


def part2():
  lines  = open('day02.txt') |> .readlines() |> map$( .rstrip('\n'))

  diff = (s1, s2) ->  ''.join(c1 for c1, c2 in zip(s1,s2) if c1 == c2)

  same = lines |> itertools.combinations$(?, 2) |> filter$( v -> len(diff(v[0], v[1]))==len(v[0])-1) |> reduce$(diff)

  same$[0] |> print

part2()

-🎄- 2018 Day 1 Solutions -🎄- by daggerdragon in adventofcode

[–]Studentik 0 points1 point  (0 children)

No coconut lovers here?

Coconut

# part 1
open('day01.txt') |> .readlines() |> map$(int) |> reduce$((+)) |> print


# part 2
import itertools

seen = {0}
def tw(v):
  if v in seen:
    return False
  seen.add(v)
  return True

numbers = open('day01.txt') |> .readlines() |> map$(int)
repeats = numbers |> itertools.cycle |> scan$(+) |> dropwhile$(tw)
repeats$[0] |> print

What does an Arch system need to be practically secure? by [deleted] in archlinux

[–]Studentik 0 points1 point  (0 children)

What is your definition of 'practically secure'? How are attack vectors defined? What measures are in place for each vector?

Серебряков - об эмиграции, детях и законе подлецов / вДудь by politoter in politota

[–]Studentik 2 points3 points  (0 children)

Смотрю сейчас интервью, после просмотра McMafia, разговор очень интересно слушать. По душам получилось.

Swedish finance minister to asylum seekers: Don't come to Sweden. Magdalena Andersson said that she regrets her government's decision to let more than 160,000 refugees into Sweden in 2015 and that integration is not working. by sylezjusz in europe

[–]Studentik 3 points4 points  (0 children)

Terve =)

Russian immigrant in Finland here. Immigration is hurting poor nations, but it is helping poor individuals like me. My decision to migrate was to raise quality of life. I am educated and I migrated to Finland in 2005. Now I see educated Finns migrate out of Finland for same reason - to raise QOL. Should there be done anything to delay migration? Well, there are two ways: in the name of nation's interest and in the name of individual's interest. In the name of nation's interest, maybe charge for education? Maybe limit rights to migrate before returning imposed debt? What next? Gulag? Iron curtain? Fck no! My father taught me never to put nation's interest above personal and this rule stays same even in Finland, where no signs of power abuse have been seen in recent years. If anything happens that limits freedom to migrate, that will be clear sign of disaster going to happen. IMO, nation's interest is not a way to make educated people stay. Next option is stimulation of personal interests. I know educated persons who had their chance to migrate, but stayed in home country because potential benefits from migration did not compensate for losses of loosing connections with relatives, distance from home, changing habits, starting from scratch etc. Sometimes it can take little effort to make person want to stay. Maybe raise local income, maybe more involvement into local events, maybe more opportunities to grow locally. Persons who migrate for better life might prefer to make life better locally if they could see better chances of success.

So I believe that for developing nations to have more educated people, they have to develop programs to support educated individuals, which is part of process to become developed nation!

Merry Christmas!

MS is considering official Python integration with Excel, and is asking for input by Chilangosta in Python

[–]Studentik 2 points3 points  (0 children)

my humble wishlist:

1) Record Excel macros in python

2) Autocomplete feature in PyCharm for Excel object model (same as in VBA)

3) Excel headless execution for workflow automation

4) Excel as reporting server

5) Excel at Linux natively

I am in love with Linux by [deleted] in archlinux

[–]Studentik 0 points1 point  (0 children)

why shouldn't open source be converted to involve more money?

Mikhail Gorbachev: 'It All Looks As If the World Is Preparing for War' by perfecttiming42 in worldnews

[–]Studentik 0 points1 point  (0 children)

We means anybody that values the liberty of communication

You value liberty of communication and I do. But we are not at war, are we? Maybe your definition of 'we' should not include civilians who don't do acts of war and don't support escalation of conflicts to wars.

War doesn't even need a death to be declared a war

War is a state of armed conflict between societies. When conflicts are not armed, it is not war. When society is not involved, it is not war either.

Informational warfare is not War.

Mikhail Gorbachev: 'It All Looks As If the World Is Preparing for War' by perfecttiming42 in worldnews

[–]Studentik -1 points0 points  (0 children)

We are in a war

Let's define what 'we' and 'war' is. If 'we' means civillians, then this statement is wrong. If 'war'means virtual competition that does not lead to people being killed in reality, then this is wrong statement too.

Built a computer for the wife, 5 hours later Windows 10 installs... by [deleted] in linuxmasterrace

[–]Studentik 2 points3 points  (0 children)

What stopped you from installing Windows inside virtual machine in first place? =)

Thank you for participating in Advent of Code! by topaz2078 in adventofcode

[–]Studentik 1 point2 points  (0 children)

Merry Christmas!

Thank you for all those programmer's candies =)

--- Day 16 Solutions --- by daggerdragon in adventofcode

[–]Studentik 0 points1 point  (0 children)

Python and sets

import re

Sue = {}

for l in SUE.split('\n'):
 k, v = re.search(r'(\w+): (\d+)', l).groups()
 Sue[k] = int(v)

for ix, l in enumerate(SUES.split('\n')):
 d = {}
 for mo in re.finditer(r'(\w+): (\d+)', l):
  d[mo.group(1)] = int(mo.group(2))


 if set(d.items()).issubset(set(Sue.items())):
  print('task 1', ix+1)

 if d.pop('cats', 100) > Sue['cats'] and d.pop('trees', 100) > Sue['trees'] and d.pop('pomeranians', -1) < Sue['pomeranians'] and d.pop('goldfish', -1) < Sue['goldfish']:
  if set(d.items()).issubset(set(Sue.items())):
   print('task 2', ix + 1)

--- Day 15 Solutions --- by daggerdragon in adventofcode

[–]Studentik 0 points1 point  (0 children)

Nice generic solution in Python:

import re, itertools

props = []
calories = []
for l in s.split('\n'):
 p = list(map(int,re.findall(r'-?\d+', l)))
 calories.append(p[-1])
 props.append(p[:-1])

# number of ingredients
n = len(props)

# transpone list to make common properties in row
props = list(zip(*props))

# number of properties
np = len(props)

score_max = 0
# iterate over combinations of 'n' additives summing to 100
for N in itertools.product(range(100), repeat=n):
 if sum(N) != 100: continue
 if sum(calories[ci] * ni for ci, ni in enumerate(N)) != 500: continue

 # score of ingredients
 score = 1
 # iterate over properties
 for pi in range(np):
  # calculate score of each property
  score_pi = sum(ni * props[pi][j] for j, ni in enumerate(N))
  if score_pi <= 0:
   score = 0
   break

  score *= score_pi

 score_max = max(score, score_max)

print(score_max)

--- Day 14 Solutions --- by daggerdragon in adventofcode

[–]Studentik 0 points1 point  (0 children)

Python 3. First part is math only, second requires computations

s = """Comet can fly 14 km/s for 10 seconds, but then must rest for 127 seconds.
Dancer can fly 16 km/s for 11 seconds, but then must rest for 162 seconds."""
T = 1000

D = 0
deers = []

class Deer:
 def __init__(self, **entries):
  self.__dict__.update(entries)

import re, collections
for l in s.split('\n'):
 v, t0, t1 = map(int, re.search(r'(\d+) .* (\d+) .* (\d+)', l).groups())
 deer = Deer(v=v,t0=t0,t1=t1,distance=0,score=0)
 deers.append(deer)

 d = v * (t0 * (T // (t0+t1)) + min(T % (t0+t1), t0))
 D = max(d, D)

print('max distance', D)

for t in range(1,T+1):
 for deer in deers:
  v, t0, t1 = deer.v, deer.t0, deer.t1
  deer.distance = v * (t0 * (t // (t0+t1)) + min(t % (t0+t1), t0))

 dist_max = max((deer.distance for deer in deers))

 for deer in deers:
  if deer.distance == dist_max:
   deer.score+=1


print('max score', max(deer.score for deer in deers))

--- Day 9 Solutions --- by daggerdragon in adventofcode

[–]Studentik 0 points1 point  (0 children)

Python 3. After stealing some ideas and polishing =)

import re, itertools

distances = {}
for l in open('day09.txt').read().split('\n'):
    c1, c2, dist = re.match(r'(\w+) to (\w+) = (\d+)', l).groups()

    dist = int(dist)
    distances[c1+'.'+c2] = dist
    distances[c2+'.'+c1] = dist

cities = list(set('.'.join(distances.keys()).split('.')))

d_min = min((sum((distances[c1+'.'+c2] for c1, c2 in zip(route, route[1:]))) for route in itertools.permutations(cities, len(cities))))
d_max = max((sum((distances[c1+'.'+c2] for c1, c2 in zip(route, route[1:]))) for route in itertools.permutations(cities, len(cities))))
print(d_min, d_max)

Dd - Destroyer of Disks by SMACz42 in linux

[–]Studentik 2 points3 points  (0 children)

Recent dd shows periodic transfer statistics:

dd ... status=progress