instruction
stringlengths
0
30k
null
As it turns out, it was more of a Batch issue than a Boot issue. What worked for me was adding the application property 'spring.batch.jdbc.initialize-schema=always'
I have a tests case which uses react-dom 16.8 `const mockDOM = ReactTestUtils.renderIntoDocument(Component()` returns null. But in react-dom 16.7 it is working fine. Any fixes for that? Component is written using Class not function Seems like the method implementation has changed
Lock the row references using `$`: ``` Formula1:="=" & ws1.Name & "!" & "A$1:A$" & aantalrijen2 ```
A good regex would be `(?<=[^0]\w{3}\w*)\w(?=\w{4})`. Unfortunately, in Java you can't use unbounded lookbehinds, but you can use (?<=[^0]\w{3,14})\w(?=\w{4}) if you know that your string is at most 20 characters long (14 = 20 minus the first character, minus the one you're matching, minus the last 4 ones). Clearly this value can be computed dynamically. See a demo [here](https://regex101.com/r/hvMU2x/1).
Karate call embedded function conditionally
I want to get the path (from parent to child node) of a structure that is nested. Is it even possible to do it in ABAP? ![table](https://i.stack.imgur.com/Pt1OA.png) For example, for `column 1` I want to get: `lt_Structure-table1-tableA-field1`, for `tableA` I want to get: `lt_Structure-table1-tableA`. I have multiple fields and a couple of nested structures in those columns so it has to be a dynamic solution, have any of you came across something similar? I need to get all of the values from the structure and I do not see any other way than: ``` ASSIGN (lt_Structure-table1-tableA-field1) TO <fs_value_of_the_field1>. ``` The part inside brackets needs to change dynamically.
**When running npx react-native run-android it shows this error. I am using JDK 17 and gradle 6.8.1** ```none > Task :react-native-community_netinfo:compileDebugJavaWithJavac FAILED > Task :react-native-community_masked-view:compileDebugJavaWithJavac FAILED > Task :react-native-community_datetimepicker:compileDebugJavaWithJavac FAILED > Task :react-native-community_cameraroll:compileDebugJavaWithJavac FAILED > Task :react-native-async-storage_async-storage:compileDebugJavaWithJavac FAILED > Task :react-native-extra-dimensions-android:compileDebugJavaWithJavac FAILED > Task :react-native-camera:compileGeneralDebugJavaWithJavac FAILED warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 warnings warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. 3 warnings warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. 3 warnings warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: C:\reactapp\ehs_pulse_app\node_modules\@react-native-community\cameraroll\android\src\main\java\com\reactnativecommunity\cameraroll\CameraRollModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 warnings warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: C:\reactapp\ehs_pulse_app\node_modules\@react-native-async-storage\async-storage\android\src\main\java\com\reactnativecommunity\asyncstorage\AsyncStorageModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 warnings warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: C:\reactapp\ehs_pulse_app\node_modules\react-native-extra-dimensions-android\android\src\main\java\ca\jaysoo\extradimensions\ExtraDimensionsModule.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 warnings warning: [options] source value 7 is obsolete and will be removed in a future release warning: [options] target value 7 is obsolete and will be removed in a future release warning: [options] To suppress warnings about obsolete options, use -Xlint:-options. Note: Some input files use or override a deprecated API. Note: Recompile with -Xlint:deprecation for details. 3 warnings FAILURE: Build completed with 7 failures. 1: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-community_netinfo:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 2: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-community_masked-view:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 3: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-community_datetimepicker:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 4: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-community_cameraroll:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 5: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-async-storage_async-storage:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 6: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-extra-dimensions-android:compileDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights. ============================================================================== 7: Task failed with an exception. ----------- * What went wrong: Execution failed for task ':react-native-camera:compileGeneralDebugJavaWithJavac'. > java.lang.IllegalAccessError: class org.gradle.internal.compiler.java.ClassNameCollector (in unnamed module @0x7471177c) cannot access class com.sun.tools.javac.code.Symbol$TypeSymbol (in module jdk.compiler) because module jdk.compiler does not export com.sun.tools.javac.code to unnamed module @0x7471177c ``` **and if I use JDK 11 in running the project it will install but it will suddenly crash after the message says 'BUILD SUCCESFUL'.** also if I use JDK 11 and run 'npx react-native doctor' it will show that it can't find the sdk but if I use JDK 17 it will be just fine. I am trying to run this old project.
I'm filling for someone at work today who is in charge of our SQL codebase. I don't have any experience with SQL. I have a file called `exp_impl.sql` with this code: ``` create schema if not exists exp; grant usage on schema exp to public; create table exp.manifest ( -- id INT PRIMARY KEY; -- some attributes are defined below and omitted ); ``` I received a request to add ``` default nextval('ids_id_seq') ``` after the primary key with the comment "I would like for the `id` here to share the same sequence as the `id` in the `result.ids` table". I added this, and now the file looks like: ``` create schema if not exists exp; grant usage on schema exp to public; create table exp.manifest ( id INT PRIMARY KEY default nextval('ids_id_seq'); -- some attributes are defined below and omitted ); ``` Bazel tests we have for this file are running successfully, but from what I can see `ids_id_seq` isn't defined anywhere. Do I need to create this sequence in the file? How can I expose this file to `result.ids` table -- is there some kind of header file I need to include?
I have finally reached a solution. Maybe there is a simpler way but this is what has worked for me: ``` class MainActivity : ComponentActivity() { override fun onCreate(savedInstanceState: Bundle?) { super.onCreate(savedInstanceState) setContent { MainActivityLayout() } } } @Composable fun MainActivityLayout() { val context = LocalContext.current val assetManager = context.assets Column( modifier = Modifier.fillMaxSize(), horizontalAlignment = Alignment.CenterHorizontally ) { var fileList by remember { mutableStateOf(emptyList<String>()) } Button( onClick = { val files = assetManager.list("files") fileList = files?.toList() ?: emptyList() }, modifier = Modifier.fillMaxWidth() ) { Text("List Files") } ShowFileList(fileList) } } @Composable fun ShowFileList(fileList: List<String>) { Column { Text("Files in assets/files:") fileList.forEach { Text(it) } } } ``` As has been said in comments and in last answer, I had to create the assets folder and put in there the folder containing the files I want to list.
unable to verify nodes.js (mern) cookie jwt token
|node.js|cookies|mern|httpcookie|express-jwt|
null
How can I accumulate a binary array containing 0 and 1 into an integer? vector<int> arr = {1,0,1,0,1,1,1,0,1,0,0}; int num = accumulate( arr.begin(), arr.end(), [](int &a, int &b) { // ??? } ); At each step I need something like this: if(arr[i] % 2) num += pow(2, i); But how to implement this in lambda? How to get `i` in lambda?
I'm trying to implement RNN and LSTM , many-to-many architecture. I reasoned myself why BPTT is necessary in RNNs and it makes sense. But what doesn't make sense to me is, most of resources I went through online for LSTM back prop (like attachment ) and this one : https://www.youtube.com/watch?v=8rQPJnyGLlY Seems to be doing more of back propagation w.r.t current time stamp itself, but not through time , keeping variable convention aside, similar to RNN , I would assume that when calculating DL w.r.t Wf, since both current time step and previous hidden states are made up of Wf, both needs to added together, but most derivations I found are not doing that. Specifically, taking coursers's notation, forward prop: ft = sigmoid( Wf.(at-1, xt) + bf ) it = sigmoid(Wi.(at-1, xt) + bi ) ctil = Tanh(Wc.(at-1, xt) + bc ) ct = ft * ct-1 + it*ctil ot = sigmoid(Wo.(at-1, xt) + bo ) at = ot * Tanh(ct) yhat_t = Softmax(Wy.at + by ) Since at-1 and ot both have Wo in their equations, I would assume following derivation for dWo: ``` dWo = dat * (1-T(ct)**2 ) * ot* (1-ot )*(at-1,xt)-dot part + dotat-1 * dat-1ot-1 * dot-1Wo ``` Above derivation contains dot + dot-1. But derivation given by coursera, only contains dot and not dot-1. And in the derivations of update and forget gates, what follows after plus sign, shouldn't they be t-1 and not t ? So, I'm assuming LSTM back-prop doesn't involve BPTT , could someone please enlighten me on this ? I'm specifically looking for the right theoretical derivation of BP in LSTMs, and if they involve BPTT in theory or not. Any help is very much appreciated. Thanks ! [![Coursera LSTM Backprop Derivation][1]][1] [1]: https://i.stack.imgur.com/4kZ6f.png
Make sure that the test class doesn't accidentaly have the `@Ignore` annotation. *While not applicable to the originaly stated case, same exception occurs as well if somebody for some reason uses this annotation on the class, and you try to run a test without noticing the class-wide `ignore`.*
**hello**, <br> I am trying color my paragraph tag but i unavailable to do because top p tag (element selector) is overriding bottom p tag. <br> it work when i write tag name but i want them to *automatically inherit* color. Not to write every single name of the elements. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> h1, p{color: #000;} :root{ --modern-white: #fff; } .section-main { & .container .section-main--content { color: var(--modern-white); } } <!-- language: lang-html --> <main class="section-main"> <div class="container"> <div class="section-main--content"> <h1>lorems impus</h1> <p> iis natus, id ea odio. Rem reiciendis, aliquid ut nisi voluptas deleniti reprehenderit eum possimus, consequuntur expedita molestiae pariatur veniam nostrum, earum rerum. Sunt vitae saepe hic quae quo aperiam harum quidem maiores voluptatum, dignissimos dolor libero at nobis aut repellat exercitationem cupiditate, quasi quas delectus recusandae. Necessitatibus </p> </div> </div> </main> <!-- end snippet -->
Im using the whatsapp api to generate a file and send it to whatsapp api. I first test all parameters by postman and everything was great, postman generated this code: const myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer token"); myHeaders.append("Cookie", "ps_l=0; ps_n=0"); const formdata = new FormData(); formdata.append("file", fileInput.files[0], "/C:/Users/Sub2/Documents/Hoja de trabajo.docx"); formdata.append("type", "application/vnd.ms-excel"); formdata.append("messaging_product", "whatsapp"); const requestOptions = { method: "POST", headers: myHeaders, body: formdata, redirect: "follow" }; fetch("https://graph.facebook.com/v19.0/{{media_id}}/media", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error)); If you use this code it will upload the file to the whatsapp api. The problem is that in node js its giving an error: `{"error":{"message":"(#100) The parameter messaging_product is required.","type":"OAuthException","code":100,"fbtrace_id":"AAql5W804gIHMiKVCxX7InY"}}` The parameter messaging_product is required, but this code: `formdata.append("messaging_product", "whatsapp");` add that parameter, i dont know what's the problem. The only code part that is different in my node code is this `formdata.append("file", fileStream);` im using the exceljs to generate a file, Thank you for any suggestions. Update: This code is not working: const myHeaders = new Headers(); myHeaders.append("Authorization", "Bearer token"); myHeaders.append("Cookie", "ps_l=0; ps_n=0"); const formdata = new FormData(); formdata.append("file", fileBuffer); formdata.append("type", "application/vnd.ms-excel"); formdata.append("messaging_product", "whatsapp"); const requestOptions = { method: "POST", headers: myHeaders, body: formdata, redirect: "follow" }; fetch("https://graph.facebook.com/v19.0/{{media_id}}/media", requestOptions) .then((response) => response.text()) .then((result) => console.log(result)) .catch((error) => console.error(error))
I managed to resolve it by converting the date to a timestamp before comparing. This works if the date is in the format (Y-m-d). Here is the final: function isIncreasing(dates) { let prevDate = new Date(dates[0]).getTime(); for (var i = 1; i < dates.length; i++) { let convertedToDate = new Date(dates[i]).getTime(); if (prevDate > convertedToDate) { return false; } prevDate = convertedToDate } return true; } console.log(isIncreasing(['2023/12/12','2023/12/13','2023/12/14','2021/12/12'])) console.log(isIncreasing(['2023/12/12','2023/12/13','2023/12/14']))
You can go through this repository as it might help you. Repo : https://github.com/philipplackner/WeatherApp
In Struts 2: In case of exception in prepare method, the Action is not called. How to handle `Exception` in `prepare()` method so that action method is always called ? Now I'm doing this but surely exists a better way: private Exception exceptionInPrepare = null; @Override public void prepare() throws Exception { try { ... ... } catch (Exception e) { exceptionInPrepare = e; } } @Action("myMethod") public String myMethod() { try { if (exceptionInPrepare != null) { throw exceptionInPrepare; } ... ... } catch (Exception e) { ... ... } finally { ... ... } return .... }
If you're looking for the exact place to enable this flag: [![enter image description here][1]][1] I had the same issue and it fixed it for me [1]: https://i.stack.imgur.com/I9bWc.png
This is a known issue (cf. [Issue #1539](https://github.com/apache/logging-log4j2/issues/1539)) due to the way Log4j 2.x instantiates message factories, which is apparently not supported by GraalVM. The issue is addressed in [PR #2392](https://github.com/apache/logging-log4j2/pull/2392) for the `java.util.logging` and Logback backend of Log4j API. Log4j Core users currently need to generate reachability configuration themselves. There is an [ongoing discussion](https://github.com/apache/logging-log4j2/discussions/2364) on what kind of reachability metadata should be shipped with `log4j-core` by default. ## Workaround The core of the problem is that libraries such as Log4j Core and Logback transform configuration files into a tree of Java components using reflection. Since the reflective calls don't have compile-time constant arguments, GraalVM is not able to determine which classes need to be included. To workaround this you can add a **reachability configuration** to your application (cf. [reachability metadata](https://www.graalvm.org/latest/reference-manual/native-image/metadata/)). The easiest way to do this is to: - run your application using Java and GraalVM's tracing agent (cf. [tracing agent](https://www.graalvm.org/latest/reference-manual/native-image/metadata/AutomaticMetadataCollection/)). The tracing agent will detect all the classes that are accessed through reflection and will create the necessary `reflect-config.json` and `resources-config.json` configuration files. - copy the generated `*-config.json` files into a `META-INF/native-image/<group.id>/<artifact.id>` resource folder of your application, - compile the application using GraalVM.
Using ActiveMQ Artemis 2.20 with these settings on queues: ```xml <redelivery-delay>600000</redelivery-delay> <max-delivery-attempts>9</max-delivery-attempts> ``` I'm occasionally seeing build-ups of scheduled messages where it's not always obvious what the reason for the redelivery issue. In order to investigate it would be useful to know how many times message have attempted redelivery since they first were sent. However, I don't see this info recorded in the output of the `listScheduledMessages()` operation. Is it possible to get this detail through any operational API?
I encountered a similar issue previously when I overlooked running the build command. Considering you're encountering the same problem, it's possible that the absence of a 'dist' folder might be due to not building the package beforehand. Perhaps you've mistakenly committed an outdated 'dist' folder? To address this, you have a couple of options: 1. Run **npm run build** prior to publishing. 2. Alternatively, you can add the following script to your package.json: ```json "scripts": { "prepack": "npm run build" } ``` This script will automatically execute the build command before the package will be published.
You can use `:has` pseudo-class. - Lean more : https://developer.mozilla.org/en-US/docs/Web/CSS/:has - Can I use : https://caniuse.com/css-has <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-css --> label:has(input:checked){ color : red; } <!-- language: lang-html --> <label> label <input type="checkbox" /> </label> <!-- end snippet -->
|python|pytorch|
I am using different numerical methods to understand the results yielded from different types of integrators at different time steps. I am comparing the performance of each integration method by calculating the Mean Absolute Error of the predicted energy with the analytical solution: `$$ MAE = \frac{1}{n} \sum_{i=0}^{n}\left | y_{analytical} - y_{numerical}\right | .$$` Then for different time-steps I am calculating the resulting MAE and plotting the results in a log vs. log plot as shown below. [log (MAE) vs. log(Time_step)](https://i.stack.imgur.com/ozMkL.png) The relation between MAE and time-step matches my expectations (the Verlet Method scales quadratically and the Euler Cromer method scales linearly), but I am noticing that the Verlet method has a turning point at about 10^(-4) s. This seems slightly too large and I was expecting instead a turning point to arise at time-steps closer to 10^(-8) s as I am using numpy's float64, hence there are about 15 to 17 decimal places of precision. I went onto plot the maximum and minimum errors obtained for each time step (Excluding iteration 0 as those are the initial conditions which are the same for both numerical and analytical methods) and these are the results: [log (Max Err) vs. log(Time_step)](https://i.stack.imgur.com/Thyjd.png) [log (Min Err) vs. log(Time_step)](https://i.stack.imgur.com/dXxpA.png) Again when plotting the maximum error I obtain a minimum of similar value compared to the previous plot, but plotting the minimum obtained error (these always happened in the first few iterations after the initial conditions) I obtain that the errors seem to flatten out at 10^(-4) s and approach errors of about 10^(-15) J in the energy. Because of this flattening of the minimum errors, it makes sense that going further than 10^(-4) s does not increase the precision of the Verlet's method, but I cant explain why the maximum errors grow after this point. An explanation that comes to mind is the round off error cause by float64 that should happen when values reach about 10^(-15), 10^(-17). I have manually checked the position, velocity and acceleration that result from running the verlet method but their lowest values are of order 10^(-9), very far from 10^(-15). (1) Is it possible that I am introducing a round off error when I am calculating the residual error from the analytical and the verlet's method? (2) Are there other more appropriate ways of calculating the error? (I thought MAE was a good fit because the verlet method oscillates about the true system values) (3) Are there tweaks that could be done to show possible flaws within my analysis, I have looked at my code extensively and I am not able to find any bugs, furthermore, the Verlet method I coded does have an error which scales quadratically with time step which makes me think that the code itself is fine. (Maybe a possible attempt would be to use float128 and ensure its used throughout all calculations and then see if the above plots differ?) Thanks in advance for any help with the above questions
Upgraded C# MVC project EF 4.7.2 to .net Core 8.0, on build my solution, I got the below error. >'OperationContext' does not contain a definition for 'ServiceSecurityContext' and no accessible extension method 'ServiceSecurityContext' accepting a first argument of type 'OperationContext' could be found (are you missing a using directive or an assembly reference?) ```csharp using System.Security.Principal; using System.ServiceModel; if (OperationContext.Current != null) { if (!string.IsNullOrEmpty(OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name)) { return OperationContext.Current.ServiceSecurityContext.WindowsIdentity.Name; } if (!string.IsNullOrEmpty(OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name)) { return OperationContext.Current.ServiceSecurityContext.PrimaryIdentity.Name; } } ``` I tried to install `System.ServiceModel.Primitive` and it didn't work.
|excel|maps|
i have data and i have succeeded in calling it but inside the data there is a set i couldn't i summoned the data correctly title, description and imgUrl by using map function, but i didn't know how to summon array (technologies) in a list ### Component: ```reactjs export const ProjectCard = ({ title, description, imgUrl, technologies }) => { return ( <Col size={12} sm={6} md={4}> <div className="project-imgbox"> <img src={imgUrl} alt="" /> <div className="project-text"> <h4>{title}</h4> <span>{description}</span> <span>{technologies}</span> </div> </div> </Col> ); }; ``` ### Data: ```javascript export const all = [ { title: "Business Startup", description: "Design & Development", imgurl: projImg1, technologies: ["Html", "Javascript", "Css"], }, { title: "Business Startup", description: "Design & Development", imgurl: projImg2, technologies: ["Html", "Javascript", "Css"], }, { title: "Business Startup", description: "Design & Development", imgurl: projImg3, technologies: ["Html", "Javascript", "Css"], }, ]; ``` I tried many things and tried to summon her within a group, but it did not work
Guerreiros, estou travado em um problema onde eu tenho um código typescript que valida um formulário de envio. Nesse form foi adicionado um campo de upload onde o usuário pode enviar múltiplos arquivos. E também foi feito um tipo de lista visual pro usuário adicionar e remover os arquivos. Quando clico pra selecionar os arquivos, e seleciono todos de uma vez no explorador de arquivos, eles vem corretamente no array. Agora quando adiciono um por vez, só vem o último arquivo adicionado dentro do array. Então acredito que em algum momento o Array esteja sendo soobrescrito ou redefinido. [enter image description here](https://i.stack.imgur.com/zv8dL.png) --- esse é o trecho do código responsavel pela criação do array e validação dos arquivos. ``` const uploadField = document.getElementById('00N1Q00000Tnupu') as HTMLInputElement; //id do campo de upload const fileListDiv = document.getElementById('fileList') as HTMLDivElement; const filesArray: File[] = []; uploadField?.addEventListener('change', function () { const files = uploadField.files; if (files) { for (let i = 0; i < files.length; i++) { const file = files[i]; const fileName = file.name; const fileSizeMB = file.size / (1024 * 1024); const allowedFormats = ['jpg', 'png', 'pdf', 'docx', 'xlsx', 'zip']; const fileExtension = fileName.split('.').pop()?.toLowerCase(); if (fileSizeMB > 10 || !allowedFormats.includes(fileExtension || '')) { const erroDiv = document.querySelector('.feedback[data-input="00N1Q00000Tnupu"]'); erroDiv.classList.remove('hidden'); erroDiv.classList.add('error'); const erroDivSpan = document.querySelector('.feedback[data-input="00N1Q00000Tnupu"] span'); // eslint-disable-next-line max-len erroDivSpan.innerHTML = 'Por favor, verifique o(s) arquivo(s) enviado(s). Certifique-se de que todos os arquivos estão nos formatos permitidos (jpg, png, pdf, docx, xlsx, zip) e a soma total do tamanho dos arquivos não ultrapasse 10MB.'; return; } filesArray.push(file); const fileItem = document.createElement('div'); fileItem.textContent = fileName; const removeButton = document.createElement('i'); removeButton.classList.add('icon-trash'); removeButton.style.color = '#a71900'; removeButton.style.marginLeft = '5px'; removeButton.style.cursor = 'pointer'; removeButton.addEventListener('click', () => { const index = filesArray.indexOf(file); if (index !== -1) { filesArray.splice(index, 1); } fileListDiv.removeChild(fileItem); }); fileItem.appendChild(removeButton); fileListDiv.appendChild(fileItem); } } const erroDiv = document.querySelector('.feedback[data-input="00N1Q00000Tnupu"]'); erroDiv.classList.add('hidden'); erroDiv.classList.remove('error'); }); ``` Tive algumas tentativas de armazenar esse array separadamente mas sem sucesso
I'm looking to switch the default SDK of my project in IntelliJ IDEA to Java 10 specifically. However, when I navigate to the download JDK option within IntelliJ, I notice that there's no vendor providing the **non-LTS version of Java 10**. Could someone guide me on how to configure IntelliJ IDEA to utilize Java 10, even though it's a non-LTS version? Any help or pointers on setting this up would be greatly appreciated. Thank you! [![enter image description here](https://i.stack.imgur.com/bRgwQ.png)](https://i.stack.imgur.com/bRgwQ.png) [![enter image description here](https://i.stack.imgur.com/Q1moX.png)](https://i.stack.imgur.com/Q1moX.png) My expectation is to set the current project SDK to java10, I even tried to change Language level, doesn't seem working [![enter image description here](https://i.stack.imgur.com/vOFPf.png)](https://i.stack.imgur.com/vOFPf.png)
How to Set Up IntelliJ IDEA to Use Java 10 Non-LTS Version for Project Development?
|java|java-8|java-11|java-10|
null
You can capture initial zeros and 3 alhpanumeric chars right after them in one group, the middle part into a second group, and then the last 4 alphanumeric chars into a third group, then only replace each char in the second group. Here is an example (Java 11 compliant): ```java String text = "0001113033AA55608981"; Matcher mr = Pattern.compile("^(0*\\w{4})(.*)(\\w{4})$").matcher(text); text = mr.replaceFirst(m -> m.group(1) + "*".repeat(m.group(2).length()) + m.group(3)); System.out.println(text); // => 0001113**********8981 ``` See the [Java demo][1]. The regex matches - `^` - start of string - `(0*\w{4})` - Group 1: zero or more `0` chars and then any four alphnumeric/underscore chars - `(.*)` - Group 2: any zero or more chars other than line break chars (replace with `\w*` if you only allow "word" chars) - `(\w{4})` - Group 3: four "word" chars - `$` - end of string. [1]: https://ideone.com/gTjIiN
happy to help! > the problem is: once payment has succeeded(or failed) the payment method component stays in a waiting state (donut).. I want to : > 1. show a message and reset it on fail > 2. redirect somewhere else on success (I was hoping it was clever enough to redirect to my redirect url by itself.. but I dont know if the drop in can do that ?) The Adyen Drop-in is able handle this for you. According to the [Adyen documentation](https://docs.adyen.com/online-payments/build-your-integration), you can get this behavior by overriding the `onPaymentCompleted(...)` and the `onError(...)` functions. Note: You must ensure that the `returnUrl` is specified in your request, see [documentation here](https://docs.adyen.com/online-payments/build-your-integration/?platform=Web&integration=Drop-in&version=5.60.0#handle-the-redirect). The configuration is used in `Checkout(configuration)`, you can find a [Javascript + .NET integration-example here](https://github.com/adyen-examples/adyen-dotnet-online-payments/blob/main/checkout-example/wwwroot/js/adyenImplementation.js#L66). ```js const configuration = { environment: 'test', // Change to 'live' for the live environment. clientKey: 'test_870be2...', // Public key used for client-side authentication: https://docs.adyen.com/development-resources/client-side-authentication analytics: { enabled: true // Set to false to not send analytics data to Adyen. }, session: { id: 'CSD9CAC3...', // Unique identifier for the payment session. sessionData: 'Ab02b4c...' // The payment session data. }, onPaymentCompleted: (result, component) => { console.info(result, component); }, onError: (error, component) => { console.error(error.name, error.message, error.stack, component); }, // Any payment method specific configuration. Find the configuration specific to each payment method: https://docs.adyen.com/payment-methods // For example, this is 3D Secure configuration for cards: paymentMethodsConfiguration: { card: { hasHolderName: true, holderNameRequired: true, billingAddressRequired: true } } }; ``` I see that your question also contains a reference to the ".NET Framework 4.72". Typically, the (javascript) code above should be part of your frontend (client-side). The client should then send your request to your backend (server-side/ASP .NET Core usually, which holds your secrets such as your `ADYEN_API_KEY` and `ADYEN_MERCHANT_ACCOUNT`), which then forwards that request to the Adyen servers. I've included a diagram below for illustration purposes below: [![Example of client-server communication][1]][1] [1]: https://i.stack.imgur.com/0PLv4.png Hope this helped you move forward with your integration :)
I aim to fine-tune a BERT model for a specific task involving simple arithmetic operations like "5 + 3 = 8" or "7 plus 2 equals 9". My dataset comprises thousands of examples where one operand, operator, or result is masked. For instance: - Masked: "1 added to [MASK] equals 7", Label: "1 added to 6 is equal to 7" - Masked: "6 plus 5 [MASK] 11", Label: "6 plus 5 gives 11" The challenge lies in ensuring that multiple correct labels are accepted for a masked sample during training. For instance, if the model predicts "equals" instead of the masked token in the second sample, it should be considered correct.
Finetuing BERT with masking and having multiple correct labels
|python|nlp|huggingface-transformers|bert-language-model|fine-tuning|
Your encryption code is wrong for a start: * There is no need for messing about with temp files. You can write directly to `cryptoStream`. * Do not blank out the `IV`, it's securely generated and needs to be there to keep the algorithm secure. * The IV should be pre- or appended to the encrypted result. * There is no point passing the key and IV to `CreateEncryptor`, that is the default. ```cs public async Task EncryptAndSaveFileAsync(Stream stream, string filePath) { await using var fileStream = new FileStream(filePath, FileMode.Create, FileAccess.Write); using var aesAlg = Aes.Create(); aesAlg.Key = _key; await fileStream.WriteAsync(aesAlg.IV.AsMemory()); await using var cryptoStream = new CryptoStream(fileStream, aesAlg.CreateEncryptor(), CryptoStreamMode.Write); await inputFileStream.CopyToAsync(cryptoStream); } ``` Then the decryption is the same thing in reverse. ```cs public async Task<Stream> DecryptFile(string filePath) { await using var fileStream = File.OpenRead(filePath); using var aesAlg = Aes.Create(); aesAlg.Key = _key; var iv = new byte[16]; await fileStream.ReadExactlyAsync(_iv.AsMemory()); aesAlg.IV = iv; await using var cryptoStream = new CryptoStream(fileStream, aesAlg.CreateEncryptor(), CryptoStreamMode.Read); var mem = new MemoryStream(); await cryptoStream.CopyToAsync(mem); return mem; } ```
The `tool` schema needs an `allOf` to compose your defined schemas ```json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Program content schema", "$id": "https://example.com/schemas/program", "type": "object", "properties": { "content": { "type": "object", "properties": { "id": { "type": "string" }, "tools": { "$ref": "/schemas/tool" } } } } } ``` ```json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Tool information schema", "$id": "https://example.com/schemas/tool", "allOf": [ { "type": "object", "properties": { "nodeInformation": { "type": "object", "properties": { "name": { "type": "string" }, "description": { "type": "string" } } } } }, { "$ref": "/schemas/gui" } ] } ``` ```json { "$schema": "http://json-schema.org/draft-07/schema#", "title": "Gui schema", "$id": "https://example.com/schemas/gui", "type": "object", "properties": { "active": { "type": "boolean" }, "children": { "type": "array" } } } ```
Campo de upload sobreescrevendo array de arquivos
|javascript|typescript|
null
|configuration|struts2|actionresult|
I agree that the documentation is confusing, 'expression' option is not required and you can use 'synchronize' option. I know it is not mentioned in the documentation : @ViewEntity({ name: 'existing_view', synchronize: false }) or @ViewEntity('existing_view', { synchronize: false })
I think you can achieve this by writing a custom logMethod that hoists the metadata e.g. const hooks = { logMethod (inputArgs, method, level) { const mappedInputArgs = inputArgs.map((arg) => { return arg instanceof Object ? { metadata: arg } : arg; }); return method.apply(this, mappedInputArgs) } } const logger = pino({ hooks, mixin(_, level) { return { 'severity': pino.levels.labels[level] } }, }); logger.info({ foo: 'bar' }, 'Hello'); Output {"level":30,"time":1710514951366,"pid":83790,"severity":"info","metadata":{"foo":"bar"},"msg":"Hello"}
I am using NextJS and I have a route called `about`(It's contents is displayed via `page.js`). Inside `/about/page.js`, I am showing a component called `<Hero />` and I want to pass a prop to `<Hero heroHeight={'height: 400px'} />` to my `CSS module` for styling purposes. **Hero.js** 'use client'; import styles from '../page.module.css'; import style from './Hero.module.css'; const Hero = ({ heroHeight }) => { return ( <div className={`${styles.pageWidth} ${style[heroHeight.updateTheHeight]`}> </div> ); }; export default Hero; **Hero.module.css** .updateTheHeight{ border: 1px solid green; /* I want to pass the prop here which is height: 400px */ } The code above is currently not working. I want to pass the value of the prop which is **height: 400px** to **.updateTheHeight** class. Do you know what is the problem in my code? Any help is greatly appreciated. Thanks!
`colShuffle` and `rowShuffle` in the `Rfast` package are faster than `apply`: library(Rfast) m <- matrix(1:1e4, 100, 100) microbenchmark::microbenchmark( Rfast = colShuffle(m), apply = apply(m, 2, sample) ) #> Unit: microseconds #> expr min lq mean median uq max neval #> Rfast 134.2 141.25 165.439 156.9 187.65 278.6 100 #> apply 1067.7 1166.15 1334.663 1216.9 1309.20 10578.2 100
For those looking for a simple `Python` solution here as me: # upload file to drive uploaded_file = drive_service.files().create(body=file_metadata, media_body=media, fields='id').execute() # set permission - toAll - for file in drive drive_service.permissions().create(fileId=uploaded_file['id'], body={'role': 'reader', 'type': 'anyone'}).execute()
Note that the formula for slope in simple linear regression without intercept is ```sum(x*y)/sum(x^2)```. We can utilize this in matrix form: ``` diag(t(M.x) %*% M.y) / diag(t(M.x) %*% M.x) [1] 0.142780158 -0.688172617 0.591777820 1.096226652 0.458449019 -0.729486974 -0.161225471 [8] -0.275493553 0.500602766 -0.175171117 -0.400500634 0.111438175 0.005283035 -0.302037119 [15] -0.588920240 -1.675476344 -1.609057813 0.047642782 -0.229759970 -0.599253230 2.537797206 ``` As @Onyambu points out, a more efficient approach is: ``` colSums(M.x*M.y)/colSums(M.x^2) ``` Benchmark: ``` benchmark("matrix_mul" = { a <- diag(t(M.x) %*% M.y) / diag(t(M.x) %*% M.x) }, "colsums" = { a <- colSums(M.x*M.y)/colSums(M.x^2) }, replications = 10) test replications elapsed relative user.self sys.self user.child 2 colsums 10 0.021 1.000 0.02 0.00 0 1 matrix_mul 10 2.775 132.143 2.73 0.05 0 sys.child 2 0 1 0 ```
Trying to provide some address keys to a page to get redirected to another page from where the info can be downloaded as a pdf option. Code: def appriaser(): driver.get("https://web.bcpa.net/BcpaClient/#/Record-Search") search_box = wait.until(EC.element_to_be_clickable((By.ID, 'txtField'))) search_box.send_keys(address) driver.implicitly_wait(5) search_button = driver.find_element(By.ID, 'searchButton') search_button.click() time.sleep(10) # Close Pop-Up close_button = driver.find_element(By.CLASS_NAME, 'closeCross') close_button.click() # Print the pdf pdf_appraiser = WebDriverWait(driver, 10).until(EC.visibility_of_element_located((By.XPATH, '//*[@id="hideRecInfoTab"]/div[1]/div/div[12]'))) pdf_appraiser.click() time.sleep(10) print_window = driver.window_handles driver.switch_to.window(print_window[-1]) url = driver.current_url print(url) driver.execute_script('window.print();') download_appraise_pdf = driver.execute_script( "return document.querySelector('print-preview-app')" ".shadowRoot.querySelector('print-preview-sidebar')" ".shadowRoot.querySelector('print-preview-button-strip')" ".shadowRoot.querySelector('cr-button.action-button')" ) download_appraise_pdf.click() I have checked to see that the driver is shifting to the correct url and after studying a little about the shadow-root I saw that this is one of the ways it can be interacted with. Getting the following output: Traceback (most recent call last): File ".\test.py", line 74, in <module> appriaser() File ".\test.py", line 68, in appriaser "return document.querySelector('print-preview-app')" File "D:\Python Projects\Title Search\titlesearch\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 405, in execute_script return self.execute(command, {"script": script, "args": converted_args})["value"] File "D:\Python Projects\Title Search\titlesearch\lib\site-packages\selenium\webdriver\remote\webdriver.py", line 345, in execute self.error_handler.check_response(response) File "D:\Python Projects\Title Search\titlesearch\lib\site-packages\selenium\webdriver\remote\errorhandler.py", line 229, in check_response raise exception_class(message, screen, stacktrace) selenium.common.exceptions.JavascriptException: Message: javascript error: Cannot read properties of null (reading 'shadowRoot') (Session info: chrome=122.0.6261.129) Stacktrace: GetHandleVerifier [0x00007FF6CD47AD02+56930] (No symbol) [0x00007FF6CD3EF602] (No symbol) [0x00007FF6CD2A42E5] (No symbol) [0x00007FF6CD2A9261] (No symbol) [0x00007FF6CD2AB9FD] (No symbol) [0x00007FF6CD328E57] (No symbol) [0x00007FF6CD30BC9A] (No symbol) [0x00007FF6CD3281E2] (No symbol) [0x00007FF6CD30BA43] (No symbol) [0x00007FF6CD2DD438] (No symbol) [0x00007FF6CD2DE4D1] GetHandleVerifier [0x00007FF6CD7F6F8D+3711213] GetHandleVerifier [0x00007FF6CD84865F+4044735] GetHandleVerifier [0x00007FF6CD519736+706710] (No symbol) [0x00007FF6CD3FB8DF] (No symbol) [0x00007FF6CD3F6AC4] (No symbol) [0x00007FF6CD3F6C1C] (No symbol) [0x00007FF6CD3E68D4] BaseThreadInitThunk [0x00007FFD02F37344+20] RtlUserThreadStart [0x00007FFD03F226B1+33] Can anyone help? Am I doing anything wrong to get the output? Address info for testing: address = "2216 NW 6 PL FORT LAUDERDALE"
Refer to the below document if you’re using hosted Blazor project with version 2.1 and higher [fluentui-blazor/WHATSNEW.md][1] Two additional configurations/changes are required in the project file and Program.cs [1]: https://github.com/microsoft/fluentui-blazor/blob/2ed253a99758d5647ba67ec75135ef4cea53779b/WHATSNEW.md
You are missing reseting the `x` coordinate when changing from the first row to the second. So, the following images are all placed outside of the viewable area, with a value for x that is greater than 2000. Or rather, the `while` condition for `x` will not be met again: no other images are even attempted to be placed. Just add an `x = 0` line: ``` def create_grid(im2,w,h): image = Image.new("RGBA",(2000,1000),(0,0,0)) x = 0 y = 0 x_change = int(2000/w) y_change = int(1000/h) while y<1000: while x<2000: image.paste(im2,(x,y)) x += x_change y += y_change x = 0 image.show() ```
I have three questions but they are related. My starting point is [![original table][1]][1] **Question 1:** I want to create five new columns: # Enterprises_Sig, Revenues_Sig, Costs_Sig, Net Revenues_Sig, and Assets_Sig. These columns would contain the identical number of * in their respective column. The original columns would then only contain the numbers. For example, the below code does what I need but only for one column. table_2 <- table_2 %>% mutate("Net Revenues_Sig" = ifelse(str_count(table_2$`Net Revenues`,"∗")==1, "∗",ifelse(str_count(table_2$`Net Revenues`,"∗")==2, "∗∗",ifelse(str_count(table_2$`Net Revenues`,"∗")==3, "∗∗∗","")))) table_2$`Net Revenues` <- str_replace_all(table_2$`Net Revenues`, "[∗]", "") to produce [![enter image description here][2]][2] Of course I could repeat this process another 4 times but there must be a more efficient way of doing this...? Question 2: I want to do the something similar but for the square brackets. How would I create 5 new columns for the respective standard errors without the brackets (e.g the new column Revenues_SE would be numeric and contain values 24346.05, 16080.92, 34895.03) and then remove those three rows (so Revenues only had the three long-term, short-term and lumpsum values)? **Question 3**: How do I then convert all columns into numeric (currently character due to the brackets and asterisks) except for the 5 Sig columns ? [1]: https://i.stack.imgur.com/E3dCq.png [2]: https://i.stack.imgur.com/xmV7Q.png
Mutate to create mutilple new columns based on names of existing columns and presence of strings
|string|rstudio|numeric|mutate|
As @peter-cordes pointed out, unlike regular release stores that are uni-directional, `std::atomic_thread_fence(release)` serves as bidirectional barrier between stores (loads can still be reordered). Therefore, this is the fixed code: ```c++ void producer() { runcnt.store(2, memory_order_relaxed); std::atomic_thread_fence(release); // <- Prevents reordering of barrier stores before runcnt.store. barrier[0].store(1, memory_order_relaxed); barrier[1].store(1, memory_order_relaxed); while (runcnt.load(memory_order_relaxed)) { cpu_pause(); } } void consumer(unsigned index) { while (true) { // we "ignore" the branching and RMW when we plan // memory order semantics. // `acquire` prevents fetch_sub being reordered before the `exchange`. if (barrier[index].exchange(false, memory_order_acquire)) { int prev = runcnt.fetch_sub(1, memory_order_relaxed); assert(prev > 0); } } } ```
How to access print button by Selenium webdriver when it is inside shadow-root?
|python|selenium-webdriver|selenium-chromedriver|
{"Voters":[{"Id":5468463,"DisplayName":"Vega"},{"Id":4541695,"DisplayName":"DVT"},{"Id":10415749,"DisplayName":"Merijn van Tilborg"}]}
Since you want to divide the file using invoice number, you can use the partition option available in sink transformation itself. Below is the approach. - Add a new column named `filename` using derived column transformation and assign the value of `Invoice_number` column. ![](https://i.imgur.com/TjLiZ0V.png) - Then take the sink transformation and in sink settings, give `Name file as column data` as File name option. Give `filename` as column data. ![](https://i.imgur.com/d6JVWre.png) This will divide the file based on the **invoice_number** column itself and each file name will have the value of invoice number itself.
null
I know there's a lot of topics with the same error message, to be honest, I tried many of them, but none has worked so far, that's why I'm creating this post. I'm trying to publish a .NET 7 web application, developed with Visual Studio 2022, on an IIS server. The configuration on my IIS server seems good, because I've tested it with a simple web application, the one we get after creating a new VS file, and it's working. So I'm thinking about a problem with the configuration of the application itself. Here is the Program.cs file: using Microsoft.EntityFrameworkCore; using NewJoinersWebApp.Data; using NewJoinersWebApp.Models; using Rotativa.AspNetCore; var builder = WebApplication.CreateBuilder(args); // Add services to the container. builder.Services.AddControllersWithViews(); builder.Services.AddDbContext<AppDbContext>(options => options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); //this is to configure the DbContext for LoginUser interface //builder.Services.AddDbContext<AppDbContextLoginUser>(options => //options.UseSqlServer(builder.Configuration.GetConnectionString("DefaultConnection"))); //builder.Services.AddIdentity<LoginUsers, Role>().AddEntityFrameworkStores<AppDbContextLoginUser>(); var app = builder.Build(); // Configure the HTTP request pipeline. if (!app.Environment.IsDevelopment()) { app.UseExceptionHandler("/Home/Error"); // The default HSTS value is 30 days. You may want to change this for production scenarios, see https://aka.ms/aspnetcore-hsts. app.UseHsts(); } app.UseHttpsRedirection(); app.UseStaticFiles(); app.UseRotativa(); app.UseRouting(); //add the control on the Http server //app.UseAuthentication(); app.UseAuthorization(); //app.MapFallbackToFile("/NotFound", "NotFound.html"); app.MapControllerRoute( name: "default", pattern: "{controller=Home}/{action=Index}/{id?}"); app.Run(); *Edit: I've removed the unnecessary `class Startup`* And here is the csproj file: <Project Sdk="Microsoft.NET.Sdk.Web"> <PropertyGroup> <TargetFramework>net7.0</TargetFramework> <Nullable>enable</Nullable> <ImplicitUsings>enable</ImplicitUsings> </PropertyGroup> <ItemGroup> <PackageReference Include="Microsoft.AspNetCore.Diagnostics.EntityFrameWorkCore" Version="7.0.11" /> <PackageReference Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" Version="7.0.0" /> <PackageReference Include="Microsoft.EntityFrameWorkCore.SqlServer" Version="7.0.7" /> <PackageReference Include="Microsoft.EntityFrameWorkCore.Tools" Version="7.0.11"> <PrivateAssets>all</PrivateAssets> <IncludeAssets>runtime; build; native; contentfiles; analyzers; buildtransitive</IncludeAssets> </PackageReference> <PackageReference Include="Microsoft.NET.Sdk.Functions" Version="4.2.0" /> <PackageReference Include="Microsoft.VisualStudio.Web.CodeGeneration.Design" Version="7.0.7" /> <PackageReference Include="Newtonsoft.Json" Version="13.0.3" /> <PackageReference Include="Rotativa.AspNetCore" Version="1.3.2-beta" /> </ItemGroup> </Project> I've checked them several times, I've compared them with the basic application that works, but all I tried didn't work. I desperately get the following webpage error message: > HTTP Error 403.14 - Forbidden The Web server is configured to not list > the contents of this directory. > > Most likely causes: A default document is not configured for the > requested URL, and directory browsing is not enabled on the server. > > Things you can try: If you do not want to enable directory browsing, > ensure that a default document is configured and that the file exists. > Enable directory browsing using IIS Manager. Open IIS Manager. In the > Features view, double-click Directory Browsing. On the Directory > Browsing page, in the Actions pane, click Enable. Verify that the > configuration/system.webServer/directoryBrowse@enabled attribute is > set to true in the site or application configuration file. > > Detailed Error Information: Module DirectoryListingModule > Notification ExecuteRequestHandler Handler StaticFile Error > Code 0x00000000 Requested URL http://localhost:8282/ Physical > Path C:\inetpub\wwwroot\NewJoinersWebApp.site Logon Method > Anonymous Logon User Anonymous > > More Information: This error occurs when a document is not specified > in the URL, no default document is specified for the Web site or > application, and directory listing is not enabled for the Web site or > application. This setting may be disabled on purpose to secure the > contents of the server. View more information » Of course, changing the config in the IIS server to allow the server *to list the contents of this directory* is not the solution. The *Default Document* configuration is the classic one, and in the folder created when publishing the application there no standard files like *index.html* or *default.htm*. It looks like: [![The folder created when publishing the application from VS to the IIS server][1]][1] [1]: https://i.stack.imgur.com/rpLk9.jpg Is there something I've done wrong, or a thing I missed? Thanks for any support you could grant.
I have made a C# Class Library that has some NuGet packages installed in it, like Azure.Core. When the library has been compiled, I get my library as a MyLibrary.dll which is all fine. The only files that are in the output folder is the MyLibrary.dll, MyLibaby.deps.json and MyLibrary.pdb - nothing else. Now I need to load this in Powershell by using: Add-Type -Path "C:\Temp\MyLibrary.dll" And this adds it fine and I can see my methods by using the `Get-Member`. When the code then starts running, I get an error saying: > 'Azure.Core, Version=1.37.0.0, Culture=neutral, PublicKeyToken=92742159e12e44c8'. The system cannot find the file specified. Have I done something wrong with the way I have done my class library or am I doing the Powershell bit wrong? As I mentioned, I don't have any more .dll files other than MyLibrary.dll The Class Library was made in .NET Core 7.0, if that info is needed
Load Class library dll in powershell
|c#|powershell|class-library|
Looking at https://laravel.com/docs/10.x/routing#route-group-subdomain-routing I try to make subdomains for my laravel 10 / livewire 3 app on my home kubuntu 22.04 In routes/web.php I added : Route::domain('{company}.'.config('app.url'))->group(function () { Route::get('/', HomePage::Class); Route::get('/news-details-page/{slug}', NewsDetailsPage::Class)->name('news.details'); Route::get('/news{news}', NewsListingPage::Class)->name('news.listing'); }); and in app/Livewire/HomePage.php : class HomePage extends Component { public string $companySlug = ''; public $selectedCompany; public function mount(?string $companySlug = '') { $this->companySlug = $companySlug; $this->selectedCompany = Company::getBySlug($this->companySlug)->first(); if (empty($this->selectedCompany)) { $this->selectedCompany = Company::getByActive(CompanyActiveEnum::ACTIVE)->first(); } ... } I run server with command : php artisan serve But url in browser http://main-office.127.0.0.1:8000 where "main-office" is slug of one of companies. does not work, browser use it for search. In route aputputs I have : GET|HEAD {company}.127.0.0.1:8000/ ................................................................................................................................................ generated::UVdHOKqavkOQwvfV › App\Livewire\HomePage GET|HEAD {company}.127.0.0.1:8000/news-details-page/{slug} ................................................................................................................................ news.details › App\Livewire\NewsDetailsPage GET|HEAD {company}.127.0.0.1:8000/news{news} .............................................................................................................................................. news.listing › App\Livewire\NewsListingPage Which way is correct? Have I to add any subdomain/company in /etc/hosts of my OS ? **UPDATED # 1:** In .env I changed : APP_URL=localhost and cleared cache In browser try to run url http://main-office.localhost Then apache default page is opened On http://main-office.localhost:8000/ My App is opened but shows 404 NOT FOUND error Which way is correct ? **UPDATED # 2:** I added new hosting with /etc/apache2/sites-available/local-news-publishers.com.conf file : <VirtualHost *:80> ServerAdmin webmaster@localhost DocumentRoot /_wwwroot/lar/NewsPublisher/public ServerName local-news-publishers.com ServerAlias local-news-publishers.com <Directory /_wwwroot/lar/NewsPublisher/public> AllowOverride All Order Deny,Allow Allow from all Require all granted </Directory> Options FollowSymLinks DirectoryIndex index.php ErrorLog /_wwwroot/lar/NewsPublisher/storage/logs/error.log CustomLog /_wwwroot/lar/NewsPublisher/storage/logs/access.log combined </VirtualHost> and added line in /etc/hosts : 127.0.0.1 localhost 127.0.1.1 master-at-home # The following lines are desirable for IPv6 capable hosts ::1 ip6-localhost ip6-loopback fe00::0 ip6-localnet ff00::0 ip6-mcastprefix ff02::1 ip6-allnodes ff02::2 ip6-allrouters ... 127.0.0.7 local-quizzes.com 127.0.0.8 local-news-publishers.com in .env of the app : APP_URL=http://local-news-publishers.com I restarted apache and clear cache of the app. But running in my browser : http://main-office.local-news-publishers.com I got error in my browser : This site can’t be reachedCheck if there is a typo in main-office.local-news-publishers.com. DNS_PROBE_FINISHED_NXDOMAIN But As I wrote above : On http://main-office.localhost:8000/ My app was opened but shows app error : 404 NOT FOUND Which setting have I to use ?
When transitioning from page A to page B, the user refreshes the page and then clicks the back button. Instead of redirecting the user to page A, they are redirected to the browser's home page. This issue occurs only in Chrome and Edge; Safari and Firefox behave as expected. This problem occurs only when the user refreshes the page. The application is written in React 16.8.6, and the routing is handled by the react-router library version 3.2.1. The path to the previous page remains the same before and after page refresh. The state of the history object persists before and after page refresh.
Browser Back Button Redirect Bug
|reactjs|browser|react-router|back-button|browser-history|
null
|java|spring-boot|maven|weblogic|
You have to install the package `acl` to get it running ``` sudo apt-get install acl ```
With bash only: ``` arr=(test,meta my,amazon test,amazon this,meta test,google my,google hello,microsoft) declare -Ai count declare -A locations for pair in "${arr[@]}"; do value=${pair%%,*} location=${pair#*,} count[$value]+=1 locations[$value]+="$location, " done for value in "${!locations[@]}"; do printf '%d %s: %s\n' ${count[$value]} "$value" "${locations[$value]%, }" done ```
Here is an approach that doesn't require guessing a value for stroke-dashArray, but requires trigonometry to explain the choices of angles. I got the relevant angles after drawing a diagram of a "thick line" passing through the center of a circle. [![enter image description here][1]][1] There are different values for the angle depending on the radius. Also, I changed `end` value in the `segment` function to `degrees * (i+1)` as the original interfered with the calculation somehow. <!-- begin snippet: js hide: false console: true babel: false --> <!-- language: lang-js --> /** * Polar to Cartesian. * * Håken Lid's SVG circle segments. * * @see https://observablehq.com/@haakenlid/svg-circle * @see https://blog.logrocket.com/interactive-svg-circle-of-fifths/#arcs-circles */ function polarToCartesian(x, y, r, degrees) { const radians = degrees * Math.PI / 180.0; return [x + (r * Math.cos(radians)), y + (r * Math.sin(radians))] } /** * Segment Path. * * Håken Lid's SVG circle segments. * * @see https://observablehq.com/@haakenlid/svg-circle * @see https://blog.logrocket.com/interactive-svg-circle-of-fifths/#arcs-circles */ function segmentPath(x, y, r0, r1, d0, d1) { const point = (radius, degree) => polarToCartesian(x, y, radius, degree) .map(n => n.toPrecision(5)) .join(',') let gapWidth = 12; let theta0 = Math.asin(gapWidth / (2 * r0)) * 180 / Math.PI; let theta1 = Math.asin(gapWidth / (2 * r1)) * 180 / Math.PI; const arc1 = Math.abs((d0 + theta0) - (d1 - theta0)) > 180 ? 1 : 0 const arc2 = Math.abs((d0 + theta1) - (d1 - theta1)) > 180 ? 1 : 0 return [ `M${point(r0, d0 + theta0)}`, `A${r0},${r0},0,${arc1},1,${point(r0, d1 - theta0)}`, `L${point(r1, d1 - theta1)}`, `A${r1},${r1},0,${arc2},0,${point(r1, d0 + theta1)}`, 'Z', ].join('') } /** * Segment Function. * * Modified version of Håken Lid's SVG circle segments. * * @see https://observablehq.com/@haakenlid/svg-circle * @see https://blog.logrocket.com/interactive-svg-circle-of-fifths/#arcs-circles */ function segment(i, segments, size, radius, width, className, fillColor) { const center = size / 2 const degrees = 360 / segments const start = degrees * i const end = degrees * (i + 1) const path = segmentPath(center, center, radius, radius - width, start, end); const el = document.createElementNS('http://www.w3.org/2000/svg', 'path'); el.setAttribute( 'd', path ); el.classList.add('path-segment', className); el.style.fill = fillColor; return el; } /** * Render. * * Function that will render the svg circle. */ function render() { // Circle Div. const circleDiv = document.getElementById('interactive-circle-svg'); if (null !== circleDiv) { // Setup environment. const svgSize = 580 const segments = 8 const segmentWidth = 60 const outerFill = '#FB8D00' const middleFill = '#E68E36' const innerFill = '#F9B46F' // Set cirlce div attributes. circleDiv.style.height = svgSize + 'px'; circleDiv.style.width = svgSize + 'px'; // circleDiv.style.transform = `rotate(${360 / 2}deg)` circleDiv.style.transformOrigin = '50% 50%' // SVG NS. const svgns = 'http://www.w3.org/2000/svg'; // Create the <svg>. const svg = document.createElementNS(svgns, 'svg') svg.setAttribute('viewbox', `0 0 ${svgSize} ${svgSize}`); svg.setAttribute('overflow', 'visible'); // Attach the children nodes. for (let i = 0; i < segments; i++) { // Create the first <g>. let n = i + 1, radius1 = svgSize / 2, radius2 = svgSize / 2 - segmentWidth + 1, radius3 = svgSize / 2 - (segmentWidth * 2) + 2, g1 = document.createElementNS(svgns, 'g'); g1.classList.add('segment-body', `segment-${n}`); g1.setAttribute('id', 'segment-body-' + n) g1.setAttribute('data-segment-number', n); // Attach segments to the <g>. g1.appendChild(segment(i, segments, svgSize, radius1, segmentWidth, 'outer', outerFill)); g1.appendChild(segment(i, segments, svgSize, radius2, segmentWidth, 'middle', middleFill)); g1.appendChild(segment(i, segments, svgSize, radius3, 55, 'inner', innerFill)); // Attach the <g> to the <svg> svg.appendChild(g1); // Create event handlers with the g1. g1.addEventListener('click', function (e) { const segNumber = this.getAttribute('data-segment-number'); const bodies = document.getElementsByClassName('segment-body') for (let i = 0; i < bodies.length; i++) { if (!bodies[i].classList.contains('inactive')) { bodies[i].classList.add('inactive'); } } // Show correct body. const body = document.getElementById('segment-body-' + segNumber); body.classList.remove('inactive'); }); } // Attach to div. circleDiv.append(svg); } } // Attach render to onload. window.onload = render; <!-- language: lang-css --> .segment-body{ cursor: pointer; } .inactive{ opacity: 0.5; } <!-- language: lang-html --> <div id="interactive-circle-svg"></div> <!-- end snippet --> [1]: https://i.stack.imgur.com/0zr33.png
I may have misunderstood your question, however, what I have tried and came up with the following two ways, may be one of the other satisfies your requirements. [![enter image description here][1]][1] ---------- • Formula used in cell <kbd>I2</kbd> =LET( _Data, A2:F27, _Day, INDEX(_Data,,2), _Dates, INDEX(_Data,,3), DROP(FILTER(_Data,(MAP(_Dates,LAMBDA(x,COUNTIF(C2:x,x)))=1)*(H1=_Day)),,2)) ---------- The above formula returns only the first occurrences of the dates, I am not sure how you can combine `UNIQUE()` with `FILTER()` function as the data does not have duplicates other than the dates and days. ---------- Another one which I can think of is: [![enter image description here][2]][2] ---------- =LET( _Data, A2:F27, _Day, INDEX(_Data,,2), _Dates, INDEX(_Data,,3), _Transform, HSTACK(TAKE(_Data,,2),TEXT(MAP(_Dates,LAMBDA(x,COUNTIF(C2:x,x))),"[=1]#;;")*_Dates,DROP(_Data,,3)), IFERROR(DROP(FILTER(_Transform, _Day=H1),,2),"")) ---------- **Note:** Again, I might have not understood the expected output you would need, it is quite possible to make the required changes, if explained more and shown with adequate data. ---------- [1]: https://i.stack.imgur.com/0zAaW.png [2]: https://i.stack.imgur.com/FLl0V.png
I agree that the documentation is confusing, 'expression' option is not required and you can use 'synchronize' option. : @ViewEntity({ name: 'existing_view', synchronize: false }) or @ViewEntity('existing_view', { synchronize: false })
{"Voters":[{"Id":16462950,"DisplayName":"Heiko Theißen"},{"Id":238704,"DisplayName":"President James K. Polk"},{"Id":3001761,"DisplayName":"jonrsharpe"}],"SiteSpecificCloseReasonIds":[19]}
I agree that the documentation is confusing, 'expression' option is not required and you can use 'synchronize' option. https://github.com/typeorm/typeorm/blob/master/src/decorator/options/ViewEntityOptions.ts @ViewEntity({ name: 'existing_view', synchronize: false }) or @ViewEntity('existing_view', { synchronize: false })
null
null
null
null
I misread your data somewhat, noting now that the required `Throughput(MB/s)` is token 6 and the required data is in token 4. Nor sure whether you want to process multiple files - if not, the outer loop on `%%y` is not needed and substitute the filename for `%%y` in the remaining loop. `%%b` will acquire token 4 and `%%c` token 6 in the processed lines @ECHO OFF SETLOCAL rem The following setting for the directory and filenames are names rem that I use for testing and deliberately includes spaces to make sure rem that the process works using such names. These will need to be changed to suit your situation. SET "sourcedir=u:\your files" SET "destdir=u:\your results" SET "outfile=%destdir%\outfile.txt" ( FOR %%y IN ("%sourcedir%\q78165354*.txt") DO ( SET "required=" SET "grabnext=" FOR /f "tokens=4,6delims= " %%b IN ('findstr /v /L /c:"=" "%%y"') DO IF /i "%%c"=="Throughput(MB/s)" (SET "grabnext=y") ELSE ( IF NOT DEFINED required IF DEFINED grabnext SET required=%%b&ECHO %%b %%y ) ) )>"%outfile%" GOTO :EOF rem **Always verify against a test directory before applying to real data.** I used files named `q78165354*.txt` containing your data for my testing.
I'm encountering a "Passed unnecessary parameters" error while creating a RivalEntity using Zenject in my project, and I haven't been able to resolve this issue. Here are the details regarding the problem: My factory class is as follows: ``` public class RivalFactory : PlaceholderFactory<RivalAIData, RivalEntity> { public override RivalEntity Create(RivalAIData rivalAIData) { var entity = base.Create(rivalAIData); entity.SetAIData(rivalAIData); entity.Initialize(); return entity; } } ``` The installer I'm using for setup is: ``` Container.BindFactory<RivalAIData, RivalEntity, CompetitorManager.RivalFactory>().FromComponentInNewPrefab(rivalEntity); ``` And I'm trying to create a RivalEntity with the following code: ``` _rivalEntity = _rivalFactory.Create(rivalAIData); ``` However, I'm getting a "Passed unnecessary parameters when injecting into type 'RivalEntity'. Extra Parameters: RivalAIData" error in this case, and I haven't been able to figure out the cause of the error. I'm looking forward to your assistance. Thank you. I attempted to create a RivalEntity using Zenject's factory method with the provided RivalAIData. I expected the creation process to succeed without any errors and for the RivalEntity to be properly initialized with the given data.
Getting "Passed unnecessary parameters" Error When Creating RivalEntity with Zenject
|c#|unity-game-engine|dependency-injection|zenject|
null
### What are the details of your problem? I have a [Sonatype Nexus Repository Manager](https://www.sonatype.com/products/sonatype-nexus-repository) that has an unknown number of hosted repositories for the [Maven-3 m2](https://maven.apache.org/settings.html) format. I'd like to easily make sure all available options are being used from this Nexus. I can see many options being listed available on the Nexus search but at maven command are not being found. 1. Sonatype.Nexus.Repo.1 1. Sonatype.Nexus.Repo.2 1. Sonatype.Nexus.Repo.A 1. Sonatype.Nexus.Repo.N 1. Sonatype.Nexus.Repo.A2 ### What did you try and what were you expecting? I was expecting that if I gave the overarching Sonatype Nexus URL e.g. Sonatype.Nexus.Repo that that'd be fine enough for redirects to figure out and auto-manage. But actually, none of the artifacts seemed to resolve. I don't know if I just haven't been searching the right key terms or my phrasing has been wonky. Is there a way to force Maven to use all the sub-repositories of the main Nexus? Is there a Nexus URL format that will automatically provide all the available repositories' Maven packages in one link?
Is There A Way To Simply Use All Nexus Repositories?
|maven-3|nexus|sonatype|maven-repository|maven-mirroring|
null
Consider the example below. Assume that `barrier` is initialized to 0. There is one producer thread and two consumer threads that constantly check `barrier`. If the barrier is set, they decrease `runcnt`. The producer thread waits for `runcnt` to reach 0. I am confused about the order of multiple store operations inside the producer. If the order is like it is written, I think the code would run as expected. But if the `barrier` store is reordered before `runcnt` store, it seems the assert check would fail. Am I missing anything? Is there a way to fix this? ```c++ extern atomic<int> barrier[2]; atomic_int runcnt{0}; void producer() { runcnt.store(2, memory_order_relaxed); barrier[0].store(1, memory_order_relaxed); barrier[1].store(1, memory_order_relaxed); while (runcnt.load(memory_order_relaxed)) { cpu_pause(); } } void consumer(unsigned index) { while (true) { if (barrier[index].exchange(false, memory_order_relaxed)) { int prev = runcnt.fetch_sub(1, memory_order_relaxed); assert(prev > 0); } } } ```
For various reasons - We have "the-one" windows computer that has access to a svn repo. This svn repo is located on a separate svn server machine and this server/svn is not accessible to any other computer, from either the intranet or internet. Said "the-one" computer has tortoise SVN and pulls stuff from the repo via 'svn checkout'. We also have linux, windows/cygwin and macos boxes on the same local network. Unfortunately none of them can mount the "the-one" windows computer as a shared drive, although they all individually have rsync installed on them. We would like to be able to share/serve this 'the-one' tortoise SVN folder as a master SVN repo to people working on these other computers. Eventually, we will commit these changes back from other-people => 'the-one' => svn repo weekly. Is this recursive serving of SVN checked out files possible ?
I have a python project running on my raspberry pi 4 to display pdf files. I was using fitz and pymupdf to display them. It was working fine, until february 2024. Since then I always got the error "no module named frontend" when I tried to import fitz. Because of this, I uninstalled fitz and installed PyMuPDF again, because of this question: https://stackoverflow.com/questions/56467667/how-do-i-resolve-no-module-named-frontend-error-message But when I want to install PyMuPDF it always crashes when preparing metadata. (Preparing metadata (pyproject.toml) ... ) With the error: error: metadata-generation-failed × Encountered error while generating package metadata. ╰─> See above for output. I also tried some older versions of PyMuPDF. (1.23, 1.16.14,...). With older versions I get the error: Failed building wheel for PyMuPDF. Since I was not able to fix this problem, I also tried tkPDFViewer. But this package seems also be based on fitz. - I get the same errors here. (all starting with no module named "frontend") Also tried pip install frontend. - but then the next errors occur: "This error occured while importing neccesary modules or library Directory 'static/' does not exist". I really don't know what I should try next. Why does fitz / PyMuPDF suddenly not work any more? My code with fitz and PyMuPDF was running for almost a year now, without any problems. I am using a 8GB Raspberry Pi 4 with Raspbian GNU/Linux 11 (bullseye). python Version: 3.9.2 Please let me know if somebody have the same problems lately with PyMuPdf and fitz. Thanks, Yours Tom. Older versions of PyMuPDF, TkPdfViewer, reinstall fitz, reinstall python completely.
Python3 install PyMuPDF Error creating Metadata (pyproject.toml)
|python|tkinter|pip|pymupdf|