How can I determine if a process has a window, and subsequently show, hide or close it?

Question: Is it possible, either through a shell script or terminal command, assuming you have the PID, determine if it has a main window (form), and then get info about it (title) and show/hide/close it?
Comment: Possible duplicate of [Can I minimize a window from the command line?](http://askubuntu.com/questions/4876/can-i-minimize-a-window-from-the-command-line)
Comment: This question is *not* an exact dupe, since it includes tracing down (possibly multiple) windows of an application with given `pid`, then perform an arbitrary action on it.  The linked question only asks for on element of that.
Comment: Dupe question asks about choosing any already open window. The answers there ( not necessarily the accepted one ) provide sufficient info. But that's my opinion :)
Comment: @Serg the *question* defines the dupe, not possible answers. Apart from that, I don't see *this* question answered there.
Comment: I never said answers define the dupe, I only said they provide sufficient info for what OP wants to achieve. The possible dupe question asks  "Is it possible to minimize a window from terminal ? " This one asks "is it possible to show/hide/close it? " So aside from just asking for extra operations (which can be achieved with the same set of commands  ), technically they are duplicates.
Comment: @Serg We might have to remove the comments, but *just asking for extra operations* defines half the question, if not more, so how can this be a dupe? Thousands of questions here have an overlap (probably bigger then this one), without being a dupe.
Answer: Script to look up possible window(s) of given pid, then show, minimize or close it
Since you mention the command line, the script below runs in a terminal window. You run it with the pid as an argument, e.g.:
python3 /path/to/script.py 1234

Subsequently, a window (list) appears, of which you can choose a (list-) number and type an option to perform on it:
Current Windows for pid 2189:
------------------------------------------------------------
[1] Niet-opgeslagen document 1 - gedit
[2] testbackup.py (~/Bureaublad) - gedit

------------------------------------------------------------
Type window number + option:
-k  [kill (gracfully)]
-m  [minimize]
-s  [show]
Press <Enter> to cancel
------------------------------------------------------------
1 -k

If there are no windows:
There are no windows for pid 1234

The script
#!/usr/bin/env python3
import subprocess
import sys

pid = sys.argv[1]

message = """
------------------------------------------------------------
Type window number + option:
-k  [kill (gracfully)]
-m  [minimize]
-s  s[how]
<Enter> to cancel
------------------------------------------------------------
"""
# just a helper function
get = lambda cmd: subprocess.check_output(cmd).decode("utf-8").strip()
# get the window list
wlist = [l.split()[0] for l in get(["wmctrl", "-lp"]).splitlines() if pid in l]
# create a indexed list of window name, id
wdata = [[i+1, get(["xdotool", "getwindowname", w_id]), w_id] \
         for i, w_id in enumerate(wlist)]

# if the list is not empty (windows exist)
if wdata:
    # print the window list
    print("\nCurrent Windows for pid "+pid+":\n"+"-"*60)
    for item in wdata:
        print("["+str(item[0])+"]", item[1])
    # ask for user input (see "message" at the top)
    action = input(message)
    action = action.split()
    # run the chosen action
    try:
        subj = [item[2] for item in wdata if item[0] == int(action[0])][0]
        options = ["-k", "-m", "-s"]; option = options.index(action[1])
        command = [
            ["wmctrl", "-ic", subj],
            ["xdotool", "windowminimize", subj],
            ["wmctrl", "-ia", subj],
            ][option]
        subprocess.Popen(command)
    except (IndexError, ValueError):
        pass
else:
    print("There are no windows for pid", pid)

How to use

The script uses both xdotool and wmctrl:
sudo apt-get install wmctrl xdotool

Copy the script into an empty file, save it as get_wlist.py
Run it with the command:
python3 /path/to/get_wlist.py <pid>

Explanation on the procedure

About xdotool and wmctrl:
To manipulate, move or close windows, there are two important tools on Linux: xdotool and wmctrl. Of these two, xdotool is probably the most robust one, which I prefer in general. Although the options of both tools overlap, they do complete each other however, and to create a window list we simply need wmctrl.
In most cases therefore, I end up using a mixture of both tools.

What the script does:

The script gets the currently opened window list, using the command:
wmctrl -lp

Which gives us information on both the window id and the pid it belongs to, with an output, looking like:
0x05a03ecc  0 2189   jacob-System-Product-Name Niet-opgeslagen document 1 - gedit

The script then filters out the windows, belonging to the corresponding pid, looks up the window name with the xdotool command:
xdotool getwindowname <window_id>

and displays the found windows by name. Under the hood, these windows are numbered.
subsequently, if the user types a number + an option, the corresponding action is performed on the chosen window:
wmctrl -ic <window_id>

to close the window gracefully, or
xdotool windowminimize <window_id>

to minimize the chosen window, or
wmctrl -ia <window_id>

to raise the window.


Effective system to backup this setup?

Question:
Possible Duplicate:
Software to backup data and files on a Windows computer

I currently have my development environment on a usb hd. It has things like portable xampp, virtualbox with ubuntu guest, portable firefox and other dev tools. It works fantastic! I can attach it to almost any computer and all works fine.
However, if this drive decides to go suicide on me I will be close behind it.
The problem I'm having is I use this portable HD almost all the time and so I need a fast way to backup the entire drive. It is around 400gb. Any advice?
Answer: Use an incremental backup method such as rsync or any other method that suits your OS.
Only files that have changed are backed up, so even if the drive is 400GB, most probably only a small portion of that changes from backup to backup. This will only transfer the parts that have changed, but to know this it obviously has to read all files and compare them with the backup. You can simplify the test to only check the modification dates, or you can exclude certain directories that you know does not change (or are not important to back up). The customization is up to you and your particular situation.
Answer: Microsoft SyncToy is an excellent tool provided by Microsoft that will allow you to back up everything on the drive. It supports detecting only changed files, allowing you to backup often without having to transfer the entirety of the drive each time.
Answer: bvckup (currently free) works pretty well for me. It only does one way sync (which is good enough for your needs), checks differences, and only updates the changes. Its pretty fast, and dead simple. It'll do drive to drive backups, so you can back it up to your main system.
I'd note the portable apps are pretty small, so you could probably shove them on some online backup software like dropbox or spideroak for additional safety.

Effective system to backup this setup?


Hosting static aboutus page on S3 bucket and linking to godaddy

Question: I have a domain through godaddy (www.example.com) and it is hosted on a different server. I also have a static aboutus page that I have in an S3 bucket. How do I link my aboutus page to the main website so that it has a URL of www.example.com/aboutus? What changes should I make in my DNS settings?
Comment: The DNS does not work at the URL level. With both `https://www.example.com/` and `https://www.example.com/aboutus` the DNS is involved in exactly the same way, just to resolve `www.example.com` to some IP addresses. It is then the webserver at this IP address that has to generate the content based on the full URL. So it is a matter of configuring your webserver, maybe with a redirect or a proxy, to fetch the specific page from elsewhere.
Answer: It is not possible to use DNS to point different pages on the same host name at different servers.  All the documents on www.example.com have to be served from the same server.   DNS can only point www.example.com to one IP address.  It can't be split up based on pages.
There are however, some things you can do instead.
Use a subdomain
If you want to host some content on a separate server such as an S3 bucket, you could create a subdomain for that separate server.  Subdomains are separate host names for DNS.  You can point subdomains to different host names using DNS.
For example you could create the subdomain s3.example.com and point it to the S3 bucket.   Then the URL of your "about us" page would be http://s3.example.com/aboutus.
If the "about us" page were the only thing in the S3 bucket, you could name the file index.html in the S3 bucket and point the subdomain about-us.example.com to the S3 bucket.   Then the URL for the page would be http://about-us.example.com/.
Use a reverse proxy
Your main web server could run a reverse proxy to dynamically fetch documents from the S3 bucket and re-serve them itself.   It is very common to use a reverse proxy to assign paths on the main domain to content run on different servers or different port numbers.
A reverse proxy is a great solution when the servers are on the same local network.   When the two servers are geographically distant, using a reverse proxy can make those requests significantly slower.
For example if your main server is running Apache with mod_rewrite and mod_proxy enabled, you could use this configuration to reverse proxy the page:
RewriteRule ^/?about-us http://s3.example.us-west.amazonaws.com/about-us [P]

Then the URL of the page would be http://www.example.com/about-us
Answer: I would recommend you check out Netlify for hosting static sites because they have a generous free tier and static sites are their primary focus.
In AWS Console

Create a bucket
Name a bucket to be your domain name for easy setup.
Go to bucket properties
Go to edit bucket policy
In text editor, edit a resource key with your domain name after ::
Go to static web hosting
Enable a web hosting option
There is an endpoint link which is used to point your bucket to the domain

In GoDaddy Console

Go to manage DNS
Point CNAME of www to endpoint you received from the AWS console

Reference: https://www.youtube.com/watch?v=zzNlwGaccs4
Comment: The OP said he already has a website on a server, but just only one page is in a S3 bucket. So the question is not just how to host a whole website in an S3 bucket.


Fritz Online will not finish game?

Question: Fritz Online will play all the way to the point where there's mate in one move.  In other words, if you are white and Fritz is black it will stop playing (moving) at the point any black move will be followed by mate on the part of while.
This is fine, I can read the Fritz console in the lower right and it will say something like "White mates".
The problem is that I want my kids to play with Fritz Online and this modality is disorienting to them.  They want to see the game play through to the actual end and get the satisfaction of completing the mate.
Is there a setting that will cause Fritz Online to play through to the end just like any regular chess program?
Answer: Just tested it and it may have been fixed. It let me complete the mating move.
Just in case, the site is https://fritz.chessbase.com/

Fritz Online will not finish game?


Is it common for companies to pay visa fees of their international employees?

Question: I am a foreigner working in the UK. I will need to renew my family's and my visas next year when our current visas expire. I am currently applying for jobs. I am thinking of asking my potential employers if they are willing to pay for my family's and my visa fees, something which I have never done, either when I first came to work here, or when I was working in another country before that. Is this something that companies would normally grant?
Answer: Yes, it is common, but by no means universal.
If they're the ones asking you to move overseas, visa support & costs are nearly always a part of the deal, and the family would typically be included in this case.
If you're applying for jobs locally, though, it's a bit of a question mark.  The employer would certainly sponsor the visa, and would likely pay your fees (compared to your salary, the cost is likely small), but whether the family is included would be a matter of negotiation.  And of course you'll be at a disadvantage compared another candidate who doesn't need a visa, not just because of the the cost, but because of the avoided hassle and uncertainty (what if the visa doesn't come through?).
Sponsorship for more expensive/optional endeavours like permanent residence or citizenship will also vary from company to company.  When I applied for permanent residence in Australia, my employer at the time sponsored me and covered half the (sizable) bill, but with the stipulation that I'd have to repay it if I left within a year.
Comment: Did your employer sponsor your family as well?
Comment: Yes, but IIRC there's no extra cost for spouse and dependents, so it's a bit of a moot point.
Answer: If I was your boss, and the company was small enough that I was able to make that decision and the company was profitable enough that the cost was insignificant, its a no brainer to pay for it.
Its much cheaper than paying the extra salary for you to pay it, as then there would be National Insurance, pension payments, income tax and so on all to pay.
Ask the question, make sure its not seen as a big issue, and if the answer is no, so be it, at least you asked.


I just applied for a credit card. Will I be able to see my credit score number with a decision?

Question: Will I be able to see the actual credit score number the credit card company uses? Or will it just be an accept/reject letter?
Comment: I don't know about recent rules, but in the past the rule was that if you get a rejection you can request a free copy of your credit report. Not the score, but the report. The letter will include the number to call to get the report.
Answer: Not all companies use the same scoring model, so if under the new rules, you get a notification of your score, the number might be a different scale.
http://en.wikipedia.org/wiki/Credit_score_(United_States)
Just be aware of this so you can compare apples to apples.
Answer: You will get the score, but not on-line, in a letter later on. But, as mentioned by others, it doesn't necessarily have to be the FICO score, different lenders use different scores. They must tell you where did they get the score from, and what it is, though.
Answer: My experience shows you get just the decision, without any accompanying information, but this may be old news since there are new regulations since 2011 that require lenders to give you credit score information. I did not personally ask for credit in 2011 yet so I don't know how good is the implementation.
Answer: I just received a new credit card, and didn't get my credit score. Maybe if you aren't approved, then you get your score?


com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all

Question: I am using React Native 0.26 and trying to play around with Google Plus Sign in from the below npm for Android application.
npm install react-native-google-signin --save

I am using command-line(react-native run-android) to build debug apks directly on my devices.
Followed all the installation steps very carefully. By default, my builds are working only on Build tools version 1.2.3 on build.gradle(/android/) and it used to work for other projects but I am having the below error in this project because I had to include the below line in build.gradle file,
classpath 'com.google.gms:google-services:2.1.0' // <--- add this
and when I add this, I also have to modify the distributionUrl to https\://services.gradle.org/distributions/gradle-2.13-all.zip on android/gradle/wrapper/gradle-wrapper.properties
After doing all the modifications when I tried to run the build command, it never installs the updated apk on the device and it is stuck at 99% progress.
Below is the detailed error,
Installing APK 'app-debug.apk' on 'Micromax Q372 - 5.0' for app:debug
08:26:35 E/1526411097: Error while uploading app-debug.apk : Unknown failure ([CDS]close[0])
Unable to install /home/sid/react/gplus/android/app/build/outputs/apk/app-debug.apk
com.android.ddmlib.InstallException: Failed to install all
at com.android.ddmlib.SplitApkInstaller.install(SplitApkInstaller.java:91)

......

:app:installDebug FAILED

FAILURE: Build failed with an exception.

What went wrong:
Execution failed for task ':app:installDebug'.

com.android.builder.testing.api.DeviceException: com.android.ddmlib.InstallException: Failed to install all
Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Comment: Did you resolve this ?
Answer: I had the same issue trying to install an APK on a specific device.
To solve I listed all the connected devices with adb devices and I identified the right one, then I ran run-android specifying the device ID:
react-native run-android --deviceId MY-DEVICE-ID


Is it possible to boot from a dmg file directly on Macs?

Question: Is it possible to boot from a dmg file directly on Macs, just like the Windows setup environment, which boots from a wim file?
Answer: The only way to properly create a bootable file is to use Disk Utility on a working Mac. You also may use Virtual box or TransMac.
Comment: Is it possible to boot from a dmg file created by Disk Utility? Here is the guide from Apple:https://support.apple.com/en-us/HT201372. But, if I apply this, the whole partition will be reformatted.


user name and number hit on sharepoint site

Question: Can someone provide me any solution which help to check number of user hit and user name who visited on selected sharepoint site. Like as of now I only want for site "http://sharepoint.question.aspx".
Answer: To see usage pattern of a site, you have can go for Web Analytics : http://blogs.msdn.com/b/ecm/archive/2010/03/21/introducing-web-analytics-in-sharepoint-2010.aspx
If you want further details, like how many visits were made by a single user, you may have to read ISS Logs: http://gallery.technet.microsoft.com/The-SharePoint-Flavored-5b03f323/view/Discussions#content
Answer: http://office.microsoft.com/en-us/sharepoint-designer-help/use-reports-to-measure-site-performance-and-usage-HA010174136.aspx#BM6
Just open this on whatever site you would like to have the diagnostics on.


Suspension not compressing on Rockrider ST520

Question: I have an almost brand new decathlon rockrider st520 (bought it 3 weeks ago) and noticed if I preload the bike the suspensions just don't compress. They will compress only if you hit the front brake and push down on the handlebars.
I got it for my birthday and I use it just to cycle around my town and go to school, so I don't go on trails.
My friend has the older rockrider 520 and his suspensions compress way easier even while you're on the bike. Also, the bike has a weight adjuster for the fork and nothing else.
Could it be a problem of the suspension or is the bike just made like that?
Comment: Its 3 weeks old when posting, and was brand new?  You're in the warranty period - take it back to the shop.
Answer: There are many factors affecting the behavior of a suspension fork that may be in play. Let me describe those that I can recall and which can explain the difference between the two identical bikes (one older, one newer).

Many (if not all) suspension forks have a "break-in" period in the beginning of their service. During that period of riding, the fork gradually "loosens" as its internals start to play with each other. I definitely felt such a break-in on my new fork. Some manufacturers list the length of the break-in to be as long as 50 hours, which I think is an overestimation.

The bicycle in question is at the lower end of price and quality ranges, and so is its fork. It may happen that characteristics of such forks simply vary wildly across the production batches. By a pure (bad) luck, your friend got a softer fork, you got a stiffer one.

While such entry level forks are not very configurable, there may still be some adjustments that affect the feel and dynamics of the fork. In this case, these two forks are simply set up in a different manner, and it should be possible to try doing some adjustments. More advanced forks typically have a few tuning knobs that allow to configure air pressure, compression and rebound.

You and your friend are in fact built differently (weight, height), and so are the seemingly identical bikes (frame size, frame geometry etc.). Same named bike models, if they have different model years or are from different production batches, may in fact have different components. Two forks looking identical on the outside may have different internals.

Finally, a fork that is slower to compress does not mean a worse fork. A suspension that compresses too easily can result in the front end of the bike being lower more of the time, which is not optimal. The tune of the fork depends on the riding circumstances and rider preferences. Many pros run their suspension very stiff because of the terrain and speeds they deal with.

My advice would be to continue using the bike with the fork for a while (a couple of dozens hours of riding). If you are content with the feel it gives you after that, just keep it as is. Otherwise, you may play with the tuning it has, but be sure not to wreck it in the process (do not unscrew things all the way out!). It is unlikely to make any difference however, I am afraid to predict, but I may be wrong.
If you are still not content with it, your best option would be to look for a better fork, or a better bike. In the urban setting and without any tricks involved, I do not think that you'll be at a disadvantage with your current whip.
Comment: I forgot to say he has an older model with a different fork and he has an M model and I have an L. I think he has an UFIT 80mm that came with the older version and I have a normal stock decathlon 80mm.
I know that it's probably the reason my fork is worse than his, but it's weird since a newer model should have a better fork but they just slapped a stock fork on it.
Well, to be honest, I don't go on trails so I don't really care about how the suspension behaves. I was just curious. Thanks for answering!
Comment: I would not say "worse", see my later addition bullet no 5 to the answer. But different forks will have different characteristics for sure.
Comment: your comments are not that clear @Giammy but both forks should be pretty crappy. Decathlon don't make forks, but they seem to have something resembling a SR Suntour XCT, made in China for them.  The u-fit seems like a standard coil + elastomer fork, with the slight innovation of the pre-load adjuster having weights written on it. https://www.decathlon.ie/media/catalog/product/cache/2/image/9df78eab33525d08d6e5fb8d27136e95/4/0/40_p1715940_8404653.jpg Probably if you examine the fork crown carefully you can see the actual model numbers.


How to calculate sfc per throttle setting of an turbofan engine?

Question: I was looking for sfc per throttle setting of an engine. I was not getting the performance data of that engine. So is there any way to calculate it by formula?
Comment: It's going to depend on the load put on the engine.  RPMs alone don't tell anything about it, other than the average *torque* generated by the engine equals the load resistance at this RPM (or else it speeds up or slows down).
Answer: The variation of TSFC vs. Thrust (as you vary throttle) for a jet engine (at a given altitude and airspeed) is usually called a 'thrust hook'.  So you will similarly hear a plot of BSFC vs. Power for a piston engine called a 'power hook'.
Piston engines can be a bit more complex because what happens with the variation of throttle depends on what kind of propeller you have (fixed pitch vs. constant speed).
The (mechanically more complex) constant speed prop is a lot easier to analyze -- you already know the RPM.  Consequently, a curve depicting throttle variation (at a fixed flight condition) can be readily constructed.
For a fixed-pitch prop, the propeller (load) determines the relationship between power and RPM (at a given flight condition) as throttle is varied.  Different props will have different load curves.
Consequently, you need a more complex model for the engine to be able to analyze it connected to an arbitrary fixed-pitch prop.  This model is not just a curve, it is a map.  Google 'bsfc map' and you will find plenty of examples.
Although some engine parameters are easy enough to come by (RPM, bore, stroke, number of cylinders, compression ratio, etc) -- those are not enough to construct an accurate model of engine performance.  To do that, you need to know detailed information about the friction between the rings and cylinders, in the bearings, how the valves are operated, etc.  All of these things contribute to losses that are important for determining the engine's fuel efficiency (and how it varies with speed and power).
All those factors are typically determined empirically (through test) -- not just known from analysis.
So, your best bet is to find some engine performance charts for your engine -- or a similar engine.  What engine(s) are you considering?  Will you be using a fixed pitch or constant speed prop?
Answer: You have to know the horsepower being generated at a given throttle setting, which means you need the manifold pressure and RPM, and using those values, derive the horsepower that results from the engine's power chart. So without a power chart, or some other data that tells you what HP is achieved at some throttle opening, you are stuck.
If you know the HP being created, and it's a carbureted air cooled piston engine, you can use an SFC value of 0.45 lbs/hp/hr as a ballpark number. So if you know that the throttle setting is giving you 100 HP, at some manifold pressure and RPM, you can assume the fuel burn is 45 lbs/hr, or 7.5 US Gal/hr. This is about what the cruise fuel consumption is for a 140 hp Lycoming O-290 that makes about 105 hp at 75% cruise.
For a fuel injected engine you can reduce the value to a bit lower, say .42/lb/hp/hr.
Car engines are in the high threes, and diesels are in the low threes. Two strokes and turboprops are thirstier, in the 5-7 lb/hp/hr range.
Comment: Yes finger trouble. Thanks for the catch.
Answer: My prior answer assumed you were looking at a piston engine.  This answer will reflect your update to interest in a turbofan engine.
You are interested in calculating the thrust hook (TSFC vs. Thrust as a function of throttle) at a given flight condition (Mach and altitude).  Here is an example for a turbofan engine:

As you can see, at each flight condition (numbered line), SFC and Thrust vary along a curve (as you vary throttle).  Note that these hooks do not include the flight idle condition (very low throttle).  Flight idle would show SFC getting substantially worse very quickly.
There is no simple equation to calculate a thrust hook.
Instead, you typically use a computer program capable of performing off-design cycle analysis.  Usually a first undergraduate course in propulsion will discuss on-design cycle analysis (first ideal, then non-ideal).  Off-design cycle analysis is usually not discussed until a second undergraduate course or a graduate course in propulsion.
In on-design cycle analysis, we analyze the engine at a single design point (flight condition and throttle setting).  This analysis allows us to size the engine to meet a design thrust.  Sizing the engine in cycle analysis means calculating the flowpath areas at each station (inlet, compressor inlet, compressor exit, combustor, turbine inlet, turbine exit, nozzle, etc).
In off-design cycle analysis, we take the fixed engine from the on-design analysis (leave the areas and other properties fixed) and then model its operation at different flight conditions and throttle settings.
An off-design cycle analysis requires compressor, fan, and turbine maps.  These are performance models of the turbomachinery components.  I.e. not just an on-design compressor pressure ratio and efficiency, but a map of how compressor pressure ratio and efficiency vary as functions of corrected speed (RPM) and corrected mass flow (compressor face Mach number).
At every operating condition, we solve to find the equilibrium point where the compressor and turbine are balanced (power in equals power out) at the same speed (RPM) and mass flow.  This is an operating point.
At each flight condition, we calculate an 'operating line'.  This is the locus of all the operating points at that flight condition (as we vary throttle).  This operating line is usually plotted on the compressor or fan map, but once you can calculate an operating line, you can also calculate a thrust hook.
If you have thrust hooks at a wide variety of flight conditions, (i.e. a complete performance model of the engine), you have an 'engine deck'.  A deck is the industry term for the data package an engine company would provide to an airframe company to use when designing and analyzing their aircraft.  Back in the day, it was a deck of punch cards.  Today, the 'deck' name persists, but an engine deck is usually supplied as a computer program provided from the engine company to the airplane company.
A bunch of scaling is often performed for engine data.  This isn't exactly non-dimensionalization (as the results are still dimensional quantities), but it works similarly.  Each parameter is 'corrected' in this process.  Mass flow becomes corrected flow.  Thrust becomes corrected thrust.  Compressor and turbine maps are usually provided in corrected form.
With some limitations, an engine's operating line at different flight conditions can fall onto a single operating line when written in corrected properties.  Consequently, if you have a corrected operating line, you may be able to get to a hook at many flight conditions (i.e. a deck).
If you have a corrected operating line, 'dimensionalizing' that data for an engine will be the closest you can come to a simple equation for calculating a thrust hook.  It still isn't easy -- and that line was generated with sophisticated analysis (off-design analysis) that was in turn built on sophisticated models of the turbomachinery (maps).  Neither of those steps submit to simple analysis.


Backup entire data and migrate

Question: I have been given promotion in the office and hence given a new laptop. Now I have to move from my old system to the new laptop. I am currently working on many projects and have many dependencies installed in my system. Is there any way I can take my entire system's memory or entire data even from a small image to a bigger software to my new machine?
Answer: Aren't you approaching this problem from the wrong end? I mean, cloning is convenient, but it's usually a rule of thumb that when you clone you want the hardware to be exactly identical, you might not want to clone an operating system installed on Model X straight onto Model Y for a bunch of reasons.
You mention that you have "dependencies" installed on your machine, I'm assuming you are talking about package dependencies in general in Debian/Ubuntu, but surely there is some way to check what dependencies are required for whatever important packages you have already.
Since apt-get supports several arguments, when you figure out what packages you need you can just do this on your new computer:
sudo apt-get package1 package2 package3 etc.
In short, I would recommend a clean install of Ubuntu with a clean install of the packages to avoid problems further ahead. It might take you a couple of hours, but troubleshooting a borked install will take you a lot more time.
Do you have any examples of what kind of stuff you want to back up? It's not easy to help you with so little information.
Comment: I mainly want to backup my all databases. ..My all packages installed and all the softwares and data i have in my hard disk
Comment: Are your databases backed up today? If not, what would happen if your hard drive crashed? You should be able to export the contents of your databases fairly easily, and then install the same packages on your new install.
Answer: You may try any software that provides a system image like CloneZilla (good for full hard disk backup) or Backintime (beneficial if backing up only required directories).
You can check out some other backup solutions here: http://www.thegeekstuff.com/2012/05/backup-ubuntu-desktop/
As you have dependencies etc. installed and it seems from your question that you are not very confident about it, I would highly recommend CloneZilla as it can help you to copy an exact system image to the new machine. In short, it just creates a clone of the system hard disk.
Answer: As bigbadonk240 said, cloning a system assumes the same hardware and is not recommended otherwise. However, Linux Mint (which is an Ubuntu derivative) has developed some tools that can help you. See here for more details.
Try the following:

Get the list of your installed packages

Download mintbackup from here and install it.
Run mintbackup and click on "Backup software selection":

Choose a destination to save the list of installed packages

The following screen shows you all the packages you have installed, select the ones you want to exclude from your backup and click "Apply".

This should create a file whose name starts with software_selection in the directory you chose as the destination.
Copy that file over to your new Ubuntu install on the new laptop, install mintbackup there, run it and
Click on "Restore software selection":

Select your backed up software selection file and press "Forward":

In the next screen you can see a list of packages. Select the ones you want to install and press "Apply":

This list only contains packages which were part of your previous software selection and which are not installed in the present system. The packages which are already installed in your new system don't need to be installed again, so they don't appear in this list.

Your files and data you can simply copy over from the machine. Databases can be slightly more complex but you should also be able to just copy over the data files.
Answer: Duplicating the system
I've migrated my system via dd and subsequent parted a number of times (from desktop to laptop to laptop to desktop).  There were always just a few things that changed or had to be adjusted, e.g. network device numbering and the Xorg.conf.  Most of the system, however,  continued to work just fine, esp. user space stuff like data bases.
Manual re-install
Backing up the apt-get history beforehand might be of use.  This will help you remember which packages you've had installed.

Backup entire data and migrate


Are there any good ways to run Steam on a Chromebook?

Question: I would really like to play my Steam games on my Chromebook, but I cannot figure out how to get Steam and play my games on said glorified web browser. Is there any good way to play Steam on a Chromebook?
Answer: As mentioned in the other answer, you could install Linux on your Chromebook. However, this may not be of use because most of the games are processor-specific and will likely require Intel/AMD processors (x64 or x86 instruction set) instead of a Chromebook's ARM processor (completely different instruction set).
Although Steam offers multi-platform gaming, the binaries that are downloaded from Steam are specific to the platforms that Steam offers - Windows, macOS and Linux, and all of those (as far as I know) are Intel-only.
For example, you cannot install Steam on macOS on a PowerPC. Yes Mac OS is supported but ancient Mac OSX is not, and PowerPC is not even though it falls under the "Mac OS" umbrella.
The same is true of your Chromebook. You might be able to get it to run Linux but it won't be the CPU-specific version of Linux (Linux under i686) that Steam supports.
Comment: There are both ARM and Intel Chromebooks
Answer: The only way to nattily install steam on the laptop and run it, by first installing linux
Comment: @Parzival There's no way to provide more accurate advice without having more information. Just saying "a Chromebook" isn't narrow enough, seeing as there are 18 different Chromebooks made by Acer alone.
Comment: @Parzival Depends on your Chromebook.  What is the hard drive size of it (do they even have hard disks)?
Comment: Is there enough space on a Chromebook? or do I need an external something or other?
Comment: I think it's very very small.
Comment: You might need to do something with the hardware to enable the UEFI to be flashed, so that something other than Chromebook can install. (Chromebooks take "Web PC" to a new level... they're useless for *everything*!)
Comment: This isn't "the only way". You can use CrossOver as I mentioned in my answer.
Comment: @BleedingCatz That's why I chose the wording I have in my answer.... "The only way to nattily install steam"
Answer: There are always "ways". But one of the "best" is going to utilize In home Streaming.
First you get steam up and running on a powerful computer, then you install something like crouton, and then steam on the chrome book.
Finally, login to steam on both the powerful machine, and the chrome book, and you can play the game "from" your chromebook, but it's the powerful computer that's doing all the work.
If you don't have a x86 chrome book (most aren't)  then you can try stuff like twerk and android streaming apps. They will work but's it's cludgy. See https://www.reddit.com/r/chromeos/comments/3kf73b/psa_you_can_stream_your_gaming_pc_to_your/ for an example.
Finally, though you may not want to hear it, you may be better of with something more dedicated. If you really want to stream to a portable then getting a cheap laptop around $200 and sticking XFCE on it with steam in home streaming is pretty awesome. Your not gonna get CS:GO to be fast enough to be competitive, but Civ 6 will do just fine.
Keep in mind, in all these options, it's the powerful computer that does all the work, not the portable.
Answer: As of 2016, this wasn't easily possible. However, newer Chromebooks have started to come with an option to enable a Linux VM, as part of the OS itself. This is easy to do in settings (under Advanced > Developers).

As the VM runs a Debian-based distro (GalliumOS), you'll need a .deb for Steam (or any other games or programs you wish to run). You can install it by typing:
sudo apt install ./steam_latest.deb

Having done this (with Minecraft Java, not Steam), I'd warn you to check your device's specs. If the game requires good graphics hardware or a lot of RAM, you're probably out of luck. (On my Acer R11, I get 4-5 FPS on Minecraft Java, although it's not known for it's performance).
As for storing the games, external USB/SD storage is not yet supported, so you may run into issues with installing multiple large games.
Answer: Via Reddit:
Seems like the Chromium developers made a shell script to install Steam, which worked fine for me. Try it out. (Heads up: this doesn't work on ARM devices.)
/usr/bin/curl -L "https://chromium.googlesource.com/chromiumos/platform/dev-util/+/master/contrib/gfx/crostini-steam-setup.sh?format=TEXT" | /usr/bin/base64 -d > /tmp/crostini-steam-setup.sh; /bin/chmod a+x /tmp/crostini-steam-setup.sh; /usr/bin/sudo /tmp/crostini-steam-setup.sh

Answer: I own an Acer 15 chromebook. in the download page of steam you should hit the tiny steam icon under the blue button.  After installing linux to the chromebook open files app and click your new .deb file. hit the blue button that shows. it will install. once it installs you will launch steam and it will install itself. don't shut it during this.
THEN THE SIGN IN SHOWS UP! YAY!
(only one problem, you barely have space for games b/c Steam is hogging it all. they will also lag a lot at first but later it should be fine if you have the right settings in the game. I got Nuclear Throne to work just fine like this, so that's cool.)
Answer: Short Answer: NO!
Explained: Chromebooks were made as a way to access the internet-  NOTHING ELSE. I have owned 5 chromebooks over the years, all different brands. In all of them, everything was sautered onto the motherboard. They have about 8gb of hard drive space on average and one core processor. I think that they have about 3gb of ram. None of these parts can be upgraded because everything is sautered, not allowing you to alter anything unless u know how to do sh!t. I beleive that the average chrome book can run shell shockers at 20-30 fps at 750p. This is compared to my pc with a sixth gen i5 and 650ti with 5 gb of ram having no issue consistantly running 90-100 FPS at 1080p on shell shockers. I have never tried downloading steam on a chrome book. I tried downloading cod mobile on it once and it just crashed the chrome book by giving me a scary message and the blue screen of death. If you are able to download steam, you will not even be able to download much less play any games.
Comment: What do the system requirements have to do with the ability to install Steam? The games the OP can play are still dependent on their hardware, but that's not the question, and this sounds more like a rant.


Does Steam have an API for sales data?

Question: I go to the Steamworks website to see data about my game, change its page, see sales numbers, etc. Is there a way I can download this data into my own visualization setup so it is easier for me to view up to data information. I am mostly interested in getting page view, sales, and wishlist data so I can overlay that with marketing events, sales, etc in my own software.
Comment: Have you looked at https://www.steamapis.com/ ?
Answer: At this spot in the Steamworks Quick Tips - UTM Analytics on Steam video you can see an option in the lower right corner for downloading UTM data as a CSV:

Documentation for UTM is available here.
The Sales & Activations Reports portal docs and the Wishlist Reporting docs also mention CSV options.
If you can't find what you're after digging through the CSVs, searching the docs and browsing their [developer videos](Official Group for Steamworks Development Support), you'll probably need to ask in the Steamworks Development Support Group or contact
a Valve developer support specialist.

Does Steam have an API for sales data?


Java: Usage of OTF fonts, checking if particular font exists

Question: I am working on a Java program that checks XML files for characters that have no glyph representation in a certain font (with Font.canDisplay())
The XML files should be utf-8 encoded by default. Entities in the XML code are parsed and transformed to a char/int value before they get checked by canDisplay.
In order to provide flexibility, the program accepts two parameters:

The file name of the XML file
A font name

I would like to check whether the specified font exists on the system, because otherwise there is not much sense in using canDisplay.
As far as I understand, Java 6 supports OTF fonts. However, when I use getAvailableFontFamilyNames() from java.awt.*, it apparently only lists TTF fonts.
I'd like to know whether there is a way to check whether a OTF font (given by it's name) exists. And in general, if using OTF fonts in Java on windows is practical.
The purpose of this: We use renderX's XEP to convert xsl-fo into PDFs. I would like to be able to detect whether the xsl-fo file contains characters that won't be displayable with a certain font. XEP doesn't give a warning and just prints empty spaces instead of the glyphs. What makes it worse is that it seems to confuse his computation of the spacing for justified text, so lines with those empty spaces are longer or shorter than the current justified block size.
I know that there are certain caveats, e.g. I would have to check whether a character is to be displayed regular, italic or bold, and then check for a glyph in that specific font face. But for now a more general approach that checks whether a glyph for a character exists at all in the regular font face would be enough.
Answer: I get the .OTF fonts too.
    GraphicsEnvironment genv = GraphicsEnvironment.getLocalGraphicsEnvironment();
    for (String ffname : genv.getAvailableFontFamilyNames()) {
        System.out.println(ffname);
    }

So either the specific font file has an issue, the font name is different from the file name, or one has to add a Locale parameter to getLocalGraphicsEnvironment.
For latin characters with diacritics, a unicode normalization (java text) to retrieve basic letter code + diacritic combining code might help. Something like:
java.text.Normalizer.normalize(letter, java.text.Normalizer.Form.NFKD).replaceAll("\\p{M}", "");


Find ratio between radius and height of a cone with maximised volume

Question: A cone shaped drinking cup is made from a circular piece of paper of radius r by cutting out a sector and joining the edges CB and CD. if the cut is made so that the volume of the resulting cup is maximised, then what is the ratio between the radius and height of the cup?
Comment: Please show what you've tried and where you're stuck to get better help from the community.
Comment: Interesting problem. Start with the equation for the volume of a cone and substitute the base radius for (xr) where x is the remaining fraction of the circle and write h in terms of (xr) and r?
Answer: $V = \frac{1}{3}\pi R^2\cdot h$
$xC$ is the remaining circumference after removing a sector.
The base radius then becomes $\frac{xC}{2\pi} = \frac{x\cdot 2\pi\cdot r}{2\pi} = xr$
So $V = \frac{1}{3}\pi(rx)^2\cdot \sqrt{r^2-(rx)^2}$
$$\frac{dV}{dx} = \frac{2}{3}\pi\cdot r^2 x\cdot \sqrt{r^2-(rx)^2}+\frac{1}{3}\pi(rx)^2\cdot \frac{-r^2x}{\sqrt{r^2-(rx)^2}}$$
Max volume occurs when $\frac{dV}{dx} = 0$
Then $$\frac{2}{3}\pi\cdot r^2 x\cdot \sqrt{r^2-(rx)^2} = \frac{1}{3}\pi(rx)^2\cdot \frac{-r^2x}{\sqrt{r^2-(rx)^2}}$$
Which reduces to $2r^2 = 3(rx)^2$
And $x = \sqrt{\frac{2}{3}}$
Therefore the ratio of radius to height of the cone is $$\frac{rx}{h} = \frac{\sqrt{\frac{2}{3}}r}{\sqrt{r^2-(\sqrt{\frac{2}{3}}r)^2}} = \sqrt 2$$
$$$$


Does the MS oxygen peak at m/z = 16 correspond to $\ce{O+}$ or $\ce{O2^{2+}}$?

Question: In a mass spectrum, while annealing with $\ce{O2}$ of a sample in UHV, I observe peaks at $m/z = 16$ and $32 (= 16 \times 2)$. While the latter is $\ce{O2^+}$, I'm unsure what the peak at $m/z = 16$ is. I lean toward $\ce{O2^{2+}}$ because of the molecular orbital diagram.
Comment: I wonder what may be the eq. constant $\ce{O2^2+ <=> 2 O+}$...
Answer: Most likely the signal is predominantly or entirely $\ce{O^+}$.
The question is whether two $\ce{O^+}$ ions will bind to each other forming a diatomic ion in the gas phase. A rough energy balance calculation suggests they will not.
The observed bond length in the singly charged $\ce{O2^+}$ ion is $112.3$ pm. Now suppose two $\ce{O^+}$ ions, each with a charge equivalent to one electron, are brought together to this internuclear distance. The standard Coulombic repulsion calculation gives about $1.24$ MJ/mol.
This might be overcome if the covalent binding energy is sufficiently strong, but the isoelectronic and similarly sized $\ce{N2}$ molecule has a bond energy of only about $0.94$ MJ/mol. So the covalent binding energy expected for the proposed $\ce{O#O}$ triple bond in the gas phase would be insufficient to overcome the repulsion between two positive charges, and we should expect the proposed $\ce{O2^{2+}}$ ion to be less stable than a pair of single $\ce{O^+}$ ions. Therefore the m/z signal is most probably due predominantly or entirely to $\ce{O^+}$.
Comment: There is paywalled https://www.sciencedirect.com/science/article/pii/S1387380614000189 but I checked some other articles and the dication is most likely indeed repulsive, and dimerisation unlikely. Oh well, I learnt bit about interesting topic ;)
Comment: That looks incorrect - there's no reason to think distance would be so small. Charge would obviously make the bond much longer.
Comment: Well, peroxide is a thing, and IIRC even dihelium dication is metastable, so I think you need evidence to say it doesn't exist.
Comment: What we call peroxide is not so in the gas phase, I have only ever seen it in condensed media intertwined with counterions.
Comment: Yeah, yeah, I even started to look for second affinity for O2, but hey, it's you who decided to answer ;D
Comment: @mithoron do you agree with my modifications? The energy balance still seems to favor the monitoring ion to me.
Answer: This is a very tricky molecule. A single m/z value cannot tell you whether this is singly ionized or doubly charged on a low resolution mass spectrometer. One would look at mixed isotope patterns of oxygen-17 and oxygen-18 molecules. A doubly charged molecule would then appear at half-integer values (17+18)/2 =17.5. Without any mixed isotope enrichment experiment, a real mass spectrum will be noisy, so it is hard to tell anything with ordinary oxygen which is dominated by a single isotope.


How to convert a shell script into a binary executable?

Question: I want to convert my shell scripts into binary executable so that nobody else could edit or read it. Is there a way to convert it into a binary executable?
Comment: [Don't do it!](http://mywiki.wooledge.org/GreyCat/CompilingBad)
Comment: @l0b0 That link mentions two reasons. The third reason: you want it to run on machines that don't have the interpreter installed (eg. running a bash script on a machine that only have sh). The fourth reason: it needs setuid root for some reason (eg. a script that lets the user mount volumes without sudo).
Comment: https://github.com/neurobin/shc
Comment: Related: [Execute scripts without decrypting them](https://unix.stackexchange.com/q/132373/80216) and [Avoiding users to corrupt and use a script](https://superuser.com/q/801133/354511).
Answer: shc is what you're looking for. get it here: shc
Extract, cd into dir, make and then ./shc -f SCRIPT. Done.
Everything you need to do this, you find here:
SHC Howto
Comment: Note that it doesn't work with `bash` (or `sh` based on `bash`), as one can do: `env SHELLOPTS=verbose ./script.x` to see the content of the script. There's probably easy ways to bypass with other shells as well.
Comment: +1 wow, that is interesting.  Just beware that if the process is exactly as it is described, this is a weak method of concealing a password -- it could still be extracted by someone who knows how executables are structured.  However, it would be very effective for obscuring a script from casual observers.  I'd be interested to learn if scripts pre-compiled this way are faster to execute.
Comment: From the shc man page, "Unfortunatelly, it will  not  give  you  any  speed improvement as a real C program would." http://www.datsi.fi.upm.es/~frosal/sources/shc.html
Comment: shc has been updated to 3.9.0:
https://github.com/neurobin/shc
Comment: Although SHC might not give you a speed improvement you hope for, it offers the possibility of hacking SHC itself to obtain a better translation of your script.   Writing a clean shell script and then improving SHC could be more productive than writing a C program from scratch, or convoluting a shell script to make it faster.
Comment: @StéphaneChazelas with version `4.0.3` of `shc`, option `-U` is provided, this is preventing tracing.
Answer: If the goal here is to hide your shell script so it cant be read or modified, try pasting it to the following website:
Combined Encryption & Obfuscation
When you submit your script to this site, a zip file will be produced for you.  Perform the following steps to generate a standalone executable from this zip file.

After submitting your script, right click on the download link
Go to your Unix host and wget or (curl -O) the download link
Unzip the zip file
cd EnScryption.com
./(your-script.sh)

Step 5 will automatically configure the script and will generate a standalone copy for you.  You can then scp this standalone copy to different hosts or distribute it however you want.  Note, once encrypted, you cannot change the name of your script. This is for security reasons.
Another option available to you, if you have the time, is to come up with your own secure obfuscation algorithm.  If your script is to be portable, you must use tools that are readily available on most Unix systems...ie. openssl or base64. This requires a lot of time.  But if the motivation is there, it is indeed possible to make unveiling your scripts impossible or at very least, extremely time consuming!
Comment: I would recommend against such a service. You can never be sure they doesn't inject any malware in it before handing it to you. Even if the creators themselves are not trying to do so then adversary can compromise their server to do such injections secretly.
Comment: "After submitting your script" is exactly the opposite of protecting your code.
Comment: Downvote because this is COMPLETELY opposite of what the questioner wants.
Comment: This is also a (very expensive) paid service - $30 for a month's access seems to be the minimum cost
Answer: bzexe can convert and also compress the file
Comment: I don't quite see how this would prevent anyone from extracting the file to get the original shell script, which is what the user wanted to prevent. Compression is not hiding anything.


Does amending taxes affect future QBI loss carryforward?

Question: When an S-Corp shareholder deducts losses, those losses reduce subsequent years' QBI Deduction (Form 8995, line 3 Qualified business net (loss) carryforward from the prior year). But what happens if a shareholder amends taxes from several years ago in a way which reduces the QBI loss? Does that shareholder then amend all the following years?
An example:
An S-Corp shareholder had a loss of $30K in 2020. They deducted this from their taxes, and the loss carried forward into 2021 and 2022 (reducing / eliminating their QBI Deduction).
Later, the S-Corp gets an ERTC, and the shareholder's 2020 $30K loss is reduced to $25K. I know they must amend their 2020 returns and pay the extra tax. What I am wondering is if they would then amend their 2021 and 2022 returns to get a larger QBI Deduction, and lower their tax burden for those years. (Is it allowable? beneficial? required?)
Answer:
What I am wondering is if they would then amend their 2021 and 2022 returns to get a larger QBI Deduction, and lower their tax burden for those years.
(Is it allowable?

Yes

beneficial?

Do the math.

required?)

No.


Useless edits bumping old questions

Question: It seems that one user has been on a roll this morning editing tons of old questions and basically filling the front page with this. This type of behavior makes the site quite unusable as real, current questions are being buried so he/she can add a hyphen to a tag for a question asked and answered in 2014.
Comment: It's not just this morning - it's been happening for over a week now. I'm not opposed to adding tags to improve searchability, but you are right that it does add a lot of noise to the "active questions" view
Comment: @DStanley Ah, I must have just not noticed before but right now the front page is absolutely dominated by this. The first 26 questions all fall into this.
Comment: Related question https://money.meta.stackexchange.com/questions/2253/mass-retagging-minor-gripe I guess self restraint is the way to go for now.
Answer: The question asked here isn't a question, but a statement.
The issue is systemic, an edit bumps a question to the from page, as does a new answer. This is how all of SE is coded.
Privileges are granted based on member rep. Editing with no need for approval is granted at 2000. There have been kind members who offered edits, laundry lists of them, and it's taken time to approve them all. At times, I'd pace, so they weren't filling the first page. In this case, the member is 2000+ rep and is free to do this.
If I ran the world, these would either (A) not bump, and would not be even noticed, or (B) throttle, by either (B1) limiting members to X edits per day, or (B2) prioritizing, so edits on older posts don't go though at a rate of more than X per day. But I don't, and this question seems to have been discussed already, at a higher level.
Update - One solution is to bookmark by newest question. This will avoid the bumped edited posts.
Comment: I think you are wrong. As other members have complained, these actions turn a first page of otherwise new questions into a review of old ones. Doing a disservice to those newer questions.
Comment: Is there any way to, for example, provide a friendly comment to an individual doing these types of edits, to indicate that the community would prefer volume restraint?
Comment: Yes; I realized I was wrong. Duplicate target discusses about improving quality of old questions. And, this process is going on since Feb-2018. I agree about issues it is causing by hiding new questions though. In fact, that is the reason why I came here on meta to learn why.
Comment: I've asked this on a moderator board within SE. Just now, in response to your post.
Comment: @JoeTaxpayer: If I am not wrong, the edits are intentional (and with good purpose) to bump old good question on main page so that those can be better answered.

Useless edits bumping old questions


what is the purpose of mds folder on a Mac

Question: I found out that contents of mds folder located at /private/var/folders/zg/jjtx0_k94pdc5p5q6gcvf4900000gn/C/mds gets deleted and back created quite often. I wonder, that is the purpose of this folder and it's content? It contains mdsDirectory.db, mdsObject.db and mds.lock files.
Comment: mds is a daemon for Spotlight. It indexes files to be searched by Spotlight.
Comment: Thank you! So every time this folder gets modified a new file was created on filesystem?
Comment: not necessarily, a file can be changed too. Why are you even worrying about these files? Be careful deleting files in `/private/var`.
Answer: I think in this particular case MDS stands for Module Directory Services, as explained in this apple doc. As far as I can tell this is unrelated to Spotlight's mds (which stands for metadataserver).

You use the search object created by this function in subsequent calls to the SecPolicySearchCopyNext function to obtain trust policy objects. Policies are stored in the Module Directory Services (MDS) database. MDS is described in detail in "Part 8: Module Directory Service (MDS)" of Common Security: CDSA and CSSM, version 2 (with corrigenda) from The Open Group (http://www.opengroup.org/security/cdsa.htm).

Going to that link, we have the following extra information

The Module Directory Services (MDS), which is a standalone service outside of CDSA, implements a database describing CDSA components available from the local platform. Applications and CDSA components can query MDS to obtain the compatibility information and numerous other attributes describing features of the CDSA components. This information can be used as the basis for selecting appropriate and compatible components at runtime.

We can see the source for some of pieces of MDS in Security.framework here and see indeed there are the implementations of the "DL interfaces supported by MDS" as enumerated here
So from the above, if I understand correctly from skimming the docs we can say that at a high level MDS is a database used by the Security.framework component of OSX to manage policies.
Now what about the specific per-app example you noted? We see here that mDNSResponder needs read-write access to pieces of MDS:
; Our Module Directory Services cache
(allow file-read-data                 (regex #"^/private/var/tmp/mds/"))
(allow file-read* file-write*         (regex #"^/private/var/tmp/mds/[0-9]+(/|$)"))
(allow file-read-data                 (regex #"^/private/var/db/mds/"))
(allow file-read* file-write*         (regex #"^/private/var/db/mds/[0-9]+(/|$)"))
(allow file-read* file-write*         (regex #"^/private/var/folders/[^/]+/[^/]+/C/mds(/|$)"))
(allow file-read* file-write*         (regex #"^/private/var/folders/[^/]+/[^/]+/-Caches-/mds(/|$)")) ; Required on 10.5 and 10.6

and that second-to-last line matches the file path you noted. So that could be one reason why such a file exists.
Deleting it should not pose any issue since it is part of the cache directory.


Is this lemon tree still living

Question:
The lemon tree branches are dry but the leaves are still green what can I do to save it
Comment: Seems fine to me. In my experience lemon trees are very hearty trees and can undergo a lot of mistreatment without skipping a beat.
Answer: It looks alive to me. I have a tree in Denver, so it's in a container and I have to move it in and out of the house for winter/summer. Periodically that process (or forgetfulness about watering) will cause problems and it gets shocked a bit, but as long as there are happy leaves on it then it's in a basically alive shape.
Can you tell us a bit more about where it's planted? What soil is it in? How long as it been there? Has anything changed recently?

Is this lemon tree still living


Second external monitor strange behavior for Dell E6420, Windows 7

Question: I have Dell Latitude E6420 with Dell E-Port Replicator PRO3X (on the picture at the bottom).
I have two Lenovo L24q-10 monitors with maximum resolution of 2560x1440 (QHD).
One display (main) is connected via Display Port (DP) cable, other is connected in two similar ways over DVI-D (Dual Link) port: either DVI-D cable to DP, or DVI-D adapter to HDMI. HDMI supports QHD.
However, after PC boot, the second monitor stays in stand-by mode. If the resolution is set to the 1080p (1920x1080), it works normally.
Windows didn't offer higher resolution, but I have added QHD via Nvidia Control Panel (after drivers update, second monitor appeared normally).
I have found a way to turn it on: go to Screen Resolution (Control Panel\All Control Panel Items\Display\Screen Resolution) on the second monitor,
change resolution to 1600x900, click to the button "Apply", and after Windows asks to keep this settings, I click to the "Revert".
After that, second monitor turns on and stays active until reboot.
My question is: why this is happening? Why the second monitor goes to the stand-by mode after PC booting?
I have the latest BIOS update (A25) and latest drivers from Dell site.
Answer: I did a quick google on the supported resolutions of your port replicator. It looks like only the display port can provide the resolution that you want.
https://www.dell.com/community/Laptops-General-Read-Only/max-resolution-dell-latitude-with-e-port-replicator/td-p/4453555
Comment: I saw that article. But it is working for me (currently I am using both in QHD). However, I must "wake up" the second monitor after every PC (re)start, and that is a problem.


MongoMetaRecord MegaProtoUser Password not hashed when signing in

Question: I am using the MegaProtoUser in my Lift/Scala app for managing users.
On my running app, I can sign up with a new user normally and he remains singed in just after sign up.
After I log out and try logging in with the same user name and password, the app complains that the username/password is invalid.
I checked the mongo database entry for the password field and found that the password is hashed.
If I copy and paste the the hashed password the mongo database directly in the password field of the web app, the user is logged in.
Password in the database looks like this: oqGR/cR+phb7fpSOL1Bpi8mtV...
Code for model.User.scala:
<code>/**
 * The singleton that has methods for accessing the database
 */
object User extends User with MongoMetaRecord[User] with MetaMegaProtoUser[User] {
  override def screenWrap = Full(<lift:surround with="default" at="content">
      <lift:bind /></lift:surround>)
  // define the order fields will appear in forms and output
  override def fieldOrder = List(id, firstName, lastName, email,
                                 locale, timezone, password)

  // comment this line out to require email validations
  override def skipEmailValidation = true

}

/**
 * An O-R mapped "User" class that includes first name, last name, password and we add a "Personal Essay" to it
 */
class User private() extends MongoRecord[User] with MegaProtoUser[User] {
  def meta = User // what's the "meta" server
  protected def userFromStringId(id: String): Box[User] = meta.find(id)

  protected def findUserByUniqueId(id: String): Box[User] =  {
    var searchListHeadOption = meta.findAll("_id",id).headOption
    searchListHeadOption match {
      case Some(x) => Full(x)
      case None => return Empty
    }
  }
  /**
   * Given an username (probably email address), find the user
   */
  protected def findUserByEmail(email: String): Box[User] = {
    var searchListHeadOption = meta.findAll("email",email).headOption
    searchListHeadOption match {
      case Some(x) => Full(x)
      case None => return Empty
    }
  }

  protected def findUserByUserName(email: String): Box[User] = findUserByEmail(email)

  override def valUnique(errorMsg: => String)(emailValue: String) = {
    meta.findAll("email",emailValue) match {
      case Nil => Nil
      case usr :: Nil if (usr.id == id) => Nil
      case _ => List(FieldError(email, "The email should be unique"))
    }
  }

  // define an additional field for a personal essay
}
</code>
When logging in, the entered password is matched with the hashed password from the db.
I am kind of stuck at this point.
Any help would be appreciated.
Thanks!
Answer: I saw similar Lift issue regarding Record's PasswordField open. Hope it helps!
Comment: Great! Thanks for this data, @lester.
I wish this is fixed asap.


Bitmap images not showing in CListCtrl report view

Question: I'm trying to create a dialog in MFC that contains a CListCtrl to display a list of items with associated images. However, the images are being displayed as blank white squares. They are there, or at least, there is a space where they should be.
I am trying to load the bitmap from a file (although I have also tried loading from a resource ID which has the same effect) and I am storing it in a CImageList. This image list is then given to the CListCtrl. I'm fairly certain that the bitmap is being correctly loaded as I have managed to load the same bitmap successfully elsewhere in my project using the same code.
I'm not sure whether this is important, but this is part of a context menu shell extension and the dialog is raised when the user clicks on one of the items in the explorer context menu. Also, I'm relatively new to MFC so apologies if I've just missed something really obvious.
The following is my code for initialising the CListCtrl in report view with two columns and one item which should have the image in the first column and some text in the second:
// Get reference to list control
CListCtrl m_list_control = (CListCtrl*)GetDlgItem(IDC_LISTCONTROL);

// Create image list
CImageList image_list;
image_list.Create(32, 32, ILC_COLOR4, 0, 3);

HANDLE hBitMap = ::LoadImage(0, L"E:\pathtomybitmap\bitmap1.bmp", IMAGE_BITMAP, 0, 0, LR_LOADFROMFILE);
CBitmap bitmap;
bitmap.Attach((HBITMAP)hBitMap);

image_list.Add(&bitmap, RGB(255, 0, 255));

// Add the image list to the list control
// (LVSIL_NORMAL didn't seem to show anything at all)
m_list_control->SetImageList(&image_list, LVSIL_SMALL);

// Add columns
LVCOLUMN column;
column.mask = LVCF_FMT | LVCF_WIDTH | LVCF_TEXT | LVCF_IMAGE;
column.fmt = LVCFMT_LEFT | LVCFMT_IMAGE;
column.cx = 100;
column.pszText = (LPWSTR)&L"Image";
column.iImage = 0;

m_list_control->InsertColumn(0, &column);

m_list_control->InsertColumn(1, _T("Text"), LVCFMT_LEFT, 100);

int index = m_list_control->InsertItem(0, _T(""), 0);
m_list_control->SetItemText(0, 1, _T("My text"));

Any idea what I'm doing wrong?
Comment: Can't tell from the code you've posted, but what's the scope of the variable image_list?
Comment: Is your bitmap 4bit? (16 colours). Try ILC_COLOR32
Comment: Ah sorry, I added the declarations here but image_list and m_list_control are member variables of the class extending CDialog
Comment: Yeah I'm pretty sure it's 4 bit. I tried the other options anyway though to no avail
Comment: In the fourth parameter `image_list.Create(32, 32, ILC_COLOR4, 0, 3);`  try to pass the real number of elements instead of zero.
Answer: Try changing create statement so that the size you put is smaller than the image size
image_list.Create(31, 31, ILC_COLOR4, 0, 3);

Try setting the mask argument of insert item to:
InsertItem(LVIF_TEXT | LVIF_IMAGE,...


Multiple farms in a sharepoint server

Question: Can there be multiple farms in a SharePoint server. Currently i'm having one farm in SharePoint and wondering if it is possible to have one more.
Answer: No this is not possible. one server can have only SharePoint farm. But you have to mutliple farm's database on single SQL server.
Answer: The short answer is no. The long answer is it might be useful if we understood what you are trying to do. Why would you want multiple farms on a single server? If you need multiple URLs you can create several web applications or use host named site collections. If it is a security concern then this again can be achieved with separate web applications and content databases.

Multiple farms in a sharepoint server


Embed comments within JavaScript regex like in Perl

Question: Is there any way to embed a comment in a JavaScript regex, like you can do in Perl?  I'm guessing there is not, but my searching didn't find anything stating you can or can't.
Answer: You can't embed a comment in a regex literal.
You may insert comments in a string construction that you pass to the RegExp constructor :
var r = new RegExp(
    "\\b"   + // word boundary
    "A="    + // A=
    "(\\d+)"+ // what is captured : some digits
    "\\b"     // word boundary again
, 'i');       // case insensitive

But a regex literal is so much more convenient (notice how I had to escape the \) I'd rather separate the regex from the comments : just put some comments before your regex, not inside.
EDIT 2018: This question and answer are very old. EcmaScript now offers new ways to handle this, and more precisely template strings.
For example I now use this simple utility in node:
module.exports = function(tmpl){
    let [, source, flags] = tmpl.raw.toString()
    .replace(/\s*(\/\/.*)?$\s*/gm, "") // remove comments and spaces at both ends of lines
    .match(/^\/?(.*?)(?:\/(\w+))?$/); // extracts source and flags
    return new RegExp(source, flags);
}

which lets me do things like this or this or this:
const regex = rex`
    ^         // start of string
    [a-z]+    // some letters
    bla(\d+)
    $         // end
    /ig`;

console.log(regex); // /^[a-z]+bla(\d+)$/ig
console.log("Totobla58".match(regex)); // [ 'Totobla58' ]

Comment: As for code documentation, that's bad news. I would probably "unroll" a literal regexp in a multi-line comment and explain its pieces. One must not forget to update the comment with the expression however. What also speaks for literals is that they are created faster than via the RegExp() constructor: http://jsperf.com/creating-regular-expressions/4
Answer: Now with the grave backticky things, you can do inline comments with a little finagling. Note that in the example below there are some assumptions being made about what won't appear in the strings being matched, especially regarding the whitespace. But I think often you can make intentional assumptions like that, if you write the process() function carefully. If not, there are probably creative ways to define the little "mini-language extension" to regexes in such a way as to make it work.
function process() {
  var regex = new RegExp("\\s*([^#]*?)\\s*#.*$", "mg");
  var output = "";
  while ((result = regex.exec(arguments[0])) !== null ){
    output += result[1];
  }
  return output;
}
var a = new RegExp(process `
    ^f    # matches the first letter f
    .*   # matches stuff in the middle
    h    # matches the letter 'h'
`);
console.log(a);
console.log(a.test("fish"));
console.log(a.test("frog"));

Here's a codepen.
Also, to the OP, just because I feel a need to say this, this is neato, but if your resulting code turns out just as verbose as the string concatenation or if it takes you 6 hours to figure out the right regexes and you are the only one on your team who will bother to use it, maybe there are better uses of your time...
I hope you know that I am only this blunt with you because I value our friendship.
Comment: Thanks. Spending too much time making this work would indeed be a [grave mistake](https://en.wikipedia.org/wiki/Grave_accent).


Ubuntu: how to start an app on a different desktop

Question: Automatically starting application show up on the 1st desktop. Is there a way to make them appear on a different (2nd, 3rd, etc) desktop?
Answer: If you're using compiz (desktop effects), yes.
Just install the CompizConfigurationManager, it has a plugin which allows to set such rules. I don't know what it is called exactly, but you'll sure recognize it if you see it (something with Window Location or Place Windows).
Answer: If you want a specific application to end up on a specific workspace, you can use Devilspie :)


solid mode vs. sculpt mode

Question: I was just wondering why I can't sculpt on my solid model is a way to turn a solid model into one that you can sculpt on? Can you combine or add a sculpted part onto a solid without worrying about having multiple vertices in the same space and if it is a problem how can you resolve this?
Answer: To answer the first part of your question, any mesh can be sculpted on in Blender. The way that sculpting works is by moving the positions of vertices, so your model must have vertices where you are sculpting otherwise nothing will happen.
For example, you will not be able to sculpt any detail onto the default cube, because it consists of only 8 total vertices.

But, if a Subdivision Surface or Multiresolution modifier is added, the model will gain sufficient geometry to be easily sculptable.

As for having multiple vertices in the same location, this can be resolved by pressing W > Remove Doubles in edit mode (in 2.79).

solid mode vs. sculpt mode


Playing call of the wild with friend

Question: I want to play Call of the Wild with a friend and be able to talk to him while we're hunting. How do I do this?
Answer: There are quite a few options available to you. I would say the most popular solution would be to make a discord server for you and your friends: https://discordapp.com/
I also am pretty fond of TeamSpeak, but you have to pay for it. A workaround I have found for this is to visit https://teamspeak-servers.org/ and look for servers with no people on them.
Steam also has a voice-over-IP function, instructions on how to use it from Steam:

To begin a voice chat with somebody, open a regular chat with them on Steam and click on the arrow button located at the top right of the window. From the drop down menu select Start voice chat. The person on the other end will be alerted by a ringing sound and a Steam notification.

Happy hunting!

Playing call of the wild with friend


Unable to install web3.js into my system(WINDOWS 10)

Question: **CMD show this error message  **
Geth and python is installed.
Answer: When you copy-paste Git URL, use https:// instead of ssh://
Or, alternative, add SSH key to your SSH agent, probably using command ssh-add. This really depends on course instructions and this question should be addressed to whoever is running the course, not a public forum.
Comment: send command please
Answer: You are not installing from the official repo. From the image you are installing npm install etherium/web3.js (there's a typo etherium).
The web3 project started from Ethereum organization, but it is now being developed by ChainSafe. The official readme indicates npm install web3 for installing.
npm install web3

Comment: E:\studentSample>npm install web3

up to date, audited 384 packages in 2s

53 packages are looking for funding
  run `npm fund` for details

1 low severity vulnerability

Some issues need review, and may require choosing
a different dependency.

Run `npm audit` for details.
Comment: @AmmaraDeveloper So it installed correctly. There is a low severity vulnerability, that usually shouldn't be a problem.
Comment: then why still I am unable to install web3.js
Comment: @AmmaraDeveloper The message says that web3 is already installed. You should be able to use it. If you can't use web3 update the question or create a new one, after looking the site for existing answers.


Ease of breaking MD constructions

Question: If hashing algorithms such as MD5 or SHA1 both use Merkle-Damgard constructions at their cores, why is it so easy to break them, and yet so much harder to break SHA3, which is also MDC based?
Answer: MD5 and SHA-1 have been broken (from a collision-resistance perspective) due to weaknesses of their compression function, not because they are Merkle–Damgård based.
SHA-2 hashes (SHA-256, SHA-512..) are Merkle–Damgård based, but use more compute-intensive compression functions, and are so far unbroken.
SHA-3 is not Merkle–Damgård based, it uses the sponge construction. One advantage is that the result does not reveal the full state, and that makes the construction immune to the length-extension attack.
Comment: My mistake about SHA3 being MDC based. I was unsure whether that was correct. Thank you for the correction.
Comment: I don't think there has been any published attacks breaking SHA-2 or even coming close. The is the length extension problem which don't break a hash function under certain definitions. And I can think of a post on "A distinguisher for SHA256 using Bitcoin" which draws a conclusion that I'm not aware of anyone regarding as legitimate.

Ease of breaking MD constructions


Can Bernie Sanders be a write-in candidate if he does not win the primaries?

Question: Every source I can find says most states require an individual to register to be a write-in candidate for their votes to be tallied. So, has Bernie registered, or does the fact that he ran in the primaries make him automatically registered?
Please give credible sources so we can know for sure.
Here is one source that explains write-ins need to be registered Link

An individual can run as a write-in candidate. In 35 states, a write-in candidate must file some paperwork in advance of the election. In seven states, write-in voting for presidential candidates is not permitted. The remaining states do not require write-in candidates to file paperwork in advance of the election.
Comment: He has said repeatedly and publicly that he has no intention at all of running as an independent or third-party. That would make it rather surprising if he'd filed as a write-in.
Comment: Possibly.  My point is that there's no need to run a write-in campaign if Hillary is indicted.  That's actually his best path to the nomination at this point.
Comment: He may be swayed in the future depending how the election goes. If Hillary gets indicted, and every Bernie supporter I've met wants him to run as an independent. His supporters may persuade him to at least register as a write in, if he needs to. I don't even know if he is already registered, or what, which is what my question is about.
Comment: If Hillary gets indicted, then she would withdraw from the race and another candidate would be given the nomination.
Comment: @Brythan …such as Bernie Sanders…
Comment: @Brythan - "then she would withdraw from the race" - how much would you be willing to wager on that prediction? :)
Comment: If indicted, the donors, campaign staff, and volunteers would force her to drop out.  If it happened prior to the nomination, the superdelegates would force her out as well.  See Anthony Weiner for an example of a politician whose career was ended by an indiscretion.  And nothing he did was illegal.
Answer: Bernie Sanders cannot be a write in candidate after the primaries are concluded.  The filing deadlines to run as an independent candidate for many states has already passed.  Likewise, sore loser laws prevent losing primary candidates from running as independents after the primary has concluded - this is the same reason why Charlie Christ dropped out before the Republican primary vote for FL-Gov back in 2010 to run as an independent.
Comment: Could you please give an example of a "sore loser law"?
Comment: Relevant Wikipedia article: https://en.wikipedia.org/wiki/Sore-loser_law
Answer: I believe that in the states requiring registration, Bernie would need to do so at least 1 month before the election. However, the deadlines to run as an Independent have or are about to pass. (July 31, first week of August).
Note that running as Independent and as a write-in candidate are not the same thing.
So, to answer more clearly, he probably does not have time to run as Independent, but he does have time to become a write-in. I also do NOT believe that running in the primary already qualifies or registers him as a write-in but that would be awesome if it did.  I will research that...
Answer: I served as national field director for the Bernie Write-In campaign in 2016 and he received (an all-time record) 575,000+ votes, good enough for sixth place in the general election.
There is no reason he cannot receive Write-In votes in 2020, operating under something called the 'without his consent/against his will' Theory. This will, in fact, work just fine in twelve states that guarantee to count every last single Bernie vote: Alabama; New Hampshire; Vermont; Rhode Island; Oregon; Wyoming; Washington state; Wisconsin; New Jersey; Iowa; Pennsylvania; and the District of Columbia (not a state, but they still vote).
Comment: @JamesK: The question explicitly asks for "credible sources so that we can know for sure". This post doesn't list any source at all. I didn't downvote, but I also don't consider this a very helpful answer either.
Comment: Can't see why this is attracting the downvotes. I've edited to remove the "argumentative" first line.  The rest seems like an answer to me


Global redirect edit link

Question: I am using the global redirect module. This makes /node/1 goes to my path auto /node/clean-title. If I goto /node/clean-title/edit I get a 404 error. If I go to /node/1/edit. How can I get it so that /node/clean-title/edit works. I would like this to happen on all my nodes automatically.
Answer: You want the Subpath Alias module.

For example, if node/1 is aliased to
  content/alias, this module rewrites
  the link to the node edit page
  node/1/edit to use the aliased URL
  content/alias/edit instead.
Comment: GAAARRR - doesn't exist for Drupal 7!
Answer: By default, path auto only supports node display urls. You could create a small custom module that integrates with path auto and creates the edit urls as as well.
The easiest thing to do, is probably to look at the path auto module and see how it does it. You should be able to copy/paste a lot of code and add /edit where needed to make it work for node edit urls as well.

Global redirect edit link


Proof that interior of a simple closed curve in plane is simply connected

Question: Assuming the Jordan Curve Theorem, we can consider the 2 connected components of the complement of the simple closed curve C in the Riemann sphere. I am trying to establish the Jordan-Schoenflies theorem via Caratheodory's mapping theorem. Is there a basic way of establishing that the connected components are simply connected so that we can get a conformal mapping from the unit disk to the component and hence use Caratheodory's theorem?
Comment: See Thm. 5.7 in Marshall's Complex Analysis. I also asked a similar question on MO partially inspired by your question https://mathoverflow.net/questions/447853/maehara-style-proof-of-jordan-schoenflies-theorem
Answer: The Jordan Curve Theorem says that any simple closed curve $C$ in the two-dimensional sphere $S^2$ separates $S^2$ into two connected regions (that is, $S^2 \setminus C$ has exactly two nonempty connected components).
The Jordan-Schoenflies Theorem strengthens this by stating that these two regions are homeomorphic to an open disk.
Based only on the Jordan Curve Theorem, is there a basic way of establishing the connected components are simply connected? It depends on your understanding of "basic", but it seems to me that the simple connectedness of the regions is not a straightforward corollary of Jordan Curve. In fact, you have to strengthen the proof.
Look at higher dimensions, for example an embedded copy $C$ of $S^2$ in the three-dimensional sphere $S^3$. Then $S^3 \setminus C$ also has exactly two nonempty connected components, but they are not necessarily simply connected. An example for this phenomenom is the Alexander horned sphere. See https://en.wikipedia.org/wiki/Alexander_horned_sphere.
Comment: Thanks for the answer. I am aware of the example of the Alexander horned sphere and the extension to higher dimensions via Jordan-Brouwer Theorem. What I wanted to know is how to prove the Schoenflies Theorem via Caratheodory's mapping theorem. The proof as outlined here (https://en.wikipedia.org/wiki/Schoenflies_problem#cite_ref-6) is starightforward but only if one can apply Riemann mapping which needs the components to be simply connected. Hence my question.
Comment: The horned sphere is an example that the components are not necessarily simply connected. This is a special feature in dimension two, and it is not trivial. The proof goes far deeper than just invoking Jordan Curve. That is, there is a gap between Jordan curve and the applicability of Caratheodory.
Comment: Certainly. However I am only interested in the dimension 2 case. If a proof without invoklng Schoenflies can be given then the RMT/Caratheodory proof will be complete. Else there seems to be some circular reasoning here, atleast in my head.
Comment: As I said: To fill the gap you have to go back to the origin and prove more than Jordan Curve. Simple connectedness is not an addition you will get almost for free.
Comment: @shc If you want, I shall delete my answer. This gives you a better chance that somebody else has a look to you question (if a question has an answer, then this is visible at first glance in the list of questions, and many people will not have a closer look in this case).
Comment: That won't be necessary. I agree with you that the simple-connectedness won't come for free. Have to work on the proof of JCT. Caratheodory seems to have shown existence of a conformal mapping from the disc and then applied his theorem. In that sense the wiki entry was misleading. I guess Moise has the most complete proof. I still long to see a non-PL proof.


FireFox DON'T cancel form submit from jQuery script

Question: I have that situation:
<form class="reqSnip" action="snipvw" method="post" target="_blank">
    <input type="hidden" name="a_snip" value="0">
    <input type="hidden" name="b_snip" value="1">
    <input type="hidden" name="fullDoc" value="true">
    <button type="submit" class="getFullSnippet"></button>
</form>

So - basic form with 3 hidden field+button to submit. With the help of jQuery I bind to the moment of submit this form and customize the process:
jQuery('.reqSnip').submit(function() {
    jQuery('#snipDIV').jqmShow(); // 1
    return false; // 2
});

To make picture clear:

// 1 - open some "pop-up-like" window over Web-page
// 2 - cancel form submit. I do so since the form just request some
Ajax-info and must NOT perform standart form submission. For my
question you can think as I just don't want the form submission take
place, all Ajax-stuff is irrelevant for the question.

How all this works together:

In IE7/8/9/Chrome/Opera - all as expected, pop-up open, form don't
submitted
In FireFox(ver. 8.0.1 on Windows XP SP3) - pop-up open and from DO
submitted (so new tab appear in browser)

I make a light investigation in javascript debuggers (I just place 2 breakpoints(BP) on lines // 1 and // 2) and facts I discover:

IE7/8/9/Chrome/Opera - hit BP on line // 1, then BP on line // 2
FireFox - hit BP on line // 1 and NEVER hit BP on line // 2, so
command 'return false' just never executed :(

So - how to make FF behaviour the same as in all others browsers?
P.S. Libraries used in line 1:

jQuery - you know it :)
jqmShow - command from jqModal, this is a plugin for jQuery. It's
home page: http://dev.iceburg.net/jquery/jqModal

UPDATE
I found root of the problem...
According jqModal documentation (see link above) if you bind to onShow event you must to show (set visible) the dialog (my "pop-up-like" window) inside the event handler. So the general scheme will be
var myOpen=function(hash){ hash.w.css('opacity',0.88).show(); };
$('#dialog').jqm({onShow:myOpen});
....
$('#dialog').jqmShow();

I wrote my code very close to this.
All browsers accept this approach. FF "dislike" it. Have no idea why. So, to solve my problem it is enough DON'T bind to onShow event. That is!
Comment: this works for me in FF8. have you tried clearing your browser cache and making sure you're running the code you think you're running and not some old version?
Comment: I am very-very sure that I try execute exactly the same code as in my start message, just because Firebug for FF show me for sure which lines of javascript code browser get from server (or from cache, as you mention). The same for HTML code for form. I copied both code fragments directly from Firebug. So error/inaccuracy/obsolescence and other similar reason can be eliminated.
Comment: If line 1 is hit but line 2 is not, that would normally mean line 1 threw an exception.  What exception did it throw?
Answer: Try this:
jQuery('.reqSnip').submit(function(e) {
    jQuery('#snipDIV').jqmShow(); // 1
    e.preventDefault(); // 2
});

Comment: I try you suggestion (thanks for it!). Didn't work, I am afraid. :( Line // 2 still no hit in control flow, so form continue to submit.


Netbeans has "Print to HTML" - is there a way to add this feature to Eclipse?

Question: I want to print out some syntax-highlighted Ruby and Python code and Netbeans has a feature on the File menu for "Print To HTML". I'm wondering if there is a plugin or some add-on for Eclipse that enables a feature like this since it is my preferred IDE?
Answer: You could install the Java2Html plugin, however it does not directly send it to a printer. Only to a clipboard or to a file (html or .doc since it can apply those styles in RTF as well as CSS). You can then print the result.
The plugin is made for eclipse2.x.
I just tested it with eclipse 3.5Mx (latest eclipse)... and it does work!

(source: java2html.de)
Answer: Another Eclipse plugin which does export java source code to an html file with appropriate CSS styles is CS4Eclipse
It is more recent (2008), but less sophisticated in its output format (no css files, only inline style), and a little less at ease with annotations.
However, it does support other sources than just java code (CSS, properties, XML, ... are valid sources to be exported to an HTML file)
Also tested with eclipse 3.5Mx.