I have a text file containing a list of titles that I need to change to title case (words should begin with a capital letter except for most articles, conjunctions, and prepositions). For example, this list of book titles: barbarians at the gate hot, flat, and crowded A DAY LATE AND A DOLLAR SHORT THE HITCHHIKER'S GUIDE TO THE GALAXY should be changed to: Barbarians at the Gate Hot, Flat, and Crowded A Day Late and a Dollar Short The Hitchhiker's Guide to the Galaxy I wrote the foll...
ادامه مطلبI am implementing a project with angular 5 in front end and springboot in backend. While i'm trying to send a request from client to backend, In the google chrome console the following message is displayed GET http://localhost:4200/customer 404 (Introuvable) And In the tomcat console I'm getting this line avr. 23, 2018 11:26:21 AM org.apache.tomcat.util.http.LegacyCookieProcessor processCookieHeader INFOS: Cookies: Invalid cookie. Value not a token or quoted value Note: further occurrences of Co...
ادامه مطلبSo msgpack-c provides me with objects as arrays. Say I serialized a a C++ message alike this: template struct Message { std::vector data; std::vector shape; MSGPACK_DEFINE(data, shape); }; and had T == double. If deserialised to json in C++ it would have inteals like [[1.23,3.01,44.02,33],[2,2]]. Now I want to deserialize it in C# with MessagePack-CSharp. If I try to tu it into json string I get an...
ادامه مطلبHow can I execute code received from dis.dis() python? import dis class A(): def __init__(self): print("hello") dis.dis(A) '''It retus: 3 0 LOAD_GLOBAL 0 (print) 2 LOAD_CONST 1 ('hello') 4 CALL_FUNCTION 1 6 POP_TOP 8 LOAD_CONST 0 (None) 10 RETU_VALUE ''' I want something like this: import dis dis.run(''' 3 0 LOAD_GLOBAL 0 (print) 2 LOAD_CONST 1 ('hello') 4 CALL_FUNCTION 1 6 POP_TOP 8 LOAD_CONST 0 (None) 10 RETU_VALUE ''') i.e. Execute python disassembler.(I can execute .pyc from python ,can i ex...
ادامه مطلبAs a long-time Visual Studio user, I often use Find in Files to find things throughout the project. In IntelliJ, this is causing me problems, because sometimes IntelliJ decides, for some reason, that what I want is "Directory" rather than "In Project". (I usually notice this after I'm baffled by the small number of matches.) How can I get IntelliJ to exclusively open Find in Files in In Project mode, and never in one of the other settings?...
ادامه مطلبI've fitted the following model models_list_1 % group_by(FEATURE) %>% do( fit = lmerTest::lmer( RESPONSE ~ TREATMENT * SESSION + (1 | SUBJECT), data = . ) ) %>% pull(fit) %>% lapply( function(x) summary(x)$coefficients ) %>% setNames( unique(dataset_long$FEATURE) ) and extracted the pairwise stastistics as follows md % group_by(FEATURE) %>% do( fit = lmerTest::lmer(...
ادامه مطلبI have a sample list of file names that I'd like to capture just the 'name' and the optional s##e##. Everything else I don't need. I used regex101.com to test the patte that I would be using in Java later. Heroes (2006) - s01e01 - Genesis.mp4 [Not-Important] One Piece - s22e48 - 1178 [More_not_important].mkv Stargate s01e01.mkv Stargate the Movie.mkv Star-Trek s01e01.mkv (Not_Important) Star_Trek_the_Movie (Some-More).mkv and I have this Java regex patte (?:^[[(].*?[])])?(.*?)([sS]d+...
ادامه مطلبThis question would an "update" about this kind of topics, like this old question (Is it possible to declare constexpr class in a header and define it in a separate .cpp file?), but now with C++ modules, in the context about functions that are called from multiple files and not only called from the same file. About functions that with a traditional file structure, .h/header and .cpp files, need to be placed entirely in the header file: constexpr functions template functions Now with C++ module...
ادامه مطلبCaot get through my docker container and coect to my local ollama server. Ollama server is up and ruing : http://localhost:11434 retus "Ollama is ruing" When adding n8n credentials for ollama, I get the following : Couldn't coect with these settings ECOREFUSED Here's my n8n credentials config : Base URL : http://host.docker.inteal:11434 API Key : not needed for local install and ruing models (?!) Allowed HTTP Request Domains : All According to what I've found, looks like...
ادامه مطلبI am training a C in a custom training loop. I am updating the weights manually, and calculating the gradients with torch.autograd.grad and manually. grads = torch.autograd.grad(outputs=model.fx, inputs=model.layers_weight, allow_unused=True, grad_outputs=[torch.ones_like(out) for out in model.fx]) model.fx are the outputs of all the linear functions except for the last element which is the loss. The inputs are the weights. Using these gradients I calculate back in the network dl/dw for each...
ادامه مطلبI have the following union (C# 15+): public union ValueSource(int, Func); As per the docs: An implicit union conversion exists from each case type to the union type So I expect both of the following to work: ValueSource src1 = 42; ValueSource src2 = () => 42; However, the assignment to src2 fails with: CS1660: Caot convert lambda expression to type 'ValueSource' because it is not a delegate type Moreover, if I have this static method: public class IntSource { public stat...
ادامه مطلبI'm trying to lea PCA using R but I'm unsure whether I'm using the results correctly. I have included the code for my attempt at using PCA to analyse the decathlon2 dataset in R with a scree plot, loadings and biplots with brief notes on what they show, and would like to know if these are sound conclusions or if I am misinterpreting the results.Many thanks.library(ggplot2) library(corrr) library(ggbiplot) library(factoextra) library(ggcorrplot) library(corrplot) library(dplyr) library(gt) Dec...
ادامه مطلبI have a Docker container with OrbStack that contains a directory repos with a repository app-main and worktrees like app-feature-a to develop in parallel. Configuration is done in order to prevent modification of the container configuration file in the ruing Docker. project/ ├── .devcontainer/ # outside the mount, on purpose │ └── devcontainer.json └── repos/ ├── app-main/ ├── app-feature-a/ └── app-feature-b/ MWE for devcontainer.json : { "name": "myproject", "image":...
ادامه مطلبWe would like to use Hibeate StatelessSession injected into our Spring Data JPA repositories. Our understanding is this requires HibeateTransactionManager and SharedSessionCreator.createSharedStatelessSession. Our setup is like follows: @Bean public HibeateTransactionManager transactionManager(EntityManagerFactory entityManagerFactory) { var hibeateTransactionManager = new HibeateTransactionManager(entityManagerFactory.unwrap(SessionFactory.class)); retu hiber...
ادامه مطلبI created a file with one line "bug line", initialized git repository and committed change. Then I added the second line "staged" and staged the change. Then I added the third line "unstaged". How to add a commit changing the first line to "bug line changed" so that I still get the second line as staged change and the third line as unstaged change without merge conflicts?...
ادامه مطلبI get this error, if I click my script multiple times: Uncaught (in promise) Error: reCAPTCHA has already been rendered in this element. I know, that error is correct, but how can I fix this? I have got a cookie-icon that shows a baer to accept or to reject the recaptcha/form. I hide or show the recaptcha/form onclick, but if the user clicks multiple times the accept button i get this error in console and he can not send the form. Hard to explain here is my code :) Edit: Here is a jsfiddle:...
ادامه مطلبI'm writing a query in Oracle SQL. I'm using a count - group by query, for example: select column_a, count(*) from table_1 group by column_a COLUMN_A COUNT(*) value_1 5 value_2 6 value_3 2 (null) 1 Can I write a group by that allows me to get two result rows, one with value_1 and its count, and another with the count of all other values? It would look like this: COLUMN_A COUNT(*) value_1 5 others 9...
ادامه مطلبThe following code snipped defines a nested chain of templated C++ classes. The problem I have starts on the third level. The initialization of the three level nested class works well, which can easily checked in a debugger. However, a problem arises when attempting to access the nested class member variables aValue. While the first two levels work well, accessing third level aValue gives me no joy. Any suggestions on how to propagate variable access down the chain? Ideally, is there any iterato...
ادامه مطلبWhen working with keyboard input in a situation like the one shown in the next simplified example: // abc.hpp #pragma once #include // ranges of integer values in the enum could be contiguous or // not, so question is for a general scenario. However if being // a contiguous range of integer values makes things notably // simpler, then certainly it'd be interesting to know about it. enum FileType : int { JSON = 1, YAML = 2, XML = 3 }; constexpr std::array...
ادامه مطلبI am working on improving the SEOP of an e-shop built as a React SPA. (I know its bad). The e-shop contains products that have one main Manufacturer Part Number, but some products can also have one or more alteative manufacturer part numbers. I need to make sure that wehn people search on Google using one of these alteative part numbers, Google can associate the alteative number with the correct product and show the corresponding product page in the search results. For example, if a produc...
ادامه مطلب