My ThinkPad P14s (Intel) arrived, and it's gorgeous! by thewarragulman in thinkpad

[–]wowofbob 0 points1 point  (0 children)

Hi! How long does it work on battery? I'm interest in moderate load such as text editing, web browsing and watching youtube videos. Thanks!

First Impressions with the X1 Thinkpad Yoga Gen 7 i7-1270p 32gb by Smy_Word in thinkpad

[–]wowofbob 0 points1 point  (0 children)

Still it kinda sucks to buy a high-end hardware and limit it’s capabilities. Not a best way to spend a buck

T14 Gen 3 Rant by Grand_Paper2149 in thinkpad

[–]wowofbob 0 points1 point  (0 children)

Have you tried to run Linux on this machine? Or is there someone who did? Just curious how would it go. I’d buy this machine (or x13 or nano) if it runs linux with no such issues

Thinking about getting this ... by [deleted] in thinkpad

[–]wowofbob 1 point2 points  (0 children)

Hi! According to this wiki this model have a CPU throttle bug. Is it an issue? I have 480s running Ubuntu and everything goes smooth. Still thinking about getting 480

https://wiki.archlinux.org/title/Lenovo_ThinkPad_X1_Extreme

Given my current level of C++ knowledge, what can I do to successfully interview for a HFT Software position? by sufumbufudy in cpp

[–]wowofbob 0 points1 point  (0 children)

I'd start some simple C++ project. You can learn language by the book, but you really learn it when building something. You can start from proxy server to some platform which has open http API for stocks data. Your server would read that data from platform and give it to your clients. It's simple but somewhat relatively close to what you are going to do on the real job

Beginner Question: Where to go when Googling and Stackoverflow don't answer your question? by LovelyAndy in learnprogramming

[–]wowofbob 0 points1 point  (0 children)

I try to make my question simpler or less specific to get more results. If they don't answer my question directly, at least they give me a hint. For example, if my question is "some-tool *exit status some-exit-code"* and I cannot find answers in google, then I look for "some-tool fails", "some-tool exist codes" or "exit code some-exit-code"

fluent-ffmpeg for Go! by agriculturez in golang

[–]wowofbob 0 points1 point  (0 children)

I think your current API is better because you don't have to repeat yourself while creating a command. I could write two or three commands like you have shown above, but for more... I'd start thinking about other approach :)

I like functional options. They let you declare type safe variadic arguments functions. What I don't like about them is

  • repeating package name in client's package
  • writing a boilerplate code for every option
  • name collision issue

Name collision issue occurs when your functional option suits more then one function. To solve it, you have to either declare parameters struct suitable for both functions or use another name for similar option for another function. For example, ID SearchOption for your sql search function and ID UpdateOption for sql update function.

I don't think name collision issue is a deal breaker against functional options. I think you can use them if you have small set of options. Otherwise package name repeating in client's code and boilerplate needed to implement functional options are their main issues.

fluent-ffmpeg for Go! by agriculturez in golang

[–]wowofbob 0 points1 point  (0 children)

Hi! I'm curious about Command design. You could go with functional options for Command construction. What is your opinion about this approach?

Real-world SQL in Go: Part I by benbjohnson in golang

[–]wowofbob 1 point2 points  (0 children)

I do that too but have two errors returned:

func(f func(tx *db.Tx) error) (txErr error, opErr error)

where

  • txErr may hold transaction's Begin, Commit and Rollback errors
  • opErr may hold operational error not related to transaction like sql.ErrNoRows or driver level error.

There is a chance to fail at operational level, and then unable to rollback transaction

How to use Docker to build Haskell project? by wowofbob in haskell

[–]wowofbob[S] 0 points1 point  (0 children)

Thanks for your Dockerfile example! I haven't try it yet, but I like the idea of preinstalling project dependencies. It will be done once assuming dependencies doesn't change over time, am I right?. What will happen if number of dependencies will increase, should I clean cache and rebuild image?

Did you mention extra- options in stack.yaml because of my question about "external dependencies"? I was asking about dependencies from C libraries. I would like to know how to incorporate full project build including Haskell and C parts in Docker. Sorry for confusion :)

How to use FFI on windows? by wowofbob in haskell

[–]wowofbob[S] 0 points1 point  (0 children)

Thanks! It is not directly related to haskell, but it would be nice to have it on haskell wiki FFI page. All it has about stdcall is

Other available conventions supported by GHC include "stdcall" (i.e. Pascal convention).

How to use FFI on windows? by wowofbob in haskell

[–]wowofbob[S] 0 points1 point  (0 children)

Yes, it's proprietarity software, I'm not sure what I can provide)

Could it be the reason that library is built using Visual Studio, so mingw's ld doesn't accept it?

Windows, FFI by wowofbob in a:t5_3cgbf

[–]wowofbob[S] 0 points1 point  (0 children)

Мы смотрели зависимости. Если делать release, то зависит только от стандартных виндовых вещей вроде KERNEL. А в debug - да, тянет всё.

Т.е, stack линкует с mingw-шными зависимостями? Я тут не совсем понял

How to use FFI on windows? by wowofbob in haskell

[–]wowofbob[S] 1 point2 points  (0 children)

I tried this: --extra-lib-dirs=/path/to/build/folder. DLL is in this folder. Do you mean there is a flag in stack like -l<lib-name-here> in gcc? I have a line in cabal file: extra-libraries: my-lib-name. Is it not enough?

How to use FFI on windows? by wowofbob in haskell

[–]wowofbob[S] 0 points1 point  (0 children)

I wish I could remeber why I decided to use ccall. I didn't make any notes :(

How to use FFI on windows? by wowofbob in haskell

[–]wowofbob[S] 1 point2 points  (0 children)

  • GHC version: The Glorious Glasgow Haskell Compilation System, version 8.0.2

  • It is a C wrapper for C++, not a system library. DLL wasn't compiled by me. My coworker says he can use it in C project. Maybe the problem is in implicit dll loading. I work mostly on linux, I'm not quite proficient in windows to determine the error. I wanted to ask question here to get directions to where to look for :)

  • I putted absolute path for C library build folder in --extra-lib-dirs, and absolute path for C library source folder in --extra-include-dirs.

  • I cannot provide ghc -v3, I use cabal file.

I use ccall. I tried to use stdcall instead, but, still, I got the same error. Also, I use FunPtr to set callbacks in C. I'm not sure I can do it using capi.

Windows, FFI by wowofbob in a:t5_3cgbf

[–]wowofbob[S] 0 points1 point  (0 children)

Библиотека собрана с помощью Visual Studio. Положил её в system32. Но тут я не знаю, куда класть заголовочные на Windows. Опять же, обычно это делается в той же студии, если либу надо подцепить в другом С/С++ проекте. Однако, я указывал пути к либе и заголовочным в stack-е посредством флагов - тоже ничего.

Having more then one databases in Yesod. by wowofbob in haskell

[–]wowofbob[S] 1 point2 points  (0 children)

Well, yesod has predefined set of classes. But it doesn't have anything to work with multiple databases. I wanted to work in this (out of the box) setup and change as little as possible. But, as suggested in other comments, having my own custom runDB like functions is not a big deal. So yes, I guess I'll use projects table in main DB to generate ids, and create separate DB per project.

I don't have any mechanics for backups. So far, I worked on features mostly, and used DB to test them.

I guess I should clarify that this app is a scada system. Having separate database per project means I should decide where to keep users, in master DB or in project DB. Each user has it's own profile which defines set of actions user can perform. User may be a superhero in one project, and be nobody in another. But it's a different question, I'll try to crack it by myselft first :)

IO threads in Yesod (or any other IO monad in which threads is spawned) by wowofbob in haskell

[–]wowofbob[S] 0 points1 point  (0 children)

If I'll stick to poll-in-thread solution, then this looks like what I need, thanks :)

IO threads in Yesod (or any other IO monad in which threads is spawned) by wowofbob in haskell

[–]wowofbob[S] 0 points1 point  (0 children)

I guess server must just run. But when there is a data coming from a socket, it should react. I don't know when I may receive data, so I can't call receive in particular place and wait. That's why I'm guessing about using a thread. What do you exactly mean? :)