INSTRUCTION
stringlengths
25
999
RESPONSE
stringlengths
0
999
SOURCE
stringlengths
16
38
METADATA
dict
3Ds Max and BIP skeleton modification In purpose of 3D modeling I'm using BIP skeleton. Is there any way to modify existing skeleton, i.e. increasing leg's length or so on? I have been trying to increase it, but all parts of the skeleton increase simultaneously Thanks.
Go into 'figure' mode, You find the menu at 'motion' panel, press the button for 'figure mode' there, then you can edit individual bones by using for example the regular 'scale' tool.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "3dsmax" }
K8s: what is the difference between Security Context and Security Policy? Looking into Kubernetes documentation: * Pod Security Policy * Pod Security Context Mmmm... aren't eventually they doing the same? What is the difference?
I have no idea why folks are down-voting this question, it's spot on and actually we've got our docs to blame and not the OP. OK, here goes: The pod security context (which is preceded by and largely based on OpenShift Security Context Constraints) allows you (as a developer?) to define runtime restrictions and/or settings on a per-pod basis. But how do you enforce this? How do you make sure that folks are actually defining the constraints? That's where pod security policies (PSP) come into play: as a cluster or namespace admin you can define and enforce those security context-related policies using PSPs. See also the Kubernetes Security book for more details.
stackexchange-stackoverflow
{ "answer_score": 15, "question_score": 16, "tags": "kubernetes" }
wait until label gets displayed so in my Tcl/Tk application I have a label with a text-variable: label .mylabel -textvariable statustext -relief sunken -anchor w and I can change the content of the label just fine by using something like `set statustext "sponatenous error"`. Unfortunately, sometimes the update of this variable is followed by some "heavy processing" that stalls the GUI for some time (e.g. downloading a file from the internet). set statustext "downloading from $url" download $url Since the event-queue is blocked (at least, that's what I guess), the GUI does not get any refreshes and the `label` does not show my latest message. Is there a way to force-update the label text (preferrably via a textvariable) before starting my "heavy process"?
If you **do`update idletasks` before your heavy processing,** the actual GUI update code will run. Tk works that way because _actual_ GUI drawing is quite expensive and this allows it to bunch updates efficiently. It's a _very_ clever piece of design that's made Tk GUIs seem super fast for over 25 years. In some cases, a full `update` is necessary — which can cause all sorts of problems with reentrancy of event handling — but updating a label can usually be done with the cheaper and less troublesome variant. That's _especially_ true if your change doesn't alter the actual size of the label (which depends on how you're handling the geometry management of the whole containing toplevel, which is a huge topic). As a hint, it's usually best if your GUI doesn't resize itself when you alter a label's text dynamically; otherwise, that can be a bit disorienting to the user.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -1, "tags": "tcl, tk toolkit, tcltk" }
Updating Replicated Database What is the optimal way to update a schema on a publishing database that is push-replicated is SQL Server (2012). Currently we disable replication, update the schema, re-enable replication and run a new snapshot. As the database grows this strategy will become problematic as the snapshot will get bigger which will make deployments take longer over time. Is there a way to do this without a new snapshot?
Schema changes can be made using ALTER syntax at the publisher. By default the schema change will be propagated to subscribers automatically, publication property **@replicate_ddl** must be set to true. There are considerations to make depending on the type of schema change and the publication type. This is covered in Make Schema Changes on Publication Databases and Replicate Schema Changes.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "sql server, replication" }
Is the volume of the parabola $y=\frac{x^2}{4}$, rotated around the $y$-axis, bounded by the plane $y=2$, equal to $8\pi$? I tried doing this through integration(Washer method) and got $8\pi$, but I'm unsure if it is correct. If wrong, how do you do this correctly?
Cylindrical shells: $2\pi\int_0^{2\sqrt2}x(2-\dfrac {x^2}4)\operatorname dx=2\pi[x^2-\dfrac {x^4}{16}]_0^{2\sqrt2}=2\pi(8-\dfrac{64}{16})=2\pi(4)=8\pi$. Disk method: $\pi\int_0^2(2\sqrt{y})^2\operatorname dy=\pi\int_0^2 4y\operatorname dy=4\pi[\dfrac {y^2}2]_0^2=4\pi(2)=8\pi$.
stackexchange-math
{ "answer_score": 3, "question_score": 0, "tags": "calculus, integration, volume" }
Scroll To a Location in HTML file - with Scrolling Animation I am currently trying to have a part of the text one my website, when clicked scroll to a certain location in the website. I have this code which works, but just jumps, which takes away from the user interface. The following is the code that I currently have: <a href="#part1">Go to Part One!</a> <div id="part1">Hey Yeah!</div> Please know that I don't code like that, It is just for the example.
Define a function as here: function scrollToBox(element, offset) { var destination = $(element).offset().top - (offset ? offset : 120); $("html:not(:animated),body:not(:animated)").animate({ scrollTop: destination }, 1500); } Then in `onclick` event you can call it like following code: scrollToBox('#part1', 0);
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "javascript, html, scroll" }
Having Issue on Targeting Interior Table Using jQuery Can you please take a look at This Demo and let me know why I am not able to change background color of each table related to upper button? $(function () { $('button[type="submit"]').click(function () { $(this).closest('table').css("background-color", "yellow"); // $(this).closest('.panel-body').find('.table').css("background-color", "yellow"); }); }); As you can see I already tried: $(this).closest('table').css("background-color", "yellow"); and $(this).closest('.panel-body').find('.table').css("background-color", "yellow"); but they are not doing the job? Thanks
> **jQuery Documentation -`.closest()` method** > > For each element in the set, get the first element that matches the selector by testing the element itself and _**traversing up through its ancestors**_ in the DOM tree. The reason it isn't working is because the `button` element isn't inside of the `table` element. The `.closest()` method will therefore never find the `table`. You could find the closest `.panel` ancestor, and then find the `table` element from there: **Updated Example** $('button[type="submit"]').click(function () { $(this).closest('.panel').find('table').css("background-color", "yellow"); });
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "jquery" }
How to sum an array of objects with a condition in typescript Hi I am doing addition of key value from objects of an array. I want to exclude the object from the addition if it has some conditions. Example: var arrItem = [{"id": 1, "value":100},{"id": 2, "value":300},{"id": 3, "value":400}]; //addition this.sum = arrItem.map((a:any) => a.value).reduce(function (a:any, b:any) { return a + b; }); console.log(this.sum) // ====>>> getting 800 I want to exclude object with `id==2` from summation. How I can filter this out so that I will get result as ==> 500
You can do it with reduce: this.sum = arrItem.reduce((acc, val) => { if (val.id !== 2) return acc + val.value; return acc; }, 0);
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 1, "tags": "javascript, typescript" }
Querying primary keys Please I have following results below, seven columns with a `primary key (reg_num)`: reg_num day Morning Midday Lunch Evening Total_Period 0983776412 3 Yes Yes No Yes 3 0985674389 3 No Yes No No 1 0983464736 4 Yes No Yes No 2 0983466827 11 No No No No 0 0983481234 15 Yes Yes Yes Yes 4 Each row shows a combination of 'yes' and 'no' for a single day per `reg_num`. You will see the last column "`Total_Period`" is a count of all the '`yes`' in each row. Please do you know how I can calculate the value for "`Total_Period`"?
the simplest way is: select decode(Morning, 'Yes', 1, 0) + decode(Midday, 'Yes', 1, 0) + decode(Lunch, 'Yes', 1, 0) + decode(Evening , 'Yes', 1, 0) from your_table
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "sql, oracle11g" }
Как убрать подчеркивание? Добрый день! Я дико извиняюсь за следующий глупый вопрос, но факт остается фактом, впервые за много лет работы со стилем к моему большому стыду не могу справиться вот с чем: как у `span` убрать подчеркивание, в том числе и при наведении как на картинку, так и на сам `span`? При чем у `a` подчеркивание есть и должно быть, т.е. на странице ссылки при наведении подчеркиваются, и при этом мне нужно исключить подчеркивание именно у `<span class="help">`. Каким только способом не пытался, хоть тресни - подчеркивает. Никогда бы не подумал, что приду сюда с таким вопросом. Подскажите, пожалуйста. span.help, a span.help, a:hover span.help { text-decoration: none; } <p> <a href="#"><img src="kartinka.jpg"> <span class="help">Мемориальный комплекс</span> </a> </p>
Это происходит, потому что подчеркивание применяется именно к `a`, а не `span`, и манипулируя стилями `span`, вы не сможете повлиять на стили `a`. Поэтому единственный выход - ввести новый класс, например, help-a: a { text-decoration: none } a:hover { text-decoration: underline; } a.help-a:hover { text-decoration: none; } <p> <a class="help-a" href="#"><img src="kartinka.jpg"> <span class="help">Мемориальный комплекс</span> </a> </p>
stackexchange-ru_stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "html, css" }
Find basis for $U$ and $W$ I have this problem : > $U,W \subseteq R^4$ > > Base of $W = \\{w1 = (1,2,2,-2), w2 = (0,1,2,-1)\\}$ > > Base of $U = \\{u1 = (1,1,0,-1),u2 = (0,1,3,1)\\}$ > > Find a basis for $U \cap W$. **My solution** for any $v \in U \cap W$, $v \in W$ and $v \in U$ I need to find $\lambda_1...\lambda_4$ that appiles: $$\lambda_1u1+\lambda_2u2=\lambda_3w1+\lambda_4w2$$ Hence (put the vectors as colums), $$\left[\begin{array}{cccc} 1 & 0 & -1 & 0 \\\ 2 & 1 & -1 & -1 \\\ 2 & 2 & 0 & -3 \\\ -2 & -1 & 1 & -1 \end{array}\right]$$ After elementary operations: $$\left[\begin{array}{cccc} 1 & 0 & -1 & 0 \\\ 0 & 1 & 1 & 0 \\\ 0 & 0 & 0 & 1 \\\ 0 & 0 & 0 & 0 \end{array}\right]$$ Therefore : $$\lambda_1=\lambda_3$$ $$\lambda_2=-\lambda_3$$ $$\lambda_3=\text{arbitrary}$$ $$\lambda_4=0$$ Therefore basis of $U \cap W=\operatorname{Sp}\\{(1,-1,1,0)\\}$ For some reason I don't get the same results as the book. Any help will be appreciated, thanks.
You correctly computed the set of $(\lambda_1,\ldots,\lambda_4)$ such that $\lambda_1w_1+\lambda_2w_2=\lambda_3u_1+\lambda_4u_2$ (your question mixes up $u$ and $w$ half way). That was not however the question; the question was to find the corresponding values of the left-hand-side of the equation (which are of course also values of the right-hand-side). That's $\\{\,\lambda_3w_1-\lambda_3w_2\mid\lambda_3\in\Bbb R\,\\}$, which is the line spanned by $w_1-w_2=(1,1,0,-1)$, which happens to be$~u_1$ (why this is so is more clear if you look at the right-hand-side, where $\lambda_4=0$).
stackexchange-math
{ "answer_score": 1, "question_score": 0, "tags": "linear algebra" }
API to access vehicle information I was wondering if there is an API for accessing vehicle information and various events that occur? I am guessing that if I want that type of information, I'd have to work directly with the manufacturer to get access to that information. Walter
The technology is called an On Board Diagnostics port OBD2 and it exists in most modern cars. A quick google search for OBD2 + java turned up some interesting results.
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "api" }
Good algorithm for managing configuration trees with wildcards? I am searching for a good algorithm for managing configuration variables in form of tree with wildcards (x.y.z, x. _.z, x._.* etc.). Is there something with search time better than O(N)? (insert / delete time are not so important). Currently I have a flat list (pairs key=>value), and I search all matching values, then sort them by importance (basically, more wildcards => less important) and choose one with best score.
As epitaph points out, a trie or radix-tree will do the trick. A radix-tree will generally be more space efficent. I guess there are a dozens of implementations out there. Take a look at my implementation here. _lookup()_ will allow you to search for a given key. _startwith()_ will return all those keys and their corresponding values that start with the passed string. It is effectively a wild-card search.
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 2, "tags": "algorithm, language agnostic, configuration, tree" }
How do I wait until AWS ElasticBeanstalk has finished updating the environment during CI/CD? I'm learning about CI/CD and currently trying to deploy an app (webapp) and a server. In my CircleCI pipeline, I do the following: `Build WebApp` -> `Build Server` -> `Deploy Server` -> `Deploy WebApp` For deploying the EB application to the environment I'm using the AWS CLI (I could use EB but I'm exploring the regular CLI). When I execute: aws elasticbeanstalk update-environment --environment-name my-env \ --version-label my-app-version-2 it outputs automatically and continues to the next step. The issue, I want to be sure that everything in EB finishes before moving to the next step in the pipeline. I could use a wait function or timer, but, I'd prefer if there's a way to keep the job running until EB finishes instead of returning.
> wait function or timer Yes, this is what you have to use. In fact **AWS CLI provides** a built-in waiter for that: `environment-updated` ([v1 / v2)]. You don't have to program your own wait function or timer as you can just use the one provided by AWS.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 0, "tags": "amazon web services, amazon elastic beanstalk" }
sonata admin-bundle in Symfony 3.4 I'm using the following command: **composer requires sonata-project/admin-bundle** but it is installing the latest version of sonata which is not compatible with Symfony 3.4 i am getting the following: Problem 1 \- Installation request for sonata-project/admin-bundle ^3.73 -> satisfiable by sonata-project/admin-bundle[3.73.0]. \- sonata-project/admin-bundle 3.73.0 requires symfony/asset ^4.4 -> no matching package found. How can I fix that? a way to choose which sonata version i want to install.
Use the following command to install the chosen version: `composer requires sonata-project/admin-bundle:3.x`
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -2, "tags": "symfony, sonata admin, sonata" }
How to reduce code size of iPhone app? My iPhone app is getting ready to go to production and we like to cram in as much data as possible. When I poke around the generated .app file for my application I see a file named <executable name> which I assume is the compiled code. It is about 2.5 megs which seem large for what I am including in my app. What type of things should I check to make sure there aren't any unneeded items being included into my executable?
There are a number of things you could do -- 2.5 MB is a small app. * One obvious way is to verify that your binary is in fact stripped. This removes unused references (e.g. functions which are not actually called) and debugging info. * Link Time Optimization (LTO) can save you a ton of space, although that applies to the C and C++ aspects of your program. It brought one of my programs down to about 1/5 the size. * Play with optimization settings. `O3` and `O2` often produce a smaller binary than `Os`. * Keep track of your dependent libraries. Their exported symbols may be relatively large. * Favor C or C++ for shared libraries in larger projects. If unused, they may be stripped or optimized away. * Minimize `static` data and `static` functions, restricting their scope to the c, cpp, m, mm file.
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 10, "tags": "iphone, objective c, xcode, optimization, code size" }
How to fix GCP OCR returning null for bounding poly vertices for text? Google Cloud Platform's OCR returns the bounding box coordinates fine in most cases, but sometimes it returns NULL which is really annoying because I need the bounding box for it to function properly. I have noticed that this happens usually when the text is close to the left/right edge, but I can't find confirmation of this anywhere. Even the documentation here: < here says that it just returns `null for none`, but I was wondering if anyone can confirm if this only happens if the box is outside the dimensions of the image, as this would save me a lot of hassle. Thanks!
Vision API uses Protocol Buffers v3 > An unset primitive field has a language-defined default value. If the X or Y value is unset, it means it is 0.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "google cloud platform, google cloud vision, google vision" }
Javascript usage of && operator instead of if condition What's the point of having this logical operator like this: `r == 0 && (r = i);`? function do() { var r = 0; var i = 10; r == 0 && (r = i); } is this the same as: if (r==0) { r=i; }
What always helps me is translating it to words 1. `var r = 0;` 2. `var i = 10;` 3. `r == 0 && (r = i);` translates to 1. set variable r to zero 2. set variable i to ten 3. if variable r equals zero AND the return of the following statement "set variable r to value of variable i" 4. do nothing, but r is now 10. so in short, let's forget about 1 and 2. In javascript the execution flow in a boolean comparisan is to stop execution of if statement parameters if any part from the && fails. An boolean comparisan will execute from left to right. 1 == 1 && 2 == 3 && (r = i) it will pass `1 == 1` fail on `2 == 3` and never reach the assigment operation. Basically it's a shorthand for: if(r == 0) { r = i; }
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 10, "tags": "javascript" }
How to Hide or show the class based on the input text field For clearing the text inside a text field i have put up a class by name clear < How to make the class (searchClear_btn) show only if the textinput has some data or else disappear the class ?? $("#devsearchinputtext").val('This is test'); $("#devsearchinputtext").after('<a class="searchClear_btn">Clear</a>'); $(document).on('click', '.searchClear_btn', function(event) { $("#devsearchinputtext").val(''); event.stopImmediatePropagation(); event.preventDefault(); return false; }); Could you please let me know how to achieve this
You can bind `keyup` event and show button if input have text. $("#devsearchinputtext").on('keyup', function(){ $('.searchClear_btn').toggle(!!this.value && !!this.value.length) }).trigger('keyup'); DEMO
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "jquery" }
Invalid argument error with tab in listchars I used `list` and `listchars` in vimrc file to display hidden characters but I get this error: E474: Invalid argument: listchars=tab:> after `tab:>` there is also a space. Below I have the complete entries set list set listchars=tab:> ,trail:-,space:· I checked the arguments one by one, and the problem is caused when I also include the `tab` argument. I saw that in many cases specifying encoding to `utf-8` solves the problem, so at the top of the file I inserted the lines set encoding=utf-8 scriptencoding utf-8 but the problem remains. Currently the `tab` character is displayed as `^I`. I run vim version 8.2 in Debian 11.6 How can I solve the tab character problem? I want to include it in my specifications.
The `set` command doesn't accept space in the left hand side (space is used to separate right hand sides). You have to escape the spaces: set list set listchars=tab:>\ ,trail:-,space:·
stackexchange-vi
{ "answer_score": 1, "question_score": 0, "tags": "vimrc" }
Complex SQL transformation This is my source table Reference ModifiedDate ------------------------------------ 1023175 2017-03-03 16:02:01.723 1023175 2017-03-07 07:59:49.283 1023175 2017-03-12 11:14:40.230 Ineed the following output Reference StartDate EndDate --------------------------------------------- 1023175 2017-03-03 16:02:01.723 2017-03-07 07:59:49.283 1023175 2017-03-07 07:59:49.283 2017-03-12 11:14:40.230 1023175 2017-03-12 11:14:40.230 9999-12-31 00:00:00.000 (last record should have this value) Any suggestions on how this can be achieved?
DECLARE @MyTable TABLE (Reference INT, ModifiedDate DATETIME) INSERT INTO @MyTable VALUES (1023175, '2017-03-03 16:02:01.723'), (1023175, '2017-03-07 07:59:49.283'), (1023175, '2017-03-12 11:14:40.230'); SELECT T1.Reference, T1. ModifiedDate AS Start_Date, COALESCE(MIN(T2.ModifiedDate),CAST('31/12/9999' AS DATETIME)) as EndDate FROM @MyTable T1 LEFT JOIN @MyTable T2 ON T1.reference = T2.reference AND T1.ModifiedDate < T2.ModifiedDate GROUP BY T1.Reference, T1. ModifiedDate
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "sql, sql server, sql server 2008" }
$c=zw+z$ , solve for $w$ $c=zw+z$, solve for $w$. I know this sounds basic but i want to be sure. This is a site homework, My result was $w={c\over z}-1$ but the site says the correct answer is $w={(c-z)\over z}$. anything possibly wrong with my solution ? thanks!
It depends on how you do the algebra: $$c=zw+z\to c-z=zw\to \frac{c-z}{z}=w$$ or $$c=zw+z\to c=z(w+1)\to \frac{c}{z}=w+1\to \frac{c}{z}-1=w$$ So $$\frac{c-z}{z}=\frac{c}{z}-1$$
stackexchange-math
{ "answer_score": 0, "question_score": 1, "tags": "algebra precalculus" }
What is the difference between STATUS_STACK_BUFFER_OVERRUN and STATUS_STACK_OVERFLOW? I just found out that there is a STATUS_STACK_BUFFER_OVERRUN and a STATUS_STACK_OVERFLOW. What's the difference between those 2? I just found Stack overflow (stack exhaustion) not the same as stack buffer overflow but either it doesn't explain it or I don't understand it. Can you help me out? Regards Tobias
Consider the following stack which grows downward in memory: +----------------+ | some data | | +----------------+ | growth of stack | 20-byte string | V +----------------+ limit of stack A buffer overrun occurs when you write 30 bytes to your 20-byte string. This corrupts entries further up the stack ('some data'). A stack overflow is when you try to push something else _on_ to the stack when it's already full (where it says 'limit of stack'). Stacks are typically limited in their maximum size.
stackexchange-stackoverflow
{ "answer_score": 8, "question_score": 7, "tags": "windows, stack overflow, buffer overflow, buffer overrun" }
Meaning of "unfreiwillig komisch" From Spiegel Online: > Psychologie mit dem Vorschlaghammer und ein Drehbuch, das in die Asservatenkammer gehört: "Winternebel", der witterungsaktive Entführungs-"Tatort" aus Konstanz, ist **unfreiwillig komisch**. What does "unfreiwillig komisch" mean here? Even literally translated into English, it would be "involuntarily funny", which doesn't really make that much sense.
An idiomatic translation of **unfreiwillig komisch** would be > **unintentionally hilarious** but I guess the literal translation **involuntarily funny** can be understood, too: According to _Spiegel Online_ , the _Tatort_ crime movie is funny because it has a bad, laughable script (or is poorly acted) - although, by the producers, it is not meant to be funny.
stackexchange-german
{ "answer_score": 7, "question_score": 1, "tags": "meaning" }
Base64 utility in awk I run into a specific issue when try to convert an image binary (with a 0xFFD8 jpeg signature) to a base64 string using awk. It looks to me that I am almost there but the base64 string is truncated and not complete. Since the image binary is large, I am not sure if that causes the issue. The command producing this is below: #!/bin/bash awk --field-separator '|' '{ "echo "$mybinaryhere" | xxd -r -p | base64" | getline x print x }' myfile.csv The output is: /9j/2wBDAAMCAgMCAgMDAwMEAwMEBQgFBQQEBQoHBwYIDAoMDAsKCwsNDhIQDQ4RDgsLEBYQERMU Expected output should be similar but much longer because it is a binary image. The `$mybinaryhere` is just a column variable which holds the full binary image when `awk` is reading `myfile.csv` Thanks
The output of `base64` is wrapped at an appropriate column size (76 columns) and each line ends with a newline. The `getline` function of `awk` just reads next single line from the standard input and the remaining lines will be discarded. Then would you please try: awk --field-separator '|' '{ while ("echo "$mybinaryhere" | xxd -r -p | base64" | getline) print }' myfile.csv
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "bash, awk" }
WD 500gb Hard Drive Reads on my computer Shows No data Hi i just tried plugging in my WD 500g Hard Drive when it just shows me the drive with no data. I ran a cksdsk/e and it says Invalid Parameters. It also asks me to format disk. Can anyone help solve this problem?
This command will take a while, but try `chkdsk I: /r /f /v /x` where `I:` should be replaced with your drive letter.
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "hard drive" }
How does one use 'moue' properly in a sentence? I don't understand how to use _moue_ in a sentence. I know the definition of moue: > _**noun_** \- a little grimace : pout It says it is a noun, but whenever I've seen it used, it always comes off verb-like, unless I'm misreading. An example: > With a moue of discontent, he set down his mug upon the table at his elbow and rubbed his hands through his hair, mussing it so that it would probably be horribly tangled when he tried to brush it later. Either way, I still don't understand how to use this word properly. Do you always say 'moue **_of_** x' or can it be used by itself like 'His moue showed how unhappy he was'?
I, for one, do not always say “moue of x”, so the answer to the first question is no. For the other half of your question, it is grammatical to say “His moue showed how unhappy he was”; but I have yet to hear anyone say such a thing. Note, wiktionary's entry for _moue_ says > Often used in the phrase “make a moue”, influenced by French “faire la moue”, meaning “to pout” and one of the examples cited is for “made ... a moue”: > She made what I believe, though I wouldn't swear to it, is called a moue. Putting the lips together and shoving them out, if you know what I mean. The impression I got was that she was disappointed in Bertram, having expected better things [...]. (1960, P. G. Wodehouse, _Jeeves in the Offing_ )
stackexchange-english
{ "answer_score": 3, "question_score": 3, "tags": "word usage" }
Change Tiny Proxy IP per request on EC2 I'm fairly new to Proxy servers and how they work exactly. I recently span up an AWS EC2 instance to act as a proxy server using tiny proxy. Everything seems to work just fine however i am curious about something. Is it possible to configure tiny proxy to use a different public IP each time it makes a request ? I looked into AWS Elastic IP's but don't quite understand how those might fit in this scenario.
Not possible. Public IPs are allocated to the instance during launch. You can allocate multiple IPs using Elastic IPs like you mentioned but you can't get IPs per request like you asked. What's your use case?
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "linux, amazon web services, ubuntu, amazon ec2, tinyproxy" }
Angular (2/4): selecting text fires click event If an element has a `(click)` handler and you select some text within this element, the `(click)` handler gets called. Is there a way to prevent this? Here's a Plunkr illustrating the problem. Relevant code: @Component({ selector: 'my-app', template: ` <div> <h2 (click)="handleClick()">Click or select this text</h2> </div> ` }) export class App { public handleClick() { alert('you clicked'); } }
**use this code** public handleClick() { var selection = window.getSelection(); if(selection.toString().length === 0) { alert('you clicked'); } }
stackexchange-stackoverflow
{ "answer_score": 9, "question_score": 11, "tags": "angular" }
Is there any possible do upsert functionality in "array of an object" using firestore query? Example :[{ inst:"EVA", std:"12th" }, { inst:"KSF", std:"12th" }] ![enter image description here]( As per the above example, In my case if "inst: "EVA" is already there in the "qualification" array so we need to update the object from the existing one. Then "inst: "KSF" does not already exist in the "qualification" array so we need to add that one. Help me if there is any way to upsert using firestore query.
There is no "upsert" operation for objects in arrays. If you need to make changes to that array, you will have to read the document, modify the contents of the array in memory, then update the document with the new contents of the array. Arrays of objects usually do not work the way that people want, given their limitations on querying and updating. It's usually better to store data as documents in a nested subcollection, so they can be more easily queried and updated by the contents of their fields.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "google cloud firestore" }
A fascinating maths equation Just out of curiosity, I wrote a maths equation today. I then deleted one digit from the RHS and one digit from the LHS, but the equation still stood true. I then again deleted one digit from the RHS and one digit from the LHS, but the equation still stood true. Lastly, I deleted one digit from the remaining two digits on the RHS, even then after deleting a digit from LHS, the equation stood true. Assuming, the equation only comprised of standard BODMAS operations(no exponents, logarithms etc.) If all gaps left by erased digits were considered to be closed up,what were the three equations created? EDIT: There is no unique solution, but hardworked solutions will be appreciated. Example: 3(43+2)=135 3(3+2)=15 3+2=5
There seems to be very many solutions families, each having multiple solutions. Here is the simplest solution I found: > 1111=1111 (at each phase, remove whichever digit) Some of the other solution families: > N + 0 = N (remove corresponding digits of N). > N x 1 = N (same). > N + M = S, where N (mod 10) + M < 10, remove first digits on both sides. > N - M = D, similarly where N (mod 10) > M. there are quite a lot of other solution families too.
stackexchange-puzzling
{ "answer_score": 3, "question_score": -1, "tags": "mathematics, logical deduction" }
Compare two vars of T in a method of a generic class<T,U> (code port from C++ to C#) How to compare two vars of type T in a method of a generic class< T, U >? Here is an example code which throws the following compiler error: > Error CS0019 Operator '>=' cannot be applied to operands of type 'T' and 'T' class IntervalSet< T, U > { public void Add ( T start, T end, ref U val ) { // new interval is empty? if (start >= end) // ERROR return; } } I try to port source from C++ to C# and C# is new to me. Thanks for your help.
You must tell C# that `T` is comparable, otherwise you can only do `System.Object` things with `T` (and that's not much), excluding creating a new instance, since C# does not even know whether `T` has a default constructor: class IntervalSet< T, U > where T : IComparable<T> { public void Add ( T start, T end, ref U val ) { if (start.CompareTo(end) >= 0) { } } } Note that standard types like `int`, `string`, `DateTime` etc. all implement this interface. See: IComparable<T> Interface.aspx), Constraints on Type Parameters (C# Programming Guide)
stackexchange-stackoverflow
{ "answer_score": 7, "question_score": 4, "tags": "c#, generics" }
PHP LDAP Distinguish user from computer Is there a way to query with LDAP and leave out computers in the result? There are users and computers inside the OU, and I only want to display the Users with their cn, title,address etc... Thanks!
You need to add the following to your LDAP filter `(!(objectClass=computer))`. This will exclude computer objects. You can read more on LDAP filters in this LDAP Filter Syntax article.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "php, active directory" }
how to get the none zero indexes of a sparseMatrix? Given a Matrix M: M <- Matrix(c(1,0,0,0,0,1,0,0,0), nrow=3, sparse=T) M 3 x 3 sparse Matrix of class "dtCMatrix" [1,] 1 . . [2,] . . . [3,] . 1 . how can I extract a list of indexed wich point to none zero values at that cell? In this case for example a data.frame like this: x y 1 1 1 2 3 2
Try: `which(M==1, arr.ind=TRUE)` row col [1,] 1 1 [2,] 3 2
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "r, sparse matrix" }
NSButton loses blue highlight effect when setting an Alternate image When I use a NSButton with style 'Round Rect', type 'Toggle' and an image, the image and title will be nicely rendered in blue, when the State is set to On. However, when I also add an alternate image, this highlight effect is gone. Is there a simple way to fix this? I want to achieve the same effect as the small tab bar icons on top of the Inspector in Xcode: blue when selected, using an alternate image (slightly bolder), black when not selected, using the default image.
This is the expected behavior. The system only transforms your template to apply the visual highlight if you don't supply your own alternate (active / lit / on) version.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "objective c, xcode, swift, macos, nsbutton" }
How to read TCP packet? > **Possible Duplicate:** > TCP IP: Is it possible to read what TCP/UDP data a program is sending remotely? I want to read a packet I've captured with Wireshark. The packet contains data, 133 bytes in length. It is not encrypted. Yet, the HEX form of the data decodes in Wireshark as a string of mostly unintelligible gibberish. Is there any way to read this data in human-readable form? I'm just trying to figure out how a game client works, that's all.
You would have to know the format to convert it into human-readable form. It's like a book written in Chinese -- if you don't know Chinese, it's going to look like unintelligible gibberish. But it makes perfect sense to anyone who does know Chinese. Figuring out the format from just the data is as difficult as learning Chinese just from a book written in Chinese. It can be done, but it's a highly-specialized art. For example, you can try not moving and seeing which numbers stay the same. Then move, and see which numbers change. That might clue you in to where the position information is. However, the entire packet might be scrambled with a pseudo-random sequence, in which case, it will be nearly impossible without reverse-engineering the software.
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 2, "tags": "tcp" }
need help for developing android restaurant menu application I want to develop restaurant menu application functions: application contains list of items available in restaurant. waiter takes order from customer by selecting various items in the list. On submitting order it goes to chef,who has android device with him, he will ack the requested order. i want to simulate this app on emulator, i have designed some basic interface. problems is that i want to transfer selected item data to other application running on other emulator,in short communication between two application running on different device. What should i do ? as far as my knowledge AIDL feature of android facilitates common between two app running on the same device. thanks!!
Bluetooth is not currently available available in the Android emulator, but some people seem to have had luck with this github project.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "android" }
reading a text file in ms access I have a text file with some data i would like to open the text file and copy data to text box fields in form, I would like do this in event procedure for click event of a button in the same form, I am using ms access 2007. Text file is very simple it has one column with 6 rows 12 2.5 6.7 9.5 3.4 7.6 I would like put these number to fields in the form.
Here's an example of how to open a text file and copy a field into a field on your form Dim MyStr1 as string dim MyStr2 as string Open "TESTFILE" For Input As #1 Do While Not EOF(1) ' Loop until end of file. Input #1, MyStr1, MyStr2 me.txtStr1 = MyStr1 me.txtStr2 = MyStr2 Loop Close #1 ' Close file. (the example loops through multiple rows, but you could equally well unroll the loop and do each row individually, as you might want to do - depending on how your text file is organised) You can find more info here
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "ms access" }
"Can't load javah" error in Eclipse I am trying to use the javah task in an ant build file in Eclipse and I keep getting the following error: BUILD FAILED C:\sandbox\build-jni.xml:7: Can't load javah Here is my build-jni.xml file: <project> <property name="bin" location="bin" /> <target name="generate-jni"> <javah destdir="${bin}" classpath="${bin}"> <class name="org.example.ExecJNI" /> </javah> </target> Any thoughts as to why I'm getting that error? My project is pointing to the JDK and not the JRE
Turned out I didn't have C:\Program Files\Java\jdk1.7.0_15\tools.jar in my Ant Home Entries in Window --> Preferences. That seemed to fix the problem.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 3, "tags": "eclipse, ant, javah" }
Loading properties in an array using Groovy Soapui I have a property containing an array of data separated by comma as below: > TESTCASE1,TESTCASE2,TESTCASE3 Now my objective is to only execute the testcases mentioned in the property and disable the rest of the testcases in the Project. So for this i have defined an array as below // Define the array def MAX_SIZE = 3 def myArray = new Object[MAX_SIZE] I am struggling to find a way: to load these TESTCASES in an array and execute via a for loop to disable the Testcases not mentioned in the property. Since I am running Soapui via command line in linux so there is no way i can execute more than 1 TESTCASES.
this is how i was able to do that: def totalTestCases = testSuite.getTestCases().size(); def myArray = new Object[totalTestCases] myArray = testRunner.testCase.testSuite.getPropertyValue( "TESTCASES" ).tokenize( ',' )
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "groovy, soapui" }
What is the syntax for `gem install` multiple gems, specifying versions for each one? How can I use `gem install` to install multiple gems at the same time, while also specifying the versions I want? Example: gem install akami -v 1.2.0 --ignore-dependencies gem install atomic -v 1.1.14 --ignore-dependencies gem install aws-s3 -v 0.6.2 --ignore-dependencies gem install backports -v 3.3.0 --ignore-dependencies gem install brendanlim-sms-fu -v 1.0.0 --ignore-dependencies gem install builder -v 3.1.3 --ignore-dependencies gem install capistrano -v 2.9.0 --ignore-dependencies How could I instruct `gem install` to execute that in one line? * * * The accepted answer do answer the question. But the final approach I took was to use bundler 1.0.22, which is compatible with ruby 1.8.6.
Since Rubygems 2.0 you can specify a version for multiple package installations like this: $ gem install akami:1.2.0 atomic:1.1.14 aws-s3:0.6.2 backports:3.3.0 \ brendanlim-sms-fu:1.0.0 builder:3.1.3 capistrano:2.9.0 \ --ignore-dependencies
stackexchange-stackoverflow
{ "answer_score": 28, "question_score": 12, "tags": "ruby, rubygems" }
How to access Elastic Beanstalk env var in springboot application We have a springboot/Tomcat server running on Elastic Beanstalk. We want to use the Env vars set in beanstalk in our springboot code. Currently we have something like Private string getvar = System.getenv("ENV_VAR"); //and have also tried Private string getvar = System.getProperty("ENV_VAR"); Locally this works just fine. When it's on aws, it can't find the variables. We have them set in our EB Instance -> Configuration -> Software -> Environment Variables: Key = ENV_VAR Value = valueWeExpect and I confirmed they are set via cloudShell. **Does anyone know if we are missing a dependency or referencing the variables incorrectly? Is there anything we have to add?**
I get my via @Autowired private Environment _env; _env.getProperty("ENV_VAR") Environment is `org.springframework.core.env.Environment`
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "java, amazon web services, spring boot, environment variables, amazon elastic beanstalk" }
ADO.NET (ODP.NET) and same Connection pool for different clients connection We have to implement a two tier architecture to distribute a cache from a central Oracle DB to a lot of clients (circa 200) into an Intranet. After some experimentations we have opted to use a direct connection from the client to the DB server. This decision has been taken to simplify the architecture and to reduce the overheads. Client application are made in C# and the natural choice should be to adopt ODP.NET (ADO). But now we are trying to understand **if it is possible to have and to use the same connection pool for all the clients connection**. The clients will connect with the same functional username and password. Could anyone help me in clarifying this key point?
Have you considered looking at Oracle 11g Database Resident Connection Pooling? This may resolve your issue.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "oracle, ado.net" }
How do you sort each character in a .txt file? For example, if a .txt file consists: _car and day_ I want to make them in alphabet order: _acr adn ady_ Here's what I have in my code right now: def read_file(fileName): list = [] with open(fileName) as f: list = f.read().split() list.sort() return list It just won't sort the way I want, do I need a nested for loop?
It seems you need this: def read_file(fileName): with open(fileName) as f: a_list = f.read().split() result = ' '.join([''.join(sorted(a)) for a in a_list]) return result
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "python" }
Pass parameter to constructor from template A very basic setup, component: export class LayerComponent { public content: string; constructor(content: string) { this.content = content; } } and its template: <p>{{content}}</p> From another component i would like to (statically) instantiate the component described passing in the content parameter (without the need for binding it). I took the following approach which doesn't work: <ipe-artboard-layer content="Joep"></ipe-artboard-layer> <ipe-artboard-layer content="Floris"></ipe-artboard-layer> <ipe-artboard-layer content="Casper"></ipe-artboard-layer> Is the approach possible, adviseable? I'd rather not go for a real binding because it's only to instantiate the component with a one-time initial value for some property of it.
AFAIK it is not possible to invoke constructor this way. What you're looking for is `@Input()` binding: <ipe-artboard-layer [content]="Joep"></ipe-artboard-layer> And in your component: export class LayerComponent { @Input() public content: string; constructor() {} } Here you can read more about component interactions.
stackexchange-stackoverflow
{ "answer_score": 7, "question_score": 4, "tags": "angular, typescript" }
Should I list startups on my resume when applying to top-notch companies I am a computer science undergraduate with no formal work experience. But currently I am working for two startups which are currently in their initial phases. I am a stakeholder in both and working as full stack developer. I dont have any contracts or commitments with any. Actually they are both not-so-technical startups, so I just want to give them a working mobile app and backend and get on with my life. Amazon is visiting my campus tomorrow and I would like to work with them as an intern. Will listing these startups be harmful in my application to Amazon or any other company? Actually I have worked quite a lot for both on apache cordova and don't really have anything else to write on my resume. Any suggestions? Thanks. Update: I eventually put it on my resume and got into Amazon. :)
If I had two people in front of me with exactly the same CV, except that one had this experience with two startup companies, and the other didn't have any of that experience, who would I prefer? Obviously the one with the added experience. Every experience is experience and every experience in your CV makes you more likely to get an interview. Worst case would be that someone values experience in a startup slightly lower than the same experience in a bigger company, but it will still be regarded a lot higher than not having that experience at all. So you should definitely add this experience to your CV.
stackexchange-workplace
{ "answer_score": 17, "question_score": 5, "tags": "resume" }
Error with updating new APK on the developer's console I have been trying to update my app with the new version and I run into this problem on the developers console. I have such error: !enter image description here I checked with the version of my previous version to see if I was doing something wrong, but it was the same. !enter image description here Here is my updated xml file <application android:allowBackup="true" android:id="@+id/title" android:icon="@mipmap/iron" android:label="@string/app_name" android:theme="@style/AppTheme" android:versionCode="100" android:versionName="2.0" >
Looks like you already have version 1. in the play store. To be able to update it, you need to change the version number in the `build.gradle` file in your android project. Sync your project, then generate the new APK. I doubt if just updating the manifest will work.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "android" }
Schedule POD alone on a node We're trying to isolate a problem with a specific pod and we would like to have it deployed all by itself on a node. (except for kube-system pods) Is there a simple way to get a high priority pod to be scheduled by itself ? (ex: set cpu requests to 100% )
In general, you should not pin Pods to a specific node - so there are no specific feature for that in Kubernetes. But you can achieve this in multiple ways anyway. > (ex: set cpu requests to 100% ) Yes, if your nodes are homogeneous (e.g. all have the same CPU amount) then, I think this is the best method. If your nodes has e.g. 4 CPU cores, you can set the CPU request to 3.5 or something (depending on how much the kube-system pods requests). Using nodeSelector might be another way to solve this.
stackexchange-serverfault
{ "answer_score": 0, "question_score": 0, "tags": "kubernetes" }
JavaFX: Call method on specific time Is there a way to simply get a method to run on a specific frame or time? I've read up on the Timeline and Keyframe + KeyValue documentation and it seems overkill for what I am trying to achieve. I'm trying to get something as simple as this, (refer to my pesudocode): atTime(Duration.millis(2000)){ myMethod(); } //do this at the time 00:00:02 atTime(Duration.millis(3000)){ myMethod(); } //do this at the time 00:00:03 atTime(Duration.millis(5000)){ myMethod(); } //do this at the time 00:00:05 And I keep timing when my method is called until I want it to stop. Is there a way to achieve this without using complicated methods revolving around keyframes and keyvalues?
You can do this in a pretty simple way using a `Timeline`: Timeline timeline = new Timeline( new KeyFrame(Duration.seconds(2), e -> myMethod()), new KeyFrame(Duration.seconds(3), e -> myMethod()), new KeyFrame(Duration.seconds(5), e -> myMethod()) ); // If you want to repeat indefinitely: timeline.setCycleCount(Animation.INDEFINITE); timeline.play();
stackexchange-stackoverflow
{ "answer_score": 4, "question_score": 0, "tags": "java, javafx" }
On finding the domain of a function with several variables Given the function as following: $$f\left ( x,y \right ):= \sqrt{\frac{x^{2}-2xy+y^{2}-10x+8y+20}{2x-x^{2}-y^{2}}}$$ Find its domain algebraically and then sketch its domain in the $xOy$ plane. The first step I took in doing so is to consider two possible cases: $1^{\circ}$ $$x^{2}-2xy+y^{2}-10x+8y+20\geq 0 \wedge 2x-x^{2}-y^{2}> 0$$ $2^{\circ}$ $$x^{2}-2xy+y^{2}-10x+8y+20\leq 0 \wedge 2x-x^{2}-y^{2}< 0$$ However, I am afraid that first inequality in both cases can only be solved using numerical methods. Using the Desmos graphing calculator I get that the interesction region for case #1 is just the open region bounded by the circle in the denominator: !Intersecting region And for case #2, I suppose, the intersection is just an empty set. Can anyone show a purely algebraic method on how to solve the inequality from the numerator?
Actually given that your domain is some part of the plane limited by two quadrics, as you correctly identified, you may want to (or have to) describe these quadrics (center and radius for a circle, focal point etc.)
stackexchange-math
{ "answer_score": 0, "question_score": 0, "tags": "multivariable calculus" }
How to reference MSA in work order? How do companies reference a Master Services Agreement in work orders or statement of work? What language is normally used to do this?
A typical provision would say on the face of the work order or statement of work, often at the top or bottom on the front side of the front page, sometimes in a text box, something like: > This work order incorporates by reference all provisions of the Master Services Agreement of June 14, 2014 ("MSA"), that are not expressly contradicted by the language of this work order. **The MSA contains a binding arbitration clause and a waiver of certain lien rights.** A copy of the MSA is available for inspection at all times in the general contractor's office or on the general contractor's website.
stackexchange-law
{ "answer_score": 1, "question_score": 1, "tags": "contract, legal terms" }
Is it possible to make [JsonIgnore] to default and only annotate properties which I want? **Context** My class has many properties, and I would like to serialize only a few of them. I am aware that I can control this via `[JsonIgnore]` attribute. **Question** Is there any way to ignore all properties except what I annotate with `[JsonProperty]`?
Above class: [JsonObject(MemberSerialization.OptIn)] Above any property you want to serialize: [JsonProperty] Check this `link` for further information.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "json.net" }
How to increase font size in javascript alert() Can I control the font size of the string in a javascript `alert()` call??! I've the image below and I want to increase the font size so that it is legible. Javascript Alert Pop Up
> Can I control the font size of the string in a javascript alert() call??! Nope. How the alert window is rendered is entirely up to the browser. You would have to use a JavaScript based dialog windows alternative like jQuery UI Dialog.
stackexchange-stackoverflow
{ "answer_score": 18, "question_score": 12, "tags": "javascript" }
how add jade in iframe? I have this code in a file `.jade` : iframe(src="file2.jade" width='100%' height='4000' frameborder=0 scrolling='no') the `file2` file is in the same folder as this file, but does not insert the file, what can I do?. Thanks
Adding .jade file to an iframe does not make sense. Iframes are processed by a browser, and browser expects html, not jade. So the answer depends on what are you trying to do, maybe `include` directive will help.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "node.js, express, pug" }
How to disable (Record Macro) menu (by macro codes) In (Microsoft Excel) In (Tools > Macro) There is a menu with name of (Record Macro) How to disable (Record Macro) menu by a macro code?
You can use a loop like this: Dim ctl As CommandBarControl For Each ctl In Application.CommandBars.FindControls(ID:=184) ctl.Enabled = False Next ctl
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": -3, "tags": "vba, excel, vbscript" }
Is this form of Bernoulli's inequality for n variables correct? Somewhere I found the following inequality (see below), named as an alternative form of classical Bernoulli's inequality. I could not find it in wikipedia or other math books. Is this inequality always true? Provided that both 1 and 2 hold simultaneously 1. $x_n > -1$ 2. all $x_n$ have same sign The below is true: $$ (1+x_1)(1+x_2)(1+x_3)...(1+x_n) \ge 1 + x_1+x_2+x_3+...+x_n $$
Yes, it's true. You can do it by induction. For $n=1$, it's trivial. On the other hand, if you have$$(1+x_1)\ldots(1+x_n)\geqslant1+x_1+\cdots+x_n,$$then, since $1+x_{n+1}\geqslant0$,\begin{align}(1+x_1)\ldots(1+x_{n+1})&\geqslant(1+x_1+\cdots+x_n)(1+x_{n+1})\\\&=1+x_1+\cdots+x_n+x_{n+1}+(x_1+\cdots+x_n)x_{n+1}\\\&\geqslant1+x_1+\cdots+x_n+x_{n+1},\end{align}since$x_1+\cdots+x_n$ and $x_{n+1}$ have the same sign.
stackexchange-math
{ "answer_score": 0, "question_score": 0, "tags": "inequality" }
sed out string middle of string that may contain one or more numbers My strings are: * "TESTING_ABC_1-JAN-2022.BCK-gz;1" * "TESTING_ABC_30-JAN-2022.BCK-gz;1" In bash when I run: `echo "TESTING_ABC_1-JAN-2022.BCK-gz;1" | sed 's/.*\([0-9]\{1,2\}-[A-Z][A-Z][A-Z]-[0-9][0-9][0-9][0-9]\).*/\1/'` it returns 1-JAN-2022 which is good. But when I run: `echo "TESTING_ABC_30-JAN-2022.BCK-gz;1" | sed 's/.*\([0-9]\{1,2\}-[A-Z][A-Z][A-Z]-[0-9][0-9][0-9][0-9]\).*/\1/'` I get 0-JAN-2022 but I want 30-JAN-2022. From me passing in my string. How can I do it so that I can get single or double digit dates in one line like "30-JAN-2022" or "1-JAN-2022"
It is much easier to use `awk` and avoid any regex: cat file TESTING_ABC_1-JAN-2022.BCK-gz;1 TESTING_ABC_30-JAN-2022.BCK-gz;1 awk -F '[_.]' '{print $3}' file 1-JAN-2022 30-JAN-2022 Another option is to use `grep -Eo` with a valid regex for date in `DD-MON-YYYY` format: grep -Eo '[0-9]{1,2}-[A-Z]{3}-[0-9]{4}' file 1-JAN-2022 30-JAN-2022
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 3, "tags": "bash, awk, sed, grep" }
Central limit theorems, Almost sure invariance principles and Brownian motion In a paper I was reading on dynamics, I came across a proof of a central limit theorem in a certain situation using brownian motion and an almost sure invariance principle. I am not very experienced in probability theory; so I would like to know: 1. Is this a standard method to prove the central limit theorem? 2. What is possibly the advantage in such an approach? 3. What are some references to see simple instances of such a proof of CLT, law of iterated logarithm, etc?
Or try the reference in the paper: 3] P. Billingsley, Convergence of probability measures, John Wiley, New York-London-Sydney 1968 It is actually a beautiful (but challenging) book
stackexchange-math
{ "answer_score": 0, "question_score": 1, "tags": "reference request, probability theory, stochastic processes" }
How to find size or shape of an tensorflow.python.data.ops.dataset_ops.MapDataset object, output of make_csv_dataset Using `make_csv_dataset` we could read an CSV file to tensorflow dataset object csv_data = tf.data.experimental.make_csv_dataset( "./train.csv", batch_size=8190, num_epochs=1, ignore_errors=True,) now `csv_data` is of type `tensorflow.python.data.ops.dataset_ops.MapDataset`. How can I find the size or shape of `csv_data`. `print(csv_data)` give column information as below `<MapDataset element_spec={'title': TensorSpec(shape=(None,), dtype=tf.string, name=None), 'user_id': TensorSpec(shape=(None,), dtype=tf.string, name=None)}>` of course getting the could from `train_recom.csv` using and `pandas.read_csv` is on option, just was curious if tensorflow has anything easier.
If you want to get the size of your batched dataset without any preprocessing steps, try: import pandas as pd import tensorflow as tf df = pd.DataFrame(data={'A': [50.1, 1.23, 4.5, 4.3, 3.2], 'B':[50.1, 1.23, 4.5, 4.3, 3.2], 'C':[5.2, 3.1, 2.2, 1., 3.]}) df.to_csv('data1.csv', index=False) df.to_csv('data2.csv', index=False) dataset = tf.data.experimental.make_csv_dataset( "/content/*.csv", batch_size=2, field_delim=",", num_epochs=1, select_columns=['A', 'B', 'C'], label_name='C') dataset_len = len(list(dataset.map(lambda x, y: (x, y)))) print(dataset_len) 5 If you want to know how many samples you have altogether, try `unbatch`: dataset_len = len(list(dataset.unbatch().map(lambda x, y: (x, y)))) print(dataset_len) # 10
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "python 3.x, csv, tensorflow, tensorflow2.0, tensorflow datasets" }
Get every nth item in array I have an array of HTML elements. I'm checking whether a previous object in the array exists like this: var boxes = $('.box'); // creating the array boxes.each(function(i){ // going through the array var prevBox = i>0?$(boxes[i-1]):false; // check whether a previous box exists if (prevBox) { } // do something else { } // do something else }); This works well. But I would also need to check the existence of every fourth object (box) in the array, or more precisely whether an object three objects before the current one exists. This doesn't work: var prevBox = i>0?$(boxes[i-4]):false; I believe using `jQuery.grep()` and checking if `(i % 4) == 0` might be the answer, but with my limited knowledge of Javascript, I don't know how to apply it to what I have now. Anyone can help? Thanks!
~~You can use themodulus operator in the loop to see if you are on a fourth interval.~~ _Question was clarified._ var boxes = $('.box'); // creating the array boxes.each(function(i){ if( i >= 3 ) { var prevBox = boxes.eq( i - 3 ); var pos = prevBox.position(); var top = pos.top; } });
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 7, "tags": "javascript, jquery" }
JAX-RS and JAXB entity causes bad request with space before xml preamble I'm testing my JAX-RS service using the RESTClient FireFox extension. Sometimes I mistakenly paste in a space before the xml preamble. This causes a 400 Bad Request when I do my PUT. Is there anyway to get Jersey/JAXB to ignore the white space? WebLogic 12c with Moxy 2.4.1.
The XML parser that **EclipseLink MOXy** or any other **JAXB (JSR-222)** implementation uses is going to thrown an exception if there is a space before the XML declaration. If you are passing the XML as a `String` then you could call trim on it first.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 1, "tags": "jaxb, jersey, weblogic, jax rs, moxy" }
Back button prevents page from authorizing user? In my MVC 4 application, I am using a `BaseController` to execute a few processes whenever any of my other controllers get hit, one of which is checking if a user is logged in or not. I've noticed that this is a common issue across design patterns, frameworks, what-have-you. Sadly, I could not find a solution. Let's keep this short and sweet: how can we prevent the back button from allowing unauthorized access to my MVC 4 pages?
One possible issue is the page being in browser cache. Consider adding some anti caching code to the page initialization. Response.Cache.SetCacheability(System.Web.HttpCacheability.NoCache); Response.Cache.SetNoStore(); Here is are some other questions with some implementation options. Disable browser cache for entire ASP.NET website How do I add site-wide no-cache headers to an MVC 3 app
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "c#, asp.net mvc, web applications, authorization, back" }
Copy rows filtered on a search criteria from one table to another in MySQL Using MySQL, I want to retrieve all rows from a table A where a field contains "EQ" for example, copy them into table B (which has exactly the same field), and then delete them from table A. I heard about triggers. Is that the right approach?
1. You need 2 SQL statements. First for inserting the data rows from A to B, and then for deleting those rows from A. INSERT INTO B SELECT * FROM A WHERE Field LIKE '%EQ%'; DELETE FROM A WHERE Field LIKE '%EQ%'; 2. Triggers are a way to automate some activities when some other activity in a separate table happens. If you need to make sure that the above 2 operations should be triggered as soon someone INSERTS/DELETES/UPDATES on some other table, then you can create a trigger for that purpose. But with the simple requirement you gave above without any such dependency, I do not see a need of a trigger here. If you do have such dependency and need, you have to provide proper requirements with details here.
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": -2, "tags": "mysql, copy, filtering" }
How to bind the cookie value to variable in knockout i am having a cooking name user and i want to access the cookie value in my knock out js script file and assign it to a observable variable. how can i do that? var Suggestion = { SuggestionId: self.SuggestionId, Title: self.Title, CategoryId: self.CategoryId, ProductId: self.ProductId, Details: self.Details, StatusId: self.StatusId, CreatedDate: self.CreatedDate, CreatedBy: self.CreatedBy, ModifiedDate: self.ModifiedDate, ModifiedBy: self.ModifiedBy, UserId: self.UserId }; i want to assign the createdby with the value in the cookie var userCookie = new HttpCookie("user", user.UserName); how to do that
If your cookie is set with the `HttpOnly` flag you will not be able to access its value from javascript. You may inspect the value of `document.cookie` to know if you can see it. One possible solution in this case is to store the value of the cookie in some global javascript variable by a server side script: <script type="text/javascript"> @{ var cookieValue = Request.Cookies["user"] != null ? Request.Cookies["user"].Value : ""; } var user = @Html.Raw(Json.Encode(cookieValue)); </script> and then in your knockout script you could access this global variable: CreatedBy: user,
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "asp.net mvc, knockout.js, view" }
get all values of a specific key in an array of dictionaries - javascript I have this json data below: [{ "name": "Dad", "age": "32" }, { "name": "Mom", "age": "30" }, { "name": "Son", "age": "3" }] I would like to have an array: `["Dad", "Mom", "Son"]`. What is the correct way to implement this in Javascript?
This is one way: var result= [{ "name": "Dad", "age": "32" }, { "name": "Mom", "age": "30" }, { "name": "Son", "age": "3" }].map( item => { return item.name }); //["Dad", "Mom", "Son"] console.log(result); var result= [{ "name": "Dad", "age": "32" }, { "name": "Mom", "age": "30" }, { "name": "Son", "age": "3" }].map( function(item) { return item.name }); //["Dad", "Mom", "Son"] console.log(result);
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 1, "tags": "javascript, arrays, json, filtering" }
How to add the UAC shield icon to program that still must target XP? I have a program that still must target Windows XP (_WIN32_WINNT 0x501), as most of our customers still use XP. However, we have been shipping Vista for a while, and are now pushing Windows 7 upgrades. For the software to work correctly on the newer OSs, there are a couple operations that require UAC elevation. I have the elevation code working, but would like to have the UAC icon present on the buttons that launch the UAC process. Unfortunately, all of the options defined in Microsoft's UAC UI document require _WIN32_WINNT 0x600 or newer. Is there any way to get the appropriate UAC icon (Vista and 7 use different ones) to show on the button while still being able to target XP (where no icon will be shown)? I'm using C++, but may be able to adapt a .NET solution.
Use Button_SetElevationRequiredState and add something like: #if ! defined(BCM_FIRST) #define BCM_FIRST 0x1600 #define BCM_SETSHIELD (BCM_FIRST + 0x000C) #define Button_SetElevationRequiredState(hwnd, fRequired) \ (LRESULT)SNDMSG((hwnd), BCM_SETSHIELD, 0, (LPARAM)fRequired) #endif // #if ! defined(BCM_FIRST) This will work on XP and Vista, and will compiled normally for all target systems.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 5, "tags": "windows 7, windows vista, windows xp, icons, uac" }
XPATH: Count occurrences of string with IMPORTXML I am using IMPORTXML in a Google Sheet and would like to count the number of occurrences of a given string throughout the entire XML document, regardless of what container it is in. I've already found that you can use `count(/Fruit/type[contains(.,'apple')])` to count the occurrence 'apple' in fruit > type. But how do I, for example, count the number of occurrences of 'the' on < Thank you so much!
The nearest approximation I can think of would be count(//text()[contains(., 'the')]) which would give you not the number of occurrences of the word "the", but rather the number of distinct text nodes that contain the substring "the" somewhere within them - multiple mentions in the same text node would only be counted once, i.e. <p>the quick brown fox jumped over the lazy dog</p> would count as 1, whereas <p>the quick brown fox jumped<br/>over the lazy dog</p> would count as 2 since the two mentions of "the" are in different text nodes
stackexchange-stackoverflow
{ "answer_score": 5, "question_score": 1, "tags": "xml, xpath, google sheets" }
Are there ‘light’ users that don’t need a license? I’m salesforce crm is there the concept of a light user? Like in jira I’ve got users and customers, I have to license users but any customer can email in a question then participate in their specific tickets. Can I do that without having to create a custom ‘myuser’ object and manually populate it with all my domain users. I only want to be able to ‘assign’ them to a user picker field in my opportunities and cases. They don’t need actual access to the system or even to receive emails from it. Just a way for me to say this email from this list of emails goes here.
On the surface of things, since you're talking about tracking email communication and not directly accessing Salesforce, I'd say the Contact object is an appropriate place for this.
stackexchange-salesforce
{ "answer_score": 1, "question_score": 0, "tags": "userlicense" }
Difference between using ' and "? > **Possible Duplicates:** > Difference between the use of double quote and quotes in python > Single quotes vs. double quotes in Python So I am now learning python, and was creating a function. What is the difference between using ' and ". I will create a sample function below to exemplify my question. def question(variable): print variable now what is the difference between calling question("hello") and question('hello') they both print hello, but why can I use both? Is it just because python is flexible? I was confused because ' is usually used for chars where as " is for strings for java right?
Both are equal and what you use is entirely your preference. As far as the `char` vs `string` thing is concerned, refer to the `Zen of Python`, (PEP 20 or `import this`) Special cases aren't special enough to break the rules. A string of length 1 is not special enough to have a dedicated `char` type. Note that you can do: >>> print 'Double" quote inside single' Double" quote inside single >>> print "Single' quote inside double" Single' quote inside double
stackexchange-stackoverflow
{ "answer_score": 59, "question_score": 46, "tags": "python, quotes" }
Error message "500 OOPS: vsftpd: refusing to run with writable root inside chroot()" I want to setup an anonymous only FTP server (able to upload files). Here is my configuration file: listen=YES anonymous_enable=YES anon_root=/var/www/ftp local_enable=YES write_enable=YESr. anon_upload_enable=YES anon_mkdir_write_enable=YES xferlog_enable=YES connect_from_port_20=YES chroot_local_user=YES dirmessage_enable=YES use_localtime=YES secure_chroot_dir=/var/run/vsftpd/empty rsa_cert_file=/etc/ssl/private/vsftpd.pem pam_service_name=vsftpd But when I try to connect it: kan@kan:~$ ftp yxxxng.bej Connected to yxxx. 220 (vsFTPd 2.3.5) Name (yxxxg.bej:kan): anonymous 331 Please specify the password. Password: 500 OOPS: vsftpd: refusing to run with writable root inside chroot() Login failed How can I fix this?
This blog here points out how to fix this problem. < The issue being that the user's root directory is writable. The Frontier Group provides you with a fix on vsFTPd. Here are the steps to be taken (copy paste from the tutorial, in case the link dies) 1. login as root (or sudo..) and do the following: 2. vi /etc/vsftpd.conf and add the following allow_writeable_chroot=YES 3. sudo service vsftpd restart
stackexchange-stackoverflow
{ "answer_score": 63, "question_score": 31, "tags": "linux, ubuntu, ftp" }
Mock Thread.currentThread().getContextClassLoader() in test init method I have the next block of code: public void init() { facultyList = new ArrayList<>(); localeFile = new Properties(); try { localeFile.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(loadFileName())); } catch (IOException | NullPointerException e) { LOG.error("Host: " + ((HttpServletRequest)FacesContext.getCurrentInstance().getExternalContext().getRequest()).getRemoteHost() + " | Error in constructing of LocaleModel. More: " + e); } } Any possible solutions to mock `Thread.currentThread().getContextClassLoader()` or how can I test this `catch` block?
You can set a custom context class loader. It is important to keep track of the original context class loader and put it back into context when your test is done.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "java, testing, junit, static, mocking" }
Find a sequence $a$ so that $a_n = s \Delta a_n $. Let $s$ be a real number $ s \ne 0 $. Find a sequence $a$ so that $a_n = s \Delta a_n $ and $a_0 = 1$. Any help with this question will be great. This is my first time doing recurrence relations and I am very confused.
With you definition, what is required is $$ a_n = sa_{n+1}-sa_n\iff a_{n+1} = \frac{s+1}s a_n $$ this is the definition of a geometric sequence. The general solution has the form $$ a_n = A \left[ \frac{s+1}s \right]^n $$and with $1=a_0 = A$ you find that $$ a_n = \left[ \frac{s+1}s \right]^n $$ * * * You have proved that IF $u$ was a solution it had the required form. You then have to check that if you define $u$ this way, the relation holds. You see that you need the condition $s\neq 0$. Then $u$ is defined and: $$ s\Delta a_n = sa_{n+1}-sa_n = sa_n \left[ \frac{s+1}s -1\right] = sa_n \frac{1}s = a_n $$
stackexchange-math
{ "answer_score": 1, "question_score": 0, "tags": "discrete mathematics, recurrence relations" }
Single word request: to learn or the act/state of learning something without awareness that one is being taught You'll often hear people reference how they learned so much about something, but it didn't _feel_ like they were learning. Is there a word to describe this? Sample sentence: "I had no idea how much I learned from the trip to the planetarium. It was _____."
What you are describing is called _**osmosis**_: > a process of absorption or diffusion suggestive of the flow of osmotic action; _especially_ : a usually effortless often unconscious assimilation > > _She seems to learn foreign languages by osmosis._ [Merriam-Webster] The word 'osmosis' has its origins in biology, describing the natural tendency for water to flow from areas of low concentration to high concentration in cells. The underlying idea is that it is a form of passive diffusion, in which no work has to be done by the cell. Its adjective form is _**osmotic**_ , and its adverb form _**osmotically**_. I'm not sure how often these constructions are seen in typical speech, however.
stackexchange-english
{ "answer_score": 4, "question_score": 2, "tags": "single word requests" }
Basic mod_rewrite issue -> mysite.us/user/xyz.php to mysite.us/user/index.php?u=xyz I'm trying out mod_rewrite for the first time and not having much luck so far. My current URL is in the format of ` How can I rewrite the URL to be ` So far, I've (unsuccessfully) tried the following, which resulted in 500 Internal Server Errors RewriteEngine On RewriteRule ^user([^/]*)\.php$ /user/index.php?u=$1 [L] Where am I going wrong? This should be pretty straight forward.
You very nearly had it correct. Rather than `[^/]` matching everything up to but not including the next `/`, you want `([\d]+)$` matching all digits until the end. You'll need a `/` after `user`, and finally, remove the `.php`. RewriteEngine On RewriteRule ^user/([\d]+)$ /user/index.php?u=$1 [L] Note, I also removed the leading `/` on the right-side rewrite from `/user`. That may not have been necessary though; I can never remember how it behaves with the leading `/` unless I test for myself. Most likely, the cause of your 500 error was a rewrite loop. Since you were matching .php on the end, even `user/index.php` would match the rule, throwing it into an infinite loop.
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 1, "tags": "regex, url, mod rewrite" }
any way to erase group data-blocks? I linked a group and so It's objects to the scene, then saved. Changed idea and deleted. Saved and closed blender. Opened It again and still find this group data-block in the *.blend file. any way to delete this group? It doesn't let me link one more time that group ... _[yes, I changed idea one more time]_ ![data-block]( I also have this orphan data that doesn't get deleted after closing blender.. It was on the linked group. Maybe correlated? ![orphan]( **UPDATE** I also made a piece of the imported group, _proxy_. but then has been deleted.
Solved by right click on the linked group and then "unlink group". It was possible only on this tab. ![solved](
stackexchange-blender
{ "answer_score": 0, "question_score": 1, "tags": "linked data, outliner, data blocks" }
Array versus linked-list Why would someone want to use a linked-list over an array? Coding a linked-list is, no doubt, a bit more work than using an array and one may wonder what would justify the additional effort. I think insertion of new elements is trivial in a linked-list but it's a major chore in an array. Are there other advantages to using a linked list to store a set of data versus storing it in an array? This question is not a duplicate of this question because the other question is asking specifically about a particular Java class while this question is concerned with the general data structures.
* It's easier to store data of different sizes in a linked list. An array assumes every element is exactly the same size. * As you mentioned, it's easier for a linked list to grow organically. An array's size needs to be known ahead of time, or re-created when it needs to grow. * Shuffling a linked list is just a matter of changing what points to what. Shuffling an array is more complicated and/or takes more memory. * As long as your iterations all happen in a "foreach" context, you don't lose any performance in iteration.
stackexchange-stackoverflow
{ "answer_score": 153, "question_score": 216, "tags": "arrays, data structures, linked list, language agnostic" }
Bash while sed is not null I need to do while loop when sed is not null. Example: File 1 line1 line2 line3 File 2 i=1 while sed "${int}p" # here I need expression which checks if line is not null # here echo this line and i++ I tried to write just `while sed -n "${int}p"` but it does not work as I expected.
You can use the `=` command in sed to get the number of lines: sed -n '/./!q;=;p' input | sed 'N;s/\n/ /' For an input: a b c d This gives: 1 a 2 b 3 c If you only want to get line number of the line before the first non-empty line: sed -n '/./!q;=' input | tail -1 A while loop that prints all lines: while read line; do echo "$line" done < input
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "bash, sed" }
Overwriting highlighted text in TeXShop I foolishly updated TeXShop recently and I now have the following problem. Previously, I could highlight text in the editor with the cursor and start typing to overwrite it. Now if I highlight some text to replace "abc" and I start typing something that requires holding shift down, such as "$def...", I end up with "$abc$def...". In other words, the highlighted text is enclosed with $...$ and then the rest of the text is inserted directly afterwards. How can I get back to the previous setting of simply overwriting the highlighted text?
Got to the `Editor` tab of `TeXShop->Preferences` and uncheck `Editor Can Add Brackets` at the bottom of the `Editor` section of that pane.
stackexchange-tex
{ "answer_score": 3, "question_score": 2, "tags": "editors, texshop" }
How to redesign the circuit such that the switching threshold is VDD/2. he switching threshold is the input voltage where the output crosses VDD/2. I want to redesign the circuit such that the witching threshold is VDD/2. ![enter image description here](
Design each to have the same Vgs(th) at 1.5V and similar RdsOn (although Nch tends to be lower. (Vt is 1.5 for CD4000 Logic I recall) Verify by measuring input voltage and supply current and self bias with a 10k negative feedback R , It can be 10M but then DMM will load it. Then verify transfer function with and without load and see the change. ![enter image description here]( /tinyurl.com/y7zmjpsw or /tinyurl.com/y9yrywqn
stackexchange-electronics
{ "answer_score": 0, "question_score": 0, "tags": "inverter, spice, nmos, pmos" }
C++: Cross correlation with OpenCV I have to implement a cross correlation of two arrays in C++, and I think that could be do with template matching in OpenCV. I started with a simple case: double telo [3] ={0,1,2}; Mat prueba(1,3,CV_64F,telo); double telo2[3] = {0,1,2}; Mat prueba2(1,3,CV_64F,telo2); Mat result(1,50,CV_64F); matchTemplate(prueba,prueba2,result,CV_TM_CCORR); But it crashes, how can i do this? it is possible? Thanks
Error message reveals that only `CV_8U` or `CV_32F` types are used. The code runs with `float` types. If you want to use double precision, you'll have to built your own function. Working code: float telo [3] ={0,1,2}; Mat prueba(1,3,CV_32F,telo); float telo2[3] = {0,1,2}; Mat prueba2(1,3,CV_32F,telo2); Mat result; matchTemplate(prueba,prueba2,result,CV_TM_CCORR); Assertion messages explain most of the times the situation. Check the console output next time.
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 1, "tags": "c++, opencv" }
How is Superman able to judge the fragility of things or the weight of objects? Did he have to specifically train himself for this?
Years of practice. Superman being raised as human, had to learn to control everything he does, including emotional outburst (Adrenaline). Namely he had to "learn" to manage his strength from the time of his boyhood, and apply only the barest fraction of it to function in every day life, by doing that over the years he's managed to gauge "What's durable" what's fragile so he can handle an egg. Thanks to years of practice he's able to discern what's durable and what force to exert. In various instances in the comics, movies and animated depictions, he showcases himself as weak to throw off suspiscion, and has mastered the art of acting to portray himself as less than agile, goofy and even clumsy. As for his ability to judge physical durability, that's a matter of observation, he knows an egg is fragile vs. a piece of steel.
stackexchange-scifi
{ "answer_score": 7, "question_score": -1, "tags": "dc, superman" }
Complex when on a Camel route I am new to Camel so I do have a lot of questions. Before I ask for help I do try to research the issue carefully. On this issue I just can't find a solution. It may be the key words are so generic. I need to have an and condition on the routing. (SOAP messages) There are two fields in the header than have to be specific values before the route is used. How do I specify if(x == 1 and y == 2) using RouteBuilder?
I think you can use Simple (< You could also look into predicates (< In XML-DSL it would look like: <choice> <when><simple>${header.x} == '1' && ${header.y} == '2'</simple> <log message="do something with message"/> </when> <otherwise> <log message="do something else"/> </otherwise> </choice>
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "java, soap, apache camel" }
One Windows account, multiple computers logged in Let's say I have three Windows PCs, each one running Windows 8.1. I have one Windows account, [email protected]. My question is: Can I log in to [email protected] on each of those computers **at the same time** , or do I need separate accounts for each machine?
I assume they are Microsoft Live accounts as that is the most viable option and most relevant to this question. You can login with such account at the same time on multiple computers, but do note that these computers _will share_ settings such as the desktop background, and that when one pc changes this the changes may carry to the next depending on who logs out last. But more important to know: you do not actually need to login/create a live account. Upon first sign in press `Create account`, then at the bottom it will say `I do not want to create an account, create local account instead` (something along these lines anyway). Click it and you only have to supply a username and optionally a password. Settings are then only kept locally.
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "windows, login" }
Evaluate variable content as field name in data frame Querying data like this: test = data.frame(a = 1:4,b = 1:4) subset(test, a < 4) # Works subset(test, b < 4) # Works However, trying something that works more dynamically is not working test = data.frame(a = 1:4,b = 1:4) field = 'a' subset(test, field < 4) # Not working I would like to query based on the `field` contents rather than the field column.
It's possible and it's sometimes very useful! You can use `get()`: test = data.frame(a = 1:4, b = 1:4) field = 'a' subset(test, get(field) < 4) This function gets object with a given name in the argument value. See documentation.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "r" }
How do I get the URL for the item using the Amazon API I'm making a ItemSearch request with keywords and the response groups 'EditorialReview' and 'Images', but I don't get back the DetailsPageURL, it's always null. I assume this would be the link (including my affliate tag) back to amazon. I've looked through all of the response groups, but I can't seem to find one which will offer this information! Does anyone know how to get an affiliate link back to a product? Or do you have to build one yourself? Thanks, Andy.
The Url of each item can be found from the itemSearch request. I got it from using item.ItemLinks as below: string strLink = item.ItemLinks[0].URL; If you look in the documentation: < itemLinks is returned in the XML from the API
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "api, amazon web services, amazon" }
How can I inherit and modify "website.layout" template for a specific page in Odoo without affect the whole site? I want to create a new checkout/payment template which has a different layout than the whole site. For example, it has a header navigation bar with the logo in the center, a centered fullwidth checkout wizard, etc... The problem is, I want to reuse the "website.layout" template so that I can use other built-in features of Odoo. Currently, I achieve that by creating a new template inside my module based on "web.layout" instead of "website.layout". But it doesn't feel right to me. Because I can't, as I said above, use built-in features of Odoo such a site builder, web editor, ... I wonder if there are any ways to replace the built-in header and footer inside `<t t-call..` block.
Try to replace header and footer using xpath expression and add your code inside that xpath expression for custom header and footer. please refer this link for example <template id="web_external_layout_inherited" inherit_id="web.external_layout_standard" customize_show="True"> <xpath expr="//div[@class='header']" position="replace"> your code. </xpath></template> you can also add custom header and footer in qweb.
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 2, "tags": "xml, odoo, qweb" }
OSI Model: serving a layer bellow Several references of the OSI model states the following: * A layer serves the layer above it and is served by the layer below it. * Each layer provides services to the next-higher layer and shields the upper layer from the details of how the services below it are actually implemented. Therefore, the Network Layer (#3) should provide services for the Transport Layer (#4) and not the other way around. However, there are some routing protocols (Network Layer) that uses UDP and TCP services (Transport Layer), for example: * RIP (Routing Information Protocol) uses UDP * BGP (Border Gate Protocol) uses TCP How do we reconcile that? Am I missing something?
This is the same answer (copied and pasted) for this question: In which OSI/TCP-IP model layers do BGP, RIP protocols belong? You have to remember that models like OSI are just that, models. They are theoretical. The real world doesn't fall neatly into these models. For the most part, routing is a layer-3 function, but, as you pointed out, BGP uses a layer-4 protocol to communicate with other BGP speakers in order to do what is normally considered a layer-3 function. Many network protocols fall into a gray area, or are considered in one layer while using another layer. Take ARP for instance. It resolves layer-3 addresses to layer-2 addresses. Which layer should it be considered to be in? Understanding the models is useful, but the models are not mandated by any organization, and you are free to create protocols and functions that do not follow any model.
stackexchange-networkengineering
{ "answer_score": 1, "question_score": 1, "tags": "osi" }
LST MODIS harmonic fitting in Google Earth Engine - Predicting Future Scenarios? I've been working on code for harmonic fitting of MODIS LST data. The code is working fine; however I would like to create future LST images in future dates by using the "fitting" band. Thus, I would like to know if is it possible to create predicted temperature images by using the fitted collection? Code: Link to access the base code
Possibly something like this at the end of your code: var futureDateImage = ee.Image(ee.Date('2018-12-31') .difference('2000-01-01', 'year') .multiply(2 * Math.PI)); var sin = futureDateImage.sin(); var cos = futureDateImage.cos(); var extrapolated = ee.Image.cat([ ee.Image(1), futureDateImage, cos, sin ]).multiply(harmonicTrendCoefficients) .reduce('sum') .rename('extrapolated') .clip(polygon); Map.addLayer(extrapolated, {min: 0, max: 35}, 'extrapolated');
stackexchange-gis
{ "answer_score": 1, "question_score": 1, "tags": "modis, google earth engine" }
How to invoke 'not' in a regular expression I want to use regex to find a pattern, that should exclude some stuff. For this example, "i am from i am text text text text i am from Japan text text John from Canada text I am mr john doe from test test test I am ..." the expression should hit only 'John from', or 'mr john doe from' but exclude 'i am from' I have tried this, re.findall(r"(?!i am from)((?:miss|mister|mr)*(?:\s*\w+\s+){1,2})from", "i am from i am text text text text i am from Japan text text John from I am mr john doe from test test test I am" ) But it also hits, on 'i am' Any suggestion? Thank you.
The closest match to what you expect comes from a regex like this: (?:\b(?:mis(?:tre|s)|mr)\s+)?((?:\b(?!(?:i|am|from)\b)\w+\s+){1,2})from in which you are able to exclude words to be matched right after a `from`. Here exclusion is done by a negative lookahead: (?!(?:i|am|from)\b) Live demo
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "python, regex" }
exterior product definition i have question from vector mathematics,i know that if there is given two vector, for instance $a=\\{a_1,a_2,a_3\\}$,$b={b_1,b_2,b_3}$; then so called exterior product is determined as $a\wedge b=\frac{1}{2}(ab-ba)$, but I am confused. My question is what is $ab$ or $ba$? is it scalar? in this case $ab=ba$ and $a\wedge b=0$ which does not have any meaning or $ab=(b_1-a_1,b_2-a_2,b_3-a_3)$ or vector? thanks Update: consider for example following equation $$[a,b][X,Y]=a*x+b*y=c$$ then solution is given by following equalities $$[ X,Y]=\frac{1}{a\wedge b}[c\wedge b,a\wedge c]$$
I suspect that what you mean is $a\wedge b = 1/2(a\otimes b-b\otimes a)$, in which case $a\otimes b$ is the tensor product of $a$ and $b$. $a\otimes b$ is an element of a new vector space that is higher-dimensional than the vector space containing $a$ and $b$. You can think about it as just a formal construction (basically it is mostly like the pair $(a,b)$), it cannot be simplified further, and satisfies some linearity properties like $(a+b)\otimes c = a\otimes c + b \otimes c$.
stackexchange-math
{ "answer_score": 5, "question_score": 1, "tags": "vector spaces, definition, exterior algebra" }
What's a good resource where I can publish some narratives in a minority language? During my fieldwork, I recorded, transcribed and translated a dozen or so narratives in an indigenous language of Central America, in close cooperation with a couple native speakers (including some beautiful illustrations). Now we'd like to publish these narratives in an open source book --- but not necessarily (or at least not only) as a linguistics textbook. I think lang-sci press may be too technical, I'd prefer to make this more for the community than for linguists (although hopefully both, nice that it can be in LaTeX). I tried Mac publisher, but the interface is very annoying ... Ideally there is an opportunity (even in a vanity press) to submit in LaTeX. But maybe some of you guys have experience with this.
The question seems to be about where one would put such materials (not how one would handle the typesetting issue). There are at least three places which don't require content review: Zenodo, Figshare, and the SOAS Endangered Languages Archive (I can't say for certain that the later is appropriate, so read their material).
stackexchange-linguistics
{ "answer_score": 3, "question_score": 4, "tags": "written language, descriptive linguistics, american languages, language preservation" }
Removing sensitive informations from the logs using regex In my Ruby app I have the following regex that helps me with removing sensitive informations from logs: /(\\"|")secure[^:]+:\s*\1.*?\1/ It works when in logs are the following information: {"secure_data": "Test"} but when instead of string I have object in logs it does not work: {"secure_data": {"name": "Test"}} How can I update regex to work with both scenarios? <
You may use this regex with negated character classes and an alternation: "secure[^:]+:\s*(?:"[^"]*"|{[^}]*}) Inside non-capturing group `(?:"[^"]*"|{[^}]*})` we are matching a quoted string or an object that starts with `{` and ends with `}`. Update RegEx Demo
stackexchange-stackoverflow
{ "answer_score": 1, "question_score": 0, "tags": "regex, rubular" }
How to allow <input type="file"> to accept only Lottie files? I need to upload only Lottie file through `<input type="file">` tag.
<input id="File1" type="file" accept=".lottie" />
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 0, "tags": "javascript, reactjs, lottie" }
What is it called when two words are combined by overlapping each other? Say I have the word "hotel" and "telephone." I then combine them together to make "hotelephone." Note that there is no truncation in this example. It is not a portmanteau. I have seen multiple examples of this, sometimes when people make very long strings of intermeshed words. I thought of the word for it earlier, but now I've forgot, and I'm totally stumped. It seemed like a question for an English stack exchange.
In computer science, a word that contains other words ( **hotel** ephone and ho **telephone** , both words are present) is called a > superstring. Your example happens to be the shortest common superstring of hotel and telephone; there is no word shorter than hotelephone that contains both hotel and telephone. It's an interesting problem to compute shortest common superstrings.
stackexchange-english
{ "answer_score": 9, "question_score": 15, "tags": "puns, diction" }
phonegap javascript files accessibility Are the javascript files in a phonegap app on a mobile device accessible/visible to the user like they are in the browser?
PhoneGap works by extending and wrapping common classes of the iOS / Android SDKs. Since the html files are wrapped by phonegap code, i dont think you can view/access its html or javacript files like normal desktop browsers. Checkout this link And also check this link ( How PhoneGap Works )
stackexchange-stackoverflow
{ "answer_score": 0, "question_score": 0, "tags": "javascript, cordova, browser" }
Solving linear congruences - Number Thoery I am having some trouble getting the correct answer on linear congruences. Any help would be appreciated! Consider the following: Solve $25x = 15 $ (mod 29) The gdc(25,29) = 1. Therefore, x has one solution. Using the extended Euclidean algorithm we know that: $25x_0 + 29y_0 = 1 $ We get that: $29 = 25(1) + 4$ $25 = 4(6) + 1$ Therefore: $1 = 25 - 4(6)$ $1 = 25 - 6(29 - 25)$ $1 = 25(7) + 29(-6)$ Multiplying by 15 we get that $15 = 25(7*15) + 29(-6*15)$ Now $x_0 = 7*15 = 105$ which is $18$ (mod 29) I know that my process is wrong because 18 does not satisfy the linear congruence.
Solving a modular form equations means that you need to find the inverse of the coefficient. In particular here $$25(7)=29(6)+1$$ $$\Rightarrow 25(7)\equiv 1\quad mod(29)$$ which makes $7$ the multiplicative inverse of $25\quad mod(29)$ and given that $7(15)=29(3)+18$ we get $$25x\equiv 15\quad mod(29)$$ $$\Rightarrow 7(25x)\equiv =7(15)\quad mod(29)$$ $$\Rightarrow x\equiv 18\quad mod(29)$$ to check $$25(18)=15(29)+15$$ $$\Rightarrow 25(18)\equiv 15\quad mod(29)$$
stackexchange-math
{ "answer_score": 0, "question_score": 0, "tags": "modular arithmetic" }
file rename script (move part of filename) I have files names containing 2 `-`'s. * Before the first the text is always the same (`daughter of moon`). * After the first `-` (followed by a blank, and before the `-` it is also a blank) it is usually some number (but can also be some text). * After the second `-` similar. I want to split my filename in 3. `part1 - part2 - part3.jpg`. I would like to have a script which moves `part3` to `part2` (= switch the parts). Later I want to be able to switch some `part2` and `part1`. I have tried things like get-childItem 'daugther of moon - * - 2*.jpg' | rename-item -newname ` { $_.name -replace ($x.split('moon -')[0], $x.split(' - ^ - ')[1], $x.split('- 2')[2], $x.split('.')[3] -join)} but that seem not to work. What am I doing wrong?
The following script uses a RegEx to build groups `()` from the elements divided by the `-` and rearranges them to build the new name # Change path to fit your environment Pushd "A:\" Get-ChildItem 'daugther of moon - * - *.jpg' | Where BaseName -match '(daugther of moon) - (.*) - (.*)'| Rename-Item -NewName {$matches[1]+' - '+` $matches[3]+' - '+` $matches[2]+$_.Extension} -Confirm PopD As Rename-Item accepts piped input the script block `{}` assembles the elements in the new order. Sample output on my `A:\` ramdrive Confirm Are you sure you want to perform this action? Performing the operation "Rename File" on target "Item: A:\daugther of moon - one - two.jpg Destination: A:\daugther of moon - two - one.jpg". [Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "Y"):
stackexchange-superuser
{ "answer_score": 0, "question_score": 0, "tags": "powershell, script" }
Calculate all 'Null' integer fields to '0'? Is there an easy way to calculate all `Null` integer fields to `0` in a GDB? Selecting `Null` values and field calculating each column to `0` is not a viable option as I need to do this for a few hundred columns across multiple layers.
You can do this for many fields with some Python. This is a stand alone example, but it'd be easy to write this into a script/Python toolbox. Or you could embed this into another loop and do this on a list of feature classes/tables. Keep in mind this approach will make the changes to _all_ short/long integer fields: import arcpy features = 'SomeGDB.gdb/SomeFeatureClass' fields = arcpy.ListFields(features) fnames = [x.name for x in fields if x.type in ['Integer','SmallInteger']] with arcpy.da.UpdateCursor(features, fnames) as rows: for row in rows: updated = False # keep track if we actually update something for v in range(len(fnames)): if row[v] is None: row[v] = 0 updated = True # only update the row if we changed something if updated: rows.updateRow(row)
stackexchange-gis
{ "answer_score": 6, "question_score": 3, "tags": "arcgis desktop, arcgis 10.4, null" }
LoadImageFromUrl IBitmap to ImageSource I am using the code below the Akavache to cache images. Return is an IBitmap, how can I convert this IBitmap to an ImageSource? var url = " ImageSource imageSrc = await BlobCache.LocalMachine.LoadImageFromUrl(url); // ???
Try this: var url = " var img = await BlobCache.LocalMachine.LoadImageFromUrl(url); MemoryStream imageStream = new MemoryStream(); await img.Save(CompressedBitmapFormat.Jpeg, 1.0f, imageStream); stream.Position = 0; var imageSrc = ImageSource.FromStream(() => imageStream); Basically you are saving the IBitmap into a MemoryStream then using this to create your ImageSource object of your Image. Hope this helps!
stackexchange-stackoverflow
{ "answer_score": 3, "question_score": 2, "tags": "android, ios, xamarin.forms, akavache" }
Adding glassfish Server in Eclipse Kepler error I am trying to add Glassfish-4 server to Eclipse in order to be able to run applications on this server, but at the final step in "new Server" wizard, finished or next buttons are disabled and a message says: to enable Install Server, enter a path to a new directory.. The Glassfish server is found on the given path. I can't add images because I don't have reputation, but here are the links: Your help is apreciated.
Probably a problem with your JDK... I think you have to download a new JDK (jdk7) here: * < After you install it, * Go to the 1st screen you have uploaded, and click "Installed JRE preferences" * click "Add...", "Next", "Directory", and select the new JDK folder previously installed * click "Finish" * And return to the "New Server" screen, select the new JDK and it will works (it's working for me today). Sorry for my english (I'm french ^^) Regards, Soufiane
stackexchange-stackoverflow
{ "answer_score": 2, "question_score": 2, "tags": "glassfish 4, eclipse kepler" }