qid
int64
1
74.7M
question
stringlengths
0
58.3k
date
stringlengths
10
10
metadata
list
response_j
stringlengths
2
48.3k
response_k
stringlengths
2
40.5k
4,104,025
Consider this F# code which computes a factor of a number: ``` let n = 340339004337I // A sequence of all factors: let factors = seq { 1I .. n / 2I} |> Seq.filter (fun x -> n % x = 0I) // Pull off the first factor from the sequence: let factor = if factors = seq [] then n else factors |> Se...
2010/11/05
[ "https://Stackoverflow.com/questions/4104025", "https://Stackoverflow.com", "https://Stackoverflow.com/users/392226/" ]
Try [Seq.isEmpty](http://msdn.microsoft.com/en-us/library/ee353547.aspx). ``` if Seq.isEmpty yourSeqName then doSomething else doSomethingElse ``` By the way, Seq.empty creates an empty Seq. It doesn't test for one.
Seq.isEmpty <http://msdn.microsoft.com/en-us/library/ee353547.aspx> The problem with your `=` test, I presume, is that it is comparing two different objects of type `IEnumerable<int>` for reference-equality.
62,827
I have bunch of objects that I want to position next to each other in a scene. When they are next to each other, there is an apparent seam between them due to different normal directions. The normal directions are this way, of course, because the two objects are of a different mesh. **Is there a way to manually change...
2016/09/11
[ "https://blender.stackexchange.com/questions/62827", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/30404/" ]
I think it is answered by Anthony Forwood: > > The Blend4Web add-on allows you to manually edit normals. > > > The add-on itself can be downloaded from [here](https://www.blend4web.com/en/downloads/). Documentation on how to use it can be seen [here](https://www.blend4web.com/doc/en/normal_editor.html).
The only method that I know of is to influence the normals by using the Normal Edit Modifier and it works only if you have two or more objects and not one object with several submeshes. 1. In Object Mode, select Object1, go to "Properties Window -> Data" and enable "Auto Smooth". 2. With Object1 still selected, go to...
62,827
I have bunch of objects that I want to position next to each other in a scene. When they are next to each other, there is an apparent seam between them due to different normal directions. The normal directions are this way, of course, because the two objects are of a different mesh. **Is there a way to manually change...
2016/09/11
[ "https://blender.stackexchange.com/questions/62827", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/30404/" ]
The only method that I know of is to influence the normals by using the Normal Edit Modifier and it works only if you have two or more objects and not one object with several submeshes. 1. In Object Mode, select Object1, go to "Properties Window -> Data" and enable "Auto Smooth". 2. With Object1 still selected, go to...
I created a Blender **add-on** for this exact purpose called [TiNA](https://gitlab.com/Modanung/TiNA) which allows you to easily transfer normals between objects. TiNA basically turns the somewhat overwhelming [Data Transfer Modifier](https://docs.blender.org/manual/en/dev/modeling/modifiers/modify/data_transfer.html) ...
62,827
I have bunch of objects that I want to position next to each other in a scene. When they are next to each other, there is an apparent seam between them due to different normal directions. The normal directions are this way, of course, because the two objects are of a different mesh. **Is there a way to manually change...
2016/09/11
[ "https://blender.stackexchange.com/questions/62827", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/30404/" ]
The only method that I know of is to influence the normals by using the Normal Edit Modifier and it works only if you have two or more objects and not one object with several submeshes. 1. In Object Mode, select Object1, go to "Properties Window -> Data" and enable "Auto Smooth". 2. With Object1 still selected, go to...
Go into edit mode select the vertex or vertices you want to edit and press `ALT`+`n` this will bring up a list of options allowing you to edit the normal or normals
62,827
I have bunch of objects that I want to position next to each other in a scene. When they are next to each other, there is an apparent seam between them due to different normal directions. The normal directions are this way, of course, because the two objects are of a different mesh. **Is there a way to manually change...
2016/09/11
[ "https://blender.stackexchange.com/questions/62827", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/30404/" ]
I think it is answered by Anthony Forwood: > > The Blend4Web add-on allows you to manually edit normals. > > > The add-on itself can be downloaded from [here](https://www.blend4web.com/en/downloads/). Documentation on how to use it can be seen [here](https://www.blend4web.com/doc/en/normal_editor.html).
I created a Blender **add-on** for this exact purpose called [TiNA](https://gitlab.com/Modanung/TiNA) which allows you to easily transfer normals between objects. TiNA basically turns the somewhat overwhelming [Data Transfer Modifier](https://docs.blender.org/manual/en/dev/modeling/modifiers/modify/data_transfer.html) ...
62,827
I have bunch of objects that I want to position next to each other in a scene. When they are next to each other, there is an apparent seam between them due to different normal directions. The normal directions are this way, of course, because the two objects are of a different mesh. **Is there a way to manually change...
2016/09/11
[ "https://blender.stackexchange.com/questions/62827", "https://blender.stackexchange.com", "https://blender.stackexchange.com/users/30404/" ]
I think it is answered by Anthony Forwood: > > The Blend4Web add-on allows you to manually edit normals. > > > The add-on itself can be downloaded from [here](https://www.blend4web.com/en/downloads/). Documentation on how to use it can be seen [here](https://www.blend4web.com/doc/en/normal_editor.html).
Go into edit mode select the vertex or vertices you want to edit and press `ALT`+`n` this will bring up a list of options allowing you to edit the normal or normals
50,941
On a given elliptic curve I have some points that are defined like this: Where $$A=a\*G$$ $$B=b\*G$$ $$C=(a+b)\*G$$ $$D=d\*G$$ $$E=(a+d)\*G$$ So finally I have two equations like below: $$A+B=C$$ $$A+D=E$$ Given the values $(C,E,A)$, is there any way I can prove that point $A$ is common in both the points $C$ and $E$?...
2017/08/18
[ "https://crypto.stackexchange.com/questions/50941", "https://crypto.stackexchange.com", "https://crypto.stackexchange.com/users/49683/" ]
You only have $6$ bits of entropy in $8$ bits of your output - in general that does not fullfill the requirements for a cryptohraphic key of being drawn uniformly random over the full range. In general, this can potentially be desastorous: You have no security guarantees, because no security proof applies any more. In ...
No, I don't think that there are any security issues with this approach. 1. A truncated base64 encoded key of 32 characters still contains 192 bits of entropy. 192 > 128 and 128 bit algorithms are ostensibly considered secure. Certainly secure enough for Joe Public if perhaps not for strategic defence. 2. Base64 encod...
541,696
If a given first derivative is: $\ {dy \over dx} = {-48x \over (x^2+12)^2} $ What are the steps using the quotient rule to derive the second derivative: $\ {d^2y \over dx^2} = {-144(4-x^2) \over (x^2+12)^3} $ My Steps: \begin{align\*} {d^2y \over dx^2} &= {-48(x^2 +12)^2 - 2(x^2+12)(2x)(-48x)\over (x^2+12)^4} \\ &=-...
2013/10/27
[ "https://math.stackexchange.com/questions/541696", "https://math.stackexchange.com", "https://math.stackexchange.com/users/101957/" ]
First, make sure you know what the quotient rule is - which you can derive from the product rule say by taking the derivative of $g(x)/f(x)$. Then, simplify. Looking at the product rule, expect to have to cancel a factor of $x^2+12$ from the top and bottom.
Recall the Quotient Rule: $$(\frac{f}{g})' = \frac{f'\cdot g - g' \cdot f}{g^2}$$ So you have the first derivative, $\frac{dy}{dx}= \frac{-48x}{(x^2+12)^2}$. Just apply the quotient rule: Let $f(x) = -48x$. So $f'(x) = -48$. Let $g(x) = (x^2 + 12)^2$. So, by the chain rule, $g'(x) = 2(x^2 + 12) \cdot 2x = 4x(x^2+...
541,696
If a given first derivative is: $\ {dy \over dx} = {-48x \over (x^2+12)^2} $ What are the steps using the quotient rule to derive the second derivative: $\ {d^2y \over dx^2} = {-144(4-x^2) \over (x^2+12)^3} $ My Steps: \begin{align\*} {d^2y \over dx^2} &= {-48(x^2 +12)^2 - 2(x^2+12)(2x)(-48x)\over (x^2+12)^4} \\ &=-...
2013/10/27
[ "https://math.stackexchange.com/questions/541696", "https://math.stackexchange.com", "https://math.stackexchange.com/users/101957/" ]
We can factor out the constant term to make life easier (and just multiply by that $-48$ at the end of our calculation) as: $$-48 \dfrac{x}{(x^2+12)^2}$$ This makes it easier to use the quotient and chain rule (I will assume you know these). The derivative of $\ {dy \over dx} = {-48x \over (x^2+12)^2} $, using the q...
First, make sure you know what the quotient rule is - which you can derive from the product rule say by taking the derivative of $g(x)/f(x)$. Then, simplify. Looking at the product rule, expect to have to cancel a factor of $x^2+12$ from the top and bottom.
541,696
If a given first derivative is: $\ {dy \over dx} = {-48x \over (x^2+12)^2} $ What are the steps using the quotient rule to derive the second derivative: $\ {d^2y \over dx^2} = {-144(4-x^2) \over (x^2+12)^3} $ My Steps: \begin{align\*} {d^2y \over dx^2} &= {-48(x^2 +12)^2 - 2(x^2+12)(2x)(-48x)\over (x^2+12)^4} \\ &=-...
2013/10/27
[ "https://math.stackexchange.com/questions/541696", "https://math.stackexchange.com", "https://math.stackexchange.com/users/101957/" ]
We can factor out the constant term to make life easier (and just multiply by that $-48$ at the end of our calculation) as: $$-48 \dfrac{x}{(x^2+12)^2}$$ This makes it easier to use the quotient and chain rule (I will assume you know these). The derivative of $\ {dy \over dx} = {-48x \over (x^2+12)^2} $, using the q...
Recall the Quotient Rule: $$(\frac{f}{g})' = \frac{f'\cdot g - g' \cdot f}{g^2}$$ So you have the first derivative, $\frac{dy}{dx}= \frac{-48x}{(x^2+12)^2}$. Just apply the quotient rule: Let $f(x) = -48x$. So $f'(x) = -48$. Let $g(x) = (x^2 + 12)^2$. So, by the chain rule, $g'(x) = 2(x^2 + 12) \cdot 2x = 4x(x^2+...
37,083,314
I need to add a Unity reference (and more) for a C# plugin. Researching this question, people wrote to go to "Project -> Edit References" or to right-click the "References" item in the directory. However, the "Edit References" tab is grayed out, if it's there at all. Additionally, there is no "References" item or folde...
2016/05/07
[ "https://Stackoverflow.com/questions/37083314", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4842381/" ]
In the screenshots you have created a Shared Project. This project is basically a set of files and does not have the concept of references. A shared project is meant to be referenced by one or more other projects and allows a simple way to share multiple files across these projects without having to use file linking. ...
Underneath your game's name on the left bar which says `Solution`, there should be a subheading that says `Assembly-CSharp`. Select that and then try and select `Project -> Edit References` again. **EDIT 2** Shared projects cannot add references, as said [in the documentation](https://developer.xamarin.com/guides/cros...
4,136,713
In my quest for knowledge I sometimes find myself scouring the source of a page only to find that the javascript method im looking for isnt on the page directly. That said I think it must be on one of the linked javascript pages. However I dont really want to have to look through each individual file to find the line. ...
2010/11/09
[ "https://Stackoverflow.com/questions/4136713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/223863/" ]
Have you checked out [Firebug](http://getfirebug.com/)?
yes.. Firebug in Firefox | IE developer toolbar for IE | Developer toolbar for Firefox are great tools for indepth check of JS/CSS/HTML
4,136,713
In my quest for knowledge I sometimes find myself scouring the source of a page only to find that the javascript method im looking for isnt on the page directly. That said I think it must be on one of the linked javascript pages. However I dont really want to have to look through each individual file to find the line. ...
2010/11/09
[ "https://Stackoverflow.com/questions/4136713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/223863/" ]
Have you checked out [Firebug](http://getfirebug.com/)?
We ran into a similar challenge while developing/editing our WordPress sites (i.e. not being able to search all CSS/PHP/JS files at once). As a solve, we built a plugin to allow us to do just that. If this question is related to a WordPress site, the plugin might help - rather than searching in Firebug and then having ...
4,136,713
In my quest for knowledge I sometimes find myself scouring the source of a page only to find that the javascript method im looking for isnt on the page directly. That said I think it must be on one of the linked javascript pages. However I dont really want to have to look through each individual file to find the line. ...
2010/11/09
[ "https://Stackoverflow.com/questions/4136713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/223863/" ]
yes.. Firebug in Firefox | IE developer toolbar for IE | Developer toolbar for Firefox are great tools for indepth check of JS/CSS/HTML
We ran into a similar challenge while developing/editing our WordPress sites (i.e. not being able to search all CSS/PHP/JS files at once). As a solve, we built a plugin to allow us to do just that. If this question is related to a WordPress site, the plugin might help - rather than searching in Firebug and then having ...
31,077,113
I want to SELECT a table in a SQL Server database and then INSERT it into a local SQLite database. IS it possible to do this entirely with a query in the vein of: ``` INSERT INTO table1 ( column1 ) SELECT col1 FROM table2 ``` but passing connection information?
2015/06/26
[ "https://Stackoverflow.com/questions/31077113", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1524210/" ]
To make a timer, you can use ``` Bukkit.getServer().getScheduler().runTaskLater(plugin, new Runnable(){ public void run(){ //code } },ticksToWait);//run code in run() after ticksToWait ticks ``` So, if you wanted to wait 2 ticks before running the function `shootFireball()`, for example, you could use ``` B...
You will start using [Scheduler Programming](http://wiki.bukkit.org/Scheduler_Programming). Look carefully at [this part](http://wiki.bukkit.org/Scheduler_Programming#BukkitRunnable) of the tutorial. You need a repeating task for this purpose: 1. First, create a class that extends [`BukkitRunnable`](https://hub.spigo...
45,830,837
I am using Selenium Webdriver with Python for automation testing. While login my application I have got popup message for clicking 'OK' button. where i have used ``` from selenium import webdriver def cbs_login(): browser = webdriver.Firefox() browser.get('172.20.31.1:7085/web/ccp/login') user = brows...
2017/08/23
[ "https://Stackoverflow.com/questions/45830837", "https://Stackoverflow.com", "https://Stackoverflow.com/users/7328872/" ]
`switchTo()` is not a `Python` method. You should try ``` browser.switch_to.alert.accept() ``` Also make sure that you have [correctly import WebDriver](https://stackoverflow.com/questions/21236824/unresolved-reference-issue-in-pycharm)
Please replace driver in as told by @andersson ``` driver.switch_to.alert.accept() ``` as browser and try ``` browser.switch_to.alert.accept() ```
221,893
The GWT Desinger is not working on Ubuntu 12.10. It worked on Ubuntu 12.04. I installed the Eclipse Plugin as described on the [GWT Homepate](https://developers.google.com/web-toolkit/download) If I want to open the Design-View (for an xml-GWT-File), Eclipse crashes (prompt closing of the application). I found [this t...
2012/11/25
[ "https://askubuntu.com/questions/221893", "https://askubuntu.com", "https://askubuntu.com/users/29483/" ]
Ahh, the good old NM bug. stop network-manager `sudo rm /var/lib/NetworkManager/NetworkManager.state` start network-manager Scream bloody murder if this fixes the issue. (This really should have been fixed a long time ago)
For `Ubuntu 20.04 LTS`: ``` sudo service network-manager stop sudo rm /var/lib/NetworkManager/NetworkManager.state sudo service network-manager start ``` For `Ubuntu 21.04`: ``` sudo systemctl stop NetworkManager.service sudo rm /var/lib/NetworkManager/NetworkManager.state sudo systemctl start NetworkManager.servic...
6,077,319
I have this code: ``` .data array: .word 13, 11, 5, 9, 0, -3 size: .word 6 .text Main: la $a0, array lw $a1, size jal PrintIntArray j Exit # $a0 - array, $a1 - size PrintIntArray: addi $sp, $sp, -12 li $t0, 0 sw $t0, 0($sp) # i sw $a0, 4($sp) # array sw $a1, 8($sp) # size li $a0, '[' li $v...
2011/05/20
[ "https://Stackoverflow.com/questions/6077319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371676/" ]
You need to multiply i by the size of the array element, then add it to the base address of the array in order to compute the address of the ith element. Note that, if the element size is 4 bytes, this multiplication can be performed easily by a left shift of two bits.
You are trying to do an unaligned 32-bit load, which is not allowed on (generic) MIPS architectures. When `i` equals one, you're trying to load form address `0x10010000 (array) + 1 (i)`. Try multiplying t0 (i) by 4 before adding it to t2 (array)
6,077,319
I have this code: ``` .data array: .word 13, 11, 5, 9, 0, -3 size: .word 6 .text Main: la $a0, array lw $a1, size jal PrintIntArray j Exit # $a0 - array, $a1 - size PrintIntArray: addi $sp, $sp, -12 li $t0, 0 sw $t0, 0($sp) # i sw $a0, 4($sp) # array sw $a1, 8($sp) # size li $a0, '[' li $v...
2011/05/20
[ "https://Stackoverflow.com/questions/6077319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371676/" ]
You need to multiply i by the size of the array element, then add it to the base address of the array in order to compute the address of the ith element. Note that, if the element size is 4 bytes, this multiplication can be performed easily by a left shift of two bits.
Rather than increment `i` by 1, try the following ``` add $t0, $t0, 4 ``` rather than ``` add $t0, $t0, 1 ``` This will add the size, in bytes, of a 32-bit integer to your index. The MIPS requires that 4-byte values be stored to and loaded from addresses which are multiples of 4-bytes. (I.e., with the low-order t...
6,077,319
I have this code: ``` .data array: .word 13, 11, 5, 9, 0, -3 size: .word 6 .text Main: la $a0, array lw $a1, size jal PrintIntArray j Exit # $a0 - array, $a1 - size PrintIntArray: addi $sp, $sp, -12 li $t0, 0 sw $t0, 0($sp) # i sw $a0, 4($sp) # array sw $a1, 8($sp) # size li $a0, '[' li $v...
2011/05/20
[ "https://Stackoverflow.com/questions/6077319", "https://Stackoverflow.com", "https://Stackoverflow.com/users/371676/" ]
You are trying to do an unaligned 32-bit load, which is not allowed on (generic) MIPS architectures. When `i` equals one, you're trying to load form address `0x10010000 (array) + 1 (i)`. Try multiplying t0 (i) by 4 before adding it to t2 (array)
Rather than increment `i` by 1, try the following ``` add $t0, $t0, 4 ``` rather than ``` add $t0, $t0, 1 ``` This will add the size, in bytes, of a 32-bit integer to your index. The MIPS requires that 4-byte values be stored to and loaded from addresses which are multiples of 4-bytes. (I.e., with the low-order t...
22,870,984
I am trying to do a Jquery .ajax post to an MVC action. This Action then should return a JsonResult. Currently, this JsonResult is "", however I want the return object to be filled with Json. Any help? Thanks! ``` $.ajax({ type: 'post', dataType: 'json', url: url, contentType: "application/json; charset=utf-8"...
2014/04/04
[ "https://Stackoverflow.com/questions/22870984", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1011117/" ]
You have done it correctly, just do ``` console.log(foo.bar); ``` and you will see what you want. You saw `{}` in some browser just because the way it is displayed in some browser. On Safari for example, you can "dig into" the object and see the `bar` when you follow the `__proto__` chain. `bar` is not a `foo`'s "...
> > In other words, is it possible to preset a prototype and have the properties be exposed as ownProperties to the object instance of that prototype? > > > You can't do it directly but [Proxy](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Proxy) object can intercept `Object.getO...
46,544,773
I have a form with Recaptcha enabled. If the user does NOT verify the Recaptcha and hits submit he/she is prompted to verify by an error message. Then they verify but the submit button remains disabled and the form cannot be submitted. How can I remove the disabled attribute once the Recapthca is verified without the f...
2017/10/03
[ "https://Stackoverflow.com/questions/46544773", "https://Stackoverflow.com", "https://Stackoverflow.com/users/696906/" ]
in your GlideListener implementation of onException method add this line on both your conditions : ``` @Override public boolean onException(Exception e, String model, Target<GlideDrawable> target, boolean isFirstResource) { progressBar.setVisibility(View.GONE); return false; } `...
Try this inside on resource ready ``` if (imageView.getDrawable().getConstantState() == getResources().getDrawable( R.drawable.girl).getConstantState()) progressBar.setVisibility(View.VISIBLE); else progressBar.setVisibility(View.GONE); ```
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
The `System.Drawing.Graphics` method `MeasureString` pads string widths with a few extra pixels (I do not know why), so measuring the width of one fixed-length character and then dividing that into the maximum width available would give a too-low estimate of the number of characters that could fit into the maximum widt...
Although this is a late reply, I came across the same issue. I think the answer to your question is inside your question. The function DrawString function you mention has facilities to automatically trim long strings. Have a look at the docs <http://msdn.microsoft.com/en-us/library/19sb1bw6.aspx>. The function will t...
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
I read few sites and come up with solution as, ``` using (System.Drawing.Graphics graphics = CreateGraphics()) { System.Drawing.Size size = TextRenderer.MeasureText(graphics, id, e.Appearance.Font); if (size.Width > e.Column.Width) { int charFit = (int)(((double)e.Column.Width / (double)size.Width)...
If it's fixed width why not just use floor(pixelcount/fontwidth)?
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
The `System.Drawing.Graphics` method `MeasureString` pads string widths with a few extra pixels (I do not know why), so measuring the width of one fixed-length character and then dividing that into the maximum width available would give a too-low estimate of the number of characters that could fit into the maximum widt...
I think [System.Drawing.Graphics.MeasureString()](http://msdn.microsoft.com/en-us/library/9bt8ty58.aspx) can help you. You can combine it with MeasureCharacterRanges or measure a Size of one character and then divide you number of pixels on this value. Something like this, you can play with results to get it work. I am...
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
I read few sites and come up with solution as, ``` using (System.Drawing.Graphics graphics = CreateGraphics()) { System.Drawing.Size size = TextRenderer.MeasureText(graphics, id, e.Appearance.Font); if (size.Width > e.Column.Width) { int charFit = (int)(((double)e.Column.Width / (double)size.Width)...
Although this is a late reply, I came across the same issue. I think the answer to your question is inside your question. The function DrawString function you mention has facilities to automatically trim long strings. Have a look at the docs <http://msdn.microsoft.com/en-us/library/19sb1bw6.aspx>. The function will t...
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
There is also [TextRenderer.MeasureText()](http://msdn.microsoft.com/en-us/library/system.windows.forms.textrenderer.measuretext.aspx), which produces a different result (this is what is used when drawing windows controls, so it is generally more accurate). There is a discussion on SO somewhere about it, but I cannot...
I think [System.Drawing.Graphics.MeasureString()](http://msdn.microsoft.com/en-us/library/9bt8ty58.aspx) can help you. You can combine it with MeasureCharacterRanges or measure a Size of one character and then divide you number of pixels on this value. Something like this, you can play with results to get it work. I am...
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
The `System.Drawing.Graphics` method `MeasureString` pads string widths with a few extra pixels (I do not know why), so measuring the width of one fixed-length character and then dividing that into the maximum width available would give a too-low estimate of the number of characters that could fit into the maximum widt...
I read few sites and come up with solution as, ``` using (System.Drawing.Graphics graphics = CreateGraphics()) { System.Drawing.Size size = TextRenderer.MeasureText(graphics, id, e.Appearance.Font); if (size.Width > e.Column.Width) { int charFit = (int)(((double)e.Column.Width / (double)size.Width)...
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
I read few sites and come up with solution as, ``` using (System.Drawing.Graphics graphics = CreateGraphics()) { System.Drawing.Size size = TextRenderer.MeasureText(graphics, id, e.Appearance.Font); if (size.Width > e.Column.Width) { int charFit = (int)(((double)e.Column.Width / (double)size.Width)...
You could use [Drawing.Graphics.MeasureString()](http://msdn.microsoft.com/en-us/library/system.drawing.graphics.measurestring.aspx) to get the size of one of your glyphs. Then just check how many of them fit into your drawing area.
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
There is also [TextRenderer.MeasureText()](http://msdn.microsoft.com/en-us/library/system.windows.forms.textrenderer.measuretext.aspx), which produces a different result (this is what is used when drawing windows controls, so it is generally more accurate). There is a discussion on SO somewhere about it, but I cannot...
You could use [Drawing.Graphics.MeasureString()](http://msdn.microsoft.com/en-us/library/system.drawing.graphics.measurestring.aspx) to get the size of one of your glyphs. Then just check how many of them fit into your drawing area.
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
I read few sites and come up with solution as, ``` using (System.Drawing.Graphics graphics = CreateGraphics()) { System.Drawing.Size size = TextRenderer.MeasureText(graphics, id, e.Appearance.Font); if (size.Width > e.Column.Width) { int charFit = (int)(((double)e.Column.Width / (double)size.Width)...
I think [System.Drawing.Graphics.MeasureString()](http://msdn.microsoft.com/en-us/library/9bt8ty58.aspx) can help you. You can combine it with MeasureCharacterRanges or measure a Size of one character and then divide you number of pixels on this value. Something like this, you can play with results to get it work. I am...
1,565,263
Given a number of pixels (say: 300) and a Font (fixed type, fixed size, like Consolas), how could I determine the maximum number of characters that I could draw with **GDI+**? The text won't be written to a Label or such, but drawn using GDI+: ``` public void DrawString( string s, Font font, Brush brush, Rectang...
2009/10/14
[ "https://Stackoverflow.com/questions/1565263", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2684/" ]
There is also [TextRenderer.MeasureText()](http://msdn.microsoft.com/en-us/library/system.windows.forms.textrenderer.measuretext.aspx), which produces a different result (this is what is used when drawing windows controls, so it is generally more accurate). There is a discussion on SO somewhere about it, but I cannot...
Although this is a late reply, I came across the same issue. I think the answer to your question is inside your question. The function DrawString function you mention has facilities to automatically trim long strings. Have a look at the docs <http://msdn.microsoft.com/en-us/library/19sb1bw6.aspx>. The function will t...
160,971
Before I upgraded to Ubuntu 12.04, thumbnails on video files worked nicely, after the upgrade, thumbnails aren't generating on video files and only on video files, most of them are .mkv files. I have some .pdf files and they all have thumbnails. I have tried to clear the thumb cache, but no luck.
2012/07/07
[ "https://askubuntu.com/questions/160971", "https://askubuntu.com", "https://askubuntu.com/users/75686/" ]
Please ensure that the necessary packages are installed by running the following command in the terminal: ``` sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly totem libxine1-ffmpeg ``` Also, please delete the thumbnails that failed to loa...
I had to re install my ubuntu to get the video thumbnails working again, it was annoying. I couldn't fin any other way.
160,971
Before I upgraded to Ubuntu 12.04, thumbnails on video files worked nicely, after the upgrade, thumbnails aren't generating on video files and only on video files, most of them are .mkv files. I have some .pdf files and they all have thumbnails. I have tried to clear the thumb cache, but no luck.
2012/07/07
[ "https://askubuntu.com/questions/160971", "https://askubuntu.com", "https://askubuntu.com/users/75686/" ]
I followed the instructions in [this forum](http://ubuntuforums.org/showthread.php?t=1801173) and it worked perfectly. Install libxine1-ffmpeg. `sudo apt-get install libxine1-ffmpeg` Then to force nautilus to generate new thumbnails execute `rm -r ~/.thumbnails/fail rm -r ~/.thumbnails/normal killall -9 n...
I had to re install my ubuntu to get the video thumbnails working again, it was annoying. I couldn't fin any other way.
160,971
Before I upgraded to Ubuntu 12.04, thumbnails on video files worked nicely, after the upgrade, thumbnails aren't generating on video files and only on video files, most of them are .mkv files. I have some .pdf files and they all have thumbnails. I have tried to clear the thumb cache, but no luck.
2012/07/07
[ "https://askubuntu.com/questions/160971", "https://askubuntu.com", "https://askubuntu.com/users/75686/" ]
Please ensure that the necessary packages are installed by running the following command in the terminal: ``` sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly totem libxine1-ffmpeg ``` Also, please delete the thumbnails that failed to loa...
I followed the instructions in [this forum](http://ubuntuforums.org/showthread.php?t=1801173) and it worked perfectly. Install libxine1-ffmpeg. `sudo apt-get install libxine1-ffmpeg` Then to force nautilus to generate new thumbnails execute `rm -r ~/.thumbnails/fail rm -r ~/.thumbnails/normal killall -9 n...
160,971
Before I upgraded to Ubuntu 12.04, thumbnails on video files worked nicely, after the upgrade, thumbnails aren't generating on video files and only on video files, most of them are .mkv files. I have some .pdf files and they all have thumbnails. I have tried to clear the thumb cache, but no luck.
2012/07/07
[ "https://askubuntu.com/questions/160971", "https://askubuntu.com", "https://askubuntu.com/users/75686/" ]
Please ensure that the necessary packages are installed by running the following command in the terminal: ``` sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly totem libxine1-ffmpeg ``` Also, please delete the thumbnails that failed to loa...
I installed `ffmpegthumbnailer`: ``` sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly totem libxine1-ffmpeg ``` It works in 13.10
160,971
Before I upgraded to Ubuntu 12.04, thumbnails on video files worked nicely, after the upgrade, thumbnails aren't generating on video files and only on video files, most of them are .mkv files. I have some .pdf files and they all have thumbnails. I have tried to clear the thumb cache, but no luck.
2012/07/07
[ "https://askubuntu.com/questions/160971", "https://askubuntu.com", "https://askubuntu.com/users/75686/" ]
I followed the instructions in [this forum](http://ubuntuforums.org/showthread.php?t=1801173) and it worked perfectly. Install libxine1-ffmpeg. `sudo apt-get install libxine1-ffmpeg` Then to force nautilus to generate new thumbnails execute `rm -r ~/.thumbnails/fail rm -r ~/.thumbnails/normal killall -9 n...
I installed `ffmpegthumbnailer`: ``` sudo apt-get install gstreamer0.10-plugins-bad gstreamer0.10-plugins-base gstreamer0.10-plugins-good gstreamer0.10-plugins-ugly totem libxine1-ffmpeg ``` It works in 13.10
293,868
I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows. I can do ``` [view1 setAlph...
2015/08/17
[ "https://softwareengineering.stackexchange.com/questions/293868", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/144888/" ]
Alternate idea: if your goal is to prevent bugs occurring because people forget there's three views and do something with only two of them that they really should do with all of them, then make a function that makes it *impossible* to forget: ``` setViewVisibilities(0.0f, 0.0f, 1.0f) ``` Now you have something far m...
I would believe that adding a comment explaining that the call is unneeded (and why) is best. (perhaps, the fact that a call is unneeded, or that you need a comment about that, might be a code smell)
293,868
I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows. I can do ``` [view1 setAlph...
2015/08/17
[ "https://softwareengineering.stackexchange.com/questions/293868", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/144888/" ]
You have an invariant: > > Only a single view (out of 3) is ever active (and visible). > > > Then, I suggest that you provide a function to switch the activity and visibility of ALL views at once: ``` [setActiveView viewID:2] ``` This function will: * check if the view is already active, avoiding unnecessary ...
I would believe that adding a comment explaining that the call is unneeded (and why) is best. (perhaps, the fact that a call is unneeded, or that you need a comment about that, might be a code smell)
293,868
I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows. I can do ``` [view1 setAlph...
2015/08/17
[ "https://softwareengineering.stackexchange.com/questions/293868", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/144888/" ]
I would believe that adding a comment explaining that the call is unneeded (and why) is best. (perhaps, the fact that a call is unneeded, or that you need a comment about that, might be a code smell)
In this particular case, @Mattieu M. has the right solution. In the more general case, where there is no similar transform, you have to ask yourself: Is there *any* chance a future programmer might mess this up? The answer is usually yes. Which means, yes, you should add the call. Maybe some future version of the fra...
293,868
I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows. I can do ``` [view1 setAlph...
2015/08/17
[ "https://softwareengineering.stackexchange.com/questions/293868", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/144888/" ]
You have an invariant: > > Only a single view (out of 3) is ever active (and visible). > > > Then, I suggest that you provide a function to switch the activity and visibility of ALL views at once: ``` [setActiveView viewID:2] ``` This function will: * check if the view is already active, avoiding unnecessary ...
Alternate idea: if your goal is to prevent bugs occurring because people forget there's three views and do something with only two of them that they really should do with all of them, then make a function that makes it *impossible* to forget: ``` setViewVisibilities(0.0f, 0.0f, 1.0f) ``` Now you have something far m...
293,868
I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows. I can do ``` [view1 setAlph...
2015/08/17
[ "https://softwareengineering.stackexchange.com/questions/293868", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/144888/" ]
Alternate idea: if your goal is to prevent bugs occurring because people forget there's three views and do something with only two of them that they really should do with all of them, then make a function that makes it *impossible* to forget: ``` setViewVisibilities(0.0f, 0.0f, 1.0f) ``` Now you have something far m...
In this particular case, @Mattieu M. has the right solution. In the more general case, where there is no similar transform, you have to ask yourself: Is there *any* chance a future programmer might mess this up? The answer is usually yes. Which means, yes, you should add the call. Maybe some future version of the fra...
293,868
I have three views in my program (iOS app). Only one of them is ever active at the same time so I set the visibility off for two of them and switch visibility as the user presses buttons. The views are initialized as visible so I set the visibility off in code before the main view shows. I can do ``` [view1 setAlph...
2015/08/17
[ "https://softwareengineering.stackexchange.com/questions/293868", "https://softwareengineering.stackexchange.com", "https://softwareengineering.stackexchange.com/users/144888/" ]
You have an invariant: > > Only a single view (out of 3) is ever active (and visible). > > > Then, I suggest that you provide a function to switch the activity and visibility of ALL views at once: ``` [setActiveView viewID:2] ``` This function will: * check if the view is already active, avoiding unnecessary ...
In this particular case, @Mattieu M. has the right solution. In the more general case, where there is no similar transform, you have to ask yourself: Is there *any* chance a future programmer might mess this up? The answer is usually yes. Which means, yes, you should add the call. Maybe some future version of the fra...
53,242,719
I'm working through this book "The C# Player's Guide" and got to the "Try It Out!" section in the chapter on arrays. The instructions are as follows: "Create 3 methods: one to create the array, one to reverse the array, and one to print the array at the end. Your main method will look something like this: ``` stati...
2018/11/10
[ "https://Stackoverflow.com/questions/53242719", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6460507/" ]
In your code here: ``` int a = numbers[index]; int b = numbers.Length - index - 1; //temp array temporarily holds value while swapping indexes int temp = a; a = b; b = temp; ``` You are putting the number itself into a, while putting the last index into b (not the number at l...
If I was going to reverse an array, I'd do it like this, as I think it's simpler and cleaner: ``` //new array to hold reverse int[] rev = new int[fwd.Length]; //establish an indexer variable for fwd and reverse //variable f starts at 0 and goes to length -1 //variable r goes the other way for(int f = 0, r = rev.Lengt...
505,529
I am trying to draw a picture of a concave function. I would like the axes to start at (0,0), however when I draw the picture as you can see below the y-axis starts below 0. [![enter image description here](https://i.stack.imgur.com/ALLB0.png)](https://i.stack.imgur.com/ALLB0.png) I have tried running several codes f...
2019/08/24
[ "https://tex.stackexchange.com/questions/505529", "https://tex.stackexchange.com", "https://tex.stackexchange.com/users/195186/" ]
I would write your frame on the following way: ``` \documentclass[usenames,dvipsnames]{beamer} \usepackage{pgfplots} \pgfplotsset{compat = 1.16} %\pgfplotsset{overwrite option/.style args={#1 with #2}{#1=#2,#1/.code=}} \begin{document} \begin{frame} \frametitle{CONVEX AND CONCAVE FUNCTIONS} \framesubtitle{DEFINITION...
This is plain TikZ version of Zarko's answer. [![enter image description here](https://i.stack.imgur.com/kTRac.png)](https://i.stack.imgur.com/kTRac.png) ``` \documentclass{beamer} \usepackage{tikz} \begin{document} \begin{frame} \frametitle{CONVEX AND CONCAVE FUNCTIONS} \framesubtitle{DEFINITION} \textbf{CONCAVE FU...
382,848
Is the function $\psi(x,t)=\sin(x^2-t^2)$ a traveling wave? It can be written as $\sin[(x-t)(x+t)] $ and I know that $\sin(x\pm t)$ are traveling waves but is $\sin[(x-t)(x+t)]$ a traveling wave? My professor asked us to check out whether or not the multiplication of two traveling waves is a traveling wave, I rememebe...
2018/01/28
[ "https://physics.stackexchange.com/questions/382848", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/169879/" ]
Regarding the question, "Is the product of two traveling waves a traveling wave?" the answer is no. Take two traveling pulses: $f(x,t)=1$ on $[t,t+1]$ and is $0$ elsewhere, and $g(x,t)=1$ on $[t+4,t+5]$ and is $0$ elsewhere. At any time, there are no points where both $f$ and $g$ are nonzero, so their product is $0$, w...
This function is not the solution of the wave equation which has general wave solutions of the form $$ y=f(x-vt)+ g(x+vt)$$ where $f$ and $g$ are arbitrary functions with $f(x-vt)$ travelling with constant shape and velocity $v$ in positive x-direction, and $g(x+vt)$ in negative x-direction. The function $$y=\sin [(x...
382,848
Is the function $\psi(x,t)=\sin(x^2-t^2)$ a traveling wave? It can be written as $\sin[(x-t)(x+t)] $ and I know that $\sin(x\pm t)$ are traveling waves but is $\sin[(x-t)(x+t)]$ a traveling wave? My professor asked us to check out whether or not the multiplication of two traveling waves is a traveling wave, I rememebe...
2018/01/28
[ "https://physics.stackexchange.com/questions/382848", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/169879/" ]
It seems you're getting very messed up with some things. One by one. You ask wether $f(x)=\sin (x^2-t^2)$ is a travelling wave. The answer is "no, it isn't", with the usual definition of wave. The reason is that that function does not satisfy the wave equation. It's as easy as that: it doesn't satisfy the wave equati...
Regarding the question, "Is the product of two traveling waves a traveling wave?" the answer is no. Take two traveling pulses: $f(x,t)=1$ on $[t,t+1]$ and is $0$ elsewhere, and $g(x,t)=1$ on $[t+4,t+5]$ and is $0$ elsewhere. At any time, there are no points where both $f$ and $g$ are nonzero, so their product is $0$, w...
382,848
Is the function $\psi(x,t)=\sin(x^2-t^2)$ a traveling wave? It can be written as $\sin[(x-t)(x+t)] $ and I know that $\sin(x\pm t)$ are traveling waves but is $\sin[(x-t)(x+t)]$ a traveling wave? My professor asked us to check out whether or not the multiplication of two traveling waves is a traveling wave, I rememebe...
2018/01/28
[ "https://physics.stackexchange.com/questions/382848", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/169879/" ]
So going back to the real basics (i.e. before students are introduced to "the" wave equation or allowed to think that it is the only wave equation) traveling waves were traditionally defined in terms like > > a moving disturbance > > > and (so long as $\psi$ is interpreted as a alteration of *something* from equi...
This function is not the solution of the wave equation which has general wave solutions of the form $$ y=f(x-vt)+ g(x+vt)$$ where $f$ and $g$ are arbitrary functions with $f(x-vt)$ travelling with constant shape and velocity $v$ in positive x-direction, and $g(x+vt)$ in negative x-direction. The function $$y=\sin [(x...
382,848
Is the function $\psi(x,t)=\sin(x^2-t^2)$ a traveling wave? It can be written as $\sin[(x-t)(x+t)] $ and I know that $\sin(x\pm t)$ are traveling waves but is $\sin[(x-t)(x+t)]$ a traveling wave? My professor asked us to check out whether or not the multiplication of two traveling waves is a traveling wave, I rememebe...
2018/01/28
[ "https://physics.stackexchange.com/questions/382848", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/169879/" ]
It seems you're getting very messed up with some things. One by one. You ask wether $f(x)=\sin (x^2-t^2)$ is a travelling wave. The answer is "no, it isn't", with the usual definition of wave. The reason is that that function does not satisfy the wave equation. It's as easy as that: it doesn't satisfy the wave equati...
This function is not the solution of the wave equation which has general wave solutions of the form $$ y=f(x-vt)+ g(x+vt)$$ where $f$ and $g$ are arbitrary functions with $f(x-vt)$ travelling with constant shape and velocity $v$ in positive x-direction, and $g(x+vt)$ in negative x-direction. The function $$y=\sin [(x...
382,848
Is the function $\psi(x,t)=\sin(x^2-t^2)$ a traveling wave? It can be written as $\sin[(x-t)(x+t)] $ and I know that $\sin(x\pm t)$ are traveling waves but is $\sin[(x-t)(x+t)]$ a traveling wave? My professor asked us to check out whether or not the multiplication of two traveling waves is a traveling wave, I rememebe...
2018/01/28
[ "https://physics.stackexchange.com/questions/382848", "https://physics.stackexchange.com", "https://physics.stackexchange.com/users/169879/" ]
It seems you're getting very messed up with some things. One by one. You ask wether $f(x)=\sin (x^2-t^2)$ is a travelling wave. The answer is "no, it isn't", with the usual definition of wave. The reason is that that function does not satisfy the wave equation. It's as easy as that: it doesn't satisfy the wave equati...
So going back to the real basics (i.e. before students are introduced to "the" wave equation or allowed to think that it is the only wave equation) traveling waves were traditionally defined in terms like > > a moving disturbance > > > and (so long as $\psi$ is interpreted as a alteration of *something* from equi...
64,254
I have a friend (yes it's actually a friend and not me) who lost his password for their Bitcoin-qt wallet and can't access is Bitcoin. The wallet is installed on the hard drive of a MacBook and he doesn't know any of the characters Does anyone know how we can get this coin back without his wallet password?
2017/12/05
[ "https://bitcoin.stackexchange.com/questions/64254", "https://bitcoin.stackexchange.com", "https://bitcoin.stackexchange.com/users/67104/" ]
> > As seen from the example image, we actually could not know that transaction-3 is located under that specific block and leaf-node since a light client only downloads the merkle root > > > As a light client, you would be given the branch/path of the tree which corresponds to the transaction you wish to know abou...
From a previous [Stack answer](https://bitcoin.stackexchange.com/questions/10479/what-is-the-merkle-root). "We start with just our transaction and its sibling (if it has one) and calculate the hash of those two and verify that it matches the expected value. From that we can ask for the sibling branch of that and calc...
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can do: In `vars.py` ``` var_one = 'happy' var_two = '2345' var_three = '-24.24' var_four = 'Chocolate' ``` In `main.py` ``` import vars # hard coded attribute lookup print(vars.var_one) # prints 'happy' # to get an attribute dynamically, use getattr name = "var_three" print(getattr(vars, name)) # prints '...
You can use "import" to import both functions and variables that are defined in other scripts. If you have ``` var_one = 'happy' ``` In a file named myvariables.py, then you can write the following to get access to this variable in another file: ``` from myvariables import var_one ```
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can do: In `vars.py` ``` var_one = 'happy' var_two = '2345' var_three = '-24.24' var_four = 'Chocolate' ``` In `main.py` ``` import vars # hard coded attribute lookup print(vars.var_one) # prints 'happy' # to get an attribute dynamically, use getattr name = "var_three" print(getattr(vars, name)) # prints '...
You can import the variables just like you would import functions from the other script. ``` import <yourscriptfile> (Without the .py extension) <yourscriptfile>.varname1 <yourscriptfile>.varname2 ``` and so on
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can do: In `vars.py` ``` var_one = 'happy' var_two = '2345' var_three = '-24.24' var_four = 'Chocolate' ``` In `main.py` ``` import vars # hard coded attribute lookup print(vars.var_one) # prints 'happy' # to get an attribute dynamically, use getattr name = "var_three" print(getattr(vars, name)) # prints '...
You can import everything from the file using a starred expression: ``` from filename import * print(var_one) print(var_two) print(var_three) print(var_four) ``` Output: ``` happy 2345 -24.24 Chocolate ```
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can do: In `vars.py` ``` var_one = 'happy' var_two = '2345' var_three = '-24.24' var_four = 'Chocolate' ``` In `main.py` ``` import vars # hard coded attribute lookup print(vars.var_one) # prints 'happy' # to get an attribute dynamically, use getattr name = "var_three" print(getattr(vars, name)) # prints '...
With a file `myfile.py`, you can do: ``` with open('myfile.py') as file: exec(file.read()) ``` The variables will than be assigned in your namespace. If you had a number of files, you could loop through like: ``` for script in ['myfile1.py1', 'myfile2.py', 'myfile3.py']: with open(script) as file: ...
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can use "import" to import both functions and variables that are defined in other scripts. If you have ``` var_one = 'happy' ``` In a file named myvariables.py, then you can write the following to get access to this variable in another file: ``` from myvariables import var_one ```
You can import the variables just like you would import functions from the other script. ``` import <yourscriptfile> (Without the .py extension) <yourscriptfile>.varname1 <yourscriptfile>.varname2 ``` and so on
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can use "import" to import both functions and variables that are defined in other scripts. If you have ``` var_one = 'happy' ``` In a file named myvariables.py, then you can write the following to get access to this variable in another file: ``` from myvariables import var_one ```
You can import everything from the file using a starred expression: ``` from filename import * print(var_one) print(var_two) print(var_three) print(var_four) ``` Output: ``` happy 2345 -24.24 Chocolate ```
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can use "import" to import both functions and variables that are defined in other scripts. If you have ``` var_one = 'happy' ``` In a file named myvariables.py, then you can write the following to get access to this variable in another file: ``` from myvariables import var_one ```
With a file `myfile.py`, you can do: ``` with open('myfile.py') as file: exec(file.read()) ``` The variables will than be assigned in your namespace. If you had a number of files, you could loop through like: ``` for script in ['myfile1.py1', 'myfile2.py', 'myfile3.py']: with open(script) as file: ...
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can import the variables just like you would import functions from the other script. ``` import <yourscriptfile> (Without the .py extension) <yourscriptfile>.varname1 <yourscriptfile>.varname2 ``` and so on
You can import everything from the file using a starred expression: ``` from filename import * print(var_one) print(var_two) print(var_three) print(var_four) ``` Output: ``` happy 2345 -24.24 Chocolate ```
62,815,766
i have a login page in which appears this error when i'm trying to insert text in an input : A RenderFlex overflowed by 104 pixels on the bottom. here is a part of my code : ``` Widget build(BuildContext context) { return Scaffold( backgroundColor: Colors.white, body: Center( ...
2020/07/09
[ "https://Stackoverflow.com/questions/62815766", "https://Stackoverflow.com", "https://Stackoverflow.com/users/13749287/" ]
You can import the variables just like you would import functions from the other script. ``` import <yourscriptfile> (Without the .py extension) <yourscriptfile>.varname1 <yourscriptfile>.varname2 ``` and so on
With a file `myfile.py`, you can do: ``` with open('myfile.py') as file: exec(file.read()) ``` The variables will than be assigned in your namespace. If you had a number of files, you could loop through like: ``` for script in ['myfile1.py1', 'myfile2.py', 'myfile3.py']: with open(script) as file: ...
30,058
Завис над выражением "(в)стать на службу" ("(в)стать на защиту"). Как все-таки правильно: встать или стать? Заранее спасибо
2014/02/05
[ "https://rus.stackexchange.com/questions/30058", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/3/" ]
На защиту встать, т.е. подняться, а на службу и не стают, и не встают, т.е. не поднимаются (если только не рано встал на службу в смысле поднялся с постели), а к службе можно приступить, на службу-определиться.
Еще можно заступить на службу. Или это о дежурстве: заступил на дежурство?
30,058
Завис над выражением "(в)стать на службу" ("(в)стать на защиту"). Как все-таки правильно: встать или стать? Заранее спасибо
2014/02/05
[ "https://rus.stackexchange.com/questions/30058", "https://rus.stackexchange.com", "https://rus.stackexchange.com/users/3/" ]
Поступить на службу можно,определиться на службу,а какой контекст?
Еще можно заступить на службу. Или это о дежурстве: заступил на дежурство?
16,366
One of Joonas's old Qs. has made a welcome return: [Is there a Latin euphemism for going to the toilet?](https://latin.stackexchange.com/q/516/1982). This brought to mind the fatuous things we say about death: "He's passed over."; "He's passed on."; currently in vogue; "He's passed."; this could be, "He's (the) past." ...
2021/07/10
[ "https://latin.stackexchange.com/questions/16366", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/1982/" ]
I believe acquiescere, excedere, and decedere were used euphemistically. excedere and decedere could be used with "de vita". Lewis and Short also lists "vixit"(he lived) as a euphemism for having died, as well as euphemisms like "si quid factum sit aliquo", "if anything happens to anyone" aka "if anyone dies". I'll try...
The verb *ex*(*s*)*pirare*, with or without the direct object *animam*, means 'to breathe one's last breath.' It's found, for example, in Seneca the Younger, *Apocolocyntosis* 4: > > *expiravit autem dum comoedos audit, ut scias me non sine causa illos timere.* > > > Moreover, he breathed his last breath while list...
16,366
One of Joonas's old Qs. has made a welcome return: [Is there a Latin euphemism for going to the toilet?](https://latin.stackexchange.com/q/516/1982). This brought to mind the fatuous things we say about death: "He's passed over."; "He's passed on."; currently in vogue; "He's passed."; this could be, "He's (the) past." ...
2021/07/10
[ "https://latin.stackexchange.com/questions/16366", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/1982/" ]
I believe acquiescere, excedere, and decedere were used euphemistically. excedere and decedere could be used with "de vita". Lewis and Short also lists "vixit"(he lived) as a euphemism for having died, as well as euphemisms like "si quid factum sit aliquo", "if anything happens to anyone" aka "if anyone dies". I'll try...
Two verbs based on *ire* are quite commonly used for dying: * [*Obire*](http://www.perseus.tufts.edu/hopper/text?doc=obeo&fromdoc=Perseus%3Atext%3A1999.04.0059) is literally "to go towards". * [*Perire*](http://www.perseus.tufts.edu/hopper/text?doc=pereo&fromdoc=Perseus%3Atext%3A1999.04.0059) is literally "to go throu...
16,366
One of Joonas's old Qs. has made a welcome return: [Is there a Latin euphemism for going to the toilet?](https://latin.stackexchange.com/q/516/1982). This brought to mind the fatuous things we say about death: "He's passed over."; "He's passed on."; currently in vogue; "He's passed."; this could be, "He's (the) past." ...
2021/07/10
[ "https://latin.stackexchange.com/questions/16366", "https://latin.stackexchange.com", "https://latin.stackexchange.com/users/1982/" ]
I believe acquiescere, excedere, and decedere were used euphemistically. excedere and decedere could be used with "de vita". Lewis and Short also lists "vixit"(he lived) as a euphemism for having died, as well as euphemisms like "si quid factum sit aliquo", "if anything happens to anyone" aka "if anyone dies". I'll try...
A method that often deliver nicely is searching the fully digitalized L&S dictionary, but *from* the English. [Searching "to die"](https://www.google.com/search?q=%22to%20die%22%20%22Charlton%20T.%20Lewis,%20Charles%20Short,%20A%20Latin%20Dictionary%22%20site:http://www.perseus.tufts.edu/hopper/text%3Fdoc%3DPerseus:tex...
21,153,531
I have `one View Controller` that handles `three views`, to do this i use `horizontal scroll view` of size (320 \* 3 ). But if i want to use `Page Controller` now, how can i do it?. I have read that page controller will require `different View controllers` for itself to show those dots at the bottom, but right now i ha...
2014/01/16
[ "https://Stackoverflow.com/questions/21153531", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3131304/" ]
`implode()` is not printing the keys of `$wordsArray` which is why the var `words` doesn't have the correct keys. What you're really trying to achieve here is a string representation of a PHP array with Javascript syntax. A function that will do that for you is `json_encode()` ``` <?php echo "var words = ". json_enc...
maybe you can try this? ``` var words = [<?php $result = []; foreach($wordsArray as $key=>$value){ $result[] = '"'.$key.'":"'.$value.'"'; } echo implode(',', $result) ?>] ```
70,523,172
I am trying to sort a list of numpy arrays with respect to a list of integers in ascending order, the problem discussed in [this post](https://stackoverflow.com/questions/9764298/how-to-sort-two-lists-which-reference-each-other-in-the-exact-same-way). Specifically, I am using the top rated solution from the post. This...
2021/12/29
[ "https://Stackoverflow.com/questions/70523172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11505332/" ]
Pandas allows you to divide columns by columns. Assuming your `DF1` and `DF2` have the same length, you could create a new column called `'values'`: ``` DF1['values'] = DF1['VALUE']/DF2['EXCHANGE'] Output DF1: MONTH VALUE values 2021-01-01 50 12,5 2021-01-01 75 18, 75 2021-01-01 100...
Avoid going into loops and if-else. You can use "Merge" to combine the two DataFrames based on column values and divide as usual: ``` DF1 = DF1.merge(DF2, on=['MONTH']) ``` Next divide VALUE by EXCHANGE: ``` DF1['VALUE'] = DF1['VALUE'].div(DF1['EXCHANGE']) ``` Finally drop EXCHANGE column from DF1: ``` DF1.drop(...
70,523,172
I am trying to sort a list of numpy arrays with respect to a list of integers in ascending order, the problem discussed in [this post](https://stackoverflow.com/questions/9764298/how-to-sort-two-lists-which-reference-each-other-in-the-exact-same-way). Specifically, I am using the top rated solution from the post. This...
2021/12/29
[ "https://Stackoverflow.com/questions/70523172", "https://Stackoverflow.com", "https://Stackoverflow.com/users/11505332/" ]
If you don't care about retaining the original order of `DF1` then ``` result = DF1.set_index('MONTH')['VALUE'].div(DF2.set_index('MONTH')['EXCHANGE']).dropna().to_frame('VALUE') VALUE MONTH 2021-01-01 12.50 2021-01-01 18.75 2021-01-01 25.00 2021-03-01 75.00 2021-03-01 75.00 2021-03-01 7...
Avoid going into loops and if-else. You can use "Merge" to combine the two DataFrames based on column values and divide as usual: ``` DF1 = DF1.merge(DF2, on=['MONTH']) ``` Next divide VALUE by EXCHANGE: ``` DF1['VALUE'] = DF1['VALUE'].div(DF1['EXCHANGE']) ``` Finally drop EXCHANGE column from DF1: ``` DF1.drop(...
71,676,845
I was wondering if there are any generic procedures to secure content of docker containers to extracting sensible source code. At the moment, I secure my Python application naively by encrypting and decrypting sources based on a licenses. Is there any solution that is independent from the content of the docker contai...
2022/03/30
[ "https://Stackoverflow.com/questions/71676845", "https://Stackoverflow.com", "https://Stackoverflow.com/users/18618326/" ]
The short answer here is that there is not a generic method for securing the contents of your containers without encrypting the contents. Since the nature of Docker is open, the main security with Docker images is controlling who can access the image (e.g. private image hosting), which depends on the security of your ...
you can use Cosign <https://github.com/sigstore/cosign>, it's used for Container Signing, Verification and Storage in an OCI registry.
48,802,922
* Typescript * ABP + .NET Core I'm using a grid to insert rows (the grid I'm using is a component of the DevExtreme framework). Anyway, similar to other grids, it raises `onRowInserting` events when the records are inserted, providing the inserted row as a parameter. I need to convert that "anonymous" object (the inse...
2018/02/15
[ "https://Stackoverflow.com/questions/48802922", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1820422/" ]
You can use decorators and serializers. See lib for ts here: <https://www.npmjs.com/package/serialize-ts>
How about using `object.assign()` to push the values of the properties from your JSON response object into the class you want? ``` ```js class thingy { a = null; print = function() { console.log(this.a); }; } const sourceJson = { a: "hello world" }; const target = Object.assign(new thingy(), sourceJso...
29,014,848
I am using POI 3.12-beta1 and have code that creates a line chart with multiple datasets and named series in the legend. However, the default settings for line charts in poi generate a line that has been smoothed over the data points. Empty values are also being plotted as 0, but we want the lines to stop at the first ...
2015/03/12
[ "https://Stackoverflow.com/questions/29014848", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4663361/" ]
Thanks to Etienne for the code to set blanks as gaps. I got help from a POI developer and here is the solution that solves both issues mentioned in the original question. ``` XSSFChart chart = (XSSFChart)drawing.createChart(anchor); // this will set blank values as gaps in the chart so you // can accurat...
I couldn't find any solution to that same problem so I ended up trying to find some "creative workaround". It's not a clean approach at all, but I'll share it just in case. It turns out that the default [Chart](https://poi.apache.org/apidocs/org/apache/poi/ss/usermodel/Chart.html) POI interface doesn't allow to do a l...
32,575,840
Using Qt, C++ on Windows, Ctrl-C copies a selection of text that includes the title, message, and so forth from a `QMessageBox`. I have added some additional fields and would like to add some custom text to the information copied from the standard `QMessageBox` from these fields. What do I override in `QMessageBox` to ...
2015/09/15
[ "https://Stackoverflow.com/questions/32575840", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1100718/" ]
You need to reimplement `QMessageBox` and all functions you want to use. Here is minimal example: **custommessagebox.h** ``` #include <QMessageBox> #include <QShortcut> class CustomMessageBox : public QMessageBox { Q_OBJECT public: explicit CustomMessageBox(QWidget *parent = 0); CustomMessageBox(Icon ico...
You can set all QMessageBox text selectable by mouse like this: ``` QMessageBox mb; mb.setTextInteractionFlags(Qt::TextSelectableByMouse); ``` [QMessageBox::setTextInteractionFlags(Qt::TextInteractionFlags flags);](http://doc.qt.io/qt-5/qmessagebox.html#textInteractionFlags-prop)
55,965,207
I'm trying to send everyone to a maintenance page EXCEPT the developers. I can successfully redirect ONE IP using a statement such as: ``` if ($remote_addr != IPHERE) { rewrite ^(.*)$ /system/maintenanance.html; } ``` however I can't figure out a way to add a second IP to the equation. Any help with be tremendo...
2019/05/03
[ "https://Stackoverflow.com/questions/55965207", "https://Stackoverflow.com", "https://Stackoverflow.com/users/10690518/" ]
You can try this way: ``` .mdc-button { justify-content: center !important; } ``` ```css .my-card-content { padding: 16px; } .mdc-button { justify-content: center !important; } ``` ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"/> <meta http-equiv="Content-Security-Pol...
This is because of .mdc-card\_\_action--button class has `justify-content: space-between;` property and value therefore if you want to center that text you should override this property with following code: ``` .mdc-card__action--button { justify-content: center !important; } ```
26,940,718
Trying to find out where default value for field with id **startDate** is populated. Its "24/04/2008" in rendered window on bottom right, however cannot see where it was set in code. ``` // this methid is called each time the selected period of the chart is changed function handleZoom(event) { var startDate = even...
2014/11/14
[ "https://Stackoverflow.com/questions/26940718", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4254444/" ]
You may want to use a `SKShapeNode`, like this: ``` var barra = SKShapeNode(rectOfSize: CGSize(width: 300, height: 100)) barra.name = "bar" barra.fillColor = SKColor.whiteColor() barra.position = location self.addChild(barra) ``` [Here's Apple's documentation on SKShapeNode.](https://developer.apple.com/Library/ios...
The way I was creating the rectangle was not the best, but the problem was the position I was inserting it on the game. This is how I've fixed it: ``` var barra = SKSpriteNode(color: SKColor.blackColor(), size: CGSizeMake(200, 200)) barra.position = CGPoint(x: CGRectGetMidX(self.frame), y: CGRectGetMidY(self.frame)) b...
260,583
iPhone 7 iOS 10.1.1 Gmail 5.0.3 Chrome 54.0.2840.91 When trying to open a link directly within the gmail app, it opens in safari instead of chrome. This used work just fine until the latest update of gmail. I looked in the gmail settings under google apps, to use the app instead of the browser. There is no...
2016/11/10
[ "https://apple.stackexchange.com/questions/260583", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/210076/" ]
I'm not sure if the following procedure is exactly what you tried, or if you did something differently – but maybe this helps anyways: * Run the Gmail app. * Click the little menu icon in the upper left (three parallel stripes). * Click the Settings gear icon. * Click "Google Apps" near the bottom (you may have to scr...
Problem resolved itself by as early as 11/26/2016. Gmail: 5.0.7 Chrome: 55.0.2883.79 iOS: 10.1.1
260,583
iPhone 7 iOS 10.1.1 Gmail 5.0.3 Chrome 54.0.2840.91 When trying to open a link directly within the gmail app, it opens in safari instead of chrome. This used work just fine until the latest update of gmail. I looked in the gmail settings under google apps, to use the app instead of the browser. There is no...
2016/11/10
[ "https://apple.stackexchange.com/questions/260583", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/210076/" ]
iOS 10 isn't the problem - the "old" gmail app still opened links in chrome well after updating to iOS 10. This didn't become an issue until updating to Gmail's version 5 that this became an issue.
Problem resolved itself by as early as 11/26/2016. Gmail: 5.0.7 Chrome: 55.0.2883.79 iOS: 10.1.1
116,576
Let's say you are navigating a list, grid or dropdown with the keyboard arrows. Pressing the arrows changes the temporarily "selected" item, and pressing enter **selects** it (a bit like the element on a webpage). Since the action of selecting the item is confirming your choice, navigating the list can't also be called...
2018/03/13
[ "https://ux.stackexchange.com/questions/116576", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/113067/" ]
When the user navigates to an item on the dropdown list, that item is 'active' or 'in focus.' Personally, I prefer 'in focus' when talking about tabbing through an interface or using the arrow keys, because it most accurately describes the visual feedback in the UI. Microsoft calls this 'input focus' in their UI glos...
Since it's a bit like using the mouse to move the cursor to the intended item (and maybe your UI would highlight the item which is currently hovered over) and clicking it to confirm your selection, I would like to suggest something along the lines of > > Move the cursor with the arrow keys > > > I'm not sure if t...
116,576
Let's say you are navigating a list, grid or dropdown with the keyboard arrows. Pressing the arrows changes the temporarily "selected" item, and pressing enter **selects** it (a bit like the element on a webpage). Since the action of selecting the item is confirming your choice, navigating the list can't also be called...
2018/03/13
[ "https://ux.stackexchange.com/questions/116576", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/113067/" ]
When the user navigates to an item on the dropdown list, that item is 'active' or 'in focus.' Personally, I prefer 'in focus' when talking about tabbing through an interface or using the arrow keys, because it most accurately describes the visual feedback in the UI. Microsoft calls this 'input focus' in their UI glos...
How about: > > Browse the menu with the arrow keys > > > --- Alternatively you could guide the user with a visual such as: [![enter image description here](https://i.stack.imgur.com/lnbIY.gif)](https://i.stack.imgur.com/lnbIY.gif) [Source](https://demos.telerik.com/aspnet-ajax/calendar/accessibility-and-intern...
116,576
Let's say you are navigating a list, grid or dropdown with the keyboard arrows. Pressing the arrows changes the temporarily "selected" item, and pressing enter **selects** it (a bit like the element on a webpage). Since the action of selecting the item is confirming your choice, navigating the list can't also be called...
2018/03/13
[ "https://ux.stackexchange.com/questions/116576", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/113067/" ]
When the user navigates to an item on the dropdown list, that item is 'active' or 'in focus.' Personally, I prefer 'in focus' when talking about tabbing through an interface or using the arrow keys, because it most accurately describes the visual feedback in the UI. Microsoft calls this 'input focus' in their UI glos...
The usual convention is to refer to the **active** state, which precedes the selected state. <https://www.w3schools.com/cssref/sel_active.asp>
116,576
Let's say you are navigating a list, grid or dropdown with the keyboard arrows. Pressing the arrows changes the temporarily "selected" item, and pressing enter **selects** it (a bit like the element on a webpage). Since the action of selecting the item is confirming your choice, navigating the list can't also be called...
2018/03/13
[ "https://ux.stackexchange.com/questions/116576", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/113067/" ]
When the user navigates to an item on the dropdown list, that item is 'active' or 'in focus.' Personally, I prefer 'in focus' when talking about tabbing through an interface or using the arrow keys, because it most accurately describes the visual feedback in the UI. Microsoft calls this 'input focus' in their UI glos...
The technical term is *focus* ("you can move focus with the arrow keys") or *active* ("you can change the active item with the arrow keys"). However, I note that in your question, you seem to be seeking input on what *user-facing text* would be helpful to explain to a user that they can move in the list with arrow key...
116,576
Let's say you are navigating a list, grid or dropdown with the keyboard arrows. Pressing the arrows changes the temporarily "selected" item, and pressing enter **selects** it (a bit like the element on a webpage). Since the action of selecting the item is confirming your choice, navigating the list can't also be called...
2018/03/13
[ "https://ux.stackexchange.com/questions/116576", "https://ux.stackexchange.com", "https://ux.stackexchange.com/users/113067/" ]
When the user navigates to an item on the dropdown list, that item is 'active' or 'in focus.' Personally, I prefer 'in focus' when talking about tabbing through an interface or using the arrow keys, because it most accurately describes the visual feedback in the UI. Microsoft calls this 'input focus' in their UI glos...
I would call this keyboard navigation or tabbed navigation (if the below is done) One suggestion I would make is to keep it consistent with the WCAG recommendations for navigating through the grid. Thoughts?
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
To change a pointer, you need to pass a pointer to the pointer, ie `Object** pNext`. To change the value of a variable inside a function, you pass a pointer. Hence, by extension, to change the value of a pointer inside a function, pass a pointer to the pointer. ``` func() { Object* pNext; func1(&pNext); } fu...
It should be ``` func() { Object *pNext; func1(&pNext); } void func1(Object **pNext) { *pNext = Segment->GetFirstPara(0); } ```
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
In c, you would want: ``` func1(&pNext); func1(Object** pNext) { *pNext = ... } ``` In C++ ``` func1(pNext); func1(Object*& pNext) { pNext = ... } ``` In either language, your example would pass an uninitialized `Object*` to `func1`, which would copy it, assign a value to the copy and then return. Note that the o...
To change a pointer, you need to pass a pointer to the pointer, ie `Object** pNext`. To change the value of a variable inside a function, you pass a pointer. Hence, by extension, to change the value of a pointer inside a function, pass a pointer to the pointer. ``` func() { Object* pNext; func1(&pNext); } fu...
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
For C++ only, you can make the parameter a reference ``` func() { Object* pNext; func1(pNext); } func1(Object*& pNext) { pNext = Segement->GetFirstPara(0); } ``` What is going on here is the difference between passing parameters by value and passing by reference. C always passes by value. In order to ge...
To change a pointer, you need to pass a pointer to the pointer, ie `Object** pNext`. To change the value of a variable inside a function, you pass a pointer. Hence, by extension, to change the value of a pointer inside a function, pass a pointer to the pointer. ``` func() { Object* pNext; func1(&pNext); } fu...
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
To change a pointer, you need to pass a pointer to the pointer, ie `Object** pNext`. To change the value of a variable inside a function, you pass a pointer. Hence, by extension, to change the value of a pointer inside a function, pass a pointer to the pointer. ``` func() { Object* pNext; func1(&pNext); } fu...
Please initialize pNext when you instantiate it. It might be NULL now when you're debugging, but in the field it will be 0x12AbD468, or something. The if you have a test like: ``` if( NULL != pNext ) { pNext->DoSomething(); } ``` ...and your program will explode, users will get mad, call support and somehow get yo...
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
In c, you would want: ``` func1(&pNext); func1(Object** pNext) { *pNext = ... } ``` In C++ ``` func1(pNext); func1(Object*& pNext) { pNext = ... } ``` In either language, your example would pass an uninitialized `Object*` to `func1`, which would copy it, assign a value to the copy and then return. Note that the o...
It should be ``` func() { Object *pNext; func1(&pNext); } void func1(Object **pNext) { *pNext = Segment->GetFirstPara(0); } ```
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
For C++ only, you can make the parameter a reference ``` func() { Object* pNext; func1(pNext); } func1(Object*& pNext) { pNext = Segement->GetFirstPara(0); } ``` What is going on here is the difference between passing parameters by value and passing by reference. C always passes by value. In order to ge...
It should be ``` func() { Object *pNext; func1(&pNext); } void func1(Object **pNext) { *pNext = Segment->GetFirstPara(0); } ```
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
Please initialize pNext when you instantiate it. It might be NULL now when you're debugging, but in the field it will be 0x12AbD468, or something. The if you have a test like: ``` if( NULL != pNext ) { pNext->DoSomething(); } ``` ...and your program will explode, users will get mad, call support and somehow get yo...
It should be ``` func() { Object *pNext; func1(&pNext); } void func1(Object **pNext) { *pNext = Segment->GetFirstPara(0); } ```
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
For C++ only, you can make the parameter a reference ``` func() { Object* pNext; func1(pNext); } func1(Object*& pNext) { pNext = Segement->GetFirstPara(0); } ``` What is going on here is the difference between passing parameters by value and passing by reference. C always passes by value. In order to ge...
In c, you would want: ``` func1(&pNext); func1(Object** pNext) { *pNext = ... } ``` In C++ ``` func1(pNext); func1(Object*& pNext) { pNext = ... } ``` In either language, your example would pass an uninitialized `Object*` to `func1`, which would copy it, assign a value to the copy and then return. Note that the o...
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
In c, you would want: ``` func1(&pNext); func1(Object** pNext) { *pNext = ... } ``` In C++ ``` func1(pNext); func1(Object*& pNext) { pNext = ... } ``` In either language, your example would pass an uninitialized `Object*` to `func1`, which would copy it, assign a value to the copy and then return. Note that the o...
Please initialize pNext when you instantiate it. It might be NULL now when you're debugging, but in the field it will be 0x12AbD468, or something. The if you have a test like: ``` if( NULL != pNext ) { pNext->DoSomething(); } ``` ...and your program will explode, users will get mad, call support and somehow get yo...
193,457
I have subclassed [`java.awt.Frame`](https://docs.oracle.com/javase/9/docs/api/java/awt/Frame.html) and have overridden the [`paint()`](https://docs.oracle.com/javase/9/docs/api/java/awt/Window.html#paint-java.awt.Graphics-) method as I wish to draw the entire contents of the window manually. However, on the graphics ...
2008/10/11
[ "https://Stackoverflow.com/questions/193457", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8779/" ]
For C++ only, you can make the parameter a reference ``` func() { Object* pNext; func1(pNext); } func1(Object*& pNext) { pNext = Segement->GetFirstPara(0); } ``` What is going on here is the difference between passing parameters by value and passing by reference. C always passes by value. In order to ge...
Please initialize pNext when you instantiate it. It might be NULL now when you're debugging, but in the field it will be 0x12AbD468, or something. The if you have a test like: ``` if( NULL != pNext ) { pNext->DoSomething(); } ``` ...and your program will explode, users will get mad, call support and somehow get yo...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
You can use `reduce` and `includes` as others have already shown. This will make the code a bit cleaner, but not change the overall runtime complexity. To improve runtime complexity you may need to use a different data structure. For instance instead of ``` let genres = [1,2,3,4]; ``` as a simple array, you could u...
The simplest improvement would probably be converting `genres` to a Set <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set> and use the `has` method to check if each id in the data is a member of the set of chosen genres. You can also convert the data to a map with the ids as the key...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
You can use `reduce` and `includes` as others have already shown. This will make the code a bit cleaner, but not change the overall runtime complexity. To improve runtime complexity you may need to use a different data structure. For instance instead of ``` let genres = [1,2,3,4]; ``` as a simple array, you could u...
The current time complexity is O(MN) where M is the length of `data.genres` and N is the length of `genres`. Time complexity in JavaScript depends on which engine you use, but in most cases you can use a `Map` to reduce this time complexity to O(max{N,M}): ``` const getGenreName = () => { const dataGenresMap = new M...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
The simplest improvement would probably be converting `genres` to a Set <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set> and use the `has` method to check if each id in the data is a member of the set of chosen genres. You can also convert the data to a map with the ids as the key...
You wanted this in one loop, so here it is: ```js let result = []; data.genres.forEach(function (e) { if (genres.includes(e.id)) result.push(e.name); }); console.log(result); ``` In case you were wondering about `forEach`, here's a very good reference: <https://www.w3schools.com/jsref/jsref_foreach.asp>
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
You wanted this in one loop, so here it is: ```js let result = []; data.genres.forEach(function (e) { if (genres.includes(e.id)) result.push(e.name); }); console.log(result); ``` In case you were wondering about `forEach`, here's a very good reference: <https://www.w3schools.com/jsref/jsref_foreach.asp>
The current time complexity is O(MN) where M is the length of `data.genres` and N is the length of `genres`. Time complexity in JavaScript depends on which engine you use, but in most cases you can use a `Map` to reduce this time complexity to O(max{N,M}): ``` const getGenreName = () => { const dataGenresMap = new M...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
You can use `reduce` and `includes` as others have already shown. This will make the code a bit cleaner, but not change the overall runtime complexity. To improve runtime complexity you may need to use a different data structure. For instance instead of ``` let genres = [1,2,3,4]; ``` as a simple array, you could u...
JavaScript `#reduce` in the example outlined below would have O(n) time complexity. This only loops through the array once. We could use filter, and map but it would result in us having to loop through the array twice. ```js const getGenreName = () => { const genreSet = new Set(genres); return data.genres.redu...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
The simplest improvement would probably be converting `genres` to a Set <https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Set> and use the `has` method to check if each id in the data is a member of the set of chosen genres. You can also convert the data to a map with the ids as the key...
The current time complexity is O(MN) where M is the length of `data.genres` and N is the length of `genres`. Time complexity in JavaScript depends on which engine you use, but in most cases you can use a `Map` to reduce this time complexity to O(max{N,M}): ``` const getGenreName = () => { const dataGenresMap = new M...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
You can use `reduce` and `includes` as others have already shown. This will make the code a bit cleaner, but not change the overall runtime complexity. To improve runtime complexity you may need to use a different data structure. For instance instead of ``` let genres = [1,2,3,4]; ``` as a simple array, you could u...
**If** you might be doing this more than once then I'd recommend using a `Map`. By creating a hash map, retrieving genre names per id is much more performant. ``` let genres = [28, 12, 878]; data = { genres: [ { id: 28, name: 'Action', }, { id: 12, name: 'Adven...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
You wanted this in one loop, so here it is: ```js let result = []; data.genres.forEach(function (e) { if (genres.includes(e.id)) result.push(e.name); }); console.log(result); ``` In case you were wondering about `forEach`, here's a very good reference: <https://www.w3schools.com/jsref/jsref_foreach.asp>
**If** you might be doing this more than once then I'd recommend using a `Map`. By creating a hash map, retrieving genre names per id is much more performant. ``` let genres = [28, 12, 878]; data = { genres: [ { id: 28, name: 'Action', }, { id: 12, name: 'Adven...
70,912,921
I am trying to improve the time complexity and quality of the code snippet below. I am iterating through one array to check if the element this array exists in the object, should this be true it should return the name matching the element id in the object. how can I do this without having a nested loop? Can someone tel...
2022/01/30
[ "https://Stackoverflow.com/questions/70912921", "https://Stackoverflow.com", "https://Stackoverflow.com/users/15989850/" ]
JavaScript `#reduce` in the example outlined below would have O(n) time complexity. This only loops through the array once. We could use filter, and map but it would result in us having to loop through the array twice. ```js const getGenreName = () => { const genreSet = new Set(genres); return data.genres.redu...
**If** you might be doing this more than once then I'd recommend using a `Map`. By creating a hash map, retrieving genre names per id is much more performant. ``` let genres = [28, 12, 878]; data = { genres: [ { id: 28, name: 'Action', }, { id: 12, name: 'Adven...