SQLITE Blob OR file system for images

Question: I am building an application based on a single table with a column with text. Occassionally, an adjacent column will have an image. Is it better to store this image as a BLOB in SQLITE or should I store them on the file system and reference them from my programs.
Thanks!
Comment: Just for clarification - this is for an iPhone app, correct?
Answer: Files will cause you fewer problems in the long run.  You really don't want to be serving tons of files from your database server especially as you scale
Comment: Files will make it easier to load the images efficiently. If you use [UIImage imageNamed:@"blah.png"] it will load the image into purgable RAM and load/unload it from the file as needed(i.e. when it's no longer viewable and you are tight on memory it is purged and then reloaded when it is viewable again)
Answer: Assuming the images you are going to use are not extremely large and there is not an exorbitant number of them I would go with the database.
I am currently using a Sqlite database on several different Windows Mobile and WinCE devices with over 10,000 small images stored as blobs and it is working great.
I have seen software similar to ours running on the same hardware using file based image loading and it was significantly slower. Of course this was on WinCE and different software, so that is not the best test.
I find the single database is much easier to work with than many image files.
Answer: EDIT:
Didnt realize you meant for the iPhone environment specifically.  In that case I would use the DB just for the simplicity of having all content in one place.  You wont have to worry about scalability because its not like your iphone is going to be used as a server or anything.
Original Response:
I dont have any links to back this up, but I do recall reading in several studies that the "cut off" is 1 MB for blob efficiency.  But this can moved up to 10 MB with a fast enough disk array.  Totally depends on the system.
So basically, given your efficiency cutoff, any data smaller than that would better be served by the DB, anything larger, just index in the DB and leave in a file cache.
Comment: He's using iphone, so the disk itself is not upgradable.
Answer: I like to keep images in the file system because UIImage can cache image files & dump them from memory automatically when necessary. Just be careful not to change or delete an image file that is loaded into a UIImage or you will get crashing or other weird bugs.
Answer: It really depends on your application. Having the images stored in a database will make your life easier as you have them readily accessible in a single point instead of having them in separate files that might gone missing. On the other hand, many images, that are rather large, might prove too much for a SQLITE database. In your situation I would just reference them in the database.

SQLITE Blob OR file system for images


My usually very quiet and calm cat started biting me?

Question: My cat NEVER has bitten me in the nearly 10 years I have had him but today he got very angry and starting batting at me, biting and meowing (which he also rarely does). He is an outside/inside cat, maybe that has something to do with it? Should I call the vet ASAP?
Comment: Two thoughts... 1. If this is a single event, something may have startled your cat and it has responded with its behaviour towards you, because as far as he is concerned, you are the only source of the scare. 2. If this is a multiple event perhaps certain functions are not as good as they once were and he might be in pain or suffer loss of sense (for example loss of hearing), so yes, call the vet to discuss.
Answer: Several possibilities here, starting from non-fixable.

If the cat lives alone (meaning no appropriate feline companion)

It is possible that this is a sign of the longterm mental health issues that cats in solitary can develop. This would mean you basically can't do anything about it at this point except reap what was sown as he might be too old for proper socialisation.

He might just be bored

Its cold outside this time of year, does he still run around for hours out there? If he is understimulated, he might be attempting to play with you - which, unfortunately for us humans, hurts us because of the lack of any protective fur. Don't punish him in case you do, play more with him (but appropriately for both of you this time :D). Let him run after a toy on a stick or whatnot, clicker training also helps if he is mentally understimulated.

Not an easy fix, but fixable. He might be sick.

Especially if he reacts like this when you touch him, but even if thats not the case, he is starting to go over that middle-age hump and thats when some diseases can show up. And if he is in pain, of course he will be grumpy. Definitely get a blood panel and x-ray done (checking for infections, his organs, athritis, spondylosis and the like), but I also would get his teeth checked. Not just the outside, but tell the vet that you want him checked for Feline Tooth Resorption (or just TR, or feline odontoclastic resorption lesion (FORL)) as it's really painful and can in many cases only be diagnosed by x-raying individual teeth.
That should give the vet a good diagnostic overview to see whether or not he is phsysically in pain
Comment: All good possible answers from psyc. Anecdotally, I rescued my now nine year old cat when he was abandoned by his feral mother at 3 weeks. Every once in a while when he's been indoors for an extended period of time, he attacks me without provocation. Lunges at me and grabs on, teeth and all. I attribute his actions to being bored, wanting to go outside and inadequate time for proper socialization with his litter mates. Dint have mom around long enough to "discipline" his behavior. Just my take.


Track users based on certain credentials

Question: I would like to track user activity based on some of the details that they provided. Eg. internal sites that they have visited, number of logged in times, amount of time that they have spent of different sites. May I know how this can be done with the experience profile?
Answer: Sitecore Experience Profile allows you to monitor the behaviour of users that have interacted with your Sitecore website(s). All the marketing data associated with a user like visited pages, triggered goals, time spent on each page, total interaction duration etc. is being held in a Contact business entity and stored in Sitecore xDB. Contacts can be of two types - Anonymous and Known. Unlike the Anonymous Contacts that have no any registered identifiers the Known Contacts have registered identifiers such username, email or other unique Id.
If there is a requirement to extend the standard Contact model with specific data properties (for example, site specific user fields / properties) you can easily create a custom Facet - a Contact attribute, read more about how to create and set custom facets for contacts.
The Sitecore's Tracker is responsible for recording all contact's activity during a web session, then on the session end event the captured analytical data is being converted into an xConnect interaction and submitted to xConnect through the xConnect Client API. Read more about tracking contacts here.
By default, if you do not configure any experience marketing functionality, you will only see general information about Contacts, such as the external keywords used and general session information. Read more here about how to preconfigure Sitecore for the Experience Profile.
To extend the tracking functionality you can trigger the built-in events such as goals, page visits, outcomes etc. or create a custom event and capture custom data with the help of the Tracker and xConnect.


Why did only Boeing choose to use 4-engines on the B-17?

Question: The USAAC announced a competition in 1934 for a new multi-engined bomber with the requirement that it carry ~2000 lbs of bombs 2000+ miles at 200+ mph (with 250 mph preferred). The three entrants to the competition were famously the Douglas B-18, the Martin 186, and the Boeing Model 299, which would go on to become the B-17. The core difference in design taken by Boeing relative to the other two competitors came in the choice of the number of engines and thus the possible size of the aircraft that could be designed. Boeing decided to use 4 engines, allowing them to design a much larger aircraft that had higher range and bombload than the competing designs. Why did Douglas and Martin choose not to design 4-engined bombers for this competition?
Comment: According to Wikipedia "*while the Boeing design was clearly superior, its four engines eliminated it from consideration and the crash of the prototype put its purchase on hold*". Apparently Boeing built a prototype that was not in line with the requirements (it was twice as big as the other two!), basically betting that at a certain point during the war the Army would have needed it. Their bet was right.
Comment: Is your question "Why did Boeing choose to use 4-engines on the B-17?" or "Why did Douglas and Martin choose not to design 4-engined bombers for this competition?". They don't seem like the same question at all.
Comment: Both questions. I think they are intertwined. Clearly the Boeing and Douglas engineers made a different technical choice and I think the question is understanding why each group made the choice they did. So understanding both the thoughts of the Boeing engineers and Douglas engineers is valuable.
Answer: Martin actually did have a competing design, the twin boom XB-16 that went along with the Boeing XB-15 submitted for another USAAF requirement to travel 5000 miles.
Douglas, after their enormously successful DC-3, also had a 4 engine DC-4E airliner on the drawing board.
But Boeing was simply in the right place at the right time with proven experience that resulted in designs such as the 314 Clipper and not only the B-17 bomber, but also the 307 Stratoliner.
As it turned out, even though the Martin and Douglas designs were light years ahead of designs from the previous decade and as fast as contemporary fighters of the early 1930s, the decision to adopt the larger 4 engine Boeing aircraft as "heavy bombers" paid off in better defensive capability, larger payload, and longer range.
The two engine designs lived on as "medium bombers" better suited for shorter range tactical support missions.
Comment: @quietflyer try [this](https://www.militaryfactory.com/aircraft/detail.php?aircraft_id=1582) one.


How to define a throttle profile for PWM driven DC motor on a power wheels

Question: I am building an arduino to output PWM to a simple low side MOSFET motor driver that's powering two DC motors on a power wheels Corvette. I will have a throttle input signal between 0 and 100%, but I believe the output PWM needs to be more complex to account for starting torque and minimum voltage for the motor. Do most drive profiles start with a short pulse of 100% power to break the starting torque before pulling back to match the throttle percentage? Where can I find more information on how to define a throttle profile?
Answer: It depends on how fancy you want to get.
It's common in industrial usage (and model trains) to pulse the voltage to a motor (or the current, depending on what your driver controls).
The explanation gets complicated when you're PWM-ing a motor.  Normally when you drive a motor with PWM, you're driving it fast enough so that the motor smooths the current.  This is a good thing, because it makes for efficient operation.
To break friction, you need to pulse the drive to the motor such that the motor generates enough torque to break the friction, and for long enough so that the motor can actually move significantly.  Done right, you'll hear a buzz and see your mechanism advance at an almost arbitrarily slow crawl.  Slower motion will give you a slower buzz; if you allow control down that slow, really slow motion will result in a ticking sound.
For a fixed intensity and on-time, you'll find that for each pulse, the motor advances by some minimum amount -- so you can't move the motor by an arbitrarily small amount.  This is just a feature of driving a mechanism with friction and one you have to live with.  The fix isn't found in the electronics or the control rule -- it's found in the mechanical construction of the motor and mechanism.  For your application, you'll probably be fine -- the amount the car will move with each "tick" will be imperceptible, so the motion will appear smooth to you.
Determining the intensity and duration of the pulse is either done with a whole lot of calculation, followed by experimentation to make sure that you were right, or just starting out with experimentation.  Since you don't have control over the mechanical design, I suggest just starting with experimentation.  Find the amount of drive that'll just barely start the motor moving -- then double it, to account for wear, tear, and changing temperatures.  Then find the pulse duration that gives you acceptable low-speed behavior.
I throttle such drives by starting out varying the period of the "slow buzz" -- remember that you're keeping a fixed on time, so you vary the off time to get different speeds.  Once your throttle is at the height of your pulse (i.e. 25% throttle for a 25% pulse), then just drive the motor "normally" from there to 100% throttle.
Then stop messing with it, because this is something that you can get lost in for weeks trying to chase some optimum that only you can see (I've been there, done that -- write "you can't make a silk purse out of a sow's ear" on the wall, and figure that once you're in the neighborhood of "good", chasing "best" is just a waste of time).
Comment: Thanks for the very practical answer! Agree on not trying to chase perfect for this project.
Answer:
Do most drive profiles start with a short pulse of 100% power to break the starting torque before pulling back to match the throttle percentage?

Not to my knowledge.
If under automated control there is feedback to compensate so no need to explicitly set that.
If manually controlled, you just use your eyes and human intuition. But you may want to simply disallow an arbitrarily low non-zero throttle which will help prevent the user stalling or overheating the motor from low power which will also have the effect of a setting a minimum starting torque. You may also cutoff the throttle below some battery voltage.
Comment: Actually, if you're driving a mechanism with significant friction, it's not uncommon for low-speed operation to be accomplished with short, high-intensity pulses for exactly the reason the OP states.  Search on "driving motors with friction" and see if it comes up with useful hits.
Comment: @TimWescott I see...
Answer: One approach to this problem is to use feedback with a PI or PID controller. The throttle gives a speed command. That command is compared with the actual speed to give an error signal. That error signal is integrated (the I in PI or PID, and the integral is added to the original (Proportional) error signal, which is then used to control the pulse width modulation.
With a setup as described above, if the motor does not start immediately, the integral error signal will grow until the motor does start. It is similar to your idea of having an initial high duty cycle signal, but it is adaptive, and adjusts to circumstances.
Comment: That can lead to oscillations when there's motor friction.  They usually cause more error than the method of bumping the motor with a predetermined pulse.  So you want a "bump the motor at slow speeds" inner loop, then wrap that with a PI controller.
Answer: There is no simple answer, a real system consists of layers:

Current control (you may skip it, but in a real system it's important)
Speed control - may be useful for autonomous systems, like cruise control in your vehicle.
Speed profiler - the one that defines acceleration, i think this is what you refer to.
advanced algorithms- things that do weird stuff like open loop corrections or automatic gain calibration, etc.

So for me the takeaway would be that it's pretty complex to simply drive PWM, but i would start with speed profiler: decide every X msec what speed do you want to have at this point.
This is pretty easy- if you have a timer, inside the interrupt simply add a constant speed each time (it's acceleration) until you reach your cruise speed.
What do you do about it then? You either convert it straight to PWM (rough, but will do for the beginning) or build a velocity control loop. Current loop would be next.
I hope it helps.


IE8 Document mode not being set correctly

Question: I have a website, where IIS sends the following in the header (which is correct for the overall site):
 X-UA-Compatible: IE=Edge

However, on a specific page, I have at the very top of my  section the following:

This is being interpreted correctly by IE8, as it shows up at the top of the  when I view the page source. However, it never changes my Document Mode from "IE8 Standards" to "IE7 Standards." The Browser Mode is in IE8 Compatibility View by default(it's an intranet site), but even in normal IE8 mode, it still has the same Document Mode issues.
I thought that having the meta tag on the page overrides whatever was sent in the initial header from the server. Is there anything else I could be doing to change the document mode for this one page?
EDIT: I can force IE7 document mode if I place the following in my Page_Load of my aspx page Response.AddHeader("X-UA-Compatible", "IE=7"); so I now have this header show up after the IE=Edge header, so only this second one is interpreted. This doesn't actually solve my issue though, because the meta tag above has the advantage of not being used in IE9 or IE10, and some of the niceties of the page disappear when forcing to IE7 document mode. I just specifically need this to work for IE8 and older.
Also, if I remove the conditional CSS, it appears to get the document mode correct. So is it possible that conditional CSS executes after the page loads, and if so, how do I fix it to make IE7 document mode only show up for IE8 and earlier browsers?
Answer: Are you sure you have the order correct?  I just tried this page that I found HERE and my browser defaults to "IE7 standards".

  <title>My webpage</title>

Content goes here.

Comment: I'm fairly sure the order is correct. The very first line I use in the html head section is for the meta tag. It just simply ignores it and goes with the one provided by IIS in the http headers instead.


Do I really need to include a wall switched lighting outlet in every room?

Question: According to the Black & Decker Wiring book, the NEC indicates that each room should include at least one "switch-operated lighting outlet". Is that true even in rooms that have overhead lighting, or does that count as the "outlet"?
Comment: @PeterCordes The title was edited to conflict with the question.
Comment: Think they are using 'outlet' as something you plug or screw a light in, but wait for the experts.  I would have like them using 'device' instead, if saving words.
Comment: Your question title asks about switches, but the question text is asking about the lights they control.  I've seen bathrooms where the light switch (controlling the bathroom light) is in the hall outside (east coast of Canada, specifically in Moncton, NB for the specific example I've seen, IIRC).  (So you can prank someone while they're using the bathroom by switching it off for a few seconds.)  Anyway, those are two separate questions, so probably best to change the title to match the question that answers are answering.
Comment: The confusion here is kind of *the point*. OP doesn't know what the word "outlet" means and the answers explain that. It *should* be clear from the title, optimized for SEO, and the body, optimized for OP's question, conflicting, that this is the case (especially after one reads the answer). There isn't any issue with having the title ask about light switches, but I'm OK with it also including the term "outlet", even if it is redundant.
Comment: Can a @moderator revert the title to match the question? As it is, the title makes the question confusing.
Comment: I guess that means a *wall-mounted* switch - but can't find reference to that. Lots of standard lamps will have their own *light switch*.
Answer: TLDR: an overhead light is a fine "outlet" here.
I think the issue is NEC definition of outlet vs receptacle

Outlet. A point on the wiring system at which current is taken to
supply utilization equipment.

Receptacle. A contact device installed at the outlet for the
connection of an attachment plug, or for the direct connection of
electrical utilization equipment designed to mate with the
corresponding contact device. A single receptacle is a single contact
device with no other contact device on the same yoke. A multiple
receptacle is two or more contact devices on the same yoke.

The NEC requirement for lighting is:

210.70(A)(1) Habitable Rooms. At least one wall switch–controlled lighting outlet shall be installed in every habitable room, kitchen,
and bathroom.

You need an outlet, which can be a hard wired fixture, or could but not necessarily be a receptacle.
(Quotes 2017 NEC)
Comment: Requiements for lighting are not limited to habitable rooms, there are additional requirements that follow the quoted section for hallways, garages, crawlspaces, and more.
Comment: I took the liberty of adding a TLDR. Feel free to modify or revert to suit.
Answer: A "lighting outlet" in NEC terms (or possibly black&decker rewording, or old NEC language that may have been updated since that book) includes an overhead light.
Answer: Each entrance to a room needs a switch that can operate a light. It can be by an wired overhead junction box in the ceiling or a switched duplex outlet.
Comment: Most ridiculous example of this I've seen is the laundry room in my house - it's a room just large enough for a stacked washer/dryer and a refrigerator, with doors to the kitchen and the garage.  Since these are both "entrances", each needs a switch, but they're close enough to each other that you can stand in the middle of the room and touch both of them at once without even stretching...
Comment: @DarrelHoffman but they want you to get to the middle of the room safely.. :-)
Comment: @FreeMan  Yes, and sure enough you'd find an inspector that would flag it.
Comment: Just as an experiment I tried: I can reach the kitchen switch from inside the garage and vice versa.  Don't even need to get to the middle of the room.  (I'm not exaggerating when I say you can reach everything in this room without taking a step - I've seen larger phone booths...)
Comment: @DarrelHoffman seems that one switch, half-way between the two doors, would be the perfect solution. That nugget of common sense, however, is probably not allowed by code since the switch would be too far from either door...


Saving Python Complex Data Types to Amazon S3

Question: Can Python class data be saved to S3 without marshalling? I am trying to cut down of I/O operations until necessary.
Answer: Amazon S3 stores plain data files. Even if there's a library that makes it look like objects are being saved, it's going to do marshalling in the background. Might as well just pickle your objects by yourself.


Glare node issue

Question:
I have been experiencing strange glitches with the Glare node in the compositor. Frankly, I cannot quite figure out what causes it, since it seems to depend on randomness—frame, camera distance, the day of the week. I think that it is a glitch, but figured I would post an example here anyway in the off chance it is not.
Help would be appreciated, if possible.
Comment: Have you looked at the raw render's pixel values?
Answer: I have the exact same issue just on 1 frame. I solved it by changing the node quality from High to Medium.
Edit: happened on more frames and in different ways. Just solve it the Blender way, crank up those samples!
Comment: Ugh, the same thing happened to me like a month ago, so I wish I found this before spending 4 hours figuring it out!

Glare node issue


haproxy & complex redirects: am I missing anything?

Question: I have a complex Apache config that mostly just does ProxyPassReverse, and that seems pretty silly so I've been converting it to haproxy.  Mostly this has led to things being much, much simpler and clearer; yay.  The exception is complex RewriteRule and RedirectMatch sorts of things.  In particular, I have these:
RewriteRule ^(?:/l?mw)+/(.*\.php.*)$ https://mw-live.lojban.org/$1 [R=301,L]
RewriteRule ^(?:/l?mw)+/(.*)$ https://mw-live.lojban.org/papri/$1 [R=301,L]

The intent here is to redirect requests to, for example, /lmw/mw/lmw/foo.php to /foo.php, and /mw/lmw/mw/MyPage with /papri/MyPage (yes, those URLs are weird; an old version of the site had some redirect problems).
As far as I can tell, the right way to do this is really not to do it in haproxy, and use the back-end web service itself.  I'm asking about it in case I'm missing something, but it really seems like doing this sort of thing on the back-end web service works way better than doing it in haproxy.
I'm having 2 problems with trying to do this in haproxy:

I can't find a way to get haproxy to record the redirects that it itself performs.  I've told haproxy to show me the Location response header, but that only shows redirects from the back-end server:
 capture response header Location len 128

The ways of doing this in haproxy are ... clunky.  I've found two ways that seem to work:
# Old URL formats; trim leading "/mw" and "/lmw" when the target is a php file
http-request redirect code 301 location http://%[hdr(host)]%[url,regsub(^/lmw,,g)] if { path_beg /lmw } { path_sub .php }
http-request redirect code 301 location http://%[hdr(host)]%[url,regsub(^/mw,,g)] if { path_beg /mw } { path_sub .php }
# Old URL formats; trim leading "/mw" and "/lmw"
http-request redirect code 301 location http://%[hdr(host)]/papri%[url,regsub(^/lmw,,g)] if { path_beg /lmw }
http-request redirect code 301 location http://%[hdr(host)]/papri%[url,regsub(^/mw,,g)] if { path_beg /mw }
http-request redirect code 301 location http://%[hdr(host)]/papri%[url,regsub(^/papri/lmw,,g)] if { path_beg /papri/lmw }
http-request redirect code 301 location http://%[hdr(host)]/papri%[url,regsub(^/papri/mw,,g)] if { path_beg /papri/mw }

The problem with this method, besides it being many lines long, is that it produces a series of redirects, repeatedly redirecting each URL to one with one less /mw or whatever.
The other is having this on the front end:
use_backend mw-live-back-old-with-php if { hdr_beg(host) -i mw-live. } { path_reg ^/l?mw.*\.php }
use_backend mw-live-back-old-without-php if { hdr_beg(host) -i mw-live. } { path_reg ^/l?mw }

and then these special backends to go with it:
backend mw-live-back-old-with-php
    http-request replace-path ^(?:/l?mw)+/(.*\.php.*)$ /\1
    http-request redirect prefix / code 301

backend mw-live-back-old-without-php
    http-request replace-path ^(?:/l?mw)+/(.*) /papri/\1
    http-request redirect prefix / code 301

The problem with this method is that it's also super long, but also it seems silly to create backends just for this.
The thing you'd think would work, which I stole from https://fromanegg.com/post/2014/12/05/how-to-rewrite-and-redirect-with-haproxy/ , is having these lines as part of the generic backend.
http-request replace-path ^(?:/l?mw)+/(.*\.php.*)$ /\1 if { path_reg ^/l?mw.*\.php }
http-request redirect prefix / code 301 if { path_reg ^/l?mw.*\.php }
http-request replace-path ^(?:/l?mw)+/(.*)$ /papri/\1 if { path_reg ^/l?mw }
http-request redirect prefix / code 301 if { path_reg ^/l?mw }

This fails because the redirect never fires, because by the time we get to the redirect line, the path_reg no longer matches.
So.
Am I missing something, or should I really just move this sort of complexity to the back-end web service?
Answer:
As far as I can tell, the right way to do this is really not to do it in haproxy, and use the back-end web service itself.

Bingo. There's no need to reinvent the wheel here.


Where exactly is "Search settings" under "Settings"?

Question: I want to turn off Google suggestions that came on apparently by itself after I used YouTube. So I'm instructed to go to "Settings", and choose "Search Settings"; however, I can't locate it anywhere.
Answer: This is one of those cases where a pictures says more than the words, I think

Anyway, using a desktop web browser

Go to https://www.google.com
Click on Settings
The emerging menu will show the Search Settings menu option


How can I open the file location of a running process?

Question: I can ps -x to get a list then grep the name then manually type in the process number to lsof -p to list the processes open file locations and get the cwd of the process ... whew! all this manual work. is there a way to say "go to process location" ?
Comment: cwd is not necessarily the process location - What exactly are you after? Most Apps will start with current directory of /
Answer: Not aware of such a function, yet that doesn't mean it doesn't exist.
However, I'm guessing you could simply program it into bashrc? It shouldn't be too hard to make a manual command for this..
For example by adding something like this function to your .bashrc:
function showp() {
    pid=$(ps -x | grep -i $1 | awk '{print $1}' | head -1)
    dir=$(lsof -p $pid | grep cwd | awk '{print $9}')
    cd $dir
    echo "Now arrived here: " $(pwd)
}

Then (after sourcing bashrc of course) simply type (for example): showp safari and it will output:
Now arrived here:  /


When should I use a NoSQL database instead of a relational database? Is it okay to use both on the same site?

Question: What are the advantages of using NoSQL databases? I've read a lot about them lately, but I'm still unsure why I would want to implement one, and under what circumstances I would want to use one.
Comment: As a general rule, relational databases allow you to organize data in clearly defined entities and relationships between them, avoiding redundancy. When this way of modeling data reaches limits in performance, then a NoSQL database can help. In this modeling, data is stored to serve specific queries; redundancy is added for read performance (and to the detriment of write performance and/or consistency).
Answer: Relational databases enforces ACID. So, you will have schema based transaction oriented data stores. It's proven and suitable for 99% of the real world applications. You can practically do anything with relational databases.
But, there are limitations on speed and scaling when it comes to massive high availability data stores. For example, Google and Amazon have terabytes of data stored in big data centers. Querying and inserting is not performant in these scenarios because of the  blocking/schema/transaction nature of the RDBMs. That's the reason they have implemented their own databases (actually, key-value stores) for massive performance gain and  scalability.
NoSQL databases have been around for a long time - just the term is new. Some examples are graph, object, column, XML and document databases.
For your 2nd question: Is it okay to use both on the same site?
Why not? Both serves different purposes right?
Comment: @Rachael, some examples are redis, leveldb and riak.. there are tons around, you can google it
Comment: I don't think ACID is exclusive to relational databases. You can have durability guarantees, transactions, view consistency in non-relational databases.
Comment: @RamshVel could you give an example of  a key-value store type database? Thanks.
Answer: NoSQL solutions are usually meant to solve a problem that relational databases are either not well suited for, too expensive to use (like Oracle) or require you to implement something that breaks the relational nature of your db anyway.
Advantages are usually specific to your usage, but unless you have some sort of problem modeling your data in a RDBMS I see no reason why you would choose NoSQL.
I myself use MongoDB and Riak for specific problems where a RDBMS is not a viable solution, for all other things I use MySQL (or SQLite for testing).
If you need a NoSQL db you usually know about it, possible reasons are:

client wants 99.999% availability on
a high traffic site.
your data makes
no sense in SQL, you find yourself
doing multiple JOIN queries for
accessing some piece of information.
you are breaking the relational
model, you have CLOBs that store
denormalized data and you generate
external indexes to search that data.

If you don't need a NoSQL solution keep in mind that these solutions weren't meant as replacements for an RDBMS but rather as alternatives where the former fails and more importantly that they are relatively new as such they still have a lot of bugs and missing features.
Oh, and regarding the second question it is perfectly fine to use any technology in conjunction with another, so just to be complete from my experience MongoDB and MySQL work fine together as long as they aren't on the same machine
Comment: Thanks for the answer. Your examples of when to use NoSQL are vague at best. I was hoping for a more specific use case so I can decide if any of my data would be better stored in a NoSQL database.
Comment: I agree with Asaf's great answer, there are really only a few scenarios when you should be needing a NoSQL over a RDBMS. I see NoSQL more as a backup db or "add-on db" than a main db. I haven't seen a good system yet, where the core db was a NoSQL.
Comment: I try not to answer the same question twice, look at my previous answer to a very similar question
http://stackoverflow.com/questions/3621415/what-are-some-real-use-cases-for-going-with-a-nosql-document-store-db/3621568#3621568
Answer: Martin Fowler has an excellent video which gives a good explanation of NoSQL databases. The link goes straight to his reasons to use them, but the whole video contains good information.

You have large amounts of data - especially if you cannot fit it all on one physical server as NoSQL was designed to scale well.
Object-relational impedance mismatch - Your domain objects do not fit well in a relaitional database schema. NoSQL allows you to persist your data as documents (or graphs) which may map much more closely to your data model.
Answer: NoSQL is a database system where data is organized into the document (MongoDB), key-value pair (MemCache, Redis), and graph structure form(Neo4J).
Maybe there are possible questions and answer for "When to go for NoSQL":

Require flexible schema or deal with tree-like data?
Generally, in agile development we start designing systems without knowing all requirements upfront, whereas later on throughout the development database system may need to accommodate frequent design changes, showcasing MVP (Minimal Viable product).
Or you are dealing with a data schema that is dynamic in nature.
e.g. System logs, very precise example is AWS cloudtrail logs.

Data set is vast/big?
Yes NoSQL databases are the better candidate for applications where the database needs to manage millions or even billions of records without compromising performance and availability while may be trading for inconsistency(though modern databases are exception here where it allows tunable consistency over availability e.g. Casandra, Cloud provider databases CosmosDB, DynamoDB).

Trade-off between scaling over consistency
Unlike RDMS, NoSQL databases may make the dataset consistent across other nodes eventually which is the default behavior, but it's easy to scale in terms of performance and availability.
Example: This may be good for storing people who are online in the instant messaging app, API tokens in DB, and logging website traffic stats.

Performing Geolocation Operations:
MongoDB hash rich support for doing GeoQuerying & Geolocation operations. I really loved this feature of MongoDB. So does the PostresSQL but ease of implementation is something that depends on the use case

In nutshell, MongoDB is a great fit for applications where you can store dynamic structured data on a large scale.
Edits:
Updated the answer about the consistency of the database.
Comment: "NoSQL database may lose small data here and there" WTF!? Now who in their right mind would want to risk that? This must be false.
Comment: @JayQ. Yes, it may be false. That's why I said *maybe. Then why can't we use NpSQL DB's for transactional operations?
Comment: Ultimately, when people say a transactional DB "can't lose data", that's shorthand for *specific ways* of losing data being made impossible, which of course comes with a cost, just sometimes negligible cost. For example, two clients which are not coordinating (or not coordinating well enough, such as due to a bug in their code) write to the same key in a key-value store right after reading and modifying it, and there is a race condition if they do it at around the same time. A transaction prevents that, by forcing one client to wait or do something else until the other is done.
Comment: Everything may lose data. If you're not shielding end-to-end from gamma ray events, it's only a matter of probability before a bit magically flips on you, which could be a sign bit, or the bit being used as the boolean flag in a CPU register at the wrong moment causing a condition to literally take the wrong branch, and so on. And that's just one example. Plus, there's no certainty that your entire tech stack is big free. The only difference is how high the probability of loss/error is, if the system has enough redundancy to notice that it happens, and if the system tells you when it notices.
Answer: Some essential information is missing to answer the question: Which use cases must the database be able to cover? Do complex analyses have to be performed from existing data (OLAP) or does the application have to be able to process many transactions (OLTP)? What is the data structure? That is far from the end of question time.
In my view, it is wrong to make technology decisions on the basis of bold buzzwords without knowing exactly what is behind them. NoSQL is often praised for its scalability. But you also have to know that horizontal scaling (over several nodes) also has its price and is not free.  Then you have to deal with issues like eventual consistency and define how to resolve data conflicts if they cannot be resolved at the database level. However, this applies to all distributed database systems.
The joy of the developers with the word "schema less" at NoSQL is at the beginning also very big. This buzzword is quickly disenchanted after technical analysis, because it correctly does not require a schema when writing, but comes into play when reading. That is why it should correctly be "schema on read". It may be tempting to be able to write data at one's own discretion. But how do I deal with the situation if there is existing data but the new version of the application expects a different schema?
The document model (as in MongoDB, for example) is not suitable for data models where there are many relationships between the data. Joins have to be done on application level, which is additional effort and why should I program things that the database should do.
If you make the argument that Google and Amazon have developed their own databases because conventional RDBMS can no longer handle the flood of data, you can only say: You are not Google and Amazon. These companies are the spearhead, some 0.01% of scenarios where traditional databases are no longer suitable, but for the rest of the world they are.
What's not insignificant: SQL has been around for over 40 years and millions of hours of development have gone into large systems such as Oracle or Microsoft SQL. This has to be achieved by some new databases. Sometimes it is also easier to find an SQL admin than someone for MongoDB. Which brings us to the question of maintenance and management. A subject that is not exactly sexy, but that is a part of the technology decision.
Comment: seems correct but i dont think its also right to compare the how much time it has spent if that were the case everyone would be using assembly language in all  of their application i would rather say it always comes down to your application and usecase
Answer: Handling A Large Number Of Read Write Operations
Look towards NoSQL databases when you need to scale fast. And when do you generally need to scale fast?
When there are a large number of read-write operations on your website & when dealing with a large amount of data, NoSQL databases fit best in these scenarios. Since they have the ability to add nodes on the fly, they can handle more concurrent traffic & big amount of data with minimal latency.
Flexibility With Data Modeling
The second cue is during the initial phases of development when you are not sure about the data model, the database design, things are expected to change at a rapid pace. NoSQL databases offer us more flexibility.
Eventual Consistency Over Strong Consistency
It's preferable to pick NoSQL databases when it's OK for us to give up on Strong consistency and when we do not require transactions.
A good example of this is a social networking website like Twitter. When a tweet of a celebrity blows up and everyone is liking and re-tweeting it from around the world. Does it matter if the count of likes goes up or down a bit for a short while?
The celebrity would definitely not care if instead of the actual 5 million 500 likes, the system shows the like count as 5 million 250 for a short while.
When a large application is deployed on hundreds of servers spread across the globe, the geographically distributed nodes take some time to reach a global consensus.
Until they reach a consensus, the value of the entity is inconsistent. The value of the entity eventually gets consistent after a short while. This is what Eventual Consistency is.
Though the inconsistency does not mean that there is any sort of data loss. It just means that the data takes a short while to travel across the globe via the internet cables under the ocean to reach a global consensus and become consistent.
We experience this behaviour all the time. Especially on YouTube. Often you would see a video with 10 views and 15 likes. How is this even possible?
It's not. The actual views are already more than the likes. It's just the count of views is inconsistent and takes a short while to get updated.
Running Data Analytics
NoSQL databases also fit best for data analytics use cases, where we have to deal with an influx of massive amounts of data.
Answer: I came across this question while looking for convincing grounds to deviate from RDBMS design.
There is a great post by Julian Brown which sheds lights on constraints of distributed systems. The concept is called Brewer's CAP Theorem which in summary goes:

The three requirements of distributed systems are : Consistency, Availability and Partition tolerance (CAP in short). But you can only have two of them at a time.

And this is how I summarised it for myself:

You better go for NoSQL if Consistency is what you are sacrificing.
Answer: I designed and implemented solutions with NoSQL databases and here is my checkpoint list to make the decision to go with SQL or document-oriented NoSQL.
DON'Ts
SQL is not obsolete and remains a better tool in some cases. It's hard to justify use of a document-oriented NoSQL when

Need OLAP/OLTP
It's a small project / simple DB structure
Need ad hoc queries
Can't avoid immediate consistency
Unclear requirements
Lack of experienced developers

DOs
If you don't have those conditions or can mitigate them, then here are 2 reasons where you may benefit from NoSQL:

Need to run at scale
Convenience of development (better integration with your tech stack, no need in ORM, etc.)

More info
In my blog posts I explain the reasons in more details:

7 reasons NOT to NoSQL
2 reasons to NoSQL

Note: the above is applicable to document-oriented NoSQL only. There are other types of NoSQL, which require other considerations.
Answer: Ran into this thread and wanted to add my experience.. Many SQL databases support json data in columns and support querying of this json. So what I have used is a hybrid using a relational database with columns containing json..


How to access IOS cache in Mobile publisher app?

Question: I've created several different pages in a lightning Aura-type community. I want to implement the "Back" button functionality. Whenever a user navigates to a different page they should be able to navigate using the back button.(chaining of pages just like in breadcrumbs)
We are publishing this community as an app on IOS using Mobile Publisher.
The Standard Salesforce app uses the back button, I assume by some means they are able to extract the cache just like sessionstorage, localstorage of the browser, in a similar way I want to implement this in my custom lwc components.
How can I do that or is there any other way to do so?
One of the approaches is to create an lwc and pass the page-id as a URL parameter every time page is loaded, but this is quite cumbersome and not a very good approach.
Answer: You can definitely use local or session storage for this, to store a page reference whenever a link/button is clicked.
<code>sessionStorage.setItem('pageReference', 'someReferenceID')
</code>
For our iOS/Android Mobile Publisher app we created a custom Message Channel specifically for this. The messaging service is pub-sub so we had our header LWC (present on all pages) subscribe to the channel and all child components publish to the channel. That way anytime a child component has a link clicked or initiates redirection to another page, it can send a message to the header to letting it know what the previous page was so the back button can have the appropriate link and go to the right page. The messaging service functionality is documented below.
https://developer.salesforce.com/docs/component-library/documentation/en/lwc/lwc.use_message_channel_intro


How to cut Patio Pavers

Question: I would like to lay patio pavers for a patio in a diagonal fashion.  I would like to know what kind of tool I should use to cut the pavers in half.  They are about 2" thick, and I'd like to not use the Hammer and Chisel approach so I can get clean edges.  Is there a particular kind of blade I can put in a circular saw to do this job?  Since this patio is going to be over 200 square feet, I would be willing to purchase a new tool if needed to save me time on this task.
Answer: You could probably rent a saw like this from your local hardware store.

They will usually have a diamond tipped masonry blade. You'll also want to make sure it's a wet saw or you keep the stones wet as you cut, as the dust from cutting concrete can make a real mess and be harmful to your health.
You may also be able to find a splitter like this.

The splitters produce far less dust and noise, and can usually be found cheaper than a saw (I found a couple on-line for a few hundred dollars).  However, splitters may not produce a perfectly clean cut. Splitters also come in pneumatic and hydraulic varieties, purchasing those might be out of the budget ($1000.00 and up) but might be available for rent at a reasonable price.
Comment: Keep in mind that the splitter option is much faster than the saw option.
Comment: I've used both and would also recommend the splitter just to avoid the dust. That said, you will not get a super clean break like you will with a diamond saw.
Comment: Certain Paver styles lend them selves to one type of cut verses the other. You should use a saw for pavers that have a clean look. The splitter should be used for pavers that have a rustic look.
Comment: I've found a splitter (a more basic model than the one pictured) to work well for right angle cuts around the middle of the paver across the short dimension, but for other types of cuts it would often break the wrong way and would take several attempts (new paver each time) or not work at all and I'd have to use a small angle grinder with a diamond blade.

How to cut Patio Pavers


Determine all vectors $\mathbb v$ such that $\alpha (\mathbb v)=0$

Question: Let $\alpha$ be a linear functional in $\mathbb R^3$ such that $\alpha (e_1+e_2)=0$, $\alpha (e_1+e_3)=4$, and $\alpha (e_2+e_3)=2$. I set up a system of linear equations and was able to write $\alpha$ as $$ \alpha = e^1-e^2+3e^3 $$
I then need to determine all vectors $\mathbb v$ such that $\alpha (\mathbb v)=0$. We are given the fact that any vector of the form:
$$ \begin{bmatrix} t \\ t \\ 0 \end{bmatrix} $$
will equal $0$. I was also able to use the three vectors given to find that:
$$ \alpha(t\begin{bmatrix} 2 \\ -1 \\ -1 \end{bmatrix})=0 $$
How do I know when I have found all such vectors though? Are these two sufficient enough?
Comment: You have got a basis for $\ker \alpha$ because it has dimension two. But $v=a(1,1,0)+b(2,-1,-1)$ also satisfies $\alpha(v)=0.$
Comment: So any linear combination of those two vectors should span the entirety of $ker(\alpha)$
Comment: What is $e^1,e^2,e^3$ in contrast to $e_1,e_2,e_3$?
Comment: $e^i:\mathbb{R}^3\to \mathbb{R}$ is given by $e^i(e_j)=\delta^i_j.$
Comment: $e^1, e^2, e^3$ are the components of the dual basis to $e_1, e_2, e_3$
Answer: All you need to do is find two linearly independent vectors that are orthogonal to $\alpha$. For example $(1,-1,0)$ and $(0,1,\frac{1}{3})$. Their span is the set of all vectors annihilated by $\alpha$.
Comment: aren't the two vectors I found linearly independent also?
Comment: you found two lines which are annihiliated by $\alpha$. That's good, because those two lines are not parallel, so that you can choose from them two linearly independent vectors, which necessarily will span the kernel of $\alpha$>


4 way mixed ANOVA--Need help interpreting a 3 way interaction!

Question: I hope I can clearly articulate my stats troubles! I am having difficulty interpreting findings related to a significant three-way interaction. My study includes one between-subject variable (Group 1 and 2) and three within-subject variables (B with 3 levels, C with 2 Levels, and D with 2 levels). The DV is accuracy. I have found significant main effects of A, B, C, D, a significant 3-way interaction between B, C, and D, and the following two-way interactions: B X C and B X D. Based on the SPSS output for the 3-way interaction, the contrasts show that Variable B at level 1 is significantly different from B @ level 2 and 3 (but B at Level 2 and 3 is not significant) across C and D. This pattern of results is consistent with the 2 significant two-way interactions (I.E., B X C AND B X D). Since I cannot examine simple effects by splitting files on SPSS, can I interpret the three-way interaction using the significant main effects and two-way interactions? If not, how would I go about interpreting this three-way interaction? thanks in advance for your help!
Comment: Could you provide us with the model formulae you have used, and maybe with an excerpt of your data table and the types (continuous, factor) of your variables?
Answer: A significant 3-way interaction (here among all of the within-subject variables) means that you can't properly assess the association between any one of those predictors and outcome unless you know the values of the other 2 predictors. Thus the "significant main effects" are potentially misleading, as each represents either the association of a predictor with outcome at baseline levels of its interacting predictors or an average over all levels of the interacting predictors, depending on how the model is structured.
The way to "interpret the three-way interaction" is to recognize that it represents the additional association with outcome beyond what you would expect based on the individual coefficients ("main" effects) and their two-way interactions. That can be hard to explain in words. One good way to proceed would be to present the overall table of ANOVA results and then illustrate the 3-way interaction by showing representative predictions from the model.


Black screen after reinstall/install nvidia driver

Question: i have hard time to figure out what is the problem. After my screen going dim (lenovo Z500 brightness key problem) i change my grub to fix this.
Grub:
GRUB_DEFAULT=0
GRUB_HIDDEN_TIMEOUT=0
GRUB_HIDDEN_TIMEOUT_QUIET=true
GRUB_TIMEOUT=10
GRUB_DISTRIBUTOR=`lsb_release -i -s 2> /dev/null || echo Debian`
GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
GRUB_CMDLINE_LINUX="acpi_backlight=vendor"

Then i reinstall my kernel linux-image-4.13.0-43-generic. The problem with brightness was solvt but.. nvidia driver was not working.
Before or after restart i get notation that my computer can't detect Nvidia driver. I reinstall driver and i get black screen.
I try several times remove all nvidia drivers and install various versions [nvidia-396, nvidia-384, nvidia-340] of nvidia driver but each time result is the same. After installation and reboot i get black screen.
I have used all sorts of tips posted here
but nothing will work. After installation i check if driver is installed with nvidia-smi. One more thing i working with nvidia cuda to compute some data, don't know if this is linked to this problem.
After delete nvidia driver screen is working well on Intel gpu.
Any ideas what is the problem?
No Solution so far.
After help from my familiar computer scientist we can't found solution for this problem.
To solve this i had to to restore system using Timeshift tool.
Answer: Try to sudo apt-get remove shim-signed
as mentioned at https://superuser.com/questions/1407694/ubuntu-works-without-nvidia-but-stuck-at-login-screen-with-nvidia
It works for me.


Parks-McClellan - compiling C++ code from Iowa Hills page

Question: I am trying to compile C++ code for FIR filter design using Parks-McClellan algorithm from http://www.iowahills.com/Example%20Code/NewParksMcClellan.txt . However, I cannot find the following header files: "FIRFilterCode.h" and "Main.h" referenced in "NewParksMcClellan.cpp". Does anyone have experience compiling this code? Thank you.
Comment: This is just a programming question and should have been asked on SO itself.
Answer: You need to back track on that site.
There is a complete set of source code and header files available that you will need.
This is all about the FIR-Filters.
It links to this page with examples.
You need the "Code Kit Download."
This will get you the FIRFilterCode.h.
Main.h will be missing because that belongs to the GUI  - which they don't seem to provide code for.
However, it should be fairly simple to fix.
Remove the include Main.h, then remove all references to TopForm.
You'll probably want to replace them with some kind of logging since all they do is provide feedback to the user.
The involved lines are 273+274 and 278+279.
Notes to that effect are included in the comments in NewParksMcClellan.cpp
Comment: I have found "FIRFilterCode.h" but still looking for "Main.h".


What is causing slight steering wheel vibration?

Question: My vehicle is a Toyota Grande Mark 2 2001 Model, which slightly vibrates the steering wheel when driving at 100 km/hr or above. What could be the cause?
Answer: Steering wheel vibration can be caused by a number of things. Without detail we are unable to say for sure, but here are some likely causes.

Tire/Wheel balance
Tire condition
Wheel alignment
Worn steering components

If this vibration is happening when you apply the brakes, then the issue is with the braking system and needs to be serviced.
Answer: Don't  forget about wheel bearings and sticky caliper.  I would get first two above done first with a wheel Balance rotation and alognment.


Can you fly direct to your destination if you can cruise above FL450 regardless of airways?

Question: To my knowledge, the high altitude enroute charts only apply to the altitudes between FL180 and FL450. Does that mean you can plan direct to your destination if your cruising altitudes stay above FL450?
Comment: I'm not sure (if I was I would be posting an answer :P) but I think you have to specify jurisdiction. I guess it has to do with airspace classification, and there are differences between the countries.
Comment: This depends on the specific country you are flying over. Some countries make use of free route airspace and similar concepts, others do not
Comment: @Stelios Adamantidis Actually I meant international flights under ICAO rules, but if it's impossible to talk about it since different countries have different flight rules, I'd like to know at least about the FAA rules on this
Answer: If ATC allows a direct-to, then yes. However, what you will file is a flight plan based on published waypoints, but not airways. So pick and choose based on great circle and trade winds and so on.

Airways
The en route airspace structure of the National Airspace
  System (NAS) consists of three strata. The first stratum low
  altitude airways in the United States can be navigated
  using NAVAIDs, have names that start with the letter V, and
  are called Victor Airways. They cover altitudes
  from approximately 1,200 feet above ground level (AGL)
  up to, but not including 18,000 feet above mean sea level
  (MSL). The second stratum high altitude airways in the
  United States all have names that start with the letter J,
  and are called Jet Routes. These routes run
  from 18,000 feet to 45,000 feet. The third stratum allows
  random operations above flight level (FL) 450. The altitude
  separating the low and high airway structure varies from
  county to country. For example, in Switzerland it is 19,500
  feet and 25,000 feet in Egypt.
(FAA Instrument Procedures Handbook - En Route Operations)

And from the FAA AIM:

Operations above FL 450 − Use aids not
  more than 200 NM apart. These aids are depicted on
  enroute high altitude charts.

compared to

Operation off established routes from
  18,000 feet MSL to FL 450 − Use aids not more than
  260 NM apart. These aids are depicted on enroute
  high altitude charts.

and finally

Operation above FL 450 may be conducted on
  a point-to-point basis. Navigational guidance is
  provided on an area basis utilizing those facilities
  depicted on the enroute high altitude charts.

Special RNAV points can also be used, such as the HAR, see here: What are those 5-character alphanumeric waypoints? HAR allows up to 500 NM between waypoints.
The reason for the limitation in filing a huge distance without points is the air traffic optimization. The computers are limited by how far to look ahead for conflicts is one of the reasons. I don't have numbers at the moment but I'm mentioning it in case you were wondering. Also because the different sectors and FIR's prefer to have a complete leg(s) within their own airspace. However, they can coordinate together and shoot you direct-to the destination.


Can my Nikkor 35mm f1.8 be used as a macro lens, with reversing ring?

Question: Can the Nikkor 35mm 1.8G be used as a macro lens, if I use it with a reversing ring ?
Comment: See also the more general question [How can one use a reversing ring with Nikon G lenses?](http://photo.stackexchange.com/questions/20381/how-can-one-use-a-reversing-ring-with-nikon-g-lenses)
Answer: Yes, it can; pretty much any lens can, given a wide enough focal length. A 50mm lens will give you a 1:1 reproduction ratio (the magic 'macro' ratio), which means the image on the sensor will be life size. The wider the lens, the bigger the ratio, so a 35mm lens will give you a good macro shot (at least in terms of magnification). An 18-55mm kit lens will give you a huge 4:1 ratio @ 18mm.
You will need to hold the the aperture lever on the reverse of the lens open in order to take decent shots. You can do this by hand or with some poster tack. Check out the Photo SE blog article on reversing rings for more tips.
Answer: Absolutely, however there are some caveats. You will have to move the subject because focus is fixed but there is a much better an inexpensive alternative; a macro focusing rail that mounts on your tripod. A Nikon BR-4 will allow you to view and focus while wide open and then close down to working aperture with a manual cable release.
Answer: We can do macro work with or without lens reversal. Why reverse the lens for micro work?
Most camera lenses are optimized to image objects at different distances and project their images on the flat surface of film or digital sensor. Most close-up objects we will image are flat or nearly flat surfaces. We are talking, copy work or the like. As a result, micro lenses are optimized to do flat-to-flat work.
A standard camera lens is optimized to project and image on a flat surface. We reverse a standard lens, pointing its rear towards the subject because this end is optimized to work a flat surface. Reversing generally does a better job when doing close-up work.
Additionally, the focal length of a lens is a measurement taken from a point called the rear nodal. The distance lens to subject is measured from the front model. Reversing the lens changes these points. Most often, the reversed lens, has a slightly different focal length that results in a little added magnification when doing macro work. That being said, the reversed lens works best on the typical close-up subject which is likely to be a flat subject.


How to merge polygons not sharing same boundaries based on attribute with one expression in qgis

Question: I have a .shp file of a country in which I have NAME_1 as state/province name. NAME_2 as district name and NAME_3 as towns of the district. I want to merge the polygons based on NAME_2 for the whole country except 30 entries out of them. I tried dissolve tool of QGIS but it didn't helped. There is one more problem here is that NAME_2 can be repeated for more than one NAME_1. So I have to take care of this also. I am doing it manually one by one using merge selected features in QGIS. Could somebody show me a way for doing this as fast as possible.
Answer: I would:
1) Create a new field called Name_12 which would be a concat("NAME_1",',',"NAME_2") in order to solve the problem of the same district name for different states and use this as the dissolving field.
and
2) Select the 30 polygons that i don't want to dissolve and then do a reverse selection to select the rest and run the dissolve.
Comment: Your idea is excellent, I struggled a bit because my shapefile had null values in wkt_geom column. After deleting all the null values I was able to dissolve the features but it stuck on 100%. When I closed it, I imported the dissolved shapefile but it contains nothing. My shapefile has multipolygon and polygon as well. Do you think this could be a problem?
Comment: I don't think that this is a problem. Something else might be wrong. Just in case why don't u try to split the multiparts to single parts since you're going to dissolve them anyway just to cross-check it?


How can I disable comments and likes on my profile picture on Facebook

Question: I want people to be able to see my profile picture without feeling the need to like it and comment about it.
Answer: What you need to do is change the privacy setting of your profile pic to viewable by "Only Me". That means your friends and the general public will only be able to see the thumbnail version of your profile pic, they will not be able to click on it and like it or comment on it.
Comment: Your answer is same as I already have answered. There is nothing new.
Comment: This screenshot is from 2013. Is "only me" still listed?
Comment: My answer is written in correct English, makes sense and has a screenshot to illustrate the answer
Comment: no the screenshot is not from 2013 its from 2017, 2013 is the year that the profile picture was originally posted
Answer: There is no way to disable the comments and likes for all friends. You can do it for specific people if want to do that. What you can do is change the profile picture and set the privacy setting to "Only Me". This way no of your friends will see the update on their Timeline, so there is no chance to like and comment until they do not click on your profile. Friends can it in the thumbnail profile picture.
Answer: I can still see my friend's profile picture (not the generic one).  But when I tapped on her profile picture, the Like and Comment are not even there.  I checked my friends list and she is still there.


Basement bedroom

Question: I was sold a house as 3 bedrooms with the third laid out as such in one of the basement rooms. I had a survey done. However now discover ceiling should be 7ft, the room is only 6ft4ins.  Do I have any recourse to the surveyor or estate agent?
Comment: I'm voting to close this question as off-topic because it is a legal question
Comment: I think a recent answer said that there was some leeway and a refinished basement had a min height of 6'8", but either way it sounds too low.  I assume you are measuring from the finished floor to the finished ceiling?  And a survey is usually for the land the home is on, not the rooms.  Maybe that's a language/regional difference?  Where are you located?
Comment: How did you not notice the height when you were in that room?
Comment: @manassehkatz I took a ruler with me - one of those fold-out ones... So, vertically challenged or not - it is something easily checked.... And I would have my hair rubbing on the ceiling so I would know instantly in this particular case...
Comment: As @JPhi1618 noted, surveyor normally measures land and outer dimensions of house and other items located on the property. Real estate agent is potentially liable. But even if code now requires 7' (or whatever), it might be grandfathered in or an allowed variance. A bigger factor - and a real safety issue, not just comfort/usability - is exit. A bedroom normally requires a direct exit out - typically a window with a minimum size - [according to this article](https://www.homeadvisor.com/r/egress-windows-requirements-installation/) minimum 20" w, 24" h, 5.7 sq. ft. and max. 44" above the floor.
Comment: Agree with Jerry - if the question was about a specific code requirement for a bedroom it may be on topic, but the main question as written is "what is my [legal] recourse".
Comment: This looks like a better question for [Law.SE](//law.stackexchange.com)
Comment: @SolarMike Maybe OP is vertically challenged (formerly known as "short")?
Comment: I would notice right away too (I'm 6'0" tall). But I know plenty of people who would **not** bring a tape measure and would come back with a sense of "it seemed shorter than normal" but not really see it as a problem.
Answer: You can and should go after the real estate agent. There are minimum requirements to call a room a bedroom. My local codes require a window (not sure of the minimum size) a closet (also not sure of the minimum size) a minimum height of around 7'(not sure of exact figure) and a minimum floor space with some ratio of length vs width (also not sure of the exact criteria).
The bottom line is that to be sold legally as a 3 bedroom, which demands a premium over a two bedroom, certain criteria need to be met. The same applies for bathrooms and kitchens. That's where terminology like 2 and a half bedrooms comes in. It means 2 bedroom with a room you can use as a bedroom but legally isn't.
A surveyor is only concerned with property lines and house footprint. The interior is not a primary concern.
Edit
Yes like a 2 piece bathroom isn't actually a legal bathroom so they call it a half bath
or in this case 1+1 bedroom

www.realtor.ca
It just means one legal bedroom and a room that the realtor has arbitrarily decided is a bedroom.
Comment: Never heard of "2-1/2 bedrooms" - how does 1/2 a person sleep? 2-1/2 **bathrooms** is normal - full meaning "toilet, sink, shower or bathtub" and 1/2 meaning "toilet, sink".
Comment: @manassehkatz see edit in the answer. The half bedroom or half bath or + 1 are all just marketing mumbo jumbo of behalf of the realtors. There may actually be some rules on what qualifies as a half or + anything but I'm not aware of it.
Comment: I disagree, but I can't find code at the moment to support my statements.
Comment: That's how it was described to me by a friend in real estate and have been on jobs where a real estate agent had to pay out of his commissions to make a half bedroom qualify as a full bedroom because that's how it was advertised. I don't know the details behind it all or I would be selling houses. The average price of a house in Toronto is over a million dollars these days. Real estate agents are killing it. I'm curious if the rules for selling a home are different elsewhere.

Basement bedroom


BJT Design for maximum swing

Question: If I want to design a BJT with giving parameters like in the attachment, I know that the ideal voltage swing would put my Q point in the middle of the load line graph. To my understand, the Q point (Ic, Vce) is only with respected to DC analysis. Why was AC equivalent resistor included in calculating the Icq?
Comment: The maximum swing isn't a specific value that all trained and educated designers would equally arrive at. It's a matter of design choices, some of which may be specified (not in your list, though) and some of which may be a matter of comfort level depending on other surrounding factors and experiences. Given \$12\:\textrm{V}\$ I might choose a DC operating point of \$V_E=2\:\textrm{V}\$ for thermal stability, while another designer might not want any more than  \$V_E=1\:\textrm{V}\$ for their own "feel" for thermal stability. Same goes for minimum \$V_{CE}\$, etc.
Answer:
Why was AC equivalent resistor included in calculating the Icq?

I don't often see input specifications like the ones you gave, though I suppose there are situations where that is what's known and you need to figure out the rest. But it is hard for me to answer this, since I don't agree with the results of your approach.
What I can do is offer an alternative approach that should produce reasonable results, with sound reasoning along the way about why. But one thing that will come out of this process is a realization that while you can design for a maximum swing just fine, you DO NOT actually want to use a maximum swing when you apply the design. See discussion nearer the bottom for more on this.

Let me start by trying the unloaded case, without \$R_L\$. This is simpler and still quite useful for many cases.
Given your inputs, \$V_{CC}=12\:\textrm{V}\$, \$R_C=R_L=5\:\textrm{k}\Omega\$, \$R_E=300\:\Omega\$, \$\beta=200\$, and \$V_{BE}=700\:\textrm{mV}\$, and the following schematic:

simulate this circuit – Schematic created using CircuitLab
I'd start by deciding what I wanted as \$V_{CE_{MIN}}\$ for \$Q_1\$. Given the value of \$V_{CC}\$, I'd definitely reserve out:
$$V_{CE_{MIN}}=1\:\textrm{V}$$
From this choice, I then compute a worst-case collector current of:
$$I_{C_{PK}}=\frac{V_{CC}-V_{CE_{MIN}}}{R_C+R_E\frac{\beta+1}{\beta}}$$
This comes directly by first removing \$V_{CE_{MIN}}\$ from the available \$V_{CC}\$ rail and then, recognizing that \$I_E=\frac{\beta+1}{\beta}I_C\$, dividing by the effective resistance seen from the collector current perspective.
Since the smallest collector current is zero, the quiescent collector current value will one half this value, or:
$$I_{C_Q}=\frac{I_{C_{PK}}}{2}$$
Now that this is known, it's easy to work out the quiescent base current as:
$$I_{B_Q}=\frac{I_{C_Q}}{\beta}$$
Clearly, the desired quiescent base voltage will be the quiescent emitter voltage plus \$V_{BE}\$, or:
$$V_{B_Q}=\frac{\beta+1}{\beta}I_{C_Q}\cdot R_E +V_{BE}$$
Now, we face another problem. How stiff should the base divider pair be? Or, how much more current should there be in the divider pair as compared to the required base current? Some say they want this to be about 10 times the base current. But I like the factor of 12. So we can now compute the base divider pair values as:
$$\begin{align*}
R_2&=\frac{V_{CC}-V_{B_Q}}{12\cdot I_{B_Q}}\\\\
R_1&=\frac{V_{B_Q}}{\left(12-1\right)\cdot I_{B_Q}}
\end{align*}$$
I can compute the following, as well:
$$\begin{align*}
V_{C_Q}&=V_{CC}- R_C\cdot I_Q\\\\
V_{E_Q}&=V_{B_Q} - V_{BE}=\frac{\beta+1}{\beta}I_{C_Q}\cdot R_E
\end{align*}$$
In your case, and ignoring \$R_L\$, I get:
$$\begin{align*}
V_{CE_{MIN}}&=1\:\textrm{V} & I_{C_{PK}}&\approx 2.075\:\textrm{mA}\\\\
V_{C_Q}&\approx 6.813\:\textrm{V} & I_{C_Q}&\approx 1.037\:\textrm{mA}\\\\
V_{B_Q}&\approx 1.013\:\textrm{V} & I_{B_Q}&\approx 5.187\:\mu\textrm{A}\\\\
R_1 &\approx 17.75\:\textrm{k}\Omega &
R_2 &\approx 176.5\:\textrm{k}\Omega
\end{align*}$$
And given where \$V_{CC}\$ is at and the rest of your inputs, I think these are reasonable results. (The AC gain will be about 7.5, I believe.)

If the input signal is small, then the output signal's value will be small, too -- even with some gain. So the required load current is modest and the above design procedure works fine.
But if the goal really is to achieve the maximum possible swing, while accounting for the load current, there's more. This is probably where your example tried to go, I think, but didn't succeed so well.
But in the loaded case and when a maximum possible swing is anticipated in a more heavily loaded case then the AC peak current \$i_{PK}=\frac{v_{PK}}{R_L}\$ must be sourced by \$R_L\$ on the collector's highest voltage (when the collector current is close to zero) and sunk by the collector, in addition to the current in \$R_L\$, on the collector's lowest voltage. We have the following three equations to solve:
$$\begin{align*}
V_{C_{MX}} &= V_{CC}-R_C\frac{v_{PK}}{R_L}\\\\
V_{C_{MN}} &= V_{CE_{MIN}} + \frac{\beta+1}{\beta} R_E\left(\frac{V_{CC}-V_{C_{MN}}}{R_C}+\frac{v_{PK}}{R_L}\right)\\\\
v_{PK} &= \frac{V_{C_{MX}}-V_{C_{MN}}}{2}
\end{align*}$$
You'll note the subtraction of \$i_{PK}\$ in the first; and the addition of \$i_{PK}\$ in the second. The third equation is obvious.
Solving for \$V_{C_Q}=V_{C_{MIN}}+v_{PK}=V_{C_{MAX}}-v_{PK}\$, we get:
$$\begin{align*}
v_{PK} &= \frac{V_{CC}-V_{CE_{MIN}}}{\left(1+2\frac{\beta+1}{\beta}\frac{R_E}{R_C\mid\mid R_L}\right)+\left(1+\frac{R_C}{R_L}\right)}\\\\
V_{C_Q}&= \frac{\left(1+2\frac{\beta+1}{\beta}\frac{R_E}{R_C\mid\mid R_L}\right)V_{CC}+\left(1+\frac{R_C}{R_L}\right) V_{CE_{MIN}}}{\left(1+2\frac{\beta+1}{\beta}\frac{R_E}{R_C\mid\mid R_L}\right)+\left(1+\frac{R_C}{R_L}\right)}
\end{align*}$$
So:
$$I_{C_Q}=\frac{V_{CC}-V_{C_Q}}{R_L}$$
And the rest pretty continues directly from there:
$$\begin{align*}
V_{CE_{MIN}}&=1\:\textrm{V}\\\\
V_{C_Q}&\approx 5.212\:\textrm{V} & I_{C_Q}&\approx 1.358\:\textrm{mA}\\\\
V_{B_Q}&\approx 1.11\:\textrm{V} & I_{B_Q}&\approx 6.79\:\mu\textrm{A}\\\\
R_1 &\approx 14.9\:\textrm{k}\Omega & R_2 &\approx 134\:\textrm{k}\Omega\\\\
\end{align*}$$

There will be a significant source of distortion in the above design. The collector current will span over quite a range of currents and, as a result, the dynamic emitter resistance will vary quite widely and significantly relative to \$R_E\$. The voltage gain varies quite a lot -- leading to distortion that is inescapable when using the maximum swing. So use about half the expected range or less.
Answer: Generally the AC coupled load R must be slightly greater than the DC coupled Rc otherwise at maximum swing the collector gets current starved with the collector pullup R driving the load, so then Vce hits the rail and clips the audio.
But keep in mind now you have twice the load current at least with Rc // RL and that is why this is your equivalent collector AC load is included in the equation.
Other ticky tacky info
At the other end towards Vce(sat) the Hfe starts to drop rapidly below Vce=2V towards 10% of maximum hFE when Vce= Vce(sat) at some current. ( Note datasheets use Ic/Ib=10) So you get variable current gain and distortion in Voltage gain.
Then add V(Re) to be at least as big as your input Vpp signal, so that you have input linear impedance and not the non-linear Vbe which dynamically attenuates the input signal.  This must be determine by gain and output swing.  Remember the base spreading resistance and include this.
Thus my general Rule of thumb is make Load R >5% above Rc and choose the midpoint between Vcc and 2V + V(Re) for Q point of Vce.

BJT Design for maximum swing


How to deal with securities that has short historical data when performing mean-variance portfolio analysis?

Question: I am trying calculate expected return and risk (stdev) based on historical data using Mean Variance Analysis framework. Let's say the portfolio has 10 stocks, 9 of them have more than 10 years history but one of them only have 1 month historical data.
If I want every stock has the same length of historical data for correlation matrix, shall i just use 1 month of data to estimate? or fill the one with short historical data with 0?
Answer: There are two common solutions.

You exclude from your universe stocks whose history is too short (i.e. only recently went public). Sometimes it breaks your heart to do that, because you really like the stock. (If the time series is long enough, but still has small gaps, there are ways to "fix" the covariance matrix.)

You use models to predict the covariance. The most famous example of this approach is MSCI Barra predicted beta (see, for example, https://doi.org/10.3905/jpm.2014.41.1.057 for its description). However they don't try to predict the covarance to all other stocks. Rather, they use multifactor model, and predict, based on fundamentals, the correlation to the few factors that they assume to drive the market. They do it right at IPO time with no history.
Comment: Dimitri, thank you very much for the answer. What is your comments on assume missing value to be zero?
Comment: I'm not comfortable with making up data. What do you assume to be 0 - the returns? Or the correlations? The goal is to assume that the future will ave similar characteristics to the historical past, but there's no reason why the future would be like any made-up 0's.
Comment: I was naively assuming the returns are 0 since the securities are not there in past. But totally agree with you that it's not adding value in terms of representing future. The limitation of my calculation is that, 1). i don't have the advance tool you mentioned in solution 2; 2) i can give up the security with short time series; 3).if i just use 1 month length time series for all 10 stocks, the return and risk are absurd.  Anyways, thanks Dimitri, your help are instrumental.
Comment: Great answer, since I haв exactly the same question. Is there some rule of thumb or maybe a paper on how many data points (days, weeks, months) at the minimum you must have to arrive to somewhat sane results?


How to create 'Partial' Search?

Question: I'm using Drupal commerce and I was wondering if there is a way to do partial search? Current the search engine is only searching the exact word. E.g. Candy or Battery I'm looking to search with only term 'Can' or 'Bat'. Please advise.
Thank you
Answer: You'll want to employ some sort of stemming algorithm for that.
The Porter-Stemmer module is a possible choice:

This module implements the Porter stemming algorithm to improve English-language searching with the Drupal built-in Search module.
Answer: 1.On yoursite/admin/config/search/search_api/ choose "edit" your server   type (not index type)configuration.
2.At the bottom of the page set the "Search on parts of the word"checkbox checked.
Comment: Any idea what else one needs to do to make this work with 8? Even after making this setting and reindexing the content, it does not work.

How to create 'Partial' Search?


Set RSS feed update time

Question: I want to update my feed just once a day. For example: I want to update the feed every day at 12:00 pm. How to do this without a plugin ?
Comment: What have your tried already? Plus, this should be done in a plugin only.
Answer: You can't. WordPress doesn't "update the feed", it builds the feed in real-time whenever it's requested, much like the web page itself is built upon request. There's no "feed" anywhere for it to update, it's built on demand.
Answer: The RSS feed is "updated" every time you post something new. If you want it to always be updated at 12pm then schedule your posts to always be published at 12pm.

Set RSS feed update time


Knowledge and belief implication

Question: Does the fact that I do not know that I do not know a fact imply that I believe the negation of that fact?
For instance, John does not know that John does not know that water is wet implies that John believs that water is not wet?
Comment: No, it does not imply anything of the sort. When people do not know something it is often because they do not even have the concepts to express it, and hence can form no beliefs whatsoever about it. So Aristotle did not know that he did not know the Fundamental Theorem of Calculus, and could not possibly believe either way. And even if they *can* does not mean that they *do*. Lack of something (knowledge) can not imply any positive action (formation of belief).
Comment: Consider something where you don't know whether the  answer is odd or even (the number of skittles in the bag etc.) You are forced to believe that the answer is both odd and even.
Comment: Complementary question: if Jon Snow does not know that he knows nothing, does it mean that he believes nothing exists ?
Answer: Interesting question. I've two reasons for saying "no".
First, if the implication you've presented holds, it implies ignorance amounts to inconsistent beliefs. Consider:
(1) John doesn't know that John doesn't know P implies John believes not P
(2) John doesn't know that John doesn't know not P implies John believes P
If John is ignorant about P, then (1) and (2) seem true of John, but that means ignorance implies inconsistent beliefs. That seems mistaken.
Second, suppose John doesn't know that he doesn't know that polonium is radioactive, because he's never cared about chemistry. Rather than saying John believes polonium is not radioactive, it seems more plausible to say one of the following:
(A) John might not have any belief about the radioactivity of polonium.
(B) John might have a belief about the radioactivity of polonium, but be indeterminate between polonium being radioactive or not. In this latter case, John might believe the logical truth that polonium either is or is not radioactive, but it wouldn't follow that he believed either disjunct.
In any event, these are the reasons for thinking not knowing you don't know doesn't imply believing not. Thanks for the interesting question.
Answer: In October 2019, people did know about Covid 19.
And obviously, because Covid 19 was not even a thing, they did know they didn't know.
Yet, I don't think anybody would say we believed Covid 19 did not exist. We simply had no belief about it for having never thought of it.
It's yet another state than "not believing", since the person never ever gave any consideration to the subject. It is different for a western kid to not believe in Santa after carefully considering the question and a mesoamerican kid who never had a concept of Santa to begin with.
One could object that if at that time I were to ask people "do you believe covid 19 exists ?", some would reply "never heard of it, I believe it does not exist". But in fact rigorously they should answer "what is this Covid 19 you're talking about ? I never heard of it", and those who formulated a belief only did because I asked them about it. I kind of forced them into taking a position by introducing the concept to them.
Edit: I just realized that by introducing the new concept of Covid 19 to someone, I would in fact make them realize there is a thing called Covid 19 they don't know about. Thus, they now know they don't know, which takes us out of the question's scope.
Answer: It's not clear from the q if you're making any distinction between knowledge and belief as modals. Assuming (e.g. based on your math SE questions) that this was some kind of homework/study/exam question, it was probably intended to use a [uni]modal logic in which these concepts are the same (K = B). In that you're asserting (for all p):
T = ¬B¬Bp → B¬p
(were B is the single belief/knowledge modal.)
It's easy to see that this is not valid in all frames even in (the modal logic) S5. (Simplified) proof by tableaux: show that the negation of T is satisfiable, thus T is not valid in all frames:
¬T = ¬(¬B¬Bp → B¬p) = ¬(B¬Bp ∨ B¬p) = ¬B¬Bp ∧ ¬B¬p
Introducing the usual notation M = ¬B¬, we have ¬T = MBp ∧ Mp, which is clearly satisfiable by p being true at all worlds. So T is not valid (at all frames) in S5 and thus also not valid (on all frames) in any other [uni]modal logics with fewer theorems than S5.

If this was somehow meant as more research-y question, in which we're using a bimodal epistemic-doxastic logic, i.e one in which knowledge and belief are not interfinable (remember I just took K = B)... then I suggest you read some papers like Halpern et al. which have have some interesting results like:

It is shown that if knowledge satisfies any set of axioms contained in
S5, then it cannot be explicitly defined in terms of belief. S5 knowledge can be implicitly defined by
belief, but not reduced to it. On the other hand, S4.4 knowledge and weaker notions of knowledge
cannot be implicitly defined by belief, but can be reduced to it by defining knowledge as true belief.

It is slightly complicated what they mean by that:

In first-order logic, the notions of implicit definability and
explicit definability of predicates are standard, and are known to be equivalent by Beth's
(1953) theorem. These notions can be lifted to the definability of modalities in modal logics
in a straightforward way. We explain the definitions in the context of knowledge and belief.
Consider a logic L for knowledge and belief. Knowledge is explicitly defined in L if
there is a formula DK (for "definition of knowledge") in L of the form Kp ↔ δ, where
δ is a formula that does not mention the knowledge operator. Knowledge is implicitly
defined in L if, roughly speaking, L "determines" knowledge uniquely. Syntactically, this determination means that any two modal operators for knowledge that satisfy L must be equivalent. Semantically, this means that two Kripke models of L with the same set of
worlds that agree on the interpretation of belief (and on the interpretations of all primitive propositions) must agree also on the interpretation of knowledge.
Unlike the case of first-order definability, these two notions of definability do not coincide
for modal logics; implicit definability is strictly weaker than explicit definability.

Also, in order to show their results they basically take belief to satisfy KD45 (this seems to be a standard assumption in this field). Also interestingly...

Finally, we address the question of defining KD45 belief in terms of knowledge. It is
shown that it can be neither explicitly not implicitly defined for any logic of knowledge contained in S5, and hence for any weaker logic. Yet KD45 belief can be reduced to S4.4 knowledge by the axiom Bp ↔ ¬K¬Kp. The fact that adding this formula to S4.4 generates the logic of KD45 was already observed by Lenzen (1979).

I'll leave it as (trivial) exercise to check whether in S4.4 with that "Lenzen belief" the formula closer to (your) natural language formulation is valid or not:
¬K¬Kp → B¬p  =  ¬K¬Kp → ¬K¬K¬p
Looking through SEP page on this and the Handbook chapter I don't see any [discussed] system that could plausibly prove your proposition... generally the connection admitted [by most researchers] between K and B is weaker in the direction of Bp → KBp, but as strong as replacement in the other direction i.e Kp → Bp. (It can be a more tedious to show a countermodel with these assumptions though; perhaps best use some software.)

Knowledge and belief implication


When fitting a GLMM, is the predicted value for any success or all successes or what?

Question: I am relatively new to multilevel modeling and have just been given an assignment that uses a generalized linear mixed effects model. The outcome is smoking status (1=yes, 0=no) measured at three different time points. I am using proc glimmix in SAS to get the odds ratio estimates. I am having a hard time of understanding what the ORs are measuring exactly. Is it the odds of smoking at all three time points (compared to not smoking at all)? Or is it the odds of any smoking (i.e., smoked at 1 or more of the three time points where smoking was assessed)? It is just a a bit more confusing since there are not just two options of smoking or non smoking. There are 8 different combinations that each participant could have regarding the smoking status at three different measurements. Also, is there a way to get the correlation amongst smoking status from the model?
Comment: Can you clarify your question in the last sentence?
Answer: Typically you will have several variables in this situation.  You will have a subject ID variable that indexes which subject the data came from.  You will also have a time variable indicating which time point the particular observation came from.  So for example, your dataset might look like this:
SS time ID
0  1    1
1  2    1
1  3    1
0  1    2
0  2    2
1  3    2
...

Your model will have a coefficient for time, and will also fit a mean and variance of the distribution of random intercepts and possibly random slopes.  From those distributions you can predict a random intercept (and slope, if appropriate) for a particular subject.  Then, using the fitted coefficients for the fixed effects (notably the coefficient for time) and the predicted random effects you can calculate the predicted value for smoking (actually  ${\rm logit}(\hat p)$ since your example is binomial) at a particular time.  That is, when you plugged values into the formula, you plugged in a particular timepoint (1, 2, or 3).  The predicted value is for that timepoint.
Edit:  To get an odds ratio from your logistic regression output, you exponentiate the fitted beta.  Thus, you would do: $\exp(\hat\beta_\rm{time})$.  This gives you the multiplicative change in the odds as you increase time by one unit.  As I set up the data above, that would be going to time=2 from time=1, or going to time=3 from time=2.  If your data were in months, and the waves were six months apart, it would be the multiplicative change associated with a one month passage of time (i.e., $^1/_6$ of the interval between waves).  On the other hand, if you solved for a particular subject, or just got a prediction for a specified set of input values, you would get the log odds of smoking.  Upon exponentiating that, you would have the odds of smoking.  There is no such thing as the 'odds ratio of smoking'.
It is very likely that there will be a correlation between the timepoints.  (That is, it is very common—it isn't a logical necessity.)  The random effects will account for this.  You can get the amount of correlation from the model by using the intraclass correlation (ICC).  It is the variance of the random intercept divided by the sum of the variance of the random intercept and the residual variance.
Comment: Okay that makes since to plug in values once SAS has estimated the formula, however, I used the odds ratio option in SAS to output the odds ratio and 95% CIs. It is very clear in regular logistic regression that the OR is the odds of event=1 given exposure compared to the unexposed group. Now that there are three repeated measurements for the event of interest its confusing me as to what the odds ratio that is output is looking at in the outcome. Is in the odds of smoking at every one of the three waves? Or is it the odds of having smoked at least once during the three measurements?
Comment: Also, my question in the last sentence. What I meant was should've there be a correlation amongst the smoking status at ll three time points? For instance, if someone smoked at the first time point, is that more predictive of smoking at the later time points, or is the covariates in the model more predictive?


Iterated integral vs double integral

Question: So I'm a little confused about the difference between iterated and double integrals, I did a little bit of looking around on the internet, but I couldn't find anything to answer my question. On Wikipedia, there's something about area vs numerical computation, but it was really hard to understand the article. Could someone please explain this to me?
Answer: Double integrals are integrals of function of two variables, but Iterated integrals are integral of integral... of single variable function.
Example $$ \iint f(x,y) dx dy $$ is a double integral but $$ \int \Biggr ( \int f(x) dx\Biggl) dx$$ is an iterated integral.
Comment: It is interesting to consider the case where $f$ is constant. The double integral would give you the area of the shape defined by the integral range, while the iterated integral represents the distance travelled by an object under the force $f$, in the specified time period

Iterated integral vs double integral


Sight distances in Savage Worlds

Question: Simple question, but how is sight distance handled in Savage Worlds? I'm familiar with Pathfinder and DND where a PC has like Darkvision that works for up to 60 feet. What is the standard viewing distance in a well lit space? What about in different levels of luminosity down to total dark?
Answer: Standard viewing distance for a well lit space is not specified anywhere in the core rules. The Dim lighting condition gives a -1 to rolls but again, no distance limit. The Dark lighting condition gives a -2 to rolls, and you cant see anything beyond 10" on a battlemat, which is 20 yards. Pitch Darkness, as the name would suggest, means you cannot see any distance at all.
Comment: Hmmm... okay. I suppose distance limitations mainly make sense when darkness comes in to play. I'll see what I can do with this. Thanks! :D
Comment: Also, if there is a question whether something can or can't be seen, just make a Notice roll with the appropriate penalties. If it would be silly for them not to see it, then don't bother making a roll.

Sight distances in Savage Worlds


Does laser eye surgery prevent me from getting an EASA pilot licence?

Question: I am a masters student in Germany and I am very much interested in pilot training. I had a laser eye surgery (LASIK) 3 years ago. I heard that people who got it are not eligible as a pilot. Is this true for a private licence too?
Comment: Welcome to Aviation.se
Comment: Updated the question to include "EASA" since it is the framework Germany and a [bunch of other countries](http://easa.europa.eu/countries/easa-member-states-page) use.
Answer: LASIK is a type of refractive eye surgery and according to EASA's medical standards, you can be considered "fit" to fly after surgery if several conditions are met. The conditions depend on the class of medical; private pilots usually have a class 2 medical.
For class 1:

(1)   After refractive surgery,  a fit assessment may be considered,
  provided that:
  (i)    pre-operative refraction was not greater than
  +5 dioptres;
  (ii)  post-operative stability of refraction has been achieved (less than 0.75  dioptres variation diurnally);
  (iii) examination of the eye shows no post-operative complications;
  (iv)  glare sensitivity is within normal standards;
  (v)   mesopic contrast
  sensitivity is not impaired;
  (vi)   review is undertaken by an eye
  specialist.

For class 2 (private pilot) and LAPL:

After refractive surgery a  fit assessment may be considered provided
  that there is  stability of refraction, there are no postoperative
  complications and no increase in  glare sensitivity.

The LBA also has an FAQ on vision issues but it doesn't mention LASIK. It does say, however, that you need an optician to examine you if there are any questions about your vision that an aviation examiner can't determine himself (nicht durch den flugmedizinischen Sachverständigen durchgeführt werden können). I assume that means that if there's any doubt about your eyes, you'll need to have an additional eye exam.
Answer: In the general case, no, it is not universally disqualifying. That said, general advice doesn't substitute for talking to a flight surgeon who can issue you a medical certificate where you are, and determining exactly what will be required you you, given your history, your procedure, and the rules there in Germany.
But since there are pilots now who've had LASIK in the past, it's definitely worth scheduling the appointment & having that conversation. In the past, when LASIK was newer & less proven, the rules were much more restrictive, but they are much less so today.  Good luck!
Edit: this link is specific to the FAA, but it gives a flavor at least for attitudes in the US medical community toward LASIK. Hopefully European standards are similar.