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
490,074
how do i go about reading data being sent almost constantly to my server. the protocol is udp. if i try to read in a while(1) loop, i dont get anything. it seems like the read will only echo once all the reading is done. so it waits till the loop is done reading which it will never be. i want the socket\_read to echo i...
2009/01/29
[ "https://Stackoverflow.com/questions/490074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60020/" ]
No it is not possible. The manipulation of the file is done by the browser, not the HTML code. Think about it, GWT is 100% javascript. And javascript has no access whatsoever of the file in your computer. That would be an pretty big security risk! GWT "wraps" the file input box so it can be displayed inside the GWT pa...
I'm pretty sure that because GWT code compiles to pure JavaScript, there isn't a way without requiring some third-party browser plugin.
490,074
how do i go about reading data being sent almost constantly to my server. the protocol is udp. if i try to read in a while(1) loop, i dont get anything. it seems like the read will only echo once all the reading is done. so it waits till the loop is done reading which it will never be. i want the socket\_read to echo i...
2009/01/29
[ "https://Stackoverflow.com/questions/490074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60020/" ]
Using GWT, there is no way to read files on the client side **yet**. However, in HTML5, you can read files without uploading to a server using the "File API". Links are provided below. [File API tutorial on html5rocks.com](http://www.html5rocks.com/en/tutorials/file/dndfiles/) [Example of how to use File API in GWT ...
I'm pretty sure that because GWT code compiles to pure JavaScript, there isn't a way without requiring some third-party browser plugin.
490,074
how do i go about reading data being sent almost constantly to my server. the protocol is udp. if i try to read in a while(1) loop, i dont get anything. it seems like the read will only echo once all the reading is done. so it waits till the loop is done reading which it will never be. i want the socket\_read to echo i...
2009/01/29
[ "https://Stackoverflow.com/questions/490074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60020/" ]
No it is not possible. The manipulation of the file is done by the browser, not the HTML code. Think about it, GWT is 100% javascript. And javascript has no access whatsoever of the file in your computer. That would be an pretty big security risk! GWT "wraps" the file input box so it can be displayed inside the GWT pa...
Do you mean from an `<input type="file"...>` file upload field in a form? The short answer is no-- file uploads are handled by the browser, and are sent directly to the server (as an ENCODING\_MULTIPART POST). And security restrictions on JavaScript mean there's no way to workaround that restriction.
490,074
how do i go about reading data being sent almost constantly to my server. the protocol is udp. if i try to read in a while(1) loop, i dont get anything. it seems like the read will only echo once all the reading is done. so it waits till the loop is done reading which it will never be. i want the socket\_read to echo i...
2009/01/29
[ "https://Stackoverflow.com/questions/490074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60020/" ]
Using GWT, there is no way to read files on the client side **yet**. However, in HTML5, you can read files without uploading to a server using the "File API". Links are provided below. [File API tutorial on html5rocks.com](http://www.html5rocks.com/en/tutorials/file/dndfiles/) [Example of how to use File API in GWT ...
Do you mean from an `<input type="file"...>` file upload field in a form? The short answer is no-- file uploads are handled by the browser, and are sent directly to the server (as an ENCODING\_MULTIPART POST). And security restrictions on JavaScript mean there's no way to workaround that restriction.
490,074
how do i go about reading data being sent almost constantly to my server. the protocol is udp. if i try to read in a while(1) loop, i dont get anything. it seems like the read will only echo once all the reading is done. so it waits till the loop is done reading which it will never be. i want the socket\_read to echo i...
2009/01/29
[ "https://Stackoverflow.com/questions/490074", "https://Stackoverflow.com", "https://Stackoverflow.com/users/60020/" ]
No it is not possible. The manipulation of the file is done by the browser, not the HTML code. Think about it, GWT is 100% javascript. And javascript has no access whatsoever of the file in your computer. That would be an pretty big security risk! GWT "wraps" the file input box so it can be displayed inside the GWT pa...
Using GWT, there is no way to read files on the client side **yet**. However, in HTML5, you can read files without uploading to a server using the "File API". Links are provided below. [File API tutorial on html5rocks.com](http://www.html5rocks.com/en/tutorials/file/dndfiles/) [Example of how to use File API in GWT ...
7,436,731
This must be a simple problem, but I can't get my head around it. I have a resizable title window. Inside I just want a VGroup to hold the contents of the form and an HGroup to have a few buttons at the bottom. Very standard stuff. ``` <!-- Content --> <s:VGroup id="content" height="340" width="100%"> ...more ...
2011/09/15
[ "https://Stackoverflow.com/questions/7436731", "https://Stackoverflow.com", "https://Stackoverflow.com/users/218028/" ]
EKEvent's startDate property is declared as an NSDate but you are passing it an NSString. You need to parse the string into a NSDate first and then set the event date: ``` NSDateFormatter *formatter = [[NSDateFormatter alloc] init]; [formatter setDateFormat:@"YYYY/MM/dd"]; event.startDate = [formatter dateFromString:d...
@Tim Dean was on the right track, but that initializer is only used to return OS 10.0 style date formatters and isn't even supported on iOS. ``` NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init]; [dateFormatter setDateFormat:@"YYYY/MM/dd"]; event.startDate = [dateFormatter dateFromString:dateField.text];...
28,777,998
I have this code: ``` string firstTag = "Forums2008/forumPage.aspx?forumId="; string endTag = "</a>"; index = forums.IndexOf(firstTag, index1); if (index == -1) continue; var secondIndex = forums.IndexOf(endTag, index); result = forums.Substring(index + firstTag.Length + 12, secondIndex - (index + firstTag.Lengt...
2015/02/28
[ "https://Stackoverflow.com/questions/28777998", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4600106/" ]
One powerful way to do this is to use [Regular Expressions](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Regular_Expressions) instead of trying to find a starting position and use a substring. Try out this code, and you'll see that it extracts the anchor tag's title: ``` var input = "<a href=\"/Fo...
Okay here is the solution using `String.Substring()` `String.Split()` and `String.IndexOf()` ``` String str = "<a href=\"/Forums2008/forumPage.aspx?forumId=317\" title=\"הנקה\">הנקה</a>"; // <== Assume this is passing string. Yes unusual scape sequence are added int splitStart = str.IndexOf("title="); // < ...
11,603,585
I'm implementing a **ExpandableListView** and for each group, it shows the childs, and each child with its own duration, and the group shows the sum of all the durations of the childs. However, when I click a child it shows the error: > > Couldn't read row 1, col -1 from CursorWindow. Make sure the Cursor is initial...
2012/07/22
[ "https://Stackoverflow.com/questions/11603585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/399459/" ]
As @Jens mentioned on the comment: > > Is it looking for a row identifier (i.e. BaseColumns#\_ID) and not finding it in the cursor? Which columns are you using in mContactsCursor - you haven't forgotten the row id in that? > > > In all queries, the column `_id` must be specified. This is what was causing the erro...
We might even get this error even if we have \_ID. This occurs if we have given wrong field\_name in the query or passing the field\_name in the intent or wherever used.
11,603,585
I'm implementing a **ExpandableListView** and for each group, it shows the childs, and each child with its own duration, and the group shows the sum of all the durations of the childs. However, when I click a child it shows the error: > > Couldn't read row 1, col -1 from CursorWindow. Make sure the Cursor is initial...
2012/07/22
[ "https://Stackoverflow.com/questions/11603585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/399459/" ]
As @Jens mentioned on the comment: > > Is it looking for a row identifier (i.e. BaseColumns#\_ID) and not finding it in the cursor? Which columns are you using in mContactsCursor - you haven't forgotten the row id in that? > > > In all queries, the column `_id` must be specified. This is what was causing the erro...
If you use `ContentProvider` to query, you need add at least \_id to PROJECTION
11,603,585
I'm implementing a **ExpandableListView** and for each group, it shows the childs, and each child with its own duration, and the group shows the sum of all the durations of the childs. However, when I click a child it shows the error: > > Couldn't read row 1, col -1 from CursorWindow. Make sure the Cursor is initial...
2012/07/22
[ "https://Stackoverflow.com/questions/11603585", "https://Stackoverflow.com", "https://Stackoverflow.com/users/399459/" ]
We might even get this error even if we have \_ID. This occurs if we have given wrong field\_name in the query or passing the field\_name in the intent or wherever used.
If you use `ContentProvider` to query, you need add at least \_id to PROJECTION
14,074,795
I am working on android application and I need to parse my json object with data. How you can see I create JSONParser class and try to use asynctask but there is something wrong and I can't understand where is the problem. Every time I use it resultJSON is null. Hope that you can give me an advice! ``` public class JS...
2012/12/28
[ "https://Stackoverflow.com/questions/14074795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1107922/" ]
Why don't you `JSONArray json = new JSONArray(resultJSON);` do this on post execute method of async task . And i will not suggest varevarao way , as it will create extra burden of one thread .
You should use the [get() method](http://developer.android.com/reference/android/os/AsyncTask.html#get%28%29) of the AsyncTask class to retrieve the result of the task. It waits for the task to complete and gets the result (which means it'd be best if you enclose it within a separate thread with a progress dialog or ju...
14,074,795
I am working on android application and I need to parse my json object with data. How you can see I create JSONParser class and try to use asynctask but there is something wrong and I can't understand where is the problem. Every time I use it resultJSON is null. Hope that you can give me an advice! ``` public class JS...
2012/12/28
[ "https://Stackoverflow.com/questions/14074795", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1107922/" ]
Why don't you `JSONArray json = new JSONArray(resultJSON);` do this on post execute method of async task . And i will not suggest varevarao way , as it will create extra burden of one thread .
The problem is fixed. It's an awful workaround but it works. Add this line ``` while(json==null) {} ``` after calling the execute method.
770,411
Using the method of Lagrange multipliers, find the extreme values of the function $f(x,y)= \frac{2y^3}{3} + 2x^2 +1$ on the ellipse $5x^2 + y^2 = 1/9$ . Identify the (absolute) maximal and minimal values of f taken on the ellipse. currently I have that $\nabla f(x,y)=L\*\nabla g(x,y)$ where $g(x,y)=5x^2 + y^2-1/9$ t...
2014/04/26
[ "https://math.stackexchange.com/questions/770411", "https://math.stackexchange.com", "https://math.stackexchange.com/users/145954/" ]
$\dfrac{\partial f}{\partial x} = 4x= \gamma\cdot 10x$, and $\dfrac{\partial f}{\partial y} = 2y^2 = \gamma\cdot 2y$. So: $2x(2 - 5\gamma) = 0$, and $2y(y - \gamma) = 0$. So case 1: $x = 0$, so $y^2 = \dfrac{1}{9}$. So $y = \dfrac{1}{3}$ or $-\dfrac{1}{3}$. So: $f(0,\frac{1}{3}) = \dfrac{83}{81}$, and $f(0,-\frac{1}{...
Also differentiate wrt L, which just gives you your constraint back. Take the solutions x=0 and y=L and put into constraint to get L=1/3, and so y=1/3.
63,673,374
Im trying to test [Cassandra Sink](https://ci.apache.org/projects/flink/flink-docs-release-1.10/dev/connectors/cassandra.html#cassandra-sink-example-for-streaming-tuple-data-type) with use of [TestContainers](https://www.testcontainers.org/modules/databases/cassandra/) in a simple Flink pipeline which use [DataStreamTe...
2020/08/31
[ "https://Stackoverflow.com/questions/63673374", "https://Stackoverflow.com", "https://Stackoverflow.com/users/6823114/" ]
It's complicated... With ``` const std::function<std::string(size_t)> delegateRaw = [] (const size_t index) -> std::string { return std::to_string(index); }; const HolderDelegate holder (delegateRaw); ``` you pass a `std::function<std::string(std::size_t)>` to the `HolederDelegate` constructor that has ...
If your lambda doesn't capture anything, then you can decay it to a function pointer at the call site: ``` const HolderDelegate holder ( + [] (const size_t index) -> std::string { return std::to_string(index); }); // ^ decay to FP ``` and then you can add a deduction guide for `HolderDeleg...
37,969,467
My `CAMetalLayer` background color is black, even if i'm assigning new color as the `backgroundColor` property. Am i missing something? Thanks! Link to the original project : <https://github.com/audiokit/MetalParticles>
2016/06/22
[ "https://Stackoverflow.com/questions/37969467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4156957/" ]
This project takes a rather unconventional approach to clearing the drawable's texture each frame: it replaces the textures contents with an array of zeros that is the same size as the texture (width \* height \* 4). Subsequently, it encodes some compute work that actually draws the particles. This is almost certainly ...
I have gone through your code and can not see a place where you are setting background Color. The metal layer is added as a sublayer to it, so you have to set it explicitly. Add this line at the end of your init method in `ParticialLab` class and see if it works. ``` self.backgroundColor = UIColor.redColor().CGColor...
37,969,467
My `CAMetalLayer` background color is black, even if i'm assigning new color as the `backgroundColor` property. Am i missing something? Thanks! Link to the original project : <https://github.com/audiokit/MetalParticles>
2016/06/22
[ "https://Stackoverflow.com/questions/37969467", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4156957/" ]
This project takes a rather unconventional approach to clearing the drawable's texture each frame: it replaces the textures contents with an array of zeros that is the same size as the texture (width \* height \* 4). Subsequently, it encodes some compute work that actually draws the particles. This is almost certainly ...
I found that `self.isOpaque = false` was needed on the layer.
28,518,783
I am trying to run a rake test and I am unable to do it. I keep getting this error: ActiveRecord::SchemaMigration Load (0.1ms) SELECT "schema\_migrations".\* FROM "schema\_migrations" rake aborted! LoadError: cannot load such file -- rails/performance\_test\_help I would greatly appreciate any insight.
2015/02/14
[ "https://Stackoverflow.com/questions/28518783", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4451440/" ]
[`rails/performance_test_help`](https://github.com/rails/rails/blob/v3.2.21/railties/lib/rails/performance_test_help.rb) is an old test helper that was used up to Rails 3.2 [for performance testing](http://guides.rubyonrails.org/v3.2.13/performance_testing.html). It was supposed to be required by performance test cases...
run `rake db:migrate RAILS_ENV=test` before running rake test. Hope this solves your problem.
3,407,480
> > Let $f:\mathbb{R} \to \mathbb{R}$ be a strictly increasing bounded function of class $C^1$. Prove that there exists a sequence $\{x\_n\}\_n$ of real numbers such that $x\_n\to\infty$ and $\lim\_{n \to \infty} f'(x\_n)=0$. > > > Then construct a strictly increasing bounded function $f:\mathbb{R} \to \mathbb{R}$ o...
2019/10/24
[ "https://math.stackexchange.com/questions/3407480", "https://math.stackexchange.com", "https://math.stackexchange.com/users/487815/" ]
By the Mean Value Theorem, for any $n\in\mathbb{N}$ there is $x\_n\in (n,n+1)$ such that $$f'(x\_n)=f(n+1)-f(n).$$ The sequence $(x\_n)\_n$ is strictly increasing and goes to $+\infty$. Then $$\lim\_{n\to \infty }f'(x\_n)=\lim\_{n\to \infty }(f(n+1)-f(n))=\lim\_{n\to \infty}f(n+1)-\lim\_{n\to \infty }f(n)=M-M=0$$ where...
An increasing and bounded from above function $f:\Bbb{R} \to \Bbb{R}$ has always a limit as $x \to +\infty$ which is $L=\sup\{f(x):x \in \Bbb{R}\}$
727,325
Why are any two of $k$, $6k+1$, $8k+1$, $24k+1$ for $k\in\{2, 3, 4, 5, \ldots\}$ are mutually coprime? I am trying to show that $k$ and $6k+1$ are coprime, I am trying to reason by taking their difference, so $(6k+1)-k=5k+1$ but unable to show why are their coprime? Similarly $(8k+1)-(6k+1)=2k$, if their distance ...
2014/03/26
[ "https://math.stackexchange.com/questions/727325", "https://math.stackexchange.com", "https://math.stackexchange.com/users/71346/" ]
First, $$GCD(a,b) = GCD(|a-b|,b)=GCD(a,|b-a|).$$ As a corollary: $$GCD(a,na+l) = GCD(a,l).\qquad (n \in \mathbb{N}, ~~ l\ge 0).$$ Applying this rule, one can get: $ GCD(k,nk+1) =GCD(k,1) =1; $ $\qquad$for any $n\in \mathbb{N}$, our cases: $n=6,8,24$. Other cases - similar: $ GCD(6k+1,8k+1)=GCD(6k+1,2k)=GCD(4k+1...
Suppose that $p>1$ divides $k$. Then it divides $mk$ for any integer $m$. But then it cannot divide $mk+1$.
19,665,546
The book I am learning from says the following code is creating an object, but I am unsure as to how this works. The second section of code is another way I have learned, from an online tutorial. But what is the difference? I have tried to research this myself but am quite new to all of this and some of the explanation...
2013/10/29
[ "https://Stackoverflow.com/questions/19665546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2765936/" ]
Main difference is that the first one will have an extra object in its "prototype chain". The prototype chain is how you do inheritance in JavaScript. Therefore, you can extend that object, and all the objects created from the `Player` constructor function will inherit those items. ``` function Player (name , score ...
The first code example is a constructor. From what I understand, it's a more strongly-typed way of creating objects since the parameters and members of that object are already defined. The second code example *does* do the same thing, however there's nothing defining what the object should actually contain or how it s...
19,665,546
The book I am learning from says the following code is creating an object, but I am unsure as to how this works. The second section of code is another way I have learned, from an online tutorial. But what is the difference? I have tried to research this myself but am quite new to all of this and some of the explanation...
2013/10/29
[ "https://Stackoverflow.com/questions/19665546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2765936/" ]
Main difference is that the first one will have an extra object in its "prototype chain". The prototype chain is how you do inheritance in JavaScript. Therefore, you can extend that object, and all the objects created from the `Player` constructor function will inherit those items. ``` function Player (name , score ...
> > But what is the difference? > > > The first uses a *constructor function*, the second uses an *object initializer*. > > Are there advantages/disadvantages to using each one? > > > Yes: * Constructor functions can be reused and have logic in them, so are good for when you need to make multiple objects th...
19,665,546
The book I am learning from says the following code is creating an object, but I am unsure as to how this works. The second section of code is another way I have learned, from an online tutorial. But what is the difference? I have tried to research this myself but am quite new to all of this and some of the explanation...
2013/10/29
[ "https://Stackoverflow.com/questions/19665546", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2765936/" ]
Main difference is that the first one will have an extra object in its "prototype chain". The prototype chain is how you do inheritance in JavaScript. Therefore, you can extend that object, and all the objects created from the `Player` constructor function will inherit those items. ``` function Player (name , score ...
You can create objects in JavaScript in two ways. 1. Function constructors (in conjunction with the new keyword) 2. Object literals (the second way you show). But really, the second way is just an alternative syntax for the following: ``` var playerOne = new Object(); playerOne.name = "Craig"; playerOne.score = 199;...
3,350
Is there any free/open or commercial/paid Arduino IDE Sketch Debugger (not Atmel chip factory standard tool set) with Breakpoint and Variable read/set capability? I read about VM on web. Is there any similar product?
2014/07/18
[ "https://arduino.stackexchange.com/questions/3350", "https://arduino.stackexchange.com", "https://arduino.stackexchange.com/users/3219/" ]
Those aren't multiplexing chips. Those are just chips to give you more outputs than your arduino has. The multiplexing is just done on the microcontroller. But it depends on how you are wiring the leds. You can wire the cube to use less digital outputs, but you'll end up with a less bright leds. You could use no mul...
You could use a few TLC 5940 PWM Drivers (<http://www.ti.com/product/tlc5940>). Each one has 16 channels which would mean to power an 8\*8\*8 cube would need 32 Drivers. However, you can use multiplexing to reduce the number of 5940's you would need. For example, you could use 4 X 5940's which would give you 64 chan...
3,793,653
I'm trying to implement master detail in a rails form with fields\_for. I have one model called Recipe: ``` class Recipe < ActiveRecord::Base validates :name, :presence => true validates :directions, :presence => true has_many :recipe_ingredients end ``` and one model called RecipeIngredient: ``` class R...
2010/09/25
[ "https://Stackoverflow.com/questions/3793653", "https://Stackoverflow.com", "https://Stackoverflow.com/users/457217/" ]
You should use **<%=** instead of <% when using **form\_for** and **fields\_for** The correct code should look like this: ``` <%= form_for :recipe do |f| %> <%= f.fields_for :ingredients do |ingredient_form| %> <p> Ingredient: <%= ingredient_form.text_field :description %> </p> <% en...
Switch it up to ``` <% form_for :recipe do |f| %> <% f.fields_for :ingredients do |ingredient_form| %> <p> Ingredient: <%= ingredient_form.text_field :description %> </p> <% end %> <% end %> ```
23,874,815
What are the subtle differences between an `intent` and an `event` in Android app development? It is my understanding that both cause something to happen in response to user or system actions and that intents are global whereas events are more localized, but what are the more subtle differences.
2014/05/26
[ "https://Stackoverflow.com/questions/23874815", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3575128/" ]
[Intents](http://developer.android.com/reference/android/content/Intent.html) are the messaging system used by the Android OS (similar to messages in Windows). Intents can vary in scope and even be used to communicate between apps. If I understand you correctly, events are raised by the OS. Events require a listener to...
Intents are the foundation of Android's very flexible inter process communication features. A new android programmer will want to learn all of their ins and outs right away because they enable types of code reuse that will save a great deal of time and effort. The concept of an event is important in android as it woul...
50,328,592
I already read many posts about this topic. I'm trying to perform on a real table the following: ``` DELETE FROM MYTABLE WHERE ID in (...) ``` where *in* clause can contain 1,2 or many (>3000) values (deriving from a list in c#) I haven't problems about triggers, FK... I can't find a complete sample using tempor...
2018/05/14
[ "https://Stackoverflow.com/questions/50328592", "https://Stackoverflow.com", "https://Stackoverflow.com/users/2082861/" ]
Please see [Pass table valued parameter using ADO.Net](https://stackoverflow.com/a/10409710/1260204), that is where this answer was derived from. 1. **Create type in SQL Server**: ``` CREATE TYPE [dbo].[MyDataType] As Table ( cust_id INT ) ``` 2. **Create DataTable in C#**: ``` DataTable myDataTable = new DataT...
Step 1: Create table variable ``` CREATE TYPE SampleTable AS TABLE ( Id INT ) GO ``` Step 2: Insert your table variable from your C# List Step 3: Delete your table data ``` DECLARE @Sample_Id_List SampleTable READONLY DELETE FROM YourTable WHERE Id IN (SELECT Id FROM @Sample_Id_List) ```
29,976,725
I have 3 HTML div elements that I'd like to see sit side-by-side on a wide screen but, as the screen width collapses, I'd like to see them become vertical. For example... Wide screen: ``` ----------- abc def ghi ----------- ``` Narrow screen: ``` abc def ghi ``` Currently, having three HTML divs that look as fo...
2015/04/30
[ "https://Stackoverflow.com/questions/29976725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1255223/" ]
I would do something like this unless you actually need to apply an ID, classes are easier for multiple divs with one assignment in css, plus they take up less space. ``` html--- <div class="wrapper"> <div class="third">Something here</div> <div class="third">Something here</div> <div class="third">Something ...
Yes, there are [media queries](https://css-tricks.com/snippets/css/media-queries-for-standard-devices/) that allow you to control layout for mobile screens, ex: ``` /* Portrait and Landscape */ @media only screen and (min-device-width: 768px) and (max-device-width: 1024px) and (-webkit-min-device-pixel-ratio:...
29,976,725
I have 3 HTML div elements that I'd like to see sit side-by-side on a wide screen but, as the screen width collapses, I'd like to see them become vertical. For example... Wide screen: ``` ----------- abc def ghi ----------- ``` Narrow screen: ``` abc def ghi ``` Currently, having three HTML divs that look as fo...
2015/04/30
[ "https://Stackoverflow.com/questions/29976725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1255223/" ]
I would do something like this unless you actually need to apply an ID, classes are easier for multiple divs with one assignment in css, plus they take up less space. ``` html--- <div class="wrapper"> <div class="third">Something here</div> <div class="third">Something here</div> <div class="third">Something ...
A simple media query can do this. ```css /* Apply inner styles if the viewport's width is at least 500px */ @media (min-width: 500px) { .responsive { width:33.3333%; float:left; } } ``` ```html <div id="Master_Div"> <div class="responsive" id="Div_1"> <p>abc</p> </div> <div class="resp...
29,976,725
I have 3 HTML div elements that I'd like to see sit side-by-side on a wide screen but, as the screen width collapses, I'd like to see them become vertical. For example... Wide screen: ``` ----------- abc def ghi ----------- ``` Narrow screen: ``` abc def ghi ``` Currently, having three HTML divs that look as fo...
2015/04/30
[ "https://Stackoverflow.com/questions/29976725", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1255223/" ]
I would do something like this unless you actually need to apply an ID, classes are easier for multiple divs with one assignment in css, plus they take up less space. ``` html--- <div class="wrapper"> <div class="third">Something here</div> <div class="third">Something here</div> <div class="third">Something ...
Your problem is best resolved by natural design patterns without resorting to media queries. Think about it this way , if you lay out your columns side by side using css `float:left;` and you define some `min-width` value per column. then as soon as the screen width becomes smaller than the width value you defined X 3 ...
50,012,656
When I was trying the substring() method I found that java didn't throw IndexOutOfBoundsException in this code even though the endIndex is out of bounds ``` String str1 = "abcdefg"; System.out.println(str1.substring(3,7)); ``` When I changed the endIndex to 8 then java throwed IndexOutOfBoundsException in this code...
2018/04/25
[ "https://Stackoverflow.com/questions/50012656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8490745/" ]
This is because the `substring(start, end)` function specifies an inclusive `start` and an exclusive `end` index. This way, you can specify an `index` that's 1 greater than the max index to indicate that you want to go all the way to the end of the string (although, in that case, you should probably just use the singl...
What was stated in the other 2 solutions is correct. When you do: ``` String str1 = "abcdefg"; System.out.println(str1.substring(3,7)); ``` This is what happens: ``` v v [a][b][c][d][e][f][g] --- return "defg" [0][1][2][3][4][5][6][7] --- Grabbing index 3 to 6 ``` It is reading ...
50,012,656
When I was trying the substring() method I found that java didn't throw IndexOutOfBoundsException in this code even though the endIndex is out of bounds ``` String str1 = "abcdefg"; System.out.println(str1.substring(3,7)); ``` When I changed the endIndex to 8 then java throwed IndexOutOfBoundsException in this code...
2018/04/25
[ "https://Stackoverflow.com/questions/50012656", "https://Stackoverflow.com", "https://Stackoverflow.com/users/8490745/" ]
From the documentation you linked to: > > The substring begins at the specified beginIndex and extends to the character at index endIndex - 1. > > > So `str1.substring(3,7)` is actually taking a substring from index 3 through index 6.
What was stated in the other 2 solutions is correct. When you do: ``` String str1 = "abcdefg"; System.out.println(str1.substring(3,7)); ``` This is what happens: ``` v v [a][b][c][d][e][f][g] --- return "defg" [0][1][2][3][4][5][6][7] --- Grabbing index 3 to 6 ``` It is reading ...
28,027,226
So I'm creating a AD User with the UserPrincipal Class but I can't set the Allow Dial-In Setting through that. How can I enable the setting? Thanks in advance!
2015/01/19
[ "https://Stackoverflow.com/questions/28027226", "https://Stackoverflow.com", "https://Stackoverflow.com/users/4470461/" ]
You cannot set all Properties in the UserPrincipal class. This could give an idea how to do it with the help of the **DirectoryEntry** class: ``` //Get the Directory entry of your Userprincipal DirectoryEntry directoryEntry = [YOUR_USERPRINCIPAL_OBJECT].GetUnderlyingObject() as DirectoryEntry; //Set Allow Dialin attr...
If you want you can use UserPrincipal to read and write DialIn option using [user principal extension](http://blogs.msdn.com/b/kaevans/archive/2012/04/11/querying-active-directory-using-principal-extensions-in-system-directoryservices-accountmanagement.aspx) You can create your extended user principal like this ``` ...
51,488,814
Is there a way to either specify different alphas for `facecolor` vs `edgecolor`? Or is there a way to plot an alpha filled area with non-alpha edgecolor *that also works in the legend*? This is not what I want... [![enter image description here](https://i.stack.imgur.com/1kxO1.jpg)](https://i.stack.imgur.com/1kxO1.jp...
2018/07/24
[ "https://Stackoverflow.com/questions/51488814", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1002098/" ]
You cannot specify different alpha values via the `alpha` argument. However you can define each of `facecolor` and `edgecolor` with an alpha channel, e.g. for red with 40% opacity ``` facecolor=(1,0,0,.4) ``` This is then directly applied in the legend. ``` import matplotlib.pyplot as plt import numpy as np x = np...
Immediately, looking at [fill\_between alpha](https://matplotlib.org/gallery/recipes/fill_between_alpha.html) and general [fill\_between documentation](https://matplotlib.org/api/_as_gen/matplotlib.axes.Axes.fill_between.html#matplotlib.axes.Axes.fill_between) it appears to be unsupported. The [legend documentation](ht...
8,259
[Global IQ: 1950–2050](http://www.fourmilab.ch/documents/IQ/1950-2050/) Essentially the idea is that while smart people are getting wealthier, their birth-rate tends to drop. On the other hand poor countries, which are generally populated by less intelligent people, have constant birth rates. So theoretically this wo...
2012/02/29
[ "https://skeptics.stackexchange.com/questions/8259", "https://skeptics.stackexchange.com", "https://skeptics.stackexchange.com/users/2636/" ]
> > N.B. IQ scores are standardized for a given population at a given > time. The average IQ is *always* 100, and its standard deviation is > *always* 15. To compare between times or populations, we must use “raw IQ,” by which I mean the raw scores of a few tests, > especially: > > > * [Raven's Matrices](http://e...
Just the opposite. The [Flynn Effect](http://www.indiana.edu/~intell/flynneffect.shtml) observes that global IQ scores are actually *increasing* over time at a pretty good clip. The true extent and cause of the effect are a matter of debate (but the effect is more pronounced at the low end of the spectrum, so the theo...
8,259
[Global IQ: 1950–2050](http://www.fourmilab.ch/documents/IQ/1950-2050/) Essentially the idea is that while smart people are getting wealthier, their birth-rate tends to drop. On the other hand poor countries, which are generally populated by less intelligent people, have constant birth rates. So theoretically this wo...
2012/02/29
[ "https://skeptics.stackexchange.com/questions/8259", "https://skeptics.stackexchange.com", "https://skeptics.stackexchange.com/users/2636/" ]
> > N.B. IQ scores are standardized for a given population at a given > time. The average IQ is *always* 100, and its standard deviation is > *always* 15. To compare between times or populations, we must use “raw IQ,” by which I mean the raw scores of a few tests, > especially: > > > * [Raven's Matrices](http://e...
Changes in relative numbers of high-intelligent and low-intelligent people in the world should **never** lead to a change in global IQ. IQ is not a measure of amount of intelligence, it is a measure of amount of intelligence *relative to peers*. For example, [see this source:](http://www.iqtestexperts.com/iq-defini...
4,672,367
Is a way to pen a text file, read a few lines, close it, re-open it and start reading from the line where you left off before? Or do you always have to start from the top?
2011/01/12
[ "https://Stackoverflow.com/questions/4672367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/270577/" ]
I would just start from the top each time. This is the simplest and possibly not much slower. You can use a RandomAccessFile but you would have to wrap it with your own line reader (as well as place some check that the file hasn't changed in an incompatible manner)
I'm pretty sure every time you open a file, it starts you from the beginning.
4,672,367
Is a way to pen a text file, read a few lines, close it, re-open it and start reading from the line where you left off before? Or do you always have to start from the top?
2011/01/12
[ "https://Stackoverflow.com/questions/4672367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/270577/" ]
You sure can! This is not going to be the fastest method, but it is going to work. And, by the way, the people who responded to your question by telling you that you should just start reprocessing from the beginning of the file TOTALLY missed the point of your question. There are an ample amount of reasons to want to r...
I'm pretty sure every time you open a file, it starts you from the beginning.
4,672,367
Is a way to pen a text file, read a few lines, close it, re-open it and start reading from the line where you left off before? Or do you always have to start from the top?
2011/01/12
[ "https://Stackoverflow.com/questions/4672367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/270577/" ]
I would just start from the top each time. This is the simplest and possibly not much slower. You can use a RandomAccessFile but you would have to wrap it with your own line reader (as well as place some check that the file hasn't changed in an incompatible manner)
Can't you just save the line number externally and jump to / seek the desired position?
4,672,367
Is a way to pen a text file, read a few lines, close it, re-open it and start reading from the line where you left off before? Or do you always have to start from the top?
2011/01/12
[ "https://Stackoverflow.com/questions/4672367", "https://Stackoverflow.com", "https://Stackoverflow.com/users/270577/" ]
You sure can! This is not going to be the fastest method, but it is going to work. And, by the way, the people who responded to your question by telling you that you should just start reprocessing from the beginning of the file TOTALLY missed the point of your question. There are an ample amount of reasons to want to r...
Can't you just save the line number externally and jump to / seek the desired position?
44,418,912
When I archive from the command line using `xcodebuild archive`, how can I get the path to the newly created archive? I'd like to follow on with an `-exportArchive` command to create an adhoc distribution. I know that I can define an `-archivePath`, however if I do that then Organizer doesnt know where about this arch...
2017/06/07
[ "https://Stackoverflow.com/questions/44418912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332606/" ]
you can simply create a variable holding the path of the archive you want to generate. Then use the same path when you want to export ```sh $ARCHIVE_PATH="<path_of_your_archive>" # can be something like "build/app_name.xcarchive" # ARCHIVING xcodebuild archive \ -workspace "${APP_NAME}.xcworkspace" \ -config...
Assuming that you have a standard archives path on your machine, I use this python code to get me the current archive path for builds. ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import os import datetime class Xcodebuild: @staticmethod def current_archive_path(): # The default archives path i...
44,418,912
When I archive from the command line using `xcodebuild archive`, how can I get the path to the newly created archive? I'd like to follow on with an `-exportArchive` command to create an adhoc distribution. I know that I can define an `-archivePath`, however if I do that then Organizer doesnt know where about this arch...
2017/06/07
[ "https://Stackoverflow.com/questions/44418912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332606/" ]
you can simply create a variable holding the path of the archive you want to generate. Then use the same path when you want to export ```sh $ARCHIVE_PATH="<path_of_your_archive>" # can be something like "build/app_name.xcarchive" # ARCHIVING xcodebuild archive \ -workspace "${APP_NAME}.xcworkspace" \ -config...
There's `$ARCHIVE_PATH` variable that's only available in archive post-actions scripts[![enter image description here](https://i.stack.imgur.com/vz0vF.png)](https://i.stack.imgur.com/vz0vF.png) **Edit:** `$ARCHIVE_PATH` returns a kind of generic path that doesn't account for the date, time, or duplicate suffixes. Use...
44,418,912
When I archive from the command line using `xcodebuild archive`, how can I get the path to the newly created archive? I'd like to follow on with an `-exportArchive` command to create an adhoc distribution. I know that I can define an `-archivePath`, however if I do that then Organizer doesnt know where about this arch...
2017/06/07
[ "https://Stackoverflow.com/questions/44418912", "https://Stackoverflow.com", "https://Stackoverflow.com/users/332606/" ]
There's `$ARCHIVE_PATH` variable that's only available in archive post-actions scripts[![enter image description here](https://i.stack.imgur.com/vz0vF.png)](https://i.stack.imgur.com/vz0vF.png) **Edit:** `$ARCHIVE_PATH` returns a kind of generic path that doesn't account for the date, time, or duplicate suffixes. Use...
Assuming that you have a standard archives path on your machine, I use this python code to get me the current archive path for builds. ``` #!/usr/bin/env python # -*- coding: utf-8 -*- import os import datetime class Xcodebuild: @staticmethod def current_archive_path(): # The default archives path i...
180,164
is it possible to make `Cmd`+`Page Up` / `Page Down` shortcut performing switch tab in Terminal? At the moment I can use `Cmd`+`Shift`+`[` or `Cmd`+`Shift`+`]` shortcuts to do the thing, but this is horrible for me. I'm using external USB Keyboard and Karabiner, if that may help somehow.
2015/04/09
[ "https://apple.stackexchange.com/questions/180164", "https://apple.stackexchange.com", "https://apple.stackexchange.com/users/116242/" ]
**Update**: The answer now reassigns *Scroll to Top/Bottom* to `⌥⌘PageUp` and `⌥⌘PageDown`. This leaves *Show Previous/Next Tab* free to take over `⌘PageUp` and `⌘PageDown`. --- Assuming your OS X runs in English, you can use this one-liner: ``` defaults write com.apple.Terminal NSUserKeyEquivalents -dict-add ...
You can use `System Preferences > Keyboard > Keyboard Shortcuts > Application Shortcuts` to configure custom shortcuts for anything available in the menus of an application. Just choose the application from the list or `Other...` to select an application not in the list (or leave it at `All Applications` for every app...
24,144,713
I have an WPF mvvm application which handles shipment data, this includes breaking it down into Projects and proformas etc. However, what i'm now faced with, is needing to know in a multitude of viewmodels, which project is currently selected, which proforma and so on, as well as having access to the lists of data su...
2014/06/10
[ "https://Stackoverflow.com/questions/24144713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412240/" ]
I think that, if you're tempted to use global static objects for mutable data, it usually points to a design flaw. The central problem with using global variables is that you lose all encapsulation. This means that, as your application grows in size, it becomes impossible to think about (or test) parts of your program...
In a desktop solution where each process is a one-user-use there is no problem at all using an static class with shared data (and for many scenarios this is the "correct" way to do it), the problem comes when one process is used to serve more than one user (as an example a web page) because the data will be mixed betwe...
24,144,713
I have an WPF mvvm application which handles shipment data, this includes breaking it down into Projects and proformas etc. However, what i'm now faced with, is needing to know in a multitude of viewmodels, which project is currently selected, which proforma and so on, as well as having access to the lists of data su...
2014/06/10
[ "https://Stackoverflow.com/questions/24144713", "https://Stackoverflow.com", "https://Stackoverflow.com/users/1412240/" ]
I think that, if you're tempted to use global static objects for mutable data, it usually points to a design flaw. The central problem with using global variables is that you lose all encapsulation. This means that, as your application grows in size, it becomes impossible to think about (or test) parts of your program...
The problem with global state is that it makes it hard to write unit tests for your application. One approach to your problem that's more test-friendly would be to have a factory class that is responsible for constructing and returning the appropriate repositories for a given viewmodel.
6
Now that we have this network, I'm sure there'll be newbies coming in asking questions like, > > How do I get started with Mozilla/KDE/etc? > > > or > > How do I start contributing to project xyz? > > > I guess these questions would be very organisation specific, and would spam the network. Would these ques...
2015/06/23
[ "https://opensource.meta.stackexchange.com/questions/6", "https://opensource.meta.stackexchange.com", "https://opensource.meta.stackexchange.com/users/66/" ]
Most of these sorts of questions should (and, I think, will) be closed as **too broad**. There are a million different ways to "get started" with something and Stack Exchange is not the platform for that type of discussion.
Both of these questions *feel* like lack of research type questions. Presumably projects that want contributions from others will provide such answers on their web page/CONTRIBUTING/README/etc. I do not think we should be the switchboard for projects. If a user wants to contribute, they should be visiting the project...
6
Now that we have this network, I'm sure there'll be newbies coming in asking questions like, > > How do I get started with Mozilla/KDE/etc? > > > or > > How do I start contributing to project xyz? > > > I guess these questions would be very organisation specific, and would spam the network. Would these ques...
2015/06/23
[ "https://opensource.meta.stackexchange.com/questions/6", "https://opensource.meta.stackexchange.com", "https://opensource.meta.stackexchange.com/users/66/" ]
Both of these questions *feel* like lack of research type questions. Presumably projects that want contributions from others will provide such answers on their web page/CONTRIBUTING/README/etc. I do not think we should be the switchboard for projects. If a user wants to contribute, they should be visiting the project...
These "where do I start" sort of questions will attract opinions and most likely spam (ex. You should start with this). They will be closed for a multitude of reasons. If people want to start and get support for a project, then they should go to the project's existing contributors, or owners. If we get a bunch of "new...
6
Now that we have this network, I'm sure there'll be newbies coming in asking questions like, > > How do I get started with Mozilla/KDE/etc? > > > or > > How do I start contributing to project xyz? > > > I guess these questions would be very organisation specific, and would spam the network. Would these ques...
2015/06/23
[ "https://opensource.meta.stackexchange.com/questions/6", "https://opensource.meta.stackexchange.com", "https://opensource.meta.stackexchange.com/users/66/" ]
Most of these sorts of questions should (and, I think, will) be closed as **too broad**. There are a million different ways to "get started" with something and Stack Exchange is not the platform for that type of discussion.
These "where do I start" sort of questions will attract opinions and most likely spam (ex. You should start with this). They will be closed for a multitude of reasons. If people want to start and get support for a project, then they should go to the project's existing contributors, or owners. If we get a bunch of "new...
6
Now that we have this network, I'm sure there'll be newbies coming in asking questions like, > > How do I get started with Mozilla/KDE/etc? > > > or > > How do I start contributing to project xyz? > > > I guess these questions would be very organisation specific, and would spam the network. Would these ques...
2015/06/23
[ "https://opensource.meta.stackexchange.com/questions/6", "https://opensource.meta.stackexchange.com", "https://opensource.meta.stackexchange.com/users/66/" ]
Most of these sorts of questions should (and, I think, will) be closed as **too broad**. There are a million different ways to "get started" with something and Stack Exchange is not the platform for that type of discussion.
Over at [Programmers.SE](https://softwareengineering.stackexchange.com/), we have already discussed this and covered it in great depth: * [Where to start?](https://softwareengineering.meta.stackexchange.com/q/6366/22815) * [Green fields, blue skys, and the white board - what is too broad?](https://softwareengineering....
6
Now that we have this network, I'm sure there'll be newbies coming in asking questions like, > > How do I get started with Mozilla/KDE/etc? > > > or > > How do I start contributing to project xyz? > > > I guess these questions would be very organisation specific, and would spam the network. Would these ques...
2015/06/23
[ "https://opensource.meta.stackexchange.com/questions/6", "https://opensource.meta.stackexchange.com", "https://opensource.meta.stackexchange.com/users/66/" ]
Over at [Programmers.SE](https://softwareengineering.stackexchange.com/), we have already discussed this and covered it in great depth: * [Where to start?](https://softwareengineering.meta.stackexchange.com/q/6366/22815) * [Green fields, blue skys, and the white board - what is too broad?](https://softwareengineering....
These "where do I start" sort of questions will attract opinions and most likely spam (ex. You should start with this). They will be closed for a multitude of reasons. If people want to start and get support for a project, then they should go to the project's existing contributors, or owners. If we get a bunch of "new...
60,219,143
I installed "@material-ui/core": "^4.9.2" and "@material-ui/icons": "^4.9.1". In my form i have several rows, each row has an add button and a remove button. I want the remove button to remove the row from it was clicked. It works fine with regular Button with a "-" character in it. But i want it fancy, so i replaced ...
2020/02/14
[ "https://Stackoverflow.com/questions/60219143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9976474/" ]
Props that are not cited in the documentation are inherited to their internal `<EnhancedButton />`, so you need to use a wrapper. ```js <IconButton onClick={(e) => props.onRemoveClick(e)} className="align-self-center" color="info" size="sm" disabled={props.index ...
You can see the github ussue [here](https://github.com/mui-org/material-ui/issues/16327). There is some problem with typescript definition files but we can work around it. **Solution** *I tried to solve it like in the github issue but didn't work. So this works for me.* ``` const onClick = (e: any) => { // e is ...
60,219,143
I installed "@material-ui/core": "^4.9.2" and "@material-ui/icons": "^4.9.1". In my form i have several rows, each row has an add button and a remove button. I want the remove button to remove the row from it was clicked. It works fine with regular Button with a "-" character in it. But i want it fancy, so i replaced ...
2020/02/14
[ "https://Stackoverflow.com/questions/60219143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9976474/" ]
Props that are not cited in the documentation are inherited to their internal `<EnhancedButton />`, so you need to use a wrapper. ```js <IconButton onClick={(e) => props.onRemoveClick(e)} className="align-self-center" color="info" size="sm" disabled={props.index ...
I don't know the reason but using `e.currentTarget` helped me to get the button that I wanted and not the material icon inside it. ``` onClick={(e) => { return console.log(e.currentTarget) }} ```
60,219,143
I installed "@material-ui/core": "^4.9.2" and "@material-ui/icons": "^4.9.1". In my form i have several rows, each row has an add button and a remove button. I want the remove button to remove the row from it was clicked. It works fine with regular Button with a "-" character in it. But i want it fancy, so i replaced ...
2020/02/14
[ "https://Stackoverflow.com/questions/60219143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9976474/" ]
Well you gave an idea. Since i needed an index to identify the row's button, i sended the index through a paramater on the onClick method, like this: ``` onClick={e => props.onRemoveClick(props.index)} ``` In this way i didn't need to handle the event. I also had to bind my method on the constructor: `constructor(p...
You can see the github ussue [here](https://github.com/mui-org/material-ui/issues/16327). There is some problem with typescript definition files but we can work around it. **Solution** *I tried to solve it like in the github issue but didn't work. So this works for me.* ``` const onClick = (e: any) => { // e is ...
60,219,143
I installed "@material-ui/core": "^4.9.2" and "@material-ui/icons": "^4.9.1". In my form i have several rows, each row has an add button and a remove button. I want the remove button to remove the row from it was clicked. It works fine with regular Button with a "-" character in it. But i want it fancy, so i replaced ...
2020/02/14
[ "https://Stackoverflow.com/questions/60219143", "https://Stackoverflow.com", "https://Stackoverflow.com/users/9976474/" ]
Well you gave an idea. Since i needed an index to identify the row's button, i sended the index through a paramater on the onClick method, like this: ``` onClick={e => props.onRemoveClick(props.index)} ``` In this way i didn't need to handle the event. I also had to bind my method on the constructor: `constructor(p...
I don't know the reason but using `e.currentTarget` helped me to get the button that I wanted and not the material icon inside it. ``` onClick={(e) => { return console.log(e.currentTarget) }} ```
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Yes, 127.0.0.1 should be left. IPv6 is enabled, but IPv4 is still used.
Adding anything to /etc/hosts is not necessary, but really helps, so it will be pretty useful to add both (IPv4 and IPv6) records. After all, it is not expensive in any sense (10 seconds on each won't kill you day), but you'll know this part is done completely.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Yes, 127.0.0.1 should be left. IPv6 is enabled, but IPv4 is still used.
Leave the hosts file alone. Fiddle with it and you may break something. For example, if you remove the `127.0.0.1` don't be too surprised if anything that uses `localhost` fails.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Yes, 127.0.0.1 should be left. IPv6 is enabled, but IPv4 is still used.
On my mac, I could not access localhost. When I commented out the line "::1 localhost", I was able to access localhost again.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Yes, 127.0.0.1 should be left. IPv6 is enabled, but IPv4 is still used.
You didn't mention which OS you are using. On Windows systems, the name resolution of `localhost` is handled by the system and those entries are not needed in the `hosts` file. This is even explicitly mentioned in that very same file: ``` # localhost name resolution is handled within DNS itself. # 127.0.0.1 l...
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Leave the hosts file alone. Fiddle with it and you may break something. For example, if you remove the `127.0.0.1` don't be too surprised if anything that uses `localhost` fails.
Adding anything to /etc/hosts is not necessary, but really helps, so it will be pretty useful to add both (IPv4 and IPv6) records. After all, it is not expensive in any sense (10 seconds on each won't kill you day), but you'll know this part is done completely.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Adding anything to /etc/hosts is not necessary, but really helps, so it will be pretty useful to add both (IPv4 and IPv6) records. After all, it is not expensive in any sense (10 seconds on each won't kill you day), but you'll know this part is done completely.
On my mac, I could not access localhost. When I commented out the line "::1 localhost", I was able to access localhost again.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
You didn't mention which OS you are using. On Windows systems, the name resolution of `localhost` is handled by the system and those entries are not needed in the `hosts` file. This is even explicitly mentioned in that very same file: ``` # localhost name resolution is handled within DNS itself. # 127.0.0.1 l...
Adding anything to /etc/hosts is not necessary, but really helps, so it will be pretty useful to add both (IPv4 and IPv6) records. After all, it is not expensive in any sense (10 seconds on each won't kill you day), but you'll know this part is done completely.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
Leave the hosts file alone. Fiddle with it and you may break something. For example, if you remove the `127.0.0.1` don't be too surprised if anything that uses `localhost` fails.
On my mac, I could not access localhost. When I commented out the line "::1 localhost", I was able to access localhost again.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
You didn't mention which OS you are using. On Windows systems, the name resolution of `localhost` is handled by the system and those entries are not needed in the `hosts` file. This is even explicitly mentioned in that very same file: ``` # localhost name resolution is handled within DNS itself. # 127.0.0.1 l...
Leave the hosts file alone. Fiddle with it and you may break something. For example, if you remove the `127.0.0.1` don't be too surprised if anything that uses `localhost` fails.
385,265
I am new to unmanaged VPS servers and in addition IPv6. Is it necessary to include 127.0.0.1 AND ::1 for localhost in /etc/hosts files for IPv6 enabled servers, or is ::1 alone enough?
2012/05/02
[ "https://serverfault.com/questions/385265", "https://serverfault.com", "https://serverfault.com/users/119599/" ]
You didn't mention which OS you are using. On Windows systems, the name resolution of `localhost` is handled by the system and those entries are not needed in the `hosts` file. This is even explicitly mentioned in that very same file: ``` # localhost name resolution is handled within DNS itself. # 127.0.0.1 l...
On my mac, I could not access localhost. When I commented out the line "::1 localhost", I was able to access localhost again.
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
It's pretty trivial to implement with native addon, so someone did that: <https://github.com/ErikDubbelboer/node-sleep.git>
Blocking in Node.js is not necessary, even when developing tight hardware solutions. See [temporal.js](https://github.com/rwaldron/temporal) which does not use `setTimeout` or `setInterval`setImmediate. Instead, it uses [`setImmediate`](https://developer.mozilla.org/en-US/docs/Web/API/Window/setImmediate) or `nextTick`...
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
The best solution is to create singleton controller for your LED which will queue all commands and execute them with specified delay: ``` function LedController(timeout) { this.timeout = timeout || 100; this.queue = []; this.ready = true; } LedController.prototype.send = function(cmd, callback) { sendCmdToLed...
Easiest *true sync* solution (i.e. no yield/async) I could come up with that works in all OS's without any dependencies is to call the node process to eval an in-line `setTimeout` expression: ``` const sleep = (ms) => require("child_process") .execSync(`"${process.argv[0]}" -e setTimeout(function(){},${ms})`); ``...
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
Node is asynchronous by nature, and that's what's great about it, so you really shouldn't be blocking the thread, but as this seems to be for a project controlling LED's, I'll post a workaraound anyway, even if it's not a very good one and **shouldn't be used** (seriously). A while loop will block the thread, so you c...
As the sleep package author suggests [\*](https://www.npmjs.com/package/sleep): ```js function msleep(n) { Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n); } function sleep(n) { msleep(n * 1000); } ```
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
Just use `child_process.execSync` and call the system's sleep function. ``` //import child_process module const child_process = require("child_process"); // Sleep for 5 seconds child_process.execSync("sleep 5"); // Sleep for 250 microseconds child_process.execSync("usleep 250"); // Sleep for a variable number of mic...
asynchronous call `ping` command to block current code to execution in specified milliseconds. * `ping` command is Cross-platform * `start /b` means: start program but not show window. code as below: ``` const { execSync } = require('child_process') // delay(blocking) specified milliseconds function sleep(ms) { ...
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
As the sleep package author suggests [\*](https://www.npmjs.com/package/sleep): ```js function msleep(n) { Atomics.wait(new Int32Array(new SharedArrayBuffer(4)), 0, 0, n); } function sleep(n) { msleep(n * 1000); } ```
blocking the main thread is not a good style for node because in most cases more then one person is using it. You should use settimeout/setinterval in combination with callbacks.
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
use Node sleep package. <https://www.npmjs.com/package/sleep>. in your code you can use ``` var sleep = require('sleep'); sleep.sleep(n) ``` to sleep for a specific n seconds.
blocking the main thread is not a good style for node because in most cases more then one person is using it. You should use settimeout/setinterval in combination with callbacks.
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
use Node sleep package. <https://www.npmjs.com/package/sleep>. in your code you can use ``` var sleep = require('sleep'); sleep.sleep(n) ``` to sleep for a specific n seconds.
I found something almost working here [https://stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-ja vascript](https://stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-ja%20vascript) ``` function AnticipatedSy...
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
Easiest *true sync* solution (i.e. no yield/async) I could come up with that works in all OS's without any dependencies is to call the node process to eval an in-line `setTimeout` expression: ``` const sleep = (ms) => require("child_process") .execSync(`"${process.argv[0]}" -e setTimeout(function(){},${ms})`); ``...
I found something almost working here [https://stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-ja vascript](https://stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-ja%20vascript) ``` function AnticipatedSy...
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
I found something almost working here [https://stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-ja vascript](https://stackoverflow.com/questions/21819858/how-to-wrap-async-function-calls-into-a-sync-function-in-node-js-or-ja%20vascript) ``` function AnticipatedSy...
You can simply use `yield` feature introduced in ECMA6 and `gen-run` library: ``` let run = require('gen-run'); function sleep(time) { return function (callback) { setTimeout(function(){ console.log(time); callback(); }, time); } } run(function*(){ console.log("bef...
20,967,006
I'm currently trying to learn nodejs and a small project I'm working is writing an API to control some networked LED lights. The microprocessor controlling the LEDs has a processing delay, and I need to space commands sent to the micro at least 100ms apart. In C# I'm used to just calling Thread.Sleep(time), but I have...
2014/01/07
[ "https://Stackoverflow.com/questions/20967006", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3168265/" ]
You can simply use `yield` feature introduced in ECMA6 and `gen-run` library: ``` let run = require('gen-run'); function sleep(time) { return function (callback) { setTimeout(function(){ console.log(time); callback(); }, time); } } run(function*(){ console.log("bef...
blocking the main thread is not a good style for node because in most cases more then one person is using it. You should use settimeout/setinterval in combination with callbacks.
128,867
I'm implementing normal mapping and was trying different techniques of doing that. All seemed not to give me a correct result (e.g. the normals point in weird directions). To find the problem, I broke everything down to the simplest possible solution, but I cant find the problem. Here is a picture of my scene outputt...
2016/08/24
[ "https://gamedev.stackexchange.com/questions/128867", "https://gamedev.stackexchange.com", "https://gamedev.stackexchange.com/users/33820/" ]
Found the problem. The TBN apparently needs to be constructed as the following: `mat3(worldspaceNormal, biTangent, tangent);`. So tangent and normal need to be flipped. Don't know why, maybe a Vulkan thing.
The normal matrix should be the transpose inverse of the modelview matrix. You can't simply multiply with model-matrix. Hope this clears your problem.
39,595,654
I am trying to run a parameterized test in testNg using dataProvider. But somehow it is always ignoring that test case. Below is the reference code: ``` @DataProvider(name = "test") public Object[][] testDP() throws Exception { Object[][] arrayObject = getExcelData("TestData.xlsx", "TestData", "testName"); re...
2016/09/20
[ "https://Stackoverflow.com/questions/39595654", "https://Stackoverflow.com", "https://Stackoverflow.com/users/3837952/" ]
Since Django 1.10: `myfield = Foo._meta.get_field('bar_field').get_default()` see here (not explained in the Docs apparently...) : [https://github.com/django/django/blob/master/django/db/models/fields/**init**.py#L2301](https://github.com/django/django/blob/master/django/db/models/fields/__init__.py#L2301)
``` myfield = Foo._meta.get_field_by_name('bar_field') ``` and the default is just an attribute of the field: ``` myfield.default ```
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
Let's say S1 has the list {a,b} and say S2 has {a,c}. S1: {a,b}, {c,d}, {e,f}, {g,h} - one of these is my list. S2: {a,c}, {b,d}, {e,g}, {f,h} - one of these is mine. Now both S1,S2 know their sets are inside {a,b,c,d}, whereas because of symmetry, it could be {e,f,g,h} or {a,b,c,d} as far as eavesdroppers are conc...
Revised Solution: > > Denote suspects $S\_A, S\_B, S\_C$ where $S\_C$ is the culprit. Then Sheriff 1 has suspect set $(S\_A, S\_C)$ and Sheriff 2 has suspect set $(S\_B, S\_C)$. Sheriff 1 goes on the phone and says one of his suspects. Let us consider each of the cases: a. Sheriff 1 says $S\_A$, so therefore Sheriff ...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
In actual conversation: Suspects: 1 2 3 4 5 6 7 8 Sheriff A has 1 2 Sheriff B has 1 5 (Phone rings.) A: Bad news, someone tapped me. B: OK. Group suspects into 4 pairs with one pair being your shortlist A: 12 34 56 78 B: Is it either 12 or 34? A: Yes B: (so culprit is 1) culprit is either 1 or 3 A: (so culpr...
> > they number the suspects in binary, then each officer tells the other which digit he needs to incriminate the right suspect. the other officer can either give him that digit right away if he has it, or request a digit himself. > > > example officer A has 011 101 officer B has 000 011 officer A...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
I think it's pretty obvious. > > They discuss a meeting place on the phone and then talk about it in person. > > > ;) --- Alternatively, > > one sheriff reads his two suspects' names. The other sheriff says nothing and goes to arrest the culprit. > > >
I'm finding one small issue with mine (in the worst case scenario), so hopefully this will help someone else. > > One sheriff reads names **NOT** on his list ("I know it isn't \_\_\_\_) until he reads a name on the second sheriff's list. We know the first sheriff will have to say some name he knows it isn't that the...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
Let's say S1 has the list {a,b} and say S2 has {a,c}. S1: {a,b}, {c,d}, {e,f}, {g,h} - one of these is my list. S2: {a,c}, {b,d}, {e,g}, {f,h} - one of these is mine. Now both S1,S2 know their sets are inside {a,b,c,d}, whereas because of symmetry, it could be {e,f,g,h} or {a,b,c,d} as far as eavesdroppers are conc...
The crude answer to this is that they manually perform a [Diffie-Hellman key exchange](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) over the phone. Then they can just encrypt their lists with [AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) with the key, and speak it. Surely this...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
I think it's pretty obvious. > > They discuss a meeting place on the phone and then talk about it in person. > > > ;) --- Alternatively, > > one sheriff reads his two suspects' names. The other sheriff says nothing and goes to arrest the culprit. > > >
Revised Solution: > > Denote suspects $S\_A, S\_B, S\_C$ where $S\_C$ is the culprit. Then Sheriff 1 has suspect set $(S\_A, S\_C)$ and Sheriff 2 has suspect set $(S\_B, S\_C)$. Sheriff 1 goes on the phone and says one of his suspects. Let us consider each of the cases: a. Sheriff 1 says $S\_A$, so therefore Sheriff ...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
I think it's pretty obvious. > > They discuss a meeting place on the phone and then talk about it in person. > > > ;) --- Alternatively, > > one sheriff reads his two suspects' names. The other sheriff says nothing and goes to arrest the culprit. > > >
The crude answer to this is that they manually perform a [Diffie-Hellman key exchange](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) over the phone. Then they can just encrypt their lists with [AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) with the key, and speak it. Surely this...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
I think it's pretty obvious. > > They discuss a meeting place on the phone and then talk about it in person. > > > ;) --- Alternatively, > > one sheriff reads his two suspects' names. The other sheriff says nothing and goes to arrest the culprit. > > >
> > They each encrypt their list with the other sheriff's RSA public key. They then read the encrypted string over the phone to the other, and each sheriff then decrypts the other's list using his own private key :). > > > It's going to be a long phone call. I haven't taken computer security in a while so I hope ...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
Let's say S1 has the list {a,b} and say S2 has {a,c}. S1: {a,b}, {c,d}, {e,f}, {g,h} - one of these is my list. S2: {a,c}, {b,d}, {e,g}, {f,h} - one of these is mine. Now both S1,S2 know their sets are inside {a,b,c,d}, whereas because of symmetry, it could be {e,f,g,h} or {a,b,c,d} as far as eavesdroppers are conc...
> > They each encrypt their list with the other sheriff's RSA public key. They then read the encrypted string over the phone to the other, and each sheriff then decrypts the other's list using his own private key :). > > > It's going to be a long phone call. I haven't taken computer security in a while so I hope ...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
In actual conversation: Suspects: 1 2 3 4 5 6 7 8 Sheriff A has 1 2 Sheriff B has 1 5 (Phone rings.) A: Bad news, someone tapped me. B: OK. Group suspects into 4 pairs with one pair being your shortlist A: 12 34 56 78 B: Is it either 12 or 34? A: Yes B: (so culprit is 1) culprit is either 1 or 3 A: (so culpr...
Revised Solution: > > Denote suspects $S\_A, S\_B, S\_C$ where $S\_C$ is the culprit. Then Sheriff 1 has suspect set $(S\_A, S\_C)$ and Sheriff 2 has suspect set $(S\_B, S\_C)$. Sheriff 1 goes on the phone and says one of his suspects. Let us consider each of the cases: a. Sheriff 1 says $S\_A$, so therefore Sheriff ...
11,267
Two sheriffs are working on a case to find one culprit. There were initially 8 suspects; through independent work, each sheriff has narrowed this down to a list of 2. Because they are good sheriffs, they can be sure that both of their lists contain the culprit. They plan to make a phone call tonight to see if they can ...
2015/03/30
[ "https://puzzling.stackexchange.com/questions/11267", "https://puzzling.stackexchange.com", "https://puzzling.stackexchange.com/users/10615/" ]
In actual conversation: Suspects: 1 2 3 4 5 6 7 8 Sheriff A has 1 2 Sheriff B has 1 5 (Phone rings.) A: Bad news, someone tapped me. B: OK. Group suspects into 4 pairs with one pair being your shortlist A: 12 34 56 78 B: Is it either 12 or 34? A: Yes B: (so culprit is 1) culprit is either 1 or 3 A: (so culpr...
The crude answer to this is that they manually perform a [Diffie-Hellman key exchange](http://en.wikipedia.org/wiki/Diffie%E2%80%93Hellman_key_exchange) over the phone. Then they can just encrypt their lists with [AES](http://en.wikipedia.org/wiki/Advanced_Encryption_Standard) with the key, and speak it. Surely this...
177,391
In normal job-hunting, it's acceptable to apply for jobs "informationally", to learn about new opportunities before deciding whether the new opportunity is better than your current. Suppose I'm a published MS-level researcher in industry, but have gotten interested in certain research projects in academia and see PhD ...
2021/10/31
[ "https://academia.stackexchange.com/questions/177391", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/129176/" ]
In my view, it's completely different to apply intending to find a position but not find the right fit than it is to apply "explorationally" to gather information without intending to follow through during the current admissions cycle. And I don't think that's unique to grad school/academia, it's rude to waste any inte...
For better or worse, there are some major differences between applying to PhD programs and applying for industry jobs, that mean that treating an application for a PhD spot like an application for a job probably won't work. For one thing, in the US normally you are applying to a graduate program, rather than a specifi...
177,391
In normal job-hunting, it's acceptable to apply for jobs "informationally", to learn about new opportunities before deciding whether the new opportunity is better than your current. Suppose I'm a published MS-level researcher in industry, but have gotten interested in certain research projects in academia and see PhD ...
2021/10/31
[ "https://academia.stackexchange.com/questions/177391", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/129176/" ]
In my view, it's completely different to apply intending to find a position but not find the right fit than it is to apply "explorationally" to gather information without intending to follow through during the current admissions cycle. And I don't think that's unique to grad school/academia, it's rude to waste any inte...
PhD programs will happily continue accepting your application fees. It is your life and your money. If you were not serious about doing PhD study, then the money budgeted to such fees could be better spent on such things as a vacation, dinner at a fancy restaurant, etc. If you really have nothing better to spend your ...
177,391
In normal job-hunting, it's acceptable to apply for jobs "informationally", to learn about new opportunities before deciding whether the new opportunity is better than your current. Suppose I'm a published MS-level researcher in industry, but have gotten interested in certain research projects in academia and see PhD ...
2021/10/31
[ "https://academia.stackexchange.com/questions/177391", "https://academia.stackexchange.com", "https://academia.stackexchange.com/users/129176/" ]
For better or worse, there are some major differences between applying to PhD programs and applying for industry jobs, that mean that treating an application for a PhD spot like an application for a job probably won't work. For one thing, in the US normally you are applying to a graduate program, rather than a specifi...
PhD programs will happily continue accepting your application fees. It is your life and your money. If you were not serious about doing PhD study, then the money budgeted to such fees could be better spent on such things as a vacation, dinner at a fancy restaurant, etc. If you really have nothing better to spend your ...
30,527
Is it possible to connect several networks into one? I have read articles about site to site configuration through IPsec. But I haven't seen any articles which explain if it possible to connect 3 or more networks into one.
2016/05/18
[ "https://networkengineering.stackexchange.com/questions/30527", "https://networkengineering.stackexchange.com", "https://networkengineering.stackexchange.com/users/25480/" ]
> > As I understand a packet will be traversing the FORWARD chain only if it is not intended for the local host. > > > Correct. > > The clarification I have is how will the matching condition of -o $EXTIF be satisfied for any packets. I understand that -i $INTIF will be satisfied as it is the entry interface for...
-o $EXTIF will be satisfied because it is your egress interface for everything except your LAN. In other words the Internet. So as your LAN tries to reach some site on the Internet, it will traverse $INTIF and exit $EXTIF.
9,705,838
I am trying to find out if a user viewing my site is a mobile user. I have used "HttpContext.Current.Request.Browser.IsMobileDevice " and found it pretty useless as it didn't not pick up on my usage when viewing the site on my phone. Is there another way to find out if the user is a mobile user that works better? I h...
2012/03/14
[ "https://Stackoverflow.com/questions/9705838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/545877/" ]
Try to test with this code.... ``` string sUA = Request.UserAgent.Trim().ToLower(); uaString.InnerText = Request.UserAgent; if (sUA.Contains("ipod") || sUA.Contains("iphone")) isMobile = true; if (sUA.Contains("android")) isMobile = true; if (sUA.Contains("opera mobi")) ...
Check out [51degrees](http://51degrees.codeplex.com/) > > It’s provided as a .NET open source class library that detects mobile > devices and browsers, enhancing the information available to .NET > programmers. Using 51Degrees.mobi Device Data, accurate screen sizes, > input methods, plus manufacturer and model ...
9,705,838
I am trying to find out if a user viewing my site is a mobile user. I have used "HttpContext.Current.Request.Browser.IsMobileDevice " and found it pretty useless as it didn't not pick up on my usage when viewing the site on my phone. Is there another way to find out if the user is a mobile user that works better? I h...
2012/03/14
[ "https://Stackoverflow.com/questions/9705838", "https://Stackoverflow.com", "https://Stackoverflow.com/users/545877/" ]
Try to test with this code.... ``` string sUA = Request.UserAgent.Trim().ToLower(); uaString.InnerText = Request.UserAgent; if (sUA.Contains("ipod") || sUA.Contains("iphone")) isMobile = true; if (sUA.Contains("android")) isMobile = true; if (sUA.Contains("opera mobi")) ...
See my comment on your question for a more thorough answer, but for a simple check to see if the user is a mobile user I would personally suggest <http://detectmobilebrowsers.com/>
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
Icsn (and Ics-ssl) components at : <http://www.overbyte.be/frame_index.html>
SMTP is so trivial protocol (unless you use SASL or other exotic authentication methods) that any component would work. Of course, I would recommend our [SecureBlackbox](http://www.eldos.com/sbb/) product. Freeware libraries such as Indy, ICS, Synapse to get SSL have bindings to OpenSSL DLL and also to SecureBlackbox (...
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
Icsn (and Ics-ssl) components at : <http://www.overbyte.be/frame_index.html>
I've used IP\*Works SMTP component before. I didn't do anything involved with them, I used them to send an email with error information basically. I have never used the SSL version either. I don't believe you can purchase the components individually either. <http://nsoftware.com/ipworks/components.aspx>
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
Icsn (and Ics-ssl) components at : <http://www.overbyte.be/frame_index.html>
I use [Synapse](http://synapse.ararat.cz/doku.php) library. It works very well with SSL/TLS. There is public wiki with information on "[How To Use SMTP with TLS](http://synapse.ararat.cz/doku.php/public:howto:smtpsend)". It works with Delphi (I use Turbo that is based on 2006) and FPC. It is "normal" library, not compo...
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
I've used IP\*Works SMTP component before. I didn't do anything involved with them, I used them to send an email with error information basically. I have never used the SSL version either. I don't believe you can purchase the components individually either. <http://nsoftware.com/ipworks/components.aspx>
SMTP is so trivial protocol (unless you use SASL or other exotic authentication methods) that any component would work. Of course, I would recommend our [SecureBlackbox](http://www.eldos.com/sbb/) product. Freeware libraries such as Indy, ICS, Synapse to get SSL have bindings to OpenSSL DLL and also to SecureBlackbox (...
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
Indy 10's SMTP component supports SSL. What problems are you having with it?
SMTP is so trivial protocol (unless you use SASL or other exotic authentication methods) that any component would work. Of course, I would recommend our [SecureBlackbox](http://www.eldos.com/sbb/) product. Freeware libraries such as Indy, ICS, Synapse to get SSL have bindings to OpenSSL DLL and also to SecureBlackbox (...
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
I use [Synapse](http://synapse.ararat.cz/doku.php) library. It works very well with SSL/TLS. There is public wiki with information on "[How To Use SMTP with TLS](http://synapse.ararat.cz/doku.php/public:howto:smtpsend)". It works with Delphi (I use Turbo that is based on 2006) and FPC. It is "normal" library, not compo...
SMTP is so trivial protocol (unless you use SASL or other exotic authentication methods) that any component would work. Of course, I would recommend our [SecureBlackbox](http://www.eldos.com/sbb/) product. Freeware libraries such as Indy, ICS, Synapse to get SSL have bindings to OpenSSL DLL and also to SecureBlackbox (...
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
Indy 10's SMTP component supports SSL. What problems are you having with it?
I've used IP\*Works SMTP component before. I didn't do anything involved with them, I used them to send an email with error information basically. I have never used the SSL version either. I don't believe you can purchase the components individually either. <http://nsoftware.com/ipworks/components.aspx>
3,761,614
Indy is not enough for me, it must support SSL and be rock solid, can be commercial also
2010/09/21
[ "https://Stackoverflow.com/questions/3761614", "https://Stackoverflow.com", "https://Stackoverflow.com/users/454095/" ]
Indy 10's SMTP component supports SSL. What problems are you having with it?
I use [Synapse](http://synapse.ararat.cz/doku.php) library. It works very well with SSL/TLS. There is public wiki with information on "[How To Use SMTP with TLS](http://synapse.ararat.cz/doku.php/public:howto:smtpsend)". It works with Delphi (I use Turbo that is based on 2006) and FPC. It is "normal" library, not compo...