Every family has that weird cousin (it might be me in our case....)
and Ukraine only because it borders Europe
I suspect it mostly relates how much code base there is on internet about the topic. For instance if you make it use a niche library, it is quite common that it makes up methods that don't exist in that library but exists in related libraries. When I point this out, it also hallucinates saying "It was removed after version bla". I also may not be using the most cutting edge LLM (mix of freely available and open source ones).
The other day I asked it whether if there is a python library that can do linear algebra over F2, for which it pointed me to the correct direction (Galois) but when I asked it examples of how to do certain stuff it just came up with wrong functions over and over again:



In the end it probably was still faster than google searching this but all of these errors happened one after the other in the span of five minutes, so yeah. If I recall correctly, some of its claims about these namespaces, versions etc were also hallucinated. For instance vstack also does not exist in Galois but it does exist in a very popular package called numpy that can do regular linear algebra (and which this package also uses behind the scenes).
I did linear algebra with sympy over Q to reduce the search space to nullspace x [-N,N] grid (which is generally <=2 dimensional in these inputs and N<50 seems sufficient in most cases) then made easy work of it with vectorization. Similarly for part 2 did linear algebra over F2 but the search grid is also much smaller [0,1] x nullspace
The graph in my input (and I assume everyone else's too) is DAG so one can use transfer matrices for the first part (after severing connections going out of "out") and the second one topological sorting and just count paths between each node separately and multiply them. First part could be done much easily using the machinery of part2 but I wanted to use my favourite object transfer matrices for the solution. Second part runs in about 0.09 seconds.
from pathlib import Path
import networkx as nx
import numpy as np
cwd = Path(__file__).parent.resolve()
def parse_input(file_path):
with file_path.open("r") as fp:
data = list(map(str.strip, fp.readlines()))
nodes = [y for line in data for y in line.replace(':','').split(' ')]
M = np.zeros((len(nodes), len(nodes)))
for line in data:
from_node = line.split(':')[0]
to_nodes = line.split(': ')[-1].split(' ')
I0 = nodes.index(from_node)
I1 = [nodes.index(n) for n in to_nodes]
M[I0, I1] = 1
return M, nodes
def count_paths_between(ind0, ind1, M):
'''
counts paths by severing any outgoing connection from node ind1
and using transfer matrices. Stopping condition is having the
same positive number of paths for 10 cycles.
'''
vec = np.zeros((M.shape[0]))
vec[ind0] = 1
nhistory = []
A = M.T.copy()
A[:, ind1] = 0
A[ind1, ind1] = 1
counter = 0
while True:
vec = A@vec
nhistory.append(vec[ind1])
counter +=1
if len(nhistory)>10 and (len(set(nhistory[-10:]))==1 and nhistory[-1]!=0):
return nhistory[-1]
def count_paths_dag(G, source, target):
npaths = {node: 0 for node in G.nodes()}
npaths[source] = 1
for node in nx.topological_sort(G):
for nbr in G.successors(node):
npaths[nbr] += npaths[node]
return npaths[target]
def solve_problem1(file_name, path_nodes=None):
M, nodes = parse_input(Path(cwd, file_name))
if path_nodes is None:
npaths = count_paths_between(nodes.index("you"), nodes.index("out"), M)
else:
G = nx.from_numpy_array(M, create_using=nx.DiGraph(),
nodelist=nodes)
# assumed G is a DAG, below will raise error if not
sorted_nodes = list(nx.topological_sort(G))
sorted_path_nodes = sorted(path_nodes, key=sorted_nodes.index)
#make sure path nodes are not topoligically equivalent
for node1, node2 in zip(sorted_path_nodes[:-1], sorted_path_nodes[1:]):
assert nx.has_path(G, node1, node2)
npaths = np.prod([count_paths_dag(G, node1, node2) for node1, node2 in
zip(sorted_path_nodes[:-1], sorted_path_nodes[1:])])
return npaths
if __name__ == "__main__":
assert solve_problem1("test_input1") == 5
assert solve_problem1("input") == 431
assert solve_problem1("test_input2", ["svr","dac","fft","out"]) == 2
assert solve_problem1("input", ["svr","dac","fft","out"]) == 358458157650450
thanks in that case yea bad luck, glad he was in a cage
for fucks sake if I hear this from an older relative or sth I am gonna lose it
feel free to block me instead, I post images every now and then
What?
I like to call it the "Don't embarrass comrade Putin curtain"
Avicenna
0 post score0 comment score
She addressed the far right European movement Patriots of Europe. This movement is endorsed by people like Marine Le Pen, Viktor Orban, Milei etc major players of today's world pushing world actively to extreme right, bigotry, sexism, anti-immigration and anti-muslim policies etc you name it. The slogan of this group is "Make Europe Great Again", that should tell you all you need about this group.
She congratulated Netanyahu on his “decisive actions” in the “war” in Gaza, declared that "the struggle of Venezuela is the struggle of Israel," and has promised to move Venezuela’s embassy in Israel to Jerusalem, which would violate international law.
I don't know how much she has done for Venezuela, can't comment on that but if you work with groups that are actively pushing the world to shit, I find it hard to believe that her own goals for her own country can be that good. Far right politics is generally about power and personal gain at the expense of masses.
I also don't know if she is actively a zionist but she has no qualms about supporting zionist and far-right agendas so she can get some bit of political power in her corner of the world. I wouldn't let her walk past near the nobel peace prize. Not that that prize has any credibility any more.