Skip to content
Advertisement

Tag: java

Optapy error at “solver_manager_create(solver_config)”

I am trying to run solver_manager_create method as it shown in the quick start code in optapy repo (https://github.com/optapy/optapy-quickstarts/blob/04fd102ee31919cacc4145d0517fe07b2627ca02/employee-scheduling/services.py#L168) But i am receiving a java.lang.IllegalArgumentException error. Full Error: what am i missing? Answer From the error message, it appears the constraint stream use one version of Shift, and the domain model use a DIFFERENT version of Shift. Do not redefine

Two unicode encodings represent 1 cyrillic letter

I have such string in unicode and utf-8 representation: and The desired ouput is “Если повезет то сегодня уже скину”. I have tried all possible encodings but still wasn’t able to get it in complete cyrillic form. The best I got was using windows-1252. And also I’ve noticed that one cyrillic letter in desired string means two unicode encodings. For

Regex Help for text/pattern between two keywords

I am trying to extract text between two words. The below pattern repeats itself with modifications in between ‘start keyword’ and ‘end keyword’ across the text document. The document has paragraphs and text before and after the following patterns, which i don’t want to extract. Can anyone help me with the regex for the following ? which would extract all

When does a HashTable / Python dict stop probing?

In Java I’m building a datastructure that is supposed to resemble dictionaries in Python. (As far as I understand this is called a “HashTable” in java context.) I have read the following Python documentation in order to arrive at the probing function (as I wished to prevent using linear probing) Now I have come to a point where Im trying

Space complexity in shallow vs deep copy

Consider the problem of merging two sorted linked lists whilst keeping the order. For instance if L1: 1->1->2->4 and L2: 2->3->5 Then the result should be 1->1->2->2->3->4->5. In Elements of Programming Interview, the author presents the following solution in Java, which consists of running through both lists and choosing the smallest value to add to a dummy head: The author

Issue with Base64 encoding in Python and Decoding in Java

I have two packages running, one is written in python and the other in Java. The python package encodes a json(dictionary) object and sends it to the java package which decodes it into a specific POJO. Let the json in python be: { “name”: “John”, “Age”: 24, “Income”: None } The problem is that Java does not support None, it

Transforming JSON with XSLT using SaxonEE and Python

I am attempting to write a Python script that transforms JSON to a text file (CSV) with XSLT. With saxon-ee-10.5.jar, I can successfully perform the desired transformation by running the following command (Windows 10): How can I achieve the same result by using Python? I have been trying with Saxon-EE/C, but I am not sure if what I want to

trying to convert Java RSA-PSS signature verification code (with SHA256 hash, SHA1 MGF hash) to Python

Here’s my Java code, which successfully verifies the signature, as expected. The full code (with the imports, keys, message and signature) can be seen at https://pastebin.com/PmhGDaPv in case you want to try to reproduce the issue. My Python code, which does not verify the signature, as expected: The full code (with the imports, keys, message and signature) can be seen

Advertisement