QGIS: Clip Raster by Mask Layer-permanently remove black edges

Question: I want to introduce geotiff images generated in QGIS by clipping ortho imagery to a shapefile into matlab. However, the clipped raster images come with black borders. I managed to remove them in QGIS (by setting a no data value for zero/ black), but they return when I open the same images in matlab. Even when I check the "create an output alpha band" box, the same thing happens in matlab. Any solution?
Comment: Welcome to GIS.SE. Your "removal" of the black borders in QGIS is only of cosmetic nature - you only tell QGIS not to display them, you don't remove them. Have you done any research on how to remove the black borders? Also, is the removal necessary or only for aestheticpurposes?
Comment: I have tried nodata value and alpha band. Removes black borders perfectly in QGIS, but not in matlab. Besides, nodata values also affect the image itself it seems, which makes sense: every black pixel is removed. It turns out the black borders will probably not affect my results (Deep Learning CNN Classification and Detection), so I guess the answer is aesthetic purpose for now.
Answer: It seems to me that Matlab GeoTIFF reader can't deal with nodata value or with alpha channel https://se.mathworks.com/help/map/ref/geotiffread.html. Transparency is available only for PNG, CUR and ICO files https://se.mathworks.com/help/matlab/ref/imread.html.
 Therefore the only way to remove the nodata areas from Matlab on QGIS side is probably to save the image as PNG with alpha.
By this old answer you should be able to remove regions from a raster with Matlab by using a vector mask. The mask can be a shapefile.
https://stackoverflow.com/questions/22000272/how-to-limit-the-raster-processing-extent-using-a-spatial-mask
Comment: There are a lot of options to export the image in another format as tiff, but strange enough, no matter what I choose, the output was still a tiff image. Thanx for the links.


How is normal force in circular motion?

Question: Let's say  I have a vertical ring and  a bead is sliding on it. I understand normal force is always acting radially and that in general the radial component of weight  is not equal to the normal force. In fact the difference between these 2 forces is what causes circular motion. What I don't understand is what makes normal force is not equal to that component. I mean what is happening physically between the bead and the ring?
Answer: In general the normal force is pretty tricky. If I could give loose definition to the normal force it would be "the force needed to constrain motion along the surface the object is constrained to given the object's trajectory."$^*$
As you start digging into it, the normal force is pretty complicated. It is a force that depends on the position and velocity of our object as well as the other forces acting on the object. It isn't a force where we can just look at a "snap shot" of the object and know what the normal force is.

I mean what is happening physically between the bead and the ring?

The ring is exerting a force that keeps the bead constrained to it. This is because the bead cannot move through the ring.
More mathematically speaking, the radial net force component is given in general by
$$F_{rad}=w_{rad}+N=m(\ddot r-r\dot\theta^2)$$
and since the weight will be given by $w_{rad}=mg\cos\theta$ ($\theta=0$ is at the bottom of the ring), and because on the ring $\ddot r=0$, we know that the normal force is what is "left over". i.e.
$$N=-mg\cos\theta-mr\dot\theta^2$$
This is what $N$ needs to be too keep the bead on the ring (to make $\ddot r=0$)
In general things can be more complicated if $\ddot r\neq0$. For example, if you consider the classic banked curve problem but don't assume your object is moving around the same circle the entire time, you will find oscillatory solutions where $r$ is changing over the entire trajectory.

$^*$ Of course this seems like a circular definition, but you will find that this is the kind of thinking we get when you move to higher level mechanics like Lagrangian mechanics. We actually don't need to know what the normal force is to determine the trajectory of the object this way. You can find the trajectory using Lagrangian mechanics and then determine what the normal force needed to be in order to obtain that trajectory using Newtonian mechanics.
Answer: Any object for a circular motion, has a change in velocity,( atleast a change in direction!). This change or acceleration implies a force is acting on it. If you try to analyse the direction of change in velocity (in a small interval) using simple laws of vector addition you will find that the change takes place along radial direction, and it requires a radial force , towards centre. This is called centripetal force. In case of a bead, the normal contact force provides necessary centripetal force.
Consider bead sliding on horizontal ring first.At each instant, the tendency of bead is to move in the direction of its velocity (that is tangential to the ring). The bead tries to move out of the ring, so the inner surface of bead presses against the ring such that it tends to move outwards, but the contact generates a contact force inwards, which supplies the required centripetal force. In this case gravity doesn't contribute anything.
Now if we take ring to be vertical. Consider bead is slightly disturbed from rest from top of ring such that it starts sliding down due to gravity. Now the mg supplies the required centripetal force initially (which is small required as speed is small initially). So a normal reaction appears in radial direction away from centre such that:
$mg-N=mv^2/r$
Now, as ring slides, it's speed increases. As it moves towards the vertical Portion of ring(after covering an acute angle with respect to initial vertical position), the centripetal force contributed by mg decreases ask now it's component $mg cos\theta $ instead provides the centripetal force. But now the required centripetal force increases , on the other hand. So the bead presses outwards and the normal reaction changes direction from radially inward to outward.
Now $mgcos\theta + N= mv^2/r$ where \theta is angle covered by ring from upward vertical. It is general equation, but here v is also a function of theta(the decrease in potential energy causes increase in KE). At bottom you can see $N-mg=mv^2/r$ ($\theta =\pi$). The normal reaction is vertically upward. Again in its upward journey, the normal reaction changes direction from radially outward to inwards(that means normal reaction becomes zero for an instant).
Hope my explanation helps you!

How is normal force in circular motion?


Find users within a given radius

Question: I have a mySQL table with user name, latitude and longitude of the user. I would like to get a list of user who are inside the circle of a given latitude and longitude with given distance. For example my input Lat= 78.3232 and Long = 65.3234 and distance = 5 km. I would like to get the list of users who are inside 5km distance from the point 78.3232 and 65.3234. Is it possible to solve this with single query? Or can you give me a hint start solving this query? I am new to the geo based information.
Comment: you can try  [between](http://dev.mysql.com/doc/refman/5.0/en/comparison-operators.html#operator_between)
Answer: google gives me this :
http://www.movable-type.co.uk/scripts/latlong-db.html
it gives you a good idea to start your work.. based on the distance between points (your circle radius)
imo, you need to define all points (surface) that are into this "circle", and check if your users are into this surface... in fact, a good way to do this would be to define ranges... for example :
lat : 72, long between 65 & 67
lat : 73, long between 64 & 69
... ...
if you do it with your precision xx.yyyy that will increase consequently the possibilities... it's just a mathematical challenge... Good luck!
Answer: I think a good place to start is with the Pythagorean theorem a^2 + b^2 = c^2 where a would = the difference in lat from point to Origin and b would = the difference in long.   and c would equal distance.
that solves the math point.
I would need some helping doing the conversion from distance in lat and distance in long.
is the going to be a local, state, or a world wide program? that will create changes as differences in longitude get small as you reach the poles and larger as your reach the equator.

Find users within a given radius


Wild Card search for specific fields

Question: I need to develop a search box that allows custom/wild card searches on fields in a Sharepoint site.  The site to be searched is a subsite.  Can anyone suggest the best practice for this?
Answer: In both SharePoint 2010 and 2013 you can use Keyword Query Language to perform this search, though the wildcard only works as a suffix. For Example:

Author:Matt* will find all items where the Author starts with Matt

You can limit the scope of the search in a couple ways. FOr example you can create a Scope in 2010 or Result Source in 2013 that limits the results to those from the Site. Or you can add the Query Modifier Site:http://site/subsite (or similar query, this is off the top of my head).

Wild Card search for specific fields


Is there a way to stream a video stored on my PC to my laptop?

Question: I have a collection of .mkv files stored on my PC's hard drive that I'd like to watch on my laptop (without having to transfer any files) so I can keep working on my PC while watching them. Both are connected to my home network via wifi. Is there some kind of software that can do this?
Comment: Just use regular ol' Windows File Sharing on the LAN, and open up the file using whatever player software you like.
Answer: Download and Install VLC Media Player
Computer

Open VLC Player, Click the Media menu in VLC and select Stream.
In the Open Media dialog, select the media you want to stream. You can choose single or multiple files to stream.
Once added, click the Stream button.
The Stream Output window will appear, click next to continue.
From destination setup windows, choose the destination for your stream.
After selecting a destination, click on the add button.
You will hear or watch the media being streamed on your computer, so it's playing correctly.
After that specify a custom path in HTTP or leave it for the default and click next.
Now Option Setup will appear, leave rest of the setting and click on the stream. (If you select Display locally option, then the media will start playing locally on your computer).

Laptop:

Now open the VLC on your laptop, Click Media then Open Network Stream.
Enter address, i.e., http://IP-Address:8080. If you specified the custom path in the previous step on PC then http://IP-Address:8080/path
Now Click on Play Button, the stream should start playing.

If VLC doesn't stream and you encounter an error, consider following;

Make sure you are connected with the same network.
Make sure that VLC is not blocked by the Firewall.
Answer: A similar, but simpler way to use VLC.

Open the playlist window [should do this by default]
Navigate to the remote folder where your movie is.
Drag it to the playlist window on your local machine.
Play.

You may need to tweak the amount of buffering VLC does in order to play smoothly. On Mac that's in Prefs > Input/codecs > Default Caching Level.


Why do lvdt sensors give us different results?

Question: We take a cylindrical concrete sample and apply compression load on it, perpendicular to its head. To measure its strain we use 2 Lvdt(strain measurement devices)on both sides of the concrete sample . Surprisingly they give us different numbers (close but not the same). Why is that?
Firstly I think that it is because concrete sample might not be fully homogeneous (in preparation the mixture process might not have been perfectly mixed. The second reason is that it might have some bulk defects inside.
Let me know what you think
Comment: wherever did you get the idea eletronic sensors dont need calibration??
Comment: How close is "close" and have you calibrated them against each other to know if they just give different readings?
Comment: The instruments are electronic, so they dont need calibration.
Answer: With any measurement system, there are errors. Based on what details have been given there are plenty of potential error sources. A few that I can think of off the top of my head are:

Physical differences in the sensors
Errors in their mounting locations
Calibration errors
Differences between the sig. cond. and/or A/D hardware for each sensor
Differences in the dimensions of the test specimens
Irregularities in the test specimens
All manner of variations in setup
Operator dependent error
Etc.

If you're really interested in understanding  what you're measuring, my recommendation  is to take the time to do a real Measurement System Analysis (MSA) to understand the limitations of the measurements you're taking and what the sources of your error really are.
Answer: The reason is because of errors.
The first one is that the specimen might not be completely homogeneous(there might more cement on one side than the other for example). The second reason is that, the loading might not be in the center of the  specimen, this means that one side will have to carry more loading than the other side.


Is there a way to replicate Nikon D3100 live view on my laptop screen?

Question: I own a Nikon D3100 and I need a way to see the live view of my camera on my laptop screen.
There must definitely be a way (I am not just aware of it). I have searched all around the web sites... I could not get a solution.
The Nikon Camera Control Pro 2 does not support D3100, and "Camera Control 5.1" connects and shoots remotely from a laptop but does not show live-view nor shoot in RAW.
There is a way of connecting my camera to a TV or monitor directly via an HDMI cable and getting the live view, but I want it displayed to my laptop screen.
Comment: "There must definitely be a way (I'm just not aware of it)" Why must there be? If the hardware doesn't allow it, there won't be a way to get near-real-time video over USB. There are, however, video dongles you can get for your laptop that will allow you to use the HDMI output. It will mean using two applications (a viewer plus tethering capture).
Comment: What, exactly, do you want to be able to do while the camera is connected to the laptop? Using the HDMI output during Live View will display what the camera sees, but will also disable the ability to capture images or video with the camera itself. See page 42 of your owner's manual.
Comment: absolutely , all i want it to do is display.
Comment: If you are seeking HDMI support in a laptop. I know my Samsung Series 5 has an HDMI port, but to be honest, I've only used it for output and I'm not sure if it will accept input from the D3100. I don't have a mini HDMI to HDMI cable to test if it will work. The Series 5 is priced midrange for a laptop, only running about $600. Hope that helps some.
Answer: Most tethering softwares that list support for Nikon cameras do not include the D3xxx series. Most of the Dx, Dxx, and some of the D7xxx and D5xxx bodies are at least partially supported. The D3100's firmware or hardware may limit this capability.
If all you want to do is view the output of your camera without controlling it, you just need to connect it to a device that accepts an HDMI input. The easiest and most economical solution would be a display only device such as a portable HDMI monitor. Most laptops do not accept HDMI inputs due to copyright constraints on the licensing of the HDMI technology. Alienware once made a couple of models, the M17X and M18X, that would do this, but they were very expensive. Dell, who bought Alienware, still lists the M17X and M18X with HDMI-in capability. They're still very expensive. There may be other models that also do this. Be aware that according to page 42 of your D3100's user manual:

When the camera is attached to an HDMI video device, the
  camera monitor will turn off and the video device will display
  the view through the lens as shown at right.
  Movies can not be
  recorded and photographs can not be taken in live view while
  the camera is connected to an HDMI-CEC device

If you are willing to drop down to standard video quality using the TV out port on your camera, a USB video capture device will allow you to display photos from your D3100 on any laptop with a USB port, but you would not be able to view the live view output this way, only captured images or video.
Comment: @pradeepsekar: viewing the HDMI output on a screen isn't exactly *tethering*, which involves controlling the camera from the remote device as well. If all you want to do is view the output, then just get a laptop that accepts HDMI input and displays it on the screen. They are a niche product due to HDCP rules. Alienware once made such a model, but it is very expensive. A portable battery powered monitor would be more economically feasible.
Comment: If the hardware (the D3100) doesn't support it, then none of the tethering softwares will be able to.
Comment: If you don't care about camera _control_, you may have better luck with asking "How do I view HDMI input on my laptop" on http://superuser.com
Comment: I am aware that nikon d3100 ans some more series are not supported in most tethering software. that's why i am looking for some which do.
Comment: Some months ago I published a list of functions controllable over USB with gPhoto2 available at: https://docs.google.com/spreadsheet/ccc?key=0AsgzYOhaeKOEdG1MekdIYmxxc1F0QWZ2NTFwLVMzWEE&usp=sharing
Comment: @ Michael Clark , The software does not support the Camera model, but the hardware does, that's how i was able to display it on a TV. (displaying it on my laptop screen is the challenge here)
Answer: You could try digiCamControl.  One of its advanced features is Live View via computer display.  However, the D3100 may not support that feature.
The Nikon SDK allows you to capture Live View images as JPGs.  So a program could be written to loop, capture and display those JPGS.  Someone has written a C# wrapper for the SDK which gives an example of this (see the bottom of this page - Nikon SDK C# Wrapper FAQ )
Comment: I am a developer of camera remote control / live view tethering software, and I can confirm that D3100 does NOT support live view tethering.
Answer: If you only need standard definition output, cheap capture cards can be readily had for under $50 including a double RCA cable and a jack to RCA converter.
An HDMI-based solution will be obviously more expensive, but they're almost equally available on the market.
Answer: D3100 cannot support the feature that you want to implement, but the new Nikon D3200 has change the image of the D3xxx series.  with the help of WU-1a Wireless Mobile Adapter, you can connect it to the DSLR, to automatically send your images to your Smart phone and even use your smartphone to remotely capture images from D3200 and D5200. I'm not sure if it has a live you feature can can be viewed to the smartphone.
Answer: i used Digicam Control on my Nikon D3200 and it works ! by the way, it works for Nikon D3100 too. You can see supported camera for Digicam Control here
Answer: I use my d3100 with a HDMI monitor to record videos and take pictures all the time. Not sure about what the user manual says about it, but works well for me (tip: live view turns off after 30 seconds but this can be changed in camera menu).
Live view with USB is not possible with D3100, as far as I have been able to research. Other than that, Digicam Control allows you to control the camera, but could be more user friendly. Digicam is FREE. I like to use Digicam Control for timelaspe, and it can be used for HDR, neither of which D3100 has built in.
Answer: Almost everything that I've seen don't support the 3xxx series, but these two claim to... You can give these a shot, they seem to be quite techy and not extremely user friendly.
I've never used either one, so proceed at your ow risk! ;-)
DIYphotoBits
Master
Answer: diyphotobits does support the 3100 but it gives you a view of the image after it's been captured. I haven't tried it with the live view switch yet but, it's a easy to use program.
Comment: Perhaps you could try it and include the results of your test in your answer?
Comment: i have already used the diyphotobits and its not what i was looking for :) thanks anyway mike


By approximately what ratio does power steering (on a car) amplify the torque applied?

Question: Power steering on a car is a form of torque amplifier: the driver applies X Nm (or ftLb) of torque, and the power steering adds Y torque -  but maintaining the same angle of turn.  But what's the approximate ratio of Y:X for the power steering on a typical domestic car? Is it e.g 10:1 ?
Comment: Too broad, some add more, some less, depends on the tire sizes and ratios so many answers possible. I have driven vehicles where a finger is all that is necessary others where it has minimal effect.
Comment: I'm just looking for an example number, or even a range of numbers.  For a domestic car that range can't be too broad.
Comment: I am writing something about historical use of torque amplifiers (not in automotive use) that multiplied the torque by 10,000:1.  I want to compare this to the power steering on a car, which I am guessing is maybe between 10:1 and 100:1? I am just seeking some confirmation that I'm in the right ballpark.
Comment: You should just be able to measure this with your car and a protractor. Start with your tires straight, turn the steering wheel 180 or 360 degrees, see how much your tires have turned. Figure out how many turns of your steering wheel it would take to rotate your tires 360 degrees, this angular displacement reduction ratio is the same as your torque increase ratio (power in = power out = torque x displacement / time).
Comment: Older Chrysler products required about zero effort ; I believe they have changed as many did not like "no" road feel.
Comment: @jko turns lock to lock is not the same as power assistance...
Comment: @jko - the measurement you are proposing would be the same whether the power steering was on (i.e. engine on) or not!  I'm after the torque amplification provided by the power steering, not the gearing ratio of the steering mechanism itself.
Comment: @RichardPawson my bad
Answer: I had a go at measuring it - on my Toyota Auris. I used a handheld digital device (for weighing luggage), which conveniently records the maximum weight sensed in a measurement.  I strapped it around the spoke of the steering wheel in a fixed location, just inside the rim, and made sure that I was always applying the force tangentially.
My measurements were all taken with the vehicle stationary (not while driving!) and with the car parked on gravel.
With the power steering on, turning the wheel seemed to take a force of anywhere between 5 and 20 N (so maybe 1-4 Nm torque). With the power steering off I got readings of between 15 and 25 N. Not great data, but it seems to suggest that the amplification from the power steering is of the order of 10:1. Though, I am not very confident in this result, and I have to say that my subjective impression was that it was greater than this
If anyone can provide a more specific figure based on manufacturer's design specs-  for any domestic car  -  I would still appreciate it.
Comment: Well done!  That is right in line with what I was thinking, but you went and measured it!


USB pen drive randomly disconnects

Question: When I connect a USB pen drive in my computer it randomly disconnects. I already unchecked the power manager option in the device manager.
I have the same problem in XP & Windows 7. I tried with Ubuntu on the same machine without any problems.
Answer: I had such an issue: too long USB cable was the case.
Later it came out again, and I've changed my pen-drive: it was a hardware issue :)
Check if your USB port is in good state, and check whether its connectors to the motherboard are okay and sit tight.
Comment: On a related note, I have had ports I use frequently fail.
Comment: Sure, motherboards can also be imperfect :)
Comment: Zoredache, frequent use can certainly [wear down a connection](http://en.wikipedia.org/wiki/File:Gebrochene_loetstellen.jpg)

o_O Tync, Two words: [cold joints](http://en.wikipedia.org/wiki/Soldering#Soldering_defects).
Answer: Had a similar problem with a combination of usb card reader and old CF cards.
Basically issue was the card didn't allow simultaneous read writes. But somehow the system did try to do it - which caused it to immediatly eject.
After turning off thumbnails, indexing and also taking care I did not do any browsing on the card during read/writes I could use it "normally".
Answer: This might help you out.

Open power options --> change plan settings --> change advanced power
  settings Check for usb settings --> usb selective suspend mode

Set it to disabled

USB pen drive randomly disconnects


Use gpu on Ubuntu?

Question: I installed CUDA driver, Cudnn and tensorflow-gpu. I can run "nvidia-smi" and "nvcc --version". However, I still cannot use gpu, I don't know why, anyone can tell me?
I use an example from this: https://www.tensorflow.org/tutorials/using_gpu
But what I get is:
enter image description here
Answer: You need to use same version cuda-8 as nvidia drivers.
If you use nvidia-384.xx you need to cuda_8.0.xx_384.xx

Use gpu on Ubuntu?


OpenSSL ECC named curve support

Question: I tried searching online but can't seem to find whether or not OpenSSL support both NamedCurve.arbitrary_explicit_prime_curves and NamedCurve.arbitrary_explicit_char2_curves? As far as I can tell bouncy castle are the only SSL/TLS implementation that supports it, any others that anyone known of?
Comment: `openssl ciphers` will list supported ECC ciphers. `openssl ecparam -list_curves` will list the specific curves. But the names you refer to I don't recognise in the openssl list. Even if openssl does support your curves under a different name, they might only be available for `s_client` mode (i.e. SSL/TLS but not files). And GnuPG 2.1 with ECC hasn't been released yet.
Answer: The code for arbitrary curves is in the library; see the source code, file crypto/ec/ec_lcl.h, in particular function ec_GFp_simple_group_set_curve(). The OpenSSL code includes specialized function for some specific curves (in particular NIST curves) but also has functions for the general case.
Code for encoding and decoding arbitrary curve parameters in ASN.1 (e.g. for use with a public key in an X.509 certificate) also appears to be present (in crypto/ec/ec_asn1.c). However, I doubt this code gets much used, since most of the rest of the world supports only a few specific curves; so even if the code is there, it was probably not thoroughly tested.
Comment: Arbitrary curves are supported at the protocol level (see RFC 4492, section 5.4) but I am not sure whether OpenSSL implements it. The EC code is there (at least for prime fields), but maybe not the glue at the TLS level. Of course, if you control both sides, you could just define your own "named curve".
Comment: But it seems like we can't use arbitrary curves for SSL/TLS connection. Or am I right?

OpenSSL ECC named curve support


Creating Latitude Grid from DEM

Question: I am trying to evaluate an equation in the raster calculator and I need latitude values. I have the DEM for the region and am wondering if it is possible to create a latitude raster based on the DEM?
Comment: What software... ArcGIS? Is your DEM projected?
Answer: Unproject the DEM to determine the geographic region it covers.
Create the latitude coordinate grid for this region.  (In Arc* products prior to version 10, this is done with "$$YMap": http://forums.esri.com/Thread.asp?c=93&f=1740&t=182407.)
Projecting this grid produces the latitude raster.  For the projection, use some form of interpolation for the resampling (bilinear should be good enough in most cases), not nearest-neighbor.
Comment: You can still use the built in GRID variables/scalars (e.g. $$YMAP) in ArcGIS 10 - http://forums.arcgis.com/threads/18608#post106446
Answer: whuber's method is simpler, but this should also work if you have Spatial Analyst and ArcGIS:

Spatial Analyst Tools > Extractions > Sample, to create a points layer for each cell
Add X and Y fields to the points layers and calculate the X and Y values using "calculate geometry"
Use Conversion Tools > To Raster > Points to Raster to create a new grid for each value.
Answer: I realise this is an old thread but thought I'd contribute to help anyone searching in the future.  My DEM was too large to use Patrick's method, so I used a points file that contained a reasonable number of points (approx. 70, spread across the extent of the United Kingdom), then interpolated between these (using latitude as the z value).  Hope this is helpful to someone, sometime!
Answer: The simplest way to create Lat/Long grids rasters is to use the r.latlong function in GRASS GIS.
By importing a DEM (or another raster), you can use the DEM as input and the function will create a latitude (and longitude using the -l flag) that matches the input DEM. You can then export to any desired format. This took ~ 1.5 min for a 13 x 10 degree, 30m DEM, using a 32 GB RAM, 32 Core workstation.
https://grass.osgeo.org/grass74/manuals/r.latlong.html
Answer: I used Kate's approach in ArcGIS (very much appreciated, even after all this time). I used a basic IDW interpolation with a variable search window on ~300 points. The rabbit hole that led me this far has been trying to ADD a directional elevation trend to to an existing DEM dataset to impose a stronger flow accumulation trend in a flat landscape. As the $$YMAP/$$XMAP GRID variables are no longer supported in Arc 10+, this was the easiest workaround for me. Doing this is was able to create two rasters for X and Y coordinate values to then work into map algebra.
Answer: This is now trivial to do with GRASS tools available within QGIS. Open your raster data in QGIS (e.g., 'raster_dem.tif') and open the GRASS tool r.rastercalculator in the Processing Toolbox. For the formula variable, enter this:
raster_dem = y()

This will produce a raster of latitude values. If you also need a raster of longitude values, simply use x() instead of y(). It's much faster than previous methods too.
Comment: It can be kind of dicey to do this through QGIS, because the region creation isn't reliable; this method didn't work for me.  It **did** work to do the whole thing in GRASS, but I had to first double check & reset the region with g.region (or Settings -> Region -> Set Region in the GUI).

Creating Latitude Grid from DEM


converting Kindle files

Question: I've never bought anything on Amazon Kindle store and I don't have a Kindle.  Is there any chance for me to buy a book there and convert it into a file format I could read on my non-kindle ebook reader which understands all kinds of DRM-free file formats?
Answer: Yes and no.  If the e-book is DRM free, it is possible to convert it to other formats with programs like Calibre.  However, if it does have DRM, then you would have to use software that would remove it.  That software does exist, but I havent used it.  FYI, Amazon's Kindle does not support the open e-book format called ePub.  However, Calibre can convert ePub to Kindle friendly formats, as well as just about any other e-book format.
Comment: Also note removing DRM may not be legal..
Comment: OK, so my question, I guess, is: can I tell whether the book will be in a DRM format before buying it?
Comment: @SimonSheehan yeah, I'd argue that selling me something with DRM is not legal, but that's a whole different topic :)
Comment: It is not illegal to remove DRM, as long as the product is not distributed.  However, the Amazon license probably has a clause about removing DRM will violate the license.
Answer: You could always download the Kindle reader application for Windows and use that instead of using the ebook reader you have.
Like @Keltari said Calibre won't work with ebooks that have DRM on them.
Answer: Does your non Kindle ebook reader support web browsing ?
If the answer is Yes (and you want kindle books), then I can recommend Kindle Cloud Reader (compatible with the Chrome & Firefox web browsers), no kindle device is required.
https://read.amazon.co.uk/
If the answer is no, can your ebook reader open PDFs ? If it can and you specifically want Kindle books, then I would recommend  downloading the kindle reader application for your PC, and following an answer I posted under How to convert Kindle books into PDF format?
If your ebook reader cannot support pdf viewing then by far the simplest solution is the one recommended in Paul's answer.
Answer: Ars Technica IS your friend.

If you buy e-books from Amazon and want to engage in a bit of digital civil disobedience—by stripping the files' DRM and making sure that Amazon can't deny you access—we're about to show you how. Yes, many parts of the Internet have known about this technique for some time now, but we feel that it bears mentioning again here.

But, before proceding, remember:

We will offer this caveat, however: it's quite possible the technique we're about to outline violates not only Amazon's Terms of Service, but the Digital Millennium Copyright Act as well.

If you're still there, try following the steps on: DRM be damned: How to protect your Amazon e-books from being deleted.

converting Kindle files


Doubt about the faraday's law of electromagnetic induction

Question: We say that induced potential in a magnetic field is directly proportional to the rate of change of flux but when a wire  moving perpendicularly in a uniform magnetic field at constant velocity it is said that a potential is induced.But there isn't any rate of change of flux . So how does it induce a potential?
Comment: Flux is only defined for a closed loop.
Answer: You've brought up a great question that touches on the fundamental concept of electromagnetic induction. The statement that the induced potential (emf - electromotive force) in a magnetic field is directly proportional to the rate of change of flux is accurate, but it's also essential to understand how this principle applies to different scenarios.
In the case of a wire moving perpendicularly in a uniform magnetic field at a constant velocity, you're correct that there might not be an apparent change in the magnetic flux through the wire. However, the key factor here is the relative motion between the wire and the magnetic field.
When the wire is moving through the magnetic field, even at a constant velocity, the charges within the wire (usually electrons) experience a force due to their interaction with the magnetic field. This force causes a redistribution of charges within the wire, resulting in a buildup of charge on one end of the wire and a deficit of charge on the other end. This separation of charge creates an electric field within the wire.
This electric field, caused by the redistribution of charges, leads to the potential difference (voltage) across the ends of the wire. This potential difference is what we refer to as the induced emf. So, even though there might not be a change in the magnetic flux itself, the relative motion between the wire and the magnetic field leads to the redistribution of charges and the creation of an electric field, resulting in an induced potential difference.
In summary, the concept of electromagnetic induction is more subtle than just focusing on the rate of change of magnetic flux. It also involves the interaction between charges, electric fields, and magnetic fields, which can lead to the generation of an induced potential even in cases where the magnetic flux itself doesn't change significantly.


Doubts about creating a .Xresources file.

Question: I want to customize the look and feel of my xterm and have read that the way to do it is creating a .Xresources file and saving there the desired configuration. I've also learned that this file can control so much more than just the look of xterm, for example the screensaver and the mouse, among other things. My question would then be: if I create a .Xresources file and just write the settings for xterm, what happens to my screensaver, mouse and other stuff controled by .Xresources?
Answer: Only the values you explicitly define in your $HOME/.Xresources will override the system defaults.
So you could specify some settings as sugested by the Arch Wiki, and they would apply to any instances of xterm opened by your user, but all other settings would remain unchanged.
Answer: In a .Xresources file, settings consist of a resource name and a value. A resource name has several components separated by a dot. The first component is the name of the application, subsequent components are widgets in the application, and the last component is a setting of the widget.
A component name that starts with a capital letter is a class. For an application, that's the application name (e.g. XTerm for Xterm, unless overridden with the -class command line option). For a widget or individual setting, that's the type of widget or setting.
A component name that starts with a lowercase letter is an instance. For an application, that's the name of the executable (e.g. xterm, unless executed under a different name such as uxterm or overridden with -name).
You can also use the wildcard ? as a component name, and * to mean any sequence of subcomponents (so * means . or .?. or .?.?. or …).
Any resource specification that doesn't start with a wildcard will only apply to the specified application. (In practice, you can't really make useful non-application-specific resource specifications, as there's no unification in widget names.)
Any resource specification in .Xresources (or loaded otherwise) overrides the application's built-in defaults for that resource. (If wildcards are involved, complex precedence rules apply.) Other resources are not affected. Thus you don't need to copy any of the default settings, just write the ones you want to overwrite.
There's one exception of sorts: if you define key bindings, these are all specifies in a single resource (in the Translations class), so your set of bindings replaces the default set. To augment the default set instead, start the translation table with #override. Appendix B of the Xt Intrinsics documentation has all the details of the translation table syntax, but you don't need to read that, the examples in the Xterm man page are enough to grasp the useful bits.


H264 -> Container using .NET

Question: I have raw H264 video data that I want to wrap into some kind of container format so that I can play it in a video player like WMP or VLC, and I want to do this in .NET (C#), or C++. What is the easiest approach? Does anyone know of a free/open source SDK that would make this easy?
Comment: Have you checked out the API of the mkv splitter library?
Answer: You can simply play it through a WPF media element if the computer has the appropriate Codec's installed.

H264 -> Container using .NET


Bash script to check if a public HTTPS site is up

Question: I'm trying to setup another block of code to a bash script to check if a public website on HTTPS is up or not. Can we do this using CURL? Any suggestions what can be used besides CURL. Thanks
Comment: As Clippy might say, "It looks like you're trying to write a network monitoring system..."
Comment: https://www.pingdom.com/
Answer: One of many:
if curl -s --head  --request GET https://example.com | grep "200 OK" > /dev/null; then
   echo "mysite.com is UP"
else
   echo "mysite.com is DOWN"
fi

Comment: As of 2022 you will most likely have to use `grep "HTTP\/2\ 200"` since most servers will have switched to HTTP2 protocol
Answer: Here is a way to do it using wget instead of curl. Keep in mind that MacOS doesn't come with wget by default.
A successful web request will return a code of 200, a failure will return a 300, 400, 404, ect... (see REST API codes)
This line will return a 1 if the web request was successful, otherwise it will return 0
wget -q  -O /tmp/foo google.com | grep '200' /tmp/foo | wc -l
1

Comment: You can just use `wget` without the temp file: `wget --spider --server-response google.com 2>&1 | grep '200\ OK' | wc -l `. `--server-response` prints the headers, `--spider` prevents downloading the page itself.
Comment: `HEAD google.com | grep '200\ OK' | wc -l` avoids the temp file.
Comment: I'm aware of the multitude of applications out there to monitor websites but I wanted something simple to be included in my script. The wget -q option works great. Thank you.
Comment: wget is faster then HEAD in this case.
Answer: Nagios' check_http plugin can do this and much more, including checking for specific text in the response. You can run it from a shell script independently of Nagios itself:
$ check_http --ssl -H www.google.com -r 'Feeling Lucky'
HTTP OK: HTTP/1.1 200 OK - 11900 bytes in 0.086 second response time |time=0.085943s;;;0.000000 size=11900B;;;0

$ echo $?
0

Comment: This plugin doesn't have source, you should properly link this. The code is not known.
Comment: This has been an official Nagios plugin since at least 2002, according to the git logs: https://github.com/nagios-plugins/nagios-plugins. It isn't exactly obscure.
Comment: Do you mean this script can be used independently or are you suggesting to install this nagious thing just to solve the bash problem ?
Answer: Why not use a full solution for monitoring?
I've found monit to be pretty good for this: http://mmonit.com/monit/
(this comes after years of using home brewed bash scripts - i've found monit to be more transportable to different boxes, and more robust than some messy scripts. Don't know about their paid version).
Answer: a similiar question was answered here:
https://stackoverflow.com/questions/12747929/linux-script-with-curl-to-check-webservice-is-up
The Qoute is from Burhan Khalid

curl -sL -w "%{http_code}\n" "http://www.google.com/" -o /dev/null
-s = Silent cURL's output
-L = Follow redirects
-w = Custom output format
-o = Redirects the HTML output to /dev/null
Example:
[~]$ curl -sL -w "%{http_code}\n" "http://www.google.com/" -o /dev/null
I would probably remove the \n if It were to capture the output.

so you just need to add -k in the options if you do not want to check for a valid certificate and use https instead of http obviously.
curl -sL -w "%{http_code}\n" "https://www.google.com/" -o /dev/null

reports the status code 200 with a return code of 0.
For everything else you need to define your response in the script.
Comment: I don't think this works for https sites. For http yes, i get a exit status 0
Comment: tested again.
curl -sL -w "%{http_code}\n" "https://www.google.com/" -o /dev/null;echo $?
worked exactly at it should. you get the http code 200, and you get exit 0.

changed formatting, there was at least on linebreak not transfered.
Comment: It does work for google after the command was corrected. Thanks. However, it doesn't for our https site giving an output of 000. I'm using wget now


FSK carrier frequency estimation

Question: In the MPSK Modulations,  Cyclic Spectrum Density method can give a peaks, for example for the QPSK:

But in the FSK signal, this peaks do'nt appear. How to solve it?
Answer: To perform carrier recovery for FSK, if the data is random and can assumed to be equiprobable, then you can take the mean of the derivative of the phase versus time to determine the carrier offset.
Optionally the phase change from one sample to the next can be estimated using using a complex conjugate product of successive samples (for small angles, the imaginary result of the complex conjugate product of two normalized vectors is approximately the phase). Since this is the change in phase over a time interval, this result will be directly proportional to frequency:
$$f \propto Im(s(n)s(n-1)^*)$$
Where s(n) is the normalized complex FSK time domain signal.
Note in terms of I and Q samples this is simply:
$$I_{n-1}Q_n-I_nQ_{n-1}$$
The average of this result is proportional to the frequency of
the carrier and the deviation from average is the demodulated FSK signal. (The carrier component assuming a fixed offset can therefore be removed by using a simple DC Nulling Filter such as the one shown in this post: What does correcting IQ do?)
Since a small angle approximation was used, this provides a linear demodulation when the sampling rate is sufficiently high such that the phase change between two samples is a small angle such that $sin(\theta) \approx \theta$. For FSK that linearity is generally not as critical so would also work with much larger phase angles.

FSK carrier frequency estimation


Potential Cause for these Bay Window Cracks in Victorian House in London

Question:
Two diagonal \ and / cracks at lower part of bay window.
Can not tell if they are visible from inside as there is wall paper.
None of the neighbours seems to have any cracks.
Crack width seems at most 1 mm as was unable to squeeze-in a 1p coin.
There appear to be no other cracks inside or at the back of the house.
There are also mirror fault lines in the window sill, but I suspect they are just countours of the three-part stonework; or are they?
The front "garden" has a weird open D ~ 30 mm metal pipe/tube sticking out upwards -- looks like a super-short bin.
East London location.
Comment: Is that wall frame or masonry?
Comment: I suspect (based on geraintdavies.co.uk/stone-repair/bay-window-restoration) the wall is brickwork and window sill is stone.
Comment: Perhaps you are seeing signs of London becoming Venice... close to the Thames? Really it is age and settlement.
Comment: @SolarMike Relatively -- it is just above the boundary of the flood zone. Looking at satellite imaging data it also seems close to subsidence red zone; although this street is meant to be green zone -- the next parallel one is starting to hit the red zone though.
Answer: The cracks are caused by settlement, evident by the separation of the window sill and the wall. I suspect the settlement is caused by water. What you can do is 1) repair the concrete walkway and apply the flexible sealant to the concrete-wall joint, and 2) grade the ground, or correct the slope of the concrete walkway, to allow water to flow away from the building, also the downspout, if any.
After the corrective actions, patch the wall and monitor the situation. If the cracks reappear soon afterward, then you might need to contact a structural/geotechnical engineer to check/work on the foundation.
Comment: I have added an extra image of the window sill fault line; since they mirror -- I have assumed they are part of three-piece stone work. Or do you mean vertical separation of the window sill plane from the wall; that I did not notice, but could potentially see that in the second photo.
Comment: Thank you for clarifying. Do you think there is some probability of this being subsidence?
Comment: Sorry, I forgot to attach the photo that pointing to the problem. London is notorious for having soft clay, combined with water and time, the foundation settles. The problem seems minor for now, with proper remediation, you can delay costly repair to a much later date if it is inevitable. Do not forget to seal this joint too., so no moisture will get under the window.
Comment: I suggest checking around the house carefully for cracks and separation of the concrete walkway and the wall, and take notes. After sealing the cracks/joints, re-inspect at least once a year.
Comment: By bigger repair down the line, do you mean underpinning?
Comment: Yes, if the problem continues to get worse with all efforts end no avail.


Do I have to know RSA padding scheme in advance when verifying signature with EVP_Verify*?

Question: Is there a way to figure out what RSA padding type was used on signature during verification (when calling EVP_VerifyInit, EVP_VerifyUpdate and EVP_VerifyFinal) or is it a matter of convention which has to be known in advance?
Comment: Usually it's a matter of convention / explicit communication.
Comment: Anything left unclear after reading a few times the [nice manual](https://linux.die.net/man/3/evp_verifyinit)'s _"Due to the link between message digests and public key algorithms the correct digest algorithm must be used with the correct public key type"_?
Answer: For this answer I'll be focussing on solely on RSA (the RSA tag is present, so I'll suppose that this question is just about RSA). It is also the most likely signature scheme that requires padding, I suppose.
TL;DR: you don't just need to know the padding scheme in advance, but also the other configuration options to be used, such as data hash method and MGF1 (configured with it's own hash), salt and label for PSS.

Yes, the padding scheme is something that needs to be known in advance during verification and of course signature generation. There is no easy way of verifying which padding scheme is used from within most signature schemes without first performing modular exponentiation yourself, after all.
If you'd allow both PKCS#1 v1.5 padding for signature generation and PSS during verification (and rely on the verification result to be true for either one of them) then your verification may fail if a successful attack is launched on either one of the two schemes. Besides that, it would require you to perform the signature generation twice.
The same goes for hash functions, where the acceptance of a hash from a weaker hash function may lead to insecurities. Even if these kind of insecurities are not directly visible or possible, in general the security proofs of the algorithms generally do now allow the key to be used for different schemes.
Sometimes there are indications that using keys for different schemes is problematic. E.g. for PSS the following can be found in PKCS#1 v2.2:

This encoding method is parameterized by the choice of hash function,
     mask generation function, and salt length. These options should be
     fixed for a given RSA key, except that the salt length can be
     variable (see [JONSSON] for discussion).

Similarly, the withdrawn ISO 9796 specifications for signatures giving message recovery make it explicit that the configuration options need to be known in advance. It contains a section with three options in that respect:

Use of the signature schemes specified in this standard requires the selection of a collision-resistant hash-function h. There shall be a binding between the signature mechanism and the hash-function in use. Without such a binding, an adversary might claim the use of a weak hash-function (and not the actual one) and therebyforge a signature.NOTE 1There are various ways to accomplish this binding. The following options are listed in order of increasing risk.

Require a particular hash-function when using a particular signature mechanism. The verification process shallexclusively use that particular hash-function. ISO/IEC 14888-3 gives an example of this option where the DSAmechanism requires the use of Dedicated Hash-function 3 from ISO/IEC 10118-3 (otherwise known as SHA-1).
Allow a set of hash-functions and explicitly indicate the hash-function in use in the certificate domain parameters.Inside the certificate domain, the verification process shall exclusively use the hash-function indicated in the certificate.Outside the certificate domain, there is a risk arising from certification authorities (CAs) that may not adhere to theuserís policy. If, for example, an external CA creates a certificate permitting other hash-functions, then signatureforgery problems may arise. In such a case a misled verifier may be in dispute with the CA that produced the othercertificate.
Allow a set of hash-functions and indicate the hash-function in use by some other method, e.g., an indication in themessage or a bilateral agreement. The verification process shall exclusively use the hash-function indicated by theother method. However, there is a risk that an adversary may forge a signature using another hash-function.

I've included this mainly to show that when it comes to calling signature verification methods that the configuration options of the signature functions need to be known in advance. It makes sense that the signature algorithm itself and padding method should then also be known in advance.

For debugging or reverse engineering the methods used, it makes sense to perform modular exponentiation first. For PKCS#1 v1.5 padding the padding bytes will be immediately identifiable. If it just looks like random data then you are most likely dealing with a PSS signature scheme. Generally you can distinguish various initial and trailing bytes of the padding method as well. Unfortunately many different padding methods have been used in the past, more than you might imagine.


What are these stains on my drywall?

Question: Originally thought it was a burn but it looks quite similar to stains from another post made here. Only reason I'm concerned is because it's not circular. It is around the same size as an index finger. The house is only 8 months old.
Comment: Did it just appear or gradually since you moved it?
Comment: What's on the other side of that wall?
Answer: Knot stains happen when the sap of real wood transfers through the paint.  Knots are full of sap, and don't fully dry out when the boards are processed.  This can't happen with drywall.
What does commonly transfer through drywall is water, and I would guess that what you have here is a water stain.  It could be a leaky pipe fitting, or it could be condensation from an A/C line if that happens to run through the wall, but I admit that's probably not very common.
Since the house is so new, just call the builder.

What are these stains on my drywall?


How did Edward Norton's character stay alive at the end?

Question: All (or nearly all) in the movie Fight Club can be explained by the protagonist's mental disorder. But why does he stay alive and get rid of his alter ego after shooting himself? What is the meaning of this?
Comment: Possibly [helpful](http://movies.stackexchange.com/questions/3055/how-why-did-tyler-durden-got-shot-in-the-head) related question.
Comment: @TylerShads That might even be a duplicate? I remembered this to have been asked before, but when looking through the tagged questions I must have missed it.
Comment: @ChristianRau I'm torn because it asks how he stayed alive, but even from my answer most of it is the same.
Comment: Maybe he imagined Tyler die in a way the bullet would go through his head and just wanted Tyler to feel how the pain feels like?
Answer: When you watch the scene closely (I wish I had screenshots...might have to dig later) you can clearly see that he doesn't shoot himself in the back of the head, but really in the side of the mouth, albeit farther back than his cheek.
Even if you feel around with your tongue you can feel that it is just skin and muscle and nothing important until you get to your jawbone, we can assume he hit just before that, which explains why he is still alive.  A shot like that would hurt a tremendous amount, and probably bleed a lot, but it won't kill you outright, not unless you don't find proper treatment or something to close the wound.  Note I AM NOT A DOCTOR
The rest of this answer is C&P of my answer to a related question

It is then he realizes that he must follow Tyler's own advice and "hit bottom". Only by doing so, is he able to control his own body and "kill" Tyler. To hit bottom he realizes he must do something life-threatening and plain insane.
Whereas the bullet only blew a hole in his cheek, it was his mental F--- You to Tyler, showing him that he can take care of himself now, which is why the bullet is shown to have gone through the back of Tyler's head, killing him.


SHA-1 deprecation impact on personal PKI certificates

Question: I understand that most commercial browsers will stop trusting websites with SHA-1 PKI certificates by Jan 2017 so it is critical for websites to update to SHA-2 by that time. My question is, is it also critical for end-users to update their personal PKI certificates to SHA-2 by Jan 2017 to still be able to authenticate themselves to websites requiring certificate-based authentication? That is, will the browsers also stop supporting sending of SHA-1 certificates to websites during mutual authentication?
Answer: Web browsers will accept SHA-1 client authentication certificates. However, Web server may reject this certificate if authentication server (domain controller, for example) does not support SHA-1.
I think that most authentication servers will accept SHA-1 client certificates (at least Active Directory will do), because they are not subject of depreciation policy, but I would strongly recommend to upgrade your CAs to sign certificates with SHA-2.
Comment: Could you include some reference to support the answer? It's about future, so not easily verifiable now.
Comment: For example, Microsoft's SHA-1 depreciation policy : http://aka.ms/sha1
Comment: And which part exactly does prove (or even suggest) the client certificates with SHA-1 will be supported? I can see only `TLS Certificates - 2/14/2017 - Windows trusts SHA-2 only` under Schedule.
Comment: Thanks. So for me, as an owner of a website that requires certificate based authentication, it is a MUST that I upgrade my site to _serve_ SHA-2 certificate after 2016. If my web server is configured to _accept_ SHA-1 client certificates, it  is NOT required for my users to upgrade to SHA-2 client certificates even after 2016. So in a mutual authentication, it is possible for the server to serve a SHA-2 cert and accept a SHA-1 cert. Is that correct?
Comment: This section: http://social.technet.microsoft.com/wiki/contents/articles/32288.windows-enforcement-of-authenticode-code-signing-and-timestamping.aspx#Y
Answer: As far as I know, creating collisions for SHA1 hashes for certificates is theoretically possible but it still requires ~2^61 SHA compression (according to this paper from 2011). I don't know if there is more recent research on this topic with different results. The complexity of 2^61 means that only the most powerful players like NSA, etc. can produce a certificate that has the same hash as yours. If you are a high value target, then you should issue a new certificate but if you were you probably wouldn't have posted on this site.
Comment: That's not true. Collision attacks are not the same as pre-image attacks, and pre-image attacks are still infeasible against SHA1. (Although you still should be moving towards more secure hashes.)
Comment: Preimage attacks are also infeasible against MD5, but you shouldn't be using it either!


Is a lawyer required to discuss adjournment requests with a client before consenting?

Question: If an attorney receives a request from opposing counsel to adjourn an upcoming hearing, (which would then be communicated to the court as a joint letter) does he need to consult with his client or can he consent to the adjournment request on his own?
Comment: In some circumstances, yes. But a fully answer is more than can take the time to spell out and there are a variety of facts that matter.
Answer: canada
In Canada, the Codes of Professional Conduct, established by the regulating bodies in each province, have a rule similar to:

A lawyer must be courteous and civil and act in good faith with all persons with whom the lawyer has dealings in the course of his or her practice. (British Columbia)

A lawyer shall be courteous, civil, and act in good faith with all persons with whom the lawyer has dealings in the course of their practice. (Ontario)

The regulating bodies explain further (this wording from Ontario):

A lawyer shall agree to reasonable requests concerning trial dates, adjournments, the waiver of procedural formalities, and similar matters that do not prejudice the rights of the client.

Courts have held that it is not a breach of the standard of care to consent to an adjournment without seeking the consent of the client. Further, it will often be against the client's interests to oppose an adjournment sought by opposing counsel, especially given the costs of a hearing on an adjourment motion that could have been consented to. See e.g. Chen v. Melville and Scott, 2014 BCPC 380:

I do not find that consenting to an adjournment without the consent of the client to be a breach of the standard care, given Mr. Melville's obligation under Rule 7 of the Code of Professional Conduct, and his explanation to Mr. Chen by e-mail dated December 3rd, 2013, that Mr. Chen had not told him of any facts as a basis to assert prejudice, which would be the principled reason to oppose a reasonable request for an adjournment.
Leaving aside the commentary to Rule 7, and Mr. Melville's professional obligation to lawyers and others, Mr. Melville had been hired for his professional advice to Mr. Chen and to act in the best interests of Mr. Chen.  Part of that duty would involve informing Mr. Chen about the risks of taking positions unlikely to be successful in court, such as opposing a request for an adjournment that Mr. Melville assessed as reasonable and likely to succeed.  Opposing such a request and necessitating a court application would involve court time, court costs, costs to the client, and the result, in Mr. Melville's opinion, would be the same as if the request had been accommodated, but with extra time and money, including Mr. Chen's money, being spent.
Comment: Thanks. I've added the tags united-states and new-york-state, but I assume it's very similar
Answer:
does he need to consult with his client

By default, no.
Lawyers are vested with reasonable latitude in figuring out on their own what is in the best interest of their clients.
Not consenting (i.e. opposing) an adjournment comes at a cost, and the lawyer evaluates 1) whether the adjournment hurts the interests of his client in the first place; 2) if it does, whether any effort to fight it would be justified. If the answer to either of those questions is a definite "no", the lawyer would consent without talking to his client. If in doubt, he will talk.
However, a client is free to define their own terms of engagement with their would-be lawyer (yes, it goes both ways). So, a term could say "you shall check with me prior to making any decisions re adjournments". If the lawyer accepts this term, then yes he will need to follow it.
Comment: I'm not sure this is quite correct. I have no doubt the client can demand that the lawyer "check with me" before agreeing to an adjournment, but I suspect that a lawyer -- in the United States, at least -- is not free to delegate the actual decision to the client.
Comment: @jen has an answer that indicates the same is true in Canada.
Comment: @bdb484 The key word in "_A lawyer shall agree to reasonable requests_" is "reasonable". As we know, that definition is quite bendable towards the interests of either side. If a lawyer wants his client to be happy, he would argue what is reasonable and what is not.
Comment: That's not an unreasonable reading of the rule. Just the same, I think this answer would benefit from some kind of law supporting it, as it is indistinguishable from a random guess at this point.
Comment: @bdb484 We don't need laws to allow things, only to prohibit. I am not aware of any law prohibiting a lawyer from taking into account the view of their client in making decision whether to consent to an adjournment. You don't seem to be aware of one either. So, odds are it doesn't exist, in which case the answer is correct.
Comment: That sounds like a confirmation that this is just a guess. And I suppose it's fine to just make a guess, but it would probably be better to disclose that you're just guessing rather than offering a statement of the law.


How are stock market indices such as S&P 500 daily volume calculated?

Question: How are these indices volume calculated? Is it weighted average or a simple sum?
Answer: Most sources use a sum of trade volume of the constituents without weighting.
Some sources only use trades that occur on the primary exchange, others use all trades reported to the consolidated tape.  We use the latter.
It's worthwhile verifying the exact methodology used with your data source.
Cheers,
Richard.
Full disclosure:  I am a co-owner of Norgate Data, a data vendor in this area.


Django Action Append Slash

Question: I am making development, and my POST request come like config/alert and I am trying to catch it with action decorater below.BUT Django does not catch it It wants config/alert/ but It is not possible to change incoming url add the SLASH.
@action(methods=['post'], detail=False, url_path='alert')
def get_post(self, request, pk=None, *args, **kwargs):

How can I modify the action to listen without slash in POST request?
Answer: I found the solution adding extra APIView and putting ? end of the re_path in urls.py
re_path(r'alerta_forward/alert/?', post_data)

With using ? it became option slash, then I called an APIView.
Answer: I guess you have to check the APPEND_SLASH setting in your settings.py file.
You can find more information about option here: https://docs.djangoproject.com/en/dev/ref/settings/#append-slash

Django Action Append Slash


Does being out of trim affect drag?

Question: If the aircraft is not trimmed correctly and either the pilot or autopilot is having to use constant pressure on the elevator does this increase drag?
Comment: @RonBeyer You're forcing it to hold an attitude trimmed or not. My non-pilot intuition tells me it depends on the trim system. If the whole stabilizer moves it prob helps to trim but if it uses trim tabs then it's really just using the elevator anyway. It just helps you hold it in position
Comment: @RonBeyer Here's my thinking: You're in an ac with a trimmable stabilizer trimmed for climb. When you level off you push forward the yoke forcing the elevator down. You set the a.p. to maintain speed and altitude without re-trimming. The tailplane exerts the appropriate downforce to maintain the wings at the correct AoA for the set speed. In climb config the stab is trimmed slightly downward and now the elevator is also pointing downward to maintain level flight. Seems like it would produce more drag like that than if you re-trimmed so that the elev is neutral and aligned with the stab.
Comment: This should have the same effect, minus feedback loop issues if the pilot doesn't input exactly the right amount of pressure
Comment: I've been told that an aircraft will find its trim speed/attitude if left untrimmed, which leads me to believe that you may be increasing drag by trimming it (aka forcing it to hold an attitude), but somebody a little smarter than me will have to confirm or refute that claim...
Comment: @TomMcW Not really, think of it this way, if you are going too slow, the nose will drop and you'll pick up speed, as you pick up speed lift becomes greater and the nose will rise. Same if you are going too fast, your nose will come up, speed will bleed off, lift decreases and the nose drops. Aside from the oscillations after some period of time the aircraft will find its trim speed (even if the trim is neutral).
Answer: Normally not; details depend on the control system and by how much the aircraft is out of trim. The force produced by the empennage will be the same in the trimmed state and when out of trim, only the control forces are different.
Let's examine the different possibilities:

Adjustable spring (as used on some light aircraft and gliders): The elevator deflection will be identical to the trim position, so there is no difference at all.
Trim or servo tab on the elevator: The tab deflection will be different, but the elevator position will be practically identical. For tab angles of less than 10° relative to the elevator there should not be any difference in drag.
Adjustable stabilizer: Now the elevator deflection will be different, and depending on the trimmed state the deflection angle might cause higher airfoil drag. If the elevator deflection relative to the stabilizer is more than 10°, a slight drag increase can be expected.

If the power consumption of the autopilot is higher in the out of trim case, this might cause higher generator loads and more engine power is needed to keep it powered. But this effect should be very small.

Does being out of trim affect drag?


What's the relation between "categorical" and "category"?

Question: categorical and category look quite similar. I also search the etymology on google as follows, which shows there is a connection between them. But categorical means "unambiguously explicit and direct", category means "a class, a group". I really can't find a clue how they are connected. Please clarify.
Answer: Categorical
In traditional logic (that is, the tradition that started with Aristotle), a categorical proposition is one that affirms or denies a predicate of a subject. That is, a categorical proposition says "A is B" or "A is not B". For example, "Emily is happy" or "American foreign policy in the 21st century doesn't have a clear objective." That's as simple a proposition as you can get.
A hypothetical proposition is one that says that if some condition is true, then some proposition is true. For example, "If the printing press is working again, then Emily is (probably) happy."
When people use the term loosely, to say that a proposition is categorically true or that they are making a categorical statement, they mean that the proposition is true without additional conditions, especially unstated conditions. That is, they mean that the proposition is categorical, not hypothetical. But they mean it in a stronger sense than what is used in logic. They mean that there is no need to entertain doubts, qualifiers, conditions, ifs, ands, buts, etc.--because the statement says it all, end of story.
Category
The connection with category is more obscure. Aristotle used the term "category" to mean what today we would call a predicate: that is, something that you can say about something else. For example, the predicate in "Emily is happy" is "happy". Aristotle famously tried to organize all predicates into ten fundamental kinds, called "the ten categories" or simply "the categories". Today, we still use "category" to mean predicate, but the emphasis is on grouping things that share a common predicate. For example, you might put Emily into the category of happy people. Really, that means the same as "Emily is happy", but it encourages you to think in terms of groups: happy people and unhappy people. Or you might define a category for purposes of grouping: "All people whose names start with A through E, please wait in this line; etc."
A solecism
As Brian Hitchcock noted, sometimes people say "categorical" to mean a universal proposition with no exceptions. In fact, categorical propositions don't have to be universal; they can refer to just some of something or just one thing: "All women are happy", "Most women are happy", "Some women are happy", "Hardly any women are happy", and "Emily is happy" are all categorical propositions, differing by what logicians call "quantity". The first one is called "universal", the last one "singular", and the others "particular" (since they refer to part of the subject being talked about).
The usage of categorical to mean "universal" is  understandable because there's a connection between universality and lacking conditions, but people who know the connection between "category" and "categorical" consider that usage a solecism. A statement about just one person or thing can still be "categorical" in the informal sense of "this is the full statement, no additional conditions needed". For example, "The Harbaugh report is categorically not true!" doesn't mean anything about lacking exceptions. It means that Jim Harbaugh will still be the head coach of the 49ers next season, regardless of people's doubts about or dislike of Harbaugh.
Most people today don't know the distinction between categorical and hypothetical.  People who know what categorical means usually don't use it in the sense you found in the dictionary, meaning "unconditional", "explicit", "without exceptions", etc. A sentence like "Are you stating that categorically?" comes across as trying to use a big word without knowing what it means. Categorical is logic jargon, to be used precisely. When people use it loosely, usually they're trying to bully someone into backing down by sounding like they're speaking very precisely and formally when really they're just putting on airs. A similar abuse of logic jargon is the use of ad hominem to mean an insult.

Note that "predicate" above means the sense appropriate for logic, not for grammar, although the two are closely related, of course.
Answer: This is speculation based on what information I can find, rather than academic certainty, but here's my best guess:
The two words share a common etymology, rather than one springing from the other. The origin is shown here: The word "categorical" comes from a Greek word meaning "accusation, prediction, category", and later "assert, assertion", and also "name" (to "assert" means to outright state something, but in philosophy and logic an assertion is similar to "naming" something).
Categorical comes from the meaning of a strong assertion (to say something strongly or absolutely), while category comes in a roundabout way from the meaning of naming something (a "category" could mean, in late Greek/Latin, a name for a group (or category) of things).
Answer: You'd think that a "categorical" statement would be a limited statement rather than an unconditional statement.
However, such a statement refers to the category "all things and all cases that could be considered relevant to our conversation."
So a "categorical statement" is universal, rather than applying only to certain specified cases. It's not really a different meaning of "category", it just stretches that meaning a long way.
Answer: I have been confused about this subject because I had assumed they were related terms and so it seemed more logical to me to say

"I uncategorically deny that I had sexual relations with that woman".

From my previous thinking, that would have meant I deny it without placing that denial into some categorical setting that will let me off the hook.  (Oh, hand contact is not sexual relations).
I can see how there might be a relationship between the senses of the words.  If something is within a category, then it is definitively in that category.  I definitively deny - I am clearly in the category "no".  But that is just unresearched speculation.
Comment: Can you address the given question more clearly? Answers are expected to be definitive and authoritative. You can support your answers with reputable resources, like dictionaries.


Is there a function or an Api that allows me to remove a user from all existing Data extensions?

Question: According to Habeas Data law, when a user wants to revoke the authorization to receive communications, we must not keep user information in any Data Extension, so we need to look for a user record in all Data Extensions to delete all their information, is there any way to do this?
Answer: You can use contact deletion framework to remove a specific contact/subscriber key from all sendable data extensions. In order to do so (as per documentation):

Navigate to All Contacts in Contact Builder.
Select the checkbox next to the contact. Click the bin symbol, and select Delete selected contact.

Or alternatively- use the API route
You might need to enable contact deletion, if above step is not available.
Do also take a look on this Trailhead module about contact deletion.
It is also possible to automate contact deletion, if you need to do it on regular basis.
Comment: As a note this is only sendable DEs and allsubs/all contacts. Any non sendable DEs will retain their info


Historical record of Senate primary vote total predicting statewide presidential result

Question: I was thinking about a potential swing state (Georgia) and the fact that the Democrats got 8 percentage points more votes than the Republicans. I was thinking about the historical accuracy of this as a metric for partisanship. How accurate were Senate primary totals in predicting statewide winners in presidential election years since and including 2008? What I mean is the party with the most votes in Senate primaries going on in the presidential election and winning the electoral votes.
Comment: The answer is very likely no, for reasons similar to those in another recent question about whether primary turnout predicts general election success in U.S. Senate races.
Comment: Does the answer below solve your problem, or can I improve it?
Answer: In general, there is a decent correlation between the margin of victory in the Senate primaries - in terms of the total number of votes - and the margin of victory in the Presidential election. However, it is questionable whether this metric is a good one to use when predicting the result, for the same reasons Joe W laid out in his answer to a related question. The data I used to examine this is from the FEC election results found here.
The graph below shows that there is a fairly clear overall relationship between the two variables, with a correlation coefficient of ~0.68. However, we can see also that the relationship varies quite significantly by year. For example, in 2008, six states recorded higher participation in the Democratic Senate primary than the Republican primary - but voted for McCain in the presidential election. On the other hand, four years later in 2012, seven states recorded higher participation in the Republican primary - but supported Obama in the presidential vote.
To take your example of Georgia - in 2008, the Democrats had far higher participation in their Senate primary - 812,280 votes compared to 392,902 in the Republican primary. In 2016, this was the other way around, with 577,660 votes in the Republican primary compared to 310,053 in the Democratic primary. On both occasions, the margin of victory in the presidential election remained the same, at ~5 percentage points in favor of the Republican candidate.


Time in spaceships near the speed of light

Question: I know that the time on a moving object moves slowly compared to a stationery one, but if someone on a spaceship that moves at V=0.5c and a person is driving it. Will he notice that the clock on his spaceship moves slower or he will feel the same as he was stationer.
Answer: The way to answer this question is to ask how does the person in the spaceship know they are moving at half the speed of light, other than by looking out of the window?  They don't: so all the laws of physics are the same for them as for anyone else, and their clock keeps perfectly good time.
Answer: Since you already know that moving clocks run slow, you can use a symmetry argument to answer your question. If the spaceship is moving with half the speed of light relative to you, then you are also moving with the same speed relative to the spaceship. From your point of view a clock on the spaceship is running slow. From the point of view of the spaceship, your clock is running slow.
Answer: In the spaceships frame of reference the stationary onboard clock will run faster than your clock when you move it but first noticeable if you had a really, really fast bike. If you don't move at all, the clocks will show the same time no matter what speed the spaceship has according to the ground controller or the captain, but the ground controller will think the onboard clock is slow.


Is it OK to use player supplied music in my game?

Question: Is it copyright infringement if I create a game based around music beats but allow the players to use their own mp3 files?
Comment: Where exactly do you see an infringement if you do not provide the music?
Answer: When in doubt, always talk to a lawyer. People on this website are not qualified to give legal advice. That includes me, so don't come back and sue me for giving you incorrect information.
That said, you have to copy something to be breaking any copyright laws. If you're using the music files in-place on the player's computer, you can't be infringing on any copyrights. (There have been arguments made that, when you open a file, you are copying the file to memory and should be subject to those copyright laws. I don't think they were taken very seriously, though.)
Even if you copy the files to another location on the same device, I can't see that being a problem.
Just don't move the player's music collection to the cloud. That can get you in trouble.
Comment: There actually is a protection for providers who are only hosting user-uploaded files, but that protection requires that you comply with various requirements and appropriately handle DMCA takedown request. Definitely talk to a lawyer and get some professional advice from experienced cloud developers.
Answer: Your use of music should stay within the boundaries of personal use. Your case is not very different from listening to music while reading a book. Even the book can suggest to go get and listen a music track while reading one of its chapters.
The game should act like a local music player. It shouldn't publicize the gameplay on social media, multiplayer modes shouldn't broadcast music to other peers, you shouldn't keep the data in cloud where the user can grant access to other users...etc Then there should be no problem.
BUT! It is always a good practice to take legal advice from a lawyer before starting something serious.


SPSS statistics vs modeler

Question: I have a problem statement like to predict the loan defaulter with the given 5 to 10 years data. I was told that we could use SPSS, but I'm new to this. Also, I see that there is Statistics and Modeler. Are they two different tools? which one should I explore for my problem? Can someone help?
Answer: They are different tools from the same company. Modeler it's more intuitive but statistics it's a great software as well. Both could do predictions as you need.
You can try time series models or multiple regression to do that. Take a look on the officials manuals from IBM also to help in your decision.

SPSS statistics vs modeler


What are practical uses of over-damping?

Question: We have been given this task of preparing some small research on critical damping and comparing its behaviour and uses with over-damping. I am done with everything else but have been unable to find practical uses of over damping. It'd be great if someone could explain where it's desired.
Comment: This question seems to be more of an engineering question, and potentially doing homework for you.  My only hint: What happens in objects where you don't know it's exact characteristics (like mass/stiffness may vary to an extent, such as in a car) and overshoot must be avoided?
Comment: [Applications of overdamping?](https://www.physicsforums.com/threads/applications-of-overdamping.756931/).
Comment: Hello, I have been through this page but I kind of found it to be vague and more of a convo between two people rather than something that I can understand as a newbie.
Comment: The practical uses are situations where "overshooting" would be a disaster. To repeat the examples in the link, if a plane is landing and controlled by an autopilot, an overshoot which causes the plane to attempt to fly below the level of the runway probably won't end well! The same is true for controlling a machine tool (which is subject to random vibration caused by cutting the material) - if you cut too deep, you end up with scrap metal. Controlling an autonomous vehicle would be another example - you don't want to overshoot when stopping in a confined space for example.
Comment: @alephzero how about the automatic control of a  foundry crucible pouring molten iron! Imagine what overshoot might lead to.
Comment: This post (v2) seems like a list question.
Answer: 'Critical Damping' is a descriptive term given to 2nd order linear dynamic systems where the damping factor is ~ 1.0. And for the 2nd order system critical damping provides a settling towards your equilibrium point as quickly as possible without overshoot or bouncing about the equilibrium state: a smooth however rapid transition. If you specify critical damping you might be trying to get your system to settle with an asymptotic trajectory as quickly as possible  like targeting a data track on a disk drive for example.
But with overdamping you are further reducing speed for smoothness of settling to your equilibrium value. Any example of public transportation braking systems would be good examples where the desire is to provide the rider with comfort over the speed of coming to a stop. Like a train, elevator or automobile.
Comment: Every textbook I've seen defines the critical damping factor as $1.0$ (exactly), not $\sim 0.7$. Is $0.7$ an approximation to $1/\sqrt{2}$, in some alternative formulation of the math? Or is it just an empirical number used in some application area (control engineering or whatever)?
Comment: @alephzero thanks. Not the first time I've forgotten that. Corrections made!


Fetch child account name from parent

Question:

Estimate is the parent and it has Bid Request as a child. In Bid request there is a field "Name" Above the "Bid Estimate" field, display the selected Contractor's name that is associated to the accepted bid."Accepted bid" is a pic list value.
Comment: What's your question? Which Child are you trying to find via a Lookup and what have you tried?
Comment: I have to fetch the contractor name "Ernest Starr" .For this i have created a formula field and trying to fetch the value from there.But the problem is in Insert field i couldn't find the relation to Bid Request from Estimate object.
Answer: You'll want to go to Setup and search for Schema, then click on Schema Explorer. Once there, deselect everything, then click on custom objects and find your Estimate, Work Order, Bid Request and Contractor Objects. I'm guessing that Contractor will have also have a lookup to either an Account and/or a Contact. Schema Explorer will show you if that's the case once you click on those objects.
Generally speaking, you should have a Many to One relationship between Estimate and Bid Request, or at least that's what I'd expect. That would likely be a Master-Detail relationship but depending on who created the application, it could be something else (not what I'd expect, but I also don't know the other objects or all of the application).
There are several ways of querying this, each of which depends on where you want to start from. From looking at your screen captures, you should be able to write a query on the Bid Request that would look something along these lines to get the Contractor Object Lookup Id Record (from there, it would depend on what your schema looked like):
Bid_Request__c Request = [Select Id, Name, Contractor, Amount FROM Bid_Request__c
   WHERE Name = 'BID-05512' && Amount__c = $3772.00 && Selected_Bid__c = true limit 1];

Be sure to check the object and field API names I've used above are correct since I've made some assumptions here that may not be accurate.
That should return the Id of the Contractor Record as the result that's contained in Request.Contractor. You could also query the above starting from the Estimate Object using either a __r relationship, as part of a Parent-Child query or possibly in a sub query. Again, I'd need to see your schema to know for certain.

Fetch child account name from parent


Predicting/simulating magnetospheres of exoplanets?

Question: Based on atmospheric parameters, size, or distance from the star, is there any way to simulate or predict the magnetosphere of an exoplanet? Are there programs (similar to climate models for atmospheres) that can simulate magnetospheres?
Comment: The only planet anyone has every truly simulated with any real fidelity is the Earth. You need seriously high-end code and super computers to simulate something as complex as planetary magnetic fields. As AtmosphericPrisonEscape says, to try and simulate this for an exoplanet which we know almost nothing about is 99.9999% guesswork and any results would be meaningless.
Answer: The magnetosphere is usually not generated by the atmosphere, but by the interior ferromagnetic flows of a planet. I say usually not, because Venus is an exception for the terrestrial planets in our solar system.
But in general rocky planets will exhibit a wide range of interior flow conditions, depending on their individual composition and state of cooling.
Gaseous planets can be a bit easier in that case, if one accepts uncertainties about the properties of metallic hydrogen.
If you then simply go an assume you know all those complicated properties, then sure, you can simulate something. But it's not a scientifically testable prediction only playing around with parameters, as long as it's not tied to a specific object.


Where should I install skirt boards on my oak stairs?

Question: I have had oak awaiting installation on my existing stairway for well over a year and will soon get to putting it in. The "experts" gave me (supposedly) all the necessary materials BUT I only have 1 10 inch x 8 foot board for a skirt. This will only be enough to skirt one side. Should I skirt the inside (already has a wall above the stairs) or the outside (railing on this side with wall below the stairway). Is there a preferred way for a single skirt?
Answer: You really need another skirt board for the wall. When I have my druthers, I make the skirt board the same thickness as the base that will meet it at the top and bottom so it ties in continuously. If need be, I rip a base so the top element, if it has a profile, will make it look like the base goes right up the wall along with the treads.
As a mention, the material you have for the skirtboard would be used on the outside where the wall is under the staircase, using riser brackets to help hide some of the joinery.


Why can't I install Ubuntu from Live USB?

Question: I have been using Ubuntu and other distro's for years, but I have never had such difficulty trying to install it for a friend.
I am trying to install Ubuntu 12.04 from Live USB to an HP Mini 210-1036VU netbook but I am getting faulty medium errors. I have tried another  USB drive, alternate install, using USB creator and Unetbootin from two different computers and different release image versions (12.04.01, 12.04.02 etc) & all to the same end!
On the HP Mini the disk check boot mode gives one error. It's clean on my own laptop and image checksums are matched.
Should I try booting from an external disk drive? Is there possibly some discreet limitation to booting from a USB drive on this computer? Hardware drivers? I haven't found the same problem in forums yet.
I'll try to provide more data on request.
Comment: Do you get a error message, and what does it state exactly? And which version of Ubuntu are you trying to install (32 or 64 bit?)
Comment: First, just to make sure you are using the latest Unetbootin and not older versions. personally I don't unetbootin. I use rufus (http://rufus.akeo.ie/) cuz it's faster and seems like a better tool. Sometimes these tools need custom-scripts written for the installation of newer linux iso image because not all iso image are created equal. Can you boot up (not install) that live-usb drive on a regular desktop? btw, sometimes you can install a linux distro onto a computer with a bootable usb image but you cannot boot up its live-usb image to test run it because live-usb has a different setup scrip
Answer: I've been just as frustrated as you before, and as it turns out, I had failed to check BIOS.
You didn't mention you've checked BIOS, so maybe checked that?

Booting order/sequence on BIOS is important, USB must be on top.
Also make sure that Allow booting from usb is checked.
Also unplugged any other usb device that may be interfering.

I hope this was useful :-)


Fundamental groups of compact Kähler manifolds

Question: This is a sort of a follow-up to this question, and especially to Sean Lawton's answer: The book Fundamental Groups of compact Kähler manifolds (which, in my opinion, is one of the best mathematics books on any subject) is fantastic, but is over twenty years old now. Can someone summarize how the state of the art in that field has advanced in the intervening period?
Comment: I would say that the progress has somewhat incremental since then, but there have been some nice results proven in the intervening years. Let me see if I can put together an answer later (at least it would be nice distraction from reading the news...)
Comment: I like a lot this one: https://arxiv.org/abs/1609.08474
Answer: This is a bit off the top of my head. So if someone feels I omitted some important development, feel free to mention it to me in a comment, by email, or in your own answer.
One can also look at Burger's Seminaire Bourbaki report on Kähler groups from 2010 for a more recent survey.

A natural question, open in the 90's, is  what one-relator Kähler groups look like. This was settled by Biswas-(Mahan)Mj and Kotschick. They are fundamental groups of (orbifold) curves.
Delzant proved that solvable non-residually nilpotent groups aren't Kähler. (In the 90's Nori and I proved this under certain finiteness conditions, which were unnecessary in hindsight.)
It's still an open problem to determine whether the class of Kähler groups is the same as the class of fundamental groups of smooth complex projective varieties. Campana-Claudon-Eyssidieux showed that for linear groups these classes are "virtually" the same.
It's still open to decide whether mapping class groups are Kähler in general. For genus 2 and 3, they aren't (Veliche, Hain resp.)
Infinite three manifold groups aren't Kähler (Dimca-Suciu).
Comment: Actually in point 3. above, one can remove "virtually". Claudon has written a note to improve his paper with Campana and Eyssidieux ( http://www.iecl.univ-lorraine.fr/~Benoit.Claudon/tori_equivariant.pdf )
Comment: Concerning point 3) in dimension three, see my answer below.
Answer: It is still open whether or not all Kahler groups occur as the fundamental groups of smooth complex projective varieties.  However, there has been some interesting work on which groups can occur as the fundamental groups of complex projective varieties with only mild singularities.
Kapovich-Kollar proved in
M. Kapovich and J. Kollár,
Fundamental groups of links of isolated singularities.
J. Amer. Math. Soc. 27 (2014), no. 4, 929–952.
that every finitely presented group is the fundamental group of a complex projective surface with simple normal crossing singularities.  The varieties they construct are not irreducible; however, Kapovich proved in
M. Kapovich,
Dirichlet fundamental domains and topology of projective varieties.
Invent. Math. 194 (2013), no. 3, 631–672.
that every finitely presented group is the fundamental group of a complex irreducible projective surface whose singularities are simple normal crossings and Whitney umbrellas.
Answer: As Donu mentioned, it is an open problem whether every Kähler group is projective, i.e. the fundamental group of a complex projective manifold (equivalently, a complex projective surface).
This question is closely related to the Kodaira problem, which asks whether every compact Kähler manifold can be deformed to a projective variety (at least after passing to a minimal model).
Using this relationship, the problem on Kähler groups has recently been answered positively in dimension three, in a series of papers.
So let $X$ be a compact Kähler threefold. We make a case distinction according to the Kodaira dimension $\kappa(X)$.

$\kappa = -\infty$: $X$ is uniruled, and the MRC quotient $\varphi \colon X \dashrightarrow Z$ induces an isomorphism $\pi_1(X) \cong \pi_1(Z)$. Since $\dim Z \le 2$, $\pi_1(Z)$ is projective.
$\kappa = 0$: A minimal model $X'$ of $X$ admits a locally trivial deformation to a projective variety, so $\pi_1(X) \cong \pi_1(X')$ is projective (Graf).
$\kappa = 1$: Same line of argument as above (Lin).
$\kappa = 2$: Claudon, Höring and Lin proved that $\pi_1(X)$ is projective using the theory of elliptic fibrations.
$\kappa = 3$: A Kähler manifold which is Moishezon is already projective, so there is nothing to show.
Answer: I would like to add a new comment to this old question, since a new book written by Pierre Py will appear, named as "Lectures on Kähler groups".
The link for the draft is: https://www-fourier.ujf-grenoble.fr/~py/notes-on-kahler-groups.html


Something wrong in the datetime format

Question: When i compile the application in my laptop it runs fine but when i run the same application in the server something is wrong with the date format. But when i checked the system date time format wit my laptop and server it the same format. Can anyone tell me what is wrong.
Comment: More info. What do you mean by something is wrong with the format?
Answer: You also have to check the default culture set in the laptop and the server. Are they running in the same culture? Different culture settings will have different default time formats.
Answer: Is your application running on the server under a different user account?  Regional settings are per-user so date and time formats will depend on the user that the application is running under.  You can log in as the application user and check the Regional settings to determine if that's the issue.
This is really common in ASP.NET where the developer builds the app on their workstation and upon deployment to QA or production they find that Regional settings differ because the App Pool is using a service identity.
Answer: Is the system clock running UTC, and the OS changing it to local time on the server.  This is a pretty common configuration, but will break programs that bypass the OS's functions to retrieve the date/time.

Something wrong in the datetime format