Getting started with AI (Artificial Intelligence)

Question: I recently got interested in Artificial Intelligence. In my daily life I am a software engineer at a company that develops mobile apps. I am wondering what is the best way to read up on AI? What are 'must-read' books for information about AI?
Comment: my CS440 book is really good.. i'm going to dig it out and give you the the info
Answer: Off the top of my head, the very classic, must-read, heavy book that will help you throughout your AI experience : Artificial Intelligence, A Modern Approach.
Don't be scared by the size, this book is trying to explore multiple kinds of AI, and the authors warn that the reading of the entire book will need nearly a 2-semester period.
If you want to focus on game development and skip the linguistics/robotics/philosophical part of AI, just buy Artificial Intelligence for Games, this book will give you a fine overview of the basic algorithms and game logic behind different types of games.
I read this one last month and am currently reading the 'Modern Approach' one because, let's be honest, when I read some pages of that big AI Bible I was discouraged so I tried the more game-oriented one and was happy with it.
Comment: I second the recommendation of "A Modern Approach" - it's just a really well written text book for an interested CS student..
Comment: "Artificial Intelligence, A Modern Approach" is definitely THE must read book if you want to get a good broad overview of what AI is about. It doesn't get into much detail though. Other than that: AI is such a vast field that it is difficult to recommend much else. It really depends on what you want to do. If you want to learn about machine learning Pattern Recognition and Machine Learning by Bishop is the go-to book (warning: There be math ;)). Computer vision has it's own books. So does reinforcement learning, data mining and every other aspect of AI. So it really depends.
Answer: You could also try BerkeleyX AI course that is available on edX.
More info here: CS188.1x Artificial Intelligence
I haven't taken this particular one, but the quality of presentation is generally very good.
If you go through the archived course that already ended, you can just study at your own pace. However, if you register for the upcoming one you may also get to submit your exercises and take exams, and even receive a certificate at the end. But it will probably start around Fall.
Also their forums are great for asking questions of fellow students and community assistants.


What is rc.status file in linux

Question: I am creating a linux service , in the skeleton file it is mentioned that we need to run various rc commands(rc-status ,rc_reset) to update the service status. What does this actually mean. I have googled it but not able find many details. Can somebody help me
Answer: The commands from rc.status are actually SuSe specific I think. AFAICT they handle two things: output to the user and the final return status of the script. rc_status checks if the previous command (i.e. the start/restart/stop of a service) executed successfully and sets the "status value", which is the return value returned by rc_exit (which you place at the end of your init.d script). Source
You can conceivably write your shell script without them, but I assume they help making sure that your script conforms to LSB requirements and blends in well with other system scripts. I bet most of this is actually documented in the /etc/rc.status file, though. I just don't have a suse box handy.
Answer: You need a shell script to stop/start/restart your service and to give its status.
These are generally called rc scripts.  Have a look in directory /etc/init.d to see some examples - /etc/init.d/klogd is quite a simple one.
The reason they are in init.d is because they also need to be run automatically at boot up to restore the service.
Each Linux variant tends to be a bit different on how the boot up works but the Debian system is fairly typical as it is the basis for many other distributions - see Debian Boot Up Manager
Answer: Here is the comments block from /etc/init.d/skeleton from SUSE Linux Enterprise Server 11 SP3:
#!/bin/sh
#
#     Template SUSE system startup script for example service/daemon FOO
#     Copyright (C) 1995--2005  Kurt Garloff, SUSE / Novell Inc.
#
#     This library is free software; you can redistribute it and/or modify it
#     under the terms of the GNU Lesser General Public License as published by
#     the Free Software Foundation; either version 2.1 of the License, or (at
#     your option) any later version.
#
#     This library is distributed in the hope that it will be useful, but
#     WITHOUT ANY WARRANTY; without even the implied warranty of
#     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
#     Lesser General Public License for more details.
#
#     You should have received a copy of the GNU Lesser General Public
#     License along with this library; if not, write to the Free Software
#     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307,
#     USA.
#
# /etc/init.d/FOO
#   and its symbolic link
# /(usr/)sbin/rcFOO
#
# Template system startup script for some example service/daemon FOO
#
# LSB compatible service control script; see http://www.linuxbase.org/spec/
#
# Note: This template uses functions rc_XXX defined in /etc/rc.status on
# UnitedLinux/SUSE/Novell based Linux distributions. If you want to base your
# script on this template and ensure that it works on non UL based LSB
# compliant Linux distributions, you either have to provide the rc.status
# functions from UL or change the script to work without them.
# See skeleton.compat for a template that works with other distros as well.
#
### BEGIN INIT INFO
# Provides:          FOO
# Required-Start:    $syslog $remote_fs
# Should-Start:      $time ypbind smtp
# Required-Stop:     $syslog $remote_fs
# Should-Stop:       ypbind smtp
# Default-Start:     3 5
# Default-Stop:      0 1 2 6
# Short-Description: FOO XYZ daemon providing ZYX
# Description:       Start FOO to allow XY and provide YZ
#   continued on second line by '#<TAB>'
#   should contain enough info for the runlevel editor
#   to give admin some idea what this service does and
#   what it's needed for ...
#   (The Short-Description should already be a good hint.)
### END INIT INFO
#
# Any extensions to the keywords given above should be preceeded by
# X-VendorTag- (X-UnitedLinux- X-SuSE- for us) according to LSB.
#
# Notes on Required-Start/Should-Start:
# * There are two different issues that are solved by Required-Start
#    and Should-Start
# (a) Hard dependencies: This is used by the runlevel editor to determine
#     which services absolutely need to be started to make the start of
#     this service make sense. Example: nfsserver should have
#     Required-Start: $portmap
#     Also, required services are started before the dependent ones.
#     The runlevel editor will warn about such missing hard dependencies
#     and suggest enabling. During system startup, you may expect an error,
#     if the dependency is not fulfilled.
# (b) Specifying the init script ordering, not real (hard) dependencies.
#     This is needed by insserv to determine which service should be
#     started first (and at a later stage what services can be started
#     in parallel). The tag Should-Start: is used for this.
#     It tells, that if a service is available, it should be started
#     before. If not, never mind.
# * When specifying hard dependencies or ordering requirements, you can
#   use names of services (contents of their Provides: section)
#   or pseudo names starting with a $. The following ones are available
#   according to LSB (1.1):
#   $local_fs       all local file systems are mounted
#               (most services should need this!)
#   $remote_fs      all remote file systems are mounted
#               (note that /usr may be remote, so
#                many services should Require this!)
#   $syslog         system logging facility up
#   $network        low level networking (eth card, ...)
#   $named          hostname resolution available
#   $netdaemons     all network daemons are running
#   The $netdaemons pseudo service has been removed in LSB 1.2.
#   For now, we still offer it for backward compatibility.
#   These are new (LSB 1.2):
#   $time           the system time has been set correctly
#   $portmap        SunRPC portmapping service available
#   UnitedLinux extensions:
#   $ALL            indicates that a script should be inserted
#               at the end
# * The services specified in the stop tags
#   (Required-Stop/Should-Stop)
#   specify which services need to be still running when this service
#   is shut down. Often the entries there are just copies or a subset
#   from the respective start tag.
# * Should-Start/Stop are now part of LSB as of 2.0,
#   formerly SUSE/Unitedlinux used X-UnitedLinux-Should-Start/-Stop.
#   insserv does support both variants.
# * X-UnitedLinux-Default-Enabled: yes/no is used at installation time
#   (%fillup_and_insserv macro in %post of many RPMs) to specify whether
#   a startup script should default to be enabled after installation.
#   It's not used by insserv.
#
# Note on runlevels:
# 0 - halt/poweroff             6 - reboot
# 1 - single user           2 - multiuser without network exported
# 3 - multiuser w/ network (text mode)  5 - multiuser w/ network and X11 (xdm)
#
# Note on script names:
# http://www.linuxbase.org/spec/refspecs/LSB_1.3.0/gLSB/gLSB/scrptnames.html
# A registry has been set up to manage the init script namespace.
# http://www.lanana.org/
# Please use the names already registered or register one or use a
# vendor prefix.
#...
# Source LSB init functions
# providing start_daemon, killproc, pidofproc,
# log_success_msg, log_failure_msg and log_warning_msg.
# This is currently not used by UnitedLinux based distributions and
# not needed for init scripts for UnitedLinux only. If it is used,
# the functions from rc.status should not be sourced or used.
#. /lib/lsb/init-functions
#
# Shell functions sourced from /etc/rc.status:
#      rc_check         check and set local and overall rc status
#      rc_status        check and set local and overall rc status
#      rc_status -v     be verbose in local rc status and clear it afterwards
#      rc_status -v -r  ditto and clear both the local and overall rc status
#      rc_status -s     display "skipped" and exit with status 3
#      rc_status -u     display "unused" and exit with status 3
#      rc_failed        set local and overall rc status to failed
#      rc_failed <num>  set local and overall rc status to <num>
#      rc_reset         clear both the local and overall rc status
#      rc_exit          exit appropriate to overall rc status
#      rc_active        checks whether a service is activated by symlinks
#...
#
# Return values acc. to LSB for all commands but status:
# 0   - success
# 1       - generic or unspecified error
# 2       - invalid or excess argument(s)
# 3       - unimplemented feature (e.g. "reload")
# 4       - user had insufficient privileges
# 5       - program is not installed
# 6       - program is not configured
# 7       - program is not running
# 8--199  - reserved (8--99 LSB, 100--149 distrib, 150--199 appl)
#
# Note that starting an already running service, stopping
# or restarting a not-running service as well as the restart
# with force-reload (in case signaling is not supported) are
# considered a success.
#...
## Check status with checkproc(8), if process is running
## checkproc will return with exit status 0.
#
# Return value is slightly different for the status command:
# 0 - service up and running
# 1 - service dead, but /var/run/  pid  file exists
# 2 - service dead, but /var/lock/ lock file exists
# 3 - service not running (unused)
# 4 - service status unknown :-(
# 5--199 reserved (5--99 LSB, 100--149 distro, 150--199 appl.)

Here is the comments block from /etc/rc.status from SUSE Linux Enterprise Server 11 SP3:
# /etc/rc.status
# vim: syntax=sh
# Definition of boot script return messages
#
#   The bootscripts should use the variables rc_done and rc_failed to
#   report whether they failed or succeeded.  See /etc/init.d/skeleton for
#   an example how the shell functions rc_status and rc_reset are used.
#
#   These functions make use of the variables rc_done and rc_failed;
#   rc_done_up and rc_failed_up are the same as rc_done and rc_failed
#   but contain a terminal code to move up one line before the output
#   of the actual string. (This is particularly useful when the script
#    starts a daemon which produces user output with a newline character)
#
#   The variable rc_reset is used by the master resource control script
#   /etc/init.d/rc to turn off all attributes and switch to the standard
#   character set.
#
#    \033          ascii ESCape
#    \033[<NUM>G   move to column <NUM> (linux console, xterm, not vt100)
#    \033[<NUM>C   move <NUM> columns forward but only upto last column
#    \033[<NUM>D   move <NUM> columns backward but only upto first column
#    \033[<NUM>A   move <NUM> rows up
#    \033[<NUM>B   move <NUM> rows down
#    \033[1m       switch on bold
#    \033[31m      switch on red
#    \033[32m      switch on green
#    \033[33m      switch on yellow
#    \033[m        switch off color/bold
#    \017          exit alternate mode (xterm, vt100, linux console)
#    \033[10m      exit alternate mode (linux console)
#    \015          carriage return (without newline)

Comment: This does not really answer the question.

What is rc.status file in linux


Can bath and shower be used at same time with diverter?

Question: When running the bath my son likes both the bath faucet and shower head to be on while he plays. I'm assuming there's not the same amount of pressure in either as when they are being run solo but is there any issue with this being done?
Comment: if you have the kind of diverter that is a pull up knob in the tub spout, this probably would not be possible. The knob must either be all the way up or down, but you could try. If you have the (older and fancier) type of diverter that is inside the valve body and controlled by a rotating handle, you can divide the flow so some comes out the spout and some comes out the shower. But I don't think this gives much flow out the shower since the path through the spout is so low in resistance to flow.
Answer: You can have both one.  There is no issue.  It will not damage anything.  You are correct in that the pressure on each would be lower than if they were activated by themselves.


chat requirements

Question: will being able to access chatrooms always be linked to your meta account or will it be transfered to the respective sites account once chat is out of beta?(i.e. if I have 20+ rep in gamedev or so but only 1 here would that in the future allow me to chat on their specific chat pages)
Comment: Dunno, but now you have 20 over here anyway :)
Answer: The reputation requirements for chat are always relative to the parent site.
This is very similar to the way the per-site metas work as well, where you must have 5 rep on the parent site to ask or answer a per-site meta.
https://blog.stackoverflow.com/2010/07/new-per-site-metas/
Comment: That doesn't seem to be the way it worked at the time of this question since i had ~28 rep with the gamedev site but when I went to the chat for it it said I needed 20 rep to be able to send any messages there.

edit - also the blog post you mentioned says nothing about chat specifically.
Comment: so will there be a chat.meta for each of the sites?

chat requirements


Restore a Database into a Current Database and merge

Question: I want to know how, or if it is possible, to backup a database then should the user wish, restore that database at a later date and merge it with the one they are currently using.  Both Databases will be using the same tables and have the same fields, the difference is in the data.  Ideally I would like to do this through SQL and not have to get a third party application.  Any ideas or suggestions, I'm kind of in a bind here.
Comment: Does it have to be if the user wish? Can it be continously merging the data?
Comment: I'd be surprised if there is a product out there to do this. Think about it, you have db1 and db1' assuming *only* data values have changed, what is correct? People table has Mary Smith in db1 and Mary Winklebauer in db1' - which one should be retained? How would a generic program implement that merging of data? If all your tables have the concept of last modified date, then you can probably figure out which row to preserve. Either way, you'll need to restore the backup to a different catalog and merge that data into target in FK reference order.
Comment: Is it *every* table or just a select few? You could take your backup now, restore it under a different catalog name and set it to readonly. Then write the merge process (three part naming with merge statements, some SSIS, or some other option other folks will come up with) and let it sit idle until they have need to actually merge the data.
Comment: To be honest I questioned the reasoning for the "backup to merge" myself.  I think @bilinkc is right in the statement of what data is kept and what data is overwritten.  I think what I am going to have to do is when they "restore" the old database to restore it with a different name and set it as read only as suggested.
Answer: If you have Visual Studio Ultimate or Premium, you can use "Data Compare" feature in Data menu. It can compare data between two tables and have ability to directly update your database or generate update script.


Need later Samsung-specific posts to get a photo from dropbox to Gallery

Question: Can't believe how hard this is and the lack of recent posts with current menu options.  I have a photo modified on the PC, saved in dropbox and cannot set it as my wallpaper on my Samsung S8.  Every help post found shows options not on current apps.  Dropbox has very limited options, hold and press doesn't help, and select and download icons produce blank screens.
Answer: The current Dropbox does not "have limited options". It just may not be able to place exactly where you want, because of privilege concerns. I'll demonstrate how to get a photo to the "Downloads" folder, for example, where it can probably be able to be incorporated from whatever your wallpaper app is.

Start Dropbox and find the file within its folder hierarchy.
From its upper "hamburger" menu, which is short to start, scroll to "Export".
Choose the first option "Save to device".
In the upper left menu, it will have probably given "Documents" as a target.
From its down arrow dropdown, select your device name.
Scroll the device folders available to find your "Download" folder, select it.
Drill further or more if you like, finally, hit the "Save" button.


Is it possible to redirect a logging output of the iptables' LOG chain into a separate log file?

Question: I don't want to mix iptables's log output with other system logs. How could I specify a dedicated log file for iptables LOG chains output?
Comment: The same question got re-asked [here specifically for `rsyslog`](http://unix.stackexchange.com/q/16053/1925).
Answer: How you do this will depend on which log daemon you use, syslog or syslog-ng.
With syslog, you can do this by tweaking a specific log level to only contain iptables messages.
In /etc/syslog.conf:
kern.warning     /var/log/iptables

The set iptables to use that log level:
iptables -A INPUT -j LOG --log-level 4

With syslog-ng you should be able to get a little fancier. Instead of hacking a log level you can filter for content and send that content to a specific log file.
In /etc/syslog-ng/syslog-ng.conf:
destination d_iptables { file("/var/log/iptables"); };
filter f_iptables { match("IN=[A-Za-z0-9\.]* OUT=[A-Za-z0-9\.]*" value("MESSAGE")); };
log { source(s_sys); filter(f_iptables); destination(d_iptables); }

Comment: What I do on my system is use a unique string in each LOG message that is not likely to appear in other messages (":%FW%:" is what I use currently).  You can then tell `syslog` or `syslog-ng` to filter any incoming message containing that to its own file.
Comment: I don't have neither '/etc/syslog/' nor '/etc/syslog-ng/' directories on my Ubuntu 10.04 Lucid system. But obviously there is some logging package. In case of 'syslog', as I understand, all messages for 'kern' facility at level 'warning' and above will go to the specified log file, so I can probably end up with mixed-output file also?
Comment: Looks like I have 'rsyslog' installed.
Comment: @mbaitoff: Yes, the level 4 warning was picked because it's not used very often, but yes you COULD end up with a mixup. I'm sorry I don't know `rsyslog`, but I'm sure there is a similar way to route messages to different log files based on the originating process or filtering.
Comment: Yes, looks like there is a way to use facility and level specification together with template message filtering and `--log-prefix` ability to forward matching messages to certain log file. I'd probably open another question regarding the `rsyslog`-way implementation of such a forwarding (as the manpage is pretty cryptic about it). Thanks for help with `syslog` and `syslog-ng` cases.
Answer: You can use something like this:
:msg,contains,"IPTABLES:" /var/log/iptables
& stop

It should be added before any other rules, for example:
:msg,contains,"IPTABLES:" /var/log/iptables
& stop

auth,authpriv.*         /var/log/auth.log
*.*;auth,authpriv.none      -/var/log/syslog
cron.*              /var/log/cron.log
daemon.*            -/var/log/daemon.log
kern.*              -/var/log/kern.log
...

You just change the IPTABLES: to whatever you've set in the LOG target. If you wont use & stop, the message will be logged in both files, the standard /var/log/syslog file and in the /var/log/iptables .
It's a better solution than redirecting all kern.warning messages because in that case you can redirect some other information, not just the one you'd like.


What are some ways to optimize your use of ASP.NET caching?

Question: I have been doing some reading on this subject, but I'm curious to see what the best ways are to optimize your use of the ASP.NET cache and what some of the tips are in regards to how to determine what should and should not go in the cache. Also, are there any rules of thumb for determining how long something should say in the cache?
Comment: Have you read MSDN article "10 Tips for Writing High-Performance Web Applications"? Tip 4 "ASP.NET Cache API" should give you some good background knowledge to work out a solution for you. All the best to you. :-)
Comment: @Timothy - Nope, I hadn't seen that one yet, you should enter it in as an answer and get credit.
Answer: Some rules of thumb

Think in terms of cache miss to request ratio each time you contemplate using the cache. If cache requests for the item will miss most of the time then the benefits may not outweigh the cost of maintaining that cache item
Contemplate the query expense vs cache retrieval expense (e.g. for simple reads, SQL Server is often faster than distributed cache due to serialization costs)

Some tricks

gzip strings before sticking them in cache. Effectively expands the cache and reduces network traffic in a distributed cache situation
If you're worried about how long to cache aggregates (e.g. counts) consider having non-expiring (or long-lived) cached aggregates and pro-actively updating those when changing the underlying data. This is a controversial technique and you should really consider your request/invalidation ratio before proceeding but in some cases the benefits can be worth it (e.g. SO rep for each user might be a good candidate depending on implementation details, number of unanswered SO questions would probably be a poor candidate)
Answer: Don't implement caching yet.
Put it off until you've exhausted all the Indexing, query tuning, page simplification, and other more pedestrian means of boosting performance.  If you flip caching on before it's the last resort, you're going to have a much harder time figuring out where the performance bottlenecks really live.
And, of course, if you have the backend tuned right when you finally do turn on caching, it will work a lot better for a lot longer than it would if you did it today.
Comment: Assume that everything everything else has been properly tuned, or it is a situation where you want to keep the data out of the ViewState.
Answer: The best quote i've heard about performance tuning and caching is that it's an art not a science, sorry can't remember who said it but the point here is that there are so many factors that can have an effect on the performance of your app that you need to evaluate each situation case by case and make considered tweaks to that case until you reach a desired outcome.
I realise i'm not giving any specifics here but I don't really think you can
I will give one previous example though. I worked on an app that made alot of calls to webservices to built up a client profile e.g.

GET client
GET client quotes
GET client quote

Each object returned by the webservice contributed to a higher level object that was then used to build the resulting page. At first we gathered up all the objects into the master object and cached that. However we realised when things were not as quick as we would like that it would make more sense to cache each called object individually, this way it could be re-used on the next page the client sees e.g.

[Cache] client
[Cache] client quotes
[Cache] client quote
GET client quote upgrades
Answer: Unfortunately there is no pre-established rules...but to give you a common sense, I would say that you can easily cache:

Application Parameters (list of countries, phone codes, etc...)
Any other application non-volatile data (list of roles even if configurable)
Business data that is often read and does not change much (or not a big deal if it is not 100% accurate)

What you should not cache:

Volatile data that change frequently (usually the business data)

As for the cache duration, I tend to use different durations depending on the type of data and its size. Application Parameters can be cached for several hours or even days.
For some business data, you may want to have smaller cache duration (minutes to 1h)
One last thing is always to challenge the amount of data you manipulate. Remember that the end-user won't read thousands of records at the same time.
Hope this will give you some guidance.
Answer: It's very hard to generalize this sort of thing.  The only hard-and-fast rule to follow is not to waste time optimizing something unless you know it needs to be done.  Then the proper course of action is going to be very much dependent on the nitty gritty details of your application.
That said... I'll almost always cache global applications parameters in some easy to use object.  This is certainly more of a programming convenience rather than optimization.
The one time I've written specific data caching code was for an app that interfaced with a very slow accounting database, and then it was read-only for data that didn't change very often.  All writes went to the DB.  With SQL Server, I've never run into a situation where the built-in ASP.NET-to-SQL Server interface was the slow part of the equation.


iOS: request for up to date solution for UITabBarController rotation

Question: What is up to date best solution for rotating inner views when dealing with UITabBarController? I'm playing around with a standard app view hierarchy: In my main app delegate file, I'm creating UITabBarController, then, I'm creating UINavigationController, filling it with a UITableViewController (with instantiated custom subclass), and adding that UINavigationController to the first tab bar item. Now, I need UITableViewController to autorotate. I know that I need to implement shouldAutorotateToInterfaceOrientation in all view controllers, therefore, I implemented it in my custom UITableViewController subclass implementation file:
- (BOOL)shouldAutorotateToInterfaceOrientation:(UIInterfaceOrientation)interfaceOrientation
{
  // Return YES for supported orientations
  return YES;
}

But the UITableViewController is not rotating :( .Now, I understand that there are UINavigationController and UITabBarController objects, that are sitting above my TVC but those two are instantiated directly not through a subclass, so there is no place where to return yes for autorotation. However, I'm able to solve this problem by subclassing a UITabBarController and implementing shouldAutorotateToInterfaceOrientation method in its implementation file. But I have read, that this is a non-recommended approach and my conscience feels bad :) Another working solution is to implement a category for UITabBarController (http://stackoverflow.com/questions/1269704/uitabbarcontroller-morenavigationcontroller-and-the-holy-grail-of-device-rotatio)...
So, these two solutions are the only ones that I was able to apply. Are there any other "out of the box" solutions, for example, setting some property on the UITabBarController or smth?
Answer: In the class which you either subclass UITableViewController or implement UITableView in UIViewController, you need to set autoresizingMask for tableView. It is something like
self.tableView.autoresizingMask = UIViewAutoresizingFlexibleWidth | UIViewAutoresizingFlexibleHeight;
and TableView should be ok and rotated properly.
Hope this help :)


How is it possible for the oil to fall back to the oil pan soon enough to prevent oil starvation?

Question: This is one thing I don't understand. When the engine is running, the oil is pumped by the oil pump towards the upper part of the engine (cylinder head assembly). I know there are some galleries inside the head that helps oil to fall back into the oil pan but suppose an engine is turning at 3000 - 4000 RPM. At such engine speeds, the oil pump is spinning so fast that sucking the oil upwards will happen faster than the oil going downwards to return to the oil pan. When this happens, the level of oil may go down and the oil pickup may suck air instead of oil. How has this issue been addressed by car designers?
Answer: The galleries only hold a small amount of oil, between 0.5 and 1 litre roughly.
As the pump forces oil into the galleries, that same amount comes out and returns to the sump.
The sump holds 4 or more litres so there is always enough for the pump to draw on and also enough when the level changes due to hills or braking etc.
The other thing the oil does is to carry heat away from the bearings etc and move it to the sump where it cools - in some engines this sump cooling means fins on the outside of the sump or even an engine oil cooler can be fitted.


Is there any command tools that could list all the bp nodes info like IP Port etc after the mainnet launching?

Question: When the main net works well, is there any command line tools for us the check or monitor all the bp nodes ?
Answer: No, Not yet. I imagine something like this will be released in the next month or two.


What entities in quantum mechanics are known to be "not quantized"?

Question: Since all the traditional "continuous" quantities like time, energy, momentum, etc. are taken to be quantized implying that derived quantities will also be quantized, I was wondering if quantum physicists agree upon any quantity not being quantized?
I couldn't think of a single thing, until I came across this: Why position is not quantized in quantum mechanics?
Comment: In the future, a time will come when all people will use the term "discrete" to distinguish from continuous, and "quantized" to mean "subject to quantum rules".  I will, of course, be dead by then.
Comment: Not sure what you mean by quantized here. For a free particle, neither $p$ nor $E$ are quantized in the sense that they take any value.
Comment: Possible duplicate: http://physics.stackexchange.com/q/39208/2451
Comment: @user1104 I am talking of the known world. Do we know any existing quantities that exist in non-quantized state?
Comment: @twistor59 You have to allow for people who are not native to QM but are merely interested in philosophical implications of what Physics has uncovered so far.
Comment: @Madhur I take your point.  The comment wasn't specifically directed at you - it's just an issue with terminology that I've often seen causing confusion in discussions.
Answer: Considering that the answers to the question you link are available for reading you will see that position is also quantizable, as crystal structure unequivocally demonstrates.
Quantum mechanics has a mathematical formulation that intrinsically allows for quantization of any variable entering the formulation, depending on the boundary conditions set to the solutions of the differential equations. A free particle,  has variables that can take any value."Free" means specific boundary conditions that result in continua.
Comment: yes,  boundary conditions are necessary for quantization to appear. Similar to classical wave equations.
Comment: Does that mean that if boundary conditions do not exist, then quantization does not exist?
Comment: Am I right in stating the converse that if boundary conditions can be stated for any quantity then quantization must also exist?
Comment: i believe boundary conditions are necessary, i do not know if they are sufficient generally.. For potential well problems they are, (finite bounds)
Answer: Energy quantization in terms of quantum mechanics depends upon the boundary conditions of a problem.  A particle confined to a box will have a quantized energy and a quantized momentum.  A free particle may have any energy and corresponding momentum.
It is the requirement that the wave function match conditions at the boundaries that excludes some functions and includes others.  In other words, thats where energy quantization comes from.
Some properties seem not to be quantized at all.  Time is one.  Others seem always to be quantized, at least in non-relativistic quantum mechanics.  Mass is such a property.  Any mass is made up of atoms and atoms have definite (quantized) masses.  Indeed, the discovery of the quantization of the mass of atoms was a major step forward in chemistry.
Answer: There is actually an older but nice article by Sir Neville Mott in which he argues that quantization occurs as a result of contraints expressed through boundary conditions.
Hence, the energy of bound states is quantized because one forces the wavefunctions to be $0$ at infinity and thus normalizable.  Contrarywise, the energy of unbound states is not quantized as the wavefunction is not subject to the previous boundary condition.
Indeed, it is not hard to see, by playing with standard numerical integrators, that getting a solution of the Schrodinger equation is not hard, but getting a solutions that satisfies the boundary conditions is much harder and can only occur for discrete values of the energy.
A similar argument can be made for the quantization of the magnetic quantum number $m$: this follows by imposing that wavefunctions be single-values under a rotation by $2\pi$. There is also such a game to be played for the angular quantum number $\ell$.
Answer: In standard quantum mechanics, time is actually not quantized. What is also not quantized are all parameters that appear in the equations, like eg mass, coupling constants, and so on. You also don't quantize interactions in quantum mechanics, for this you have to go to quantum field theory.
The way I am using the term "quantized" is to means you make classical quantities operator valued. This does not necessarily mean these quantities get a discrete spectrum, which in general depends on the details of the system you consider.
Answer: Let me rephrase your question in a more pendantic way: which Hermitian (measurable) operators have eigenvalues that can take any continuous value (a continuous spectrum)?
My first reaction is to look for symmetry groups which are not closed. For instance, rotation corresponds to a closed symmetry group because rotation by any angle is equiavelent to rotation by some angle less than $2\pi$. Translation would be an example for a not closed symmetry group.
For a free particle, symmerties include position and time, and so my list would be the

position (including angles)
momentum
the Hamiltonian

operators. I'm excluding:

time, which is a parameter and not an operator is non-relativistic quantum mechanics
angular momentum, since rotation is continuous but a closed symmetry
parity, which is not a closed symmetry

Note that quasimomentum, the momentum in a crystal, also has a continuous spectrum (eigenvalues). The symmetry group, discrete translations, is not closed even though it is not continuous.
Of course, you can combine these operators and make new ones with continuous eigenvalues that don't correspond to any symmetry of the system.
Comment: by "closed" you actually mean "compact" ?


virtualbox 2 vmware disk

Question: I have a virtualbox disk I'd like to convert to a vmware disk. The disk is dynamic which makes it a lot more trickier. If I follow the instructions at http://xpapad.wordpress.com/2010/02/21/migrating-from-virtualbox-to-vmware-in-linux, the vdi-to-raw conversion will result in a 2 TB file. I don't even have that much disk space! The first step therefore seems to be a dynamic to static conversion of the virtualbox disk, right?  How do I do that or is there perhaps a better way to convert to vmware? Help!
Answer: Unfortunately, VMWare does have problems importing Virtual appliances created in Virtualbox, otherwise the process would be quite easy.
As an alternative to the method described in your post, you may wish to take a look at this http://www.barbaropoli.com/2009/07/how-to-convert-virtual-disk-from.html It's a similar process but does not require an intermediate massive RAW disk image.
Answer: Personally, I'm not clever enough to use the fancy virtual tools and stuff and tend to just consider what I am doing in terms of real machines.
As such you need to copy everything from one hard disk to another.
I would create an empty VMWare vmdk disk and add that as a second hard disk to the virtual machine in Virtualbox, then use whatever tool to copy the disk from within the Virtualbox virtual machine.
Then release the vmdk disk from the Virtualbox virtual machine and attach it to a new VMWare machine.
Answer: While it's tempting to try some fancy disk conversion scheme, the best and simplest way is probably just to run VMware vCenter P2V Virtual Machine Converter.
Answer: Download latest QEMU for your OS to use qemu-img.
Try compressed qcow2 format or use defragment + sdelete approach to shrink the disk image size first.
qemu-img supported formats:
      qcow2 bochs null-aio qcow null-co host_
      file parallels vdi blkdebug dmg vpc raw
      qed vvfat vmdk sheepdog blkverify nbd cloop

virtualbox 2 vmware disk


Failure of Metallized Film Capacitors

Question: I have the following : Metallized film capacitor. I read in some papers that MFC are protected against short-circuit with a self healing.
Self-healing is a phenomenon where  in the event the electrodes are  exposed to each other instead of the capacitor shorting, the capacitor repairs itself.  This repairing of the capacitor is due to the thinness of the foils used.
In a film /foil  capacitor when the foils are exposed to each other, the foils would touch and short  together rendering the capacitor useless.
When a capacitor with metalized films has the foils exposed to each other, they  also will touch each other, but here the combination of the foils thinness and the high  energy  density  at the fault area causes the foils to vaporize and the capacitor stays in operation.
My question:
In case of failure one foil is sucked to other foils the energy density is dissipated on large fault area which leads to not vaporize of the foils in contact and failure of the self-healing process. So short circuit of the MFC is possible, someone can confirm this through an experience with failure of MFC ?
Comment: The self healing is not a protection mechanism against short circuiting a cap, it is a somewhat nice side effect of the construction in case of overvoltages. It is though as much self healing as it is for you to cut of one of your broken limbs...
Comment: the reason for non-presence of short circuit on the MFC is self-healing
Answer: Self healing caps are typically used for direct connection to mains supplies. Mains can often have 1500V or more spikes appearing on the conductors briefly, due to switching events or lightning strikes in the supply network.
In an MFC that is designed for self healing (not all are), the metal film is patterned into a mesh of squares with fine connections between them. These fine connections behave as weak links, or fuses. If an overvoltage punctures the insulator between two squares, the fuses to those squares vapourise. (How they chose manufacturing parameters so that the metal vapour doesn't condense to form a bridge between the films, I don't know, but I guess that's why they make capacitors, and I don't).
Now with the links gone, the punctured region is isolated from the rest of the capacitor. The capacitance will have dropped slightly, but with the electrodes made from hundreds of squares, it's a tiny fraction of its total capacitance. This can be repeated, and a capacitor exposed to many overvoltage incidents can lose a significant part of its capacitance evnetually.
Comment: This is doesn't prove that the short-circuit of the MFC is not possible.    The behavior of the MFC in case of short-circuit is in normal operation, but i investigate the case of failure of the MFC capacitors, which may leads to SC of the capacitor.

Failure of Metallized Film Capacitors


Are 'high-throughput' and 'large-scale' proteomics synonyms?

Question: I wonder if 'high-throughput proteomics' and 'large-scale proteomics' are generally used synonymously? It would make sense to me to distinguish between 'high-throughput' as in a 'large number of samples' vs. 'large-scale' as in 'big samples with thousands and more of proteins'. However, I have not found any article on this so far and it seems to me that the community uses both terms interchangeably. Are there other terms commonly used to refer to these properties?
Answer: I often see the two terms used hand-in-hand, although I'd say they're not quite synonymous. Often the term high-throughput refers to the number of features being analyzed, with high-throughput methods quantifying many features in parallel. Because of the parallelization, the time needed to quantify all features is reduced, so you can process more samples in a fixed amount of time - the method has high throughput since many features/samples can be analyzed quickly. "High-throughput" typically refers to the technology being used to analyze a sample. Different proteomics technologies may be classified as high-throughput or not, regardless of how those technologies are applied.
Since a high-throughput method can process samples quickly and cheaply, it often goes hand-in-hand with large-scale analyses, which often refers to the number of samples (but sometimes the number of features) being processed. A "large-scale" analysis typically refers to the design of the experiment.
Older experiments were generally limited to small-scale by low-throughput technology, while high-throughput technology has enabled large-scale experiments. You could use a high-throughput technology to do a small-scale analysis, but it wouldn't leverage the power of high-throughput methods to run many samples in a short amount of time. Applying a high-throughput method to a single sample would be an example of such a case. You could also theoretically use a low-throughput technology to do a large-scale analysis, but it would take a very long time and be very costly, and would likely be infeasible without significant resources. Applying a low-throughput method to many samples would be an example, although this is not commonly seen in practice.
Usually you'd use a high-throughput method to achieve a large-scale analysis, which could not be feasibly achieved with a lower-throughput method. An experiment is often both high-throughput and large-scale so the terms are often seen together, but I'd say they have distinct connotations of referring to the technology and the overall experimental design, respectively.
Comment: That is a great summary of what I see in the literature as well. Most proteomics studies that I found use high-throughput to refer to numbers of features/proteins/peptides identified. Not so much regarding processing of samples in a short time.


Workflow and management questions: On-topic?

Question: Just saw this question: https://graphicdesign.stackexchange.com/questions/9142/how-to-manage-game-graphics-project and was wondering: Are workflow / management questions (when they relate exclusively to the graphic design field and can have therefore specific requirements) on topic? And if they are, should we create new tags to go with them?
Answer: I'm still adjudicating that particular question. It's not precisely a design issue, but in the real world it's the kind of thing designers and people who work with them do run into. A poorly set up design team can fail miserably, even though the individual designers may be both talented and competent. Legal questions, such as copyright, model releases and "how do I handle my clueless boss?" fall into much the same category of things that profoundly affect a designer's craft, even though they are not directly part of the craft.
Scott has already commented that it seems more a management question than design, and he's right. On the other hand, there's a team of designers out there whose work is about to be made almost impossible.
Comment: That's what I thought. Maybe it's good to keep this range of questions in mind as part of the general debate on how to improve GD's scope and visibility.
Comment: I think the workflow side of that question is fine, but it specifically is a tricky question as a) it's very broad, maybe too broad to answer (I'm sure books have literally been written on the topic, I linked to one that is close), b) not sure how represented computer game graphics currently are here, lots of different workflow issues, c) it's from the point of view of someone whose full time job is management, rather than workflow alongside design work. I think it's an example of an unusually difficult/problematic workflow question.
Answer: To me.... It's no different than if someone asked a question about managing an inventory of whizbang hinges across 20 different metal fabricators. The actual asset is irrelevant.
The mere fact that the project is related to design doesn't make it a design question in my opinion. It's purely a project management or subordinate management question.
If the designer were asking how to manage deliverables when they need to be aware of [legal issues, copyrights, releases] then that may be more of a design question. But a manager asking how to manage the assets being delivered by employees and schedule their project is not a design question.
In reality, he should be having that discussion with the employees - "How long do you feel you'll need to complete XXXX?" Then factor that into the project timeline. So... even if one disagrees with me and feels it is a design question... no one here could possibly answer it without full project specifications, which were not provided.
Comment: I agree, a project related to design isn't necessarily a design question. But we've answered questions like http://graphicdesign.stackexchange.com/questions/8086/what-are-some-tips-for-a-graphic-designers-cv-resume which are not strictly design either, and they seem to attract more people.
Comment: @yisela I see your link as far more related to design in my opinion. I don't see any comparison between a designer asking how to improve a CV and a manager asking how to organize assets. Apples and oranges to me.


Are there any books or articles that contain information on the P weak omega or second order predicate calculi?

Question: I have been trying to learn about the lambda cube, but cannot find any sources covering the P weak omega and P2 nodes.  Is the problem that these nodes are not frequently used/ offer little benefits over the calculus of constructions?  Thanks
Comment: What's the "P weak omega"? Can you link to the reference you have in mind?
Comment: It is mentioned in "An Introduction to generalized type systems" in the journal of Functional Programming, April 1991.  https://homepages.inf.ed.ac.uk/wadler/papers/barendregt/pure-type-systems.pdf mentioned on page five of the linked PDF.  Thank you :)
Answer: I've talked about a couple of these in this question, though Neel's answer gives a lot of insight as well, though I didn't dwell on $\lambda P_\underline{\omega}$ specifically.
$\lambda P_2$ is quite famous: it's the dependent type theory corresponding to second-order predicate logic. I think Geuvers has written about it (e.g. here. It's a good place to do math in, in fact you pretty rarely need the extra power of the CoC, though it is convenient.
$\lambda P_\underline\omega$ is not second order, so you cannot quantify over predicates, e.g. as in $\forall P:\star, P \rightarrow P$, indeed you only have a little more expressive power over simple first order logic.
One thing you can do in this system is express predicate transformers. For example, in the context $\mathbb{N} : \star$ one could declare
$$\mathrm{Exists}:(\mathbb{N}\rightarrow \star)\rightarrow \star$$
That is, you can give a type to the $\exists$ operator, which is not possible in $\lambda P$ proper.
I'm not sure anyone's studied this system on its own though.
Comment: Wow, thank you! that thread and the article is very useful.  I couldnt quite believe that nobody had published any papers on lambda P weak omega ever so wanted to make sure.
Comment: I don't know of any work that looks at it specifically.


Does inexistence exist?

Question: If inexistence exists then how is it inexistence?
And if inexistence does not exist then how come it into existence and we know about it?
Or is it paradox?
Comment: Some progress can be made (maybe) with the ontology of non-existent *objects*. See [Alexius Meinong](https://plato.stanford.edu/entries/meinong/).
Comment: Everything that exists exists. And what does not exist does not exist.
Comment: The first question seems to be a category error.  Paintedness (the state of being painted) cannot itself be painted, and yet it is all about being painted, and there is no deep problem with that notion.  So there is no prima facie reason why nonexistence should be nonexistent just because it is *about* not existing.
Comment: Inexistence is better phrased as non- existence. But since the prefix 'in' means not, the two words are synonymous. Existence and non- existence are used in ontology (study of being) to separate the real or non-created things from the non-existent or things which originate from a proximate cause. And yes the linguistic usage is confusing and takes time to understand clearly.  All of what was just described involves only the primary or basic tenets of ontology (in metaphysics). At an advanced stage the non-existent are termed 'puncta', flashes which barely exist if at all; less than contingent.
Answer: Already the question about the existence of existence is based on a delicate linguistic expression:
Primarily single objects exist. Everybody understands a sentence like: There exist people from Norway. But already the question, whether abstract concepts exist, and if yes, in which sense they exist, is debated. E.g., in which sense exist "humanity" or in which sense exist mathematical objects?
I consider existence and non-existence an abstract concept, namely a property of possible objects. Then one can deal with the question of the existence of these two properties in alike fashion.
Of course this approach does not answer the original question. But as stated above, the question has no generally accepted answer. For more information cf. the philosophical terms nominalism versus realism.
Answer: Inexistence does not exist. Once we die, we don't stop existing. We are eternal spirits. We have a premortal, a mortal, and a post-mortal life. Our bodies may decompose, but our eternal spirits will forever stay alive.

Does inexistence exist?


Raspberry Pi & Focusrite Scarlett 2i2

Question: I'm trying to build a project which involves a Pi connected to an Arduino over USB and to a Focusrite Scarlett 2i2 over USB as well. A small diaphragm condenser microphone is to be connected to the audio interface and the audio over USB is then further processed by code running on the Pi. The final output involves the Pi sending a command to the Arduino using Firmata.
Now, my question is this. How do I handle the power requirements for both the interface and the Arduino? Will the Pi be able to handle the interface by itself, in case of which, I'll power the Arduino over its own DC adapter? Or if not, is there any recommended USB hub that I can use to handle all the power requirements?
I've gone through the recommended list of peripherals and most are not available locally in India (which is where I am from, by the way) and the Pi Hub which seems to be the cleanest option again isn't available here.
Focusrite 2i2
Answer: I've tested it by changing the parameter max_usb_current=1 in /boot/config.txt.
It was able to work "out of the box" using Ubuntu Mate distribution for Raspberry Pi.

Raspberry Pi & Focusrite Scarlett 2i2


Can I force Flash games to play in fullscreen mode?

Question: I download Flash games from several sites and some of them can be played on fullscreen and some cannot be. How can I change the screen size of the game to accomodate my screen? Is there a way to force all Flash games to be played in fullscreen mode?
Comment: @TZHX: I am playing in a browser but the game is downloaded that is I am not playing it through some website. So my question is that how can I change the size of the game? The game is made to stretch when there is a higher resolution than 720x576p. So if my resolution is 1920x1080 the game stretches itself but the game stretches itself in it's aspect ratio i.e. in a multiple of 720x576. So how can I change this behavior and let it stretch without aspect ratio. Also if I change my resolution to 720x576 the game runs good in fullscreen. I want to play it in 1920x1080 mode.
Comment: what game? are you playing in a browser? if a game doesn't offer a full-screen option itself, there's not much you can do (that would be in the scope of this site)
Comment: We can't answer how to edit a flash file. That would fall under http://gamedev.stackexchange.com/ . We could try to help you resize your windows on flash games that don't allow for resizeability, but if it requires coding or changing the flash file, generally any coding or game editing should go to the GameDev stack exchange.
Comment: Well the normal fix is to change the res of monitor to that of the game, then it opens up correctly. Also decompiling and all won't work as then I'll just have to make them and start editing all the pics and everything. Naw I'll just leave it as they are. And thanks aal you guys.
Answer: If you play in a browser, you culd use a bookmarklet or user script to full screen the game element.
Try pasting something like this in your address bar:
javascript: addEventListener('click', function(ev) {var el = ev.target, rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen; rfs.call(el);});

This should fullscreen a clicked element.
In some browsers (cough Chrome cough), you'll need to type the "javascript:" part yourself. Put it in a bookmark to circumvent that.
Comment: This works for some browser games, need to click on the element surrounding the flash game not the game itself.  Nice one, exactly what I needed so my small child will be able to play the game without accidentally scrolling, clicking something else, etc.  In Chrome at least, we can also zoom the game to make it larger in the normal way.
Comment: @SamWatkins Zooming in? OF COURSE! I didn't though in this simple approach. My baby wants to play too haha. She's 1 year old! Thanks for the tip!
Answer: You can't. Normally, a Flash object stretches to fill all space given to it in the <object> or <embed> container, stand alone Flash player window, or screen. If it doesn't, there's nothing you can do without access to the original .fla file.
Answer: If you are playing in Browser, use this script;
https://greasyfork.org/en/scripts/4870-maximize-video
Answer: Back when I played lots of Flash games, many implemented a protection in form of an exact window/frame size specification to prevent/discourage hotlinking for example.
Code like that for example would be a big problem for your plan.
I.e. the game would actually display a piracy warning if played at an incorrect resolution. Some would actually go as far as not doing anything besides displaying said warning.
Answer: You can't do so natively, but that doesn't stop you from decompiling it to get .fla files from which you can further modify.
Be aware most flash decompilers are complete dirt, so it takes quite a bit of effort to do anything useful. Even then, a given flash file is very unreadable and usually you'll end up having to build it back up from scratch using the various pieces.
All in all, it's pretty difficult to do and only somewhat legal.
Answer: I did this:

Right-click taskbar > Taskbar settings > Turn on the "Automatically hide" option;
Download WinExplorer: http://www.nirsoft.net/utils/winexp.html;
Launch the Flash game as you would normally;
Run the winexp.exe as Administrator;
Click on the Style tab; Uncheck all styles except WS_VISIBLE (WS_CLIPSIBLINGS seems to want to stay checked for me too);
Click on the Size & Position tab; In the General section, type in Left: 0, Top: 0, Width:(fill in your current screen width divided by any scaling applied - for example, for me it's 2160/1.5), Height:(fill in using current screen height divided by any scaling);
Click Modify button;
Close the WinExplorer;
Go back to the game window (Alt-Tab, etc.);

The game window should be full screen now. If you right-click desktop > Display settings, you can view your screen size and scaling.
Answer: Pressing F11 (Fn + F11 on some keyboards) will fullscreen the HTML element, therefore making the entire game fullscreen.
Answer: This worked for me, so please try this.
Right click on the shortcut of the flash game that you wish to play full screen and then click properties. Once the properties window is open, make sure the "shortcut" tab is selected and then look for the word "Run" and then click on the drop down menu beside it and change it from "Normal" to "Maximized". Then click apply and then ok.
After that, whenever you open that game, it should automatically open maximized. Just make sure though that you always open it using that shortcut. If there is no shortcut and just only the main .exe for that game, you will need to create a shortcut first, and then after you do that, just follow the same steps that I mentioned above.
I hope this helps. Good luck :)
Answer: There are games that allow you to open in full screen, there are games created by the developer that it doesn't respond so when you open the whole screen it doesn't grow.


How to get the release version of Apple's "The Swift Programming Language" iBook

Question: I have the prerelease version of Apple's "The Swift Programming Language" book. No matter what I try, Apple won't let me update it to the release version. Has anybody else encountered this problem, and better yet, solved it?
Comment: ...and what have you tried?
Comment: I've tried looking to see if an update is available. I've tried deleting my current copy of the book and re-downloading it.
Answer: This is the release version:
https://itunes.apple.com/us/book/swift-programming-language/id881256329?isInPurchasedView=true&mt=11
This is the prerelease version:
https://itunes.apple.com/us/book/swift-programming-language/id1002622538?isInPurchasedView=true&mt=11
Comment: This is really frustrating. When I click on your link to the release version it opens my release Swift 1.2 book. I just deleted that and am re-downloading it to see if that gives me the release Swift 2.0 version or not.
Comment: It appears that THAT gives me the release Swift 2.0 book.
Answer: Ok, I finally got the Swift 2.0 book.
If I clicked the link that @IronCraftMan posted, above, it would open my copy of the Swift 1.2 version. I had to delete the release version and then re-download it and then finally I see the new version. However, the cover art does not say anything about Swift 2, although the link from IronCraftMan shows a cover that says "Swift 2.0 edition."
What a confusing mess.


What exactly is this piece of assembly code doing?

Question: This assembly is for Intel x86-64 bit, seems to be too baffling to me.

How come the jz instruction jump to a non-instruction (0x400AC9)?
How come the call invokes a non-existing address?

For curious ones, the binary is here.
Answer:
How come the jz instruction jump to a non-instruction (0x400AC9)?

It does not. There is no such thing as "an instruction". Jumps do not jump to instructions, they jump to addresses.

How come the call invokes a non-existing address?

It does not. If you check what the code actually does, you will find this call will never be executed.

Here is the relevant part of your code, prefixed with their original hex bytes.
400AC7:  66 b8 eb 05             mov    ax,0x5eb
400ACB:  31 c0                   xor    eax,eax
400ACD:  74 fa                   jz     0x400AC9
400ACF:  e8 0f b6 45 b0          call   0xffffffffb045b61c
400AD4:  3c 38                   cmp    al,0x38
400AD6:  0f                      .byte 0xf
400AD7:  85                      .byte 0x85
400AD8:  bc                      .byte 0xbc

If you assume the instruction at 400AC7 executes, it loads ax with some value but it gets immediately discarded by the next instruction, which clears it to 0. Because of that, the jump will always be taken!
The jump goes to 400AC9, and if we disassemble starting at that, we get some other code:
400AC9:  eb 05                   jmp    0x400AD0
400ACB:  31 c0                   xor    eax,eax
400ACD:  74 fa                   je     0x0
400ACF:  e8 0f b6 45 b0          call   0xffffffffb045b61a
400AD4:  3c 38                   cmp    al,0x38
400AD6:  0f                      .byte 0xf

and it looks like you did not get any further, because there are still weird calls and undefined codes. However, look at the first instruction! It jumps again into the middle of something what appears to be an instruction at this point – but if you start disassembling there, you will see that everything from that address on is perfectly ordinary code.*
* Since this is a "crackme" and you already failed the first of its tests, I will not spoil the rest of it.
Answer: IDA disassembled the instructions incorrectly. You need to manually change the instruction after jz to data and then change the jz destination to code.
Comment: How will `jz` come out of the loop?
Comment: Change the mov instruction to data and change the data at location 400AC9 to code. That will disassemble into a jump instruction that will jump out of the loop.
Answer: You should patch the ptrace the program uses to check if it's being traced by a debugger and then use gdb or another debugger to see what's going on @runtime, if you insist on statically analyzing it you'll have to manually fix up the jump as yujyet said.


How do I configure sudo in 22.04 for AD group access?

Question: I have configured sudo access in previous versions of Ubuntu for AD groups.  In 22.04 I get error that user in AD group is not in sudoers file.  I inserted the line %gg_adm_server ALL=(ALL) ALL in sudoers file as usual and it doesn't work.  Has the configuration changed in 22.04?  I have joined the domain using REALMD and can log in as member of AD group, but not sudo.
Answer: Turns out the answer was to format the group in sudo as %firstname.lastname@example.com.  wouldn't work with lower case domain name, had to be upper case.   YMMV
Answer: This answer didn't work on my company domain.
(Note: For me all the groups were showing lowercase and the domain was upper case.)
(Note: Ensure after your COMPANYDOMAINNAME there is 2\ before the group name.)
(Note: If your group has spaces in the name it requires you a \ for each space.)
Also you can use the group (wbinfo -g) or user (wbinfo -u) to get the correct formatting from your domain.
For Root Access:
<code>%admin ALL=(ALL:ALL) ALL
%COMPANYDOMAINNAME\\domain\ admins ALL=(ALL:ALL) ALL
</code>
For Sudo Access:
<code>%sudo ALL=(ALL:ALL) ALL
%COMPANYDOMAINNAME\\domain\ admins ALL=(ALL:ALL) ALL
%COMPANYDOMAINNAME\\workstationadmins ALL=(ALL:ALL) ALL
</code>


The Large Hadron Collider and Black Holes

Question: Last week, I went to Switzerland and visited the LHC. I took a tour, and the guide told us that it is possible for black holes to appear in the LHC, but they will be so small, that they would evaporate away due to Hawking Radiation and there would be virtually no time for the black hole to "suck up" anything. I suddenly remembered something I read on this post that said a "a 100 tonne black hole would evaporate in 8.4×10−2 s, emitting approximately E=Mc2=9×1021 joules of energy as it does so – equivalent to more than a million megatons of TNT. I guess you could call this an explosion!"
If Mount Everest was condensed into a black hole, it would be smaller than a hydrogen atom. Mount Everest is 357 trillion pounds. 357 trillion pounds converted into energy would be a mind-boggling amount.
If a black hole formed in the LHC, wouldn't it completely annihilate it due to the spontaneous energy release due to Hawking Radiation? I'm new to the topic of Hawking Radiation, so I do not know if I have been misinformed in any way.
Comment: More on [black holes at LHC](https://physics.stackexchange.com/questions/tagged/black-holes+large-hadron-collider).
Answer:
If a black hole formed in the LHC, wouldn't it completely annihilate it due to the spontaneous energy release due to Hawking Radiation?

The  energy that the LHC reaches is 14 Tev: $1$ TeV is $1.6e^{-7}$ joule so there is no "million megatones" .
Even if they were created following some extra dimensional theories, they would have no time to accumulate and eat up matter around the detector and grow , as they evaporate very fast with Hawking radiation, which goes inversely proportional to mass.

Do we need to worry? Might these mini black holes start growing and, eventually, devour the whole earth? We should not worry about this. Even if you do not trust the calculations predicting a quick demise for such minuscule black holes, there is solid data to go by.
If black holes really form in high-energy particle collisions, they are also continuously created in the earth's atmosphere by the collision of Ultra High-Energy Cosmic Rays (UHECRs) with nuclei of oxygen, carbon, nitrogen and other elements present in the atmosphere.

.........

The collision energies for UHECRs can be enormous - some observations show energies of hundreds of TeV (hundreds of trillions of electron volts), which is much larger than the collision energies in particle collider experiments. And while the events with very high energy are exceedingly rare, this type of collision has been going on for literally billions of years, so an inordinate number of mini black holes would have formed. Since the earth has not (yet!) disappeared into one of these black holes, the much less massive man-made mini black holes should be quite safe.

For calculational details one can try this link.
Answer: I am not sure why there is this mania over black holes with the LHC. You can be certain there is no problem with this. In a given year a square kilometer receives a cosmic ray with energy up to $10^7\ \mathrm{TeV}$ or a million times the energy the LHC can muster. There has so far been no catastrophic event such as the occurrence of a black hole.
The concerns came in part from a thread in theoretical physics with extra-large dimensions. The thinking was that in some dimensions beyond spacetime the scale may be much larger and thus at far lower energy. The idea emerged that maybe black holes could be formed at energy much lower than the Planck scale.
The Planck scale is a length where the de Broglie wavelength of a black hole equals half its perimeter length determined by the Schwarzschild radius. Then
$$\lambda=\frac{2\pi\hbar}{Mc}$$
$$=\pi r_\mathrm s=\frac{2\pi GM}{c^2}.$$
Solving for the mass gives $M=\sqrt{\hbar c/G}\sim~2\times 10^{-8}\ \mathrm{kg}$. This mass is sort of the quantum unit of a quantum black hole. If such a black hole is generated by the collision of two particles it quickly ($\sim10^{-42}\ \mathrm s$) scatters into other particles and radiation. This would occur at energy $10^{15}$ times the LHC energy. This is also associated with the Planck length that can be found as the Schwarzschild radius and this is $1.6\times 10^{-35}\ \mathrm m$. However, the idea of large extra dimensions means this length, a scale near where Calabi-Yau manifold compactify, are much larger. So then a quantum black hole might then exist with a far smaller mass, and when it quantum evaporates by Hawking radiation it will then release far less energy.
The idea of large extra dimensions appears not to work, and some work with gravitational radiation indicates no expected loss of gravitational waves by leaking into these extra dimensions. The tour guide is right in that even if such a black hole were generated it would decay rapidly. Also if LHC were to generate a black hole it would have as much or less energy than the $13\ \mathrm{TeV}$ per nucleon of energy input to generate it.
There are analogues of black holes in QCD, where a gluon plasma has some black hole features. The work with heavy ions and the ALICE (A Large Ion Collider Experiment) detector, following up from RHIC have found some black hole characteristics which lends weight to gauge/gravity duality. These so called black holes can't suck anything up and are not really black holes.
Comment: *I am not sure why there is this mania over black holes with the LHC. You can be certain there is no problem with this. In a given year a square kilometer receives a cosmic ray with energy up to 107TeV or a million times the energy the LHC can muster. There has so far been no catastrophic event such as the occurrence of a black hole.* This isn't a valid argument against the possibility of black hole production at TeV energies. They would have been traveling at close to $c$, so they would have flown through the earth without having time to accrete matter.


real-valued functions on the modular surface

Question: How does one write down $\mathbb{R}$-valued functions on the modular surface?  I am considering taking an arbitrary function on the upper half plane $f:\mathbb{H} \to \mathbb{R}$ and averaging over the elements of $SL(2, \mathbb{Z})$.  So,
$$ f_1(z) = \sum_{g \in SL(2, \mathrm{Z})} f(gz) $$
there may have to be a decay condition on $f$ so the function will converge.  I am not necessarily looking for holomorphic functions, just smooth and well defined on $\mathbb{H}\backslash SL(2, \mathbb{Z})$.
Comment: I must be missing something: what counts as "writing down a function"? There are going to be a plethora of non-zero smooth functions on this surface, so what other properties or identities are you looking for?
Comment: Take any smooth function of the j-invariant?
Comment: In the absence of an application or additional context, it is hard to tell if you would prefer a universal answer as given by Yemon and Qiaochu, or something more structured.
Comment: It could be the word I am looking for is "modular function".  Does the j-invvariant have a Fourier series?  What are the critical values?
Answer: You may have an easier time starting with a function that is periodic under translation by 1, then summing over cosets of translation in $SL_2(\mathbb{Z})$.  If your initial function is well-behaved, your sum will converge (although often one introduces correction terms to get sections of a line bundle, i.e., modular forms of nonzero weight). This is a common method for constructing Poincaré series, Real-analytic Eisenstein series (where $f$ is given by a power of the imaginary part), and Rademacher sums (where $f$ is exponential).
Comment:
To supplement Scott, see Gunning's Lectures on Modular Forms, Chapter 3. This "sum over cosets" technique is discussed there.  http://books.google.com/books?id=UBwjJAiMZtcC&lpg=PP1&dq=gunning%20lectures%20modular%20forms&pg=PA28#v=onepage&q&f=false


How can I check if a transaction is mined into the blockchain?

Question: How can I check if a transaction is mined into the blockchain ?
How much time does it take for this if the transaction is less then 1000$ ?
Answer: You can paste the txid in a block explorer, or just look at the history in the gui to see if it has started confirming.
In cli I think show_transfer <txid> should do.
No matter the amount, if the network is not overloaded, your transaction should be mined within an average 3 minutes (1 minute average for current block to be mined and then the 2 minutes blocktime for the block including your transaction to be mined).
Answer: The print_tx monerod command finds a transaction by its txid:

  print_tx TXIDHERE

The output will tell you whether that transaction was found, and if it was, whether it is mined or still in the txpool. If it was mined, you'll see when it was mined.
Assuming the transaction is valid, the time it takes to be mined depends on its fee, and how much backlog there is in the txpool. Transactions are included starting with the one that has the highest fee per byte. Typically, multi-block backlogs are rare. Blocks are mined every 2 minutes on average, but variance can be substantial for small number of blocks.
The value of the ouputs has no relevance.
Answer: Enter the the transaction hash ("Tx hash") into the search field in https://xmrchain.net/ and check the "Block:" info on the resulting page. If it says "N/A" it's not mined yet. If there is a number there, it indicates which block the transaction has been mined into. In "No of confirmations:" you will see how old (in blocks) that block is.
Depending on the client you use, this info is usually displayed along with other details about your transaction.
Transaction mining time is irrespective of the $-amount. In general, as el00ruobuob answered, you can expect to wait for about 3 minutes. But it can also take 2 hours depending on transaction backlog.
Answer: All the above answers are correct but it's worth some clarification.
In the wallet, show_transfer txid will show details about the transaction including how long before the funds become unlocked.
In the daemon, print_tx txid will show whether it's found in a block and optionally (with the +hex or +json) the raw transaction itself.
I would prefer show_transfer simply because it shows how many more blocks need mining before it's deemed complete (unlocked). Otherwise the transaction could appear in an alternative chain and so still need mining into the main chain.


Indeterminate Forms Misunderstood

Question: Hello everyone my question may be stupid but I really don't understand why $$0 \times +\infty$$ is undefined since o times any number is zero no matter how large the number may be
Comment: $\infty$ is not a number. Consider the following limits as $x \to 0$: $\lim x . \frac{1}{x}$, $\lim x . \frac{1}{x^2}$, $\lim x^2 . \frac{1}{x}$. They are all of the form $0 \times \infty$ but all of them have different answers.
Comment: Does [this](https://math.stackexchange.com/questions/28940/why-is-infinity-multiplied-by-zero-not-an-easy-zero-answer) answer your question?
Comment: Yeah it makes sense thanks very much projectile motion
Comment: @arsenestein There was a post long ago (probably the one projectilemotion linked), so I wrote below some of the facts I thought and learned through that question (and my personal knowledge). Take a look at it, it may help you ! Although, in the future try not to post duplicate question (try searching your question).
Comment: Note that the other question does not say a word about *indeterminate forms* so this *is* a different question.
Comment: @MikhailKatz But this question only mentions indeterminate forms in the title, not in the body. So I agree with the duplicate. BTW some of the answers mention indeterminate forms.
Answer: The fact is, $+ \infty$ is not a number. The laws of multiplication hold for a number $x\in \mathbb C \supseteq \mathbb R \supseteq \mathbb Q  \supseteq \mathbb Z \supseteq \mathbb  N$, but infinity is not a natural number. If you start searching around your argument, you could observe that, for example :
$$\infty \times 0 = \lim_{x \to \infty} (x \times 1/x) = 1$$
$$\infty \times 0 = 0$$
But the above, are not statements that hold for infinity, because, as mentioned, it cannot be treated as a real/natural number.
Infinity must be defined, before working with and on it, but the problem is that there are many different ways to define it, exactly because it's not a normal number case.
For example, a different and classic case is that you could define infinity by $1/\infty = 0$ but in the same time, infinity can be defined while talking about infinite sets (cardinal numbers).
As it becomes clearer, you see that infinity is rather hard to define strictly and thus really hard to handle in such strict ways, as the multiplication law.
So, to sum up, any multiplication or summation law that holds for the natural numbers does not have any meaning for infinity and thus cannot be used to derive expressions and calculations, such as : $0 \times \infty = 0 $.
Also, take in account that an operation for a natural number $n$ such the one you mentioned, is :
$$n \times 0 = 0 + 0 + 0 +\cdots+ 0 = 0$$
which is clear that is a finite operation and not an operation regarding something infinite.
Comment: "The laws of multiplication hold for *natural numbers*" —Actually the law not only holds for natural numbers, but also for integers, rational numbers, real numbers and complex numbers. All of which of course don't contain $\infty$. Just replace "natural numbers" with "numbers" and your answer is perfect. (If you are worried of the formulation because of ordinal numbers and cardinal numbers: Both contain infinite numbers, but neither contains a number $\infty$. And in both, multiplying an infinite number with zero gives, indeed, zero, so the laws of multiplication hold there as well).
Comment: @celtschk Yeah, was a bit worried about cardinal and ordinal numbers to be honest. But I'll just change it to a set-style phrase.
Answer: The easiest way of understanding this particular indeterminate form is as saying that an infinitesimal times an infinite number could have any desired order of magnitude: infinitesimal, appreciable, or infinite.  Such a situation is summarized by the symbol $0\times\infty$ but in point of fact you are not actually multiplying zero by an infinite number but rather an infinitesimal by an infinite number.
For example, if $\epsilon>0$ is infinitesimal, then $H=\frac{1}{\epsilon}$ is infinite.  Then the products $\epsilon^2\times H$,  $\quad \epsilon\times H$, and $\epsilon\times H^2$ are respectively infinitesimal, appreciable, and infinite.
See this textbook for details.

Indeterminate Forms Misunderstood


Balancing Rise and fall times at input and output in CMOS Design

Question: How do I make sure that my rise and fall times are balanced between input and output in a CMOS design?
Comment: Simulation of your design in whatever process node you're using.
Answer: Scale your pull-up PMOS circuitry to have the same conductance as the pull-down NMOS circuitry. For an inverter, this means scaling the PMOS to be 2-3× wider than the NMOS, because holes are 2-3× less mobile than electrons.


Innovative uses for a large donation for my department

Question: Thanks to a large donation by a generous donor, my department has an "institute" that they use to host seminar speakers, subsidize student travel, support postdocs, and host social engagements.  I have been asked to administer this institute for the next two years, and have to give a presentation on my plans for it at an upcoming meeting.  My problem is that I do not have any additional creative ideas to use this donation beyond the uses I just listed.  Has anyone had past experiences for creative/innovative ways to use donations of this sort?
Comment: @Roland it's about $100K per year...I guess that seems large to me :)
Comment: Do they want you to do *more* or *different* things?
Comment: Have you tried soliciting input from your faculty?
Comment: What does "large donation" mean? Can we get the order of magnitude? Recommendations would be different, e.g., for 100k $ than for 10M $. Has the donor expressed any wishes regarding how the money is used?
Comment: The field of research would also be relevant. Different disciplines have different funding requirements.
Answer: I might add more ideas later if they come to mind, but here's a few off the top of my head; you may find them interesting depending on whether something already exists at your institute/department.

Nursing room: At the (academic) research institute that I work at, we've been working on establishing and maintaining a nursing room for members of the institute. Some space with privacy, comfortable seating, a sink (for cleaning) etc. (Your university might have guidelines for how to setup a nursing room.)
Conference room with good hybrid meeting equipment: Given that so many talks (including Ph.D. defenses) are hybrid lately, it might be worth it to upgrade an existing conference room with good audiovisual equipment. Good audio speakers, microphones that allow for remote audiences to hear questions asked by in-person audiences etc.
Awards for students: Depending on how much money is available and depending on existing institute/departmental awards, you could consider setting up awards for students for excellence in research and/or service.
Physical spaces for students: Since in most departments/institutes graduate students don't have individual offices and undergrads have no offices at all, it could be nice to setup lounge areas/rooms for students to convene at. If such spaces already exist, I'm sure they wouldn't mind a new couch if you're able to fund it!
Answer: There are certain things that professors and departments are not particularly good at, but that can be addressed with money if you're willing to hire someone -- and depending on how generous the donation really is.
Specifically, what often does not work well at all in academia is strategic planning. (That's because the reward structure for professors does not provide much support for long-range planning in both their own careers and, in particular, in support of the department's mission. And departments these days largely no longer have anyone else who has the stature to address strategic things.) So things such as "Where do we want to go with the department?" and "How do we reform the Calculus sequence?" or "How do we help faculty bring modern teaching methods into their classrooms?" are the kinds of questions that just never really get addressed.
As a consequence, if your Institute also has a teaching mission, then you might want to consider hiring someone with, say, a PhD and who sits between the disciplinary aspects and the educational aspects to take a holistic look at the course offerings, course designs, and other aspects of those courses that fall within the Institute's area. If they are also teaching these kinds of courses, the Department will likely be willing to co-fund their teaching duties whereas the Institute will fund the planning and design aspects of their work.
In the research realm, one could hire a coordinator to build inter-displinary and inter-departmental connections, support collaborative grant writing, outreach to industry partners who may be interested in the research produced by the Institute, etc. There too, the "long range planning" aspect is something one could ask that person to do, and if they do not have teaching responsibilities and only a small research expectation, they may have the time and energy to do the planning that faculty often don't.


high pass circuit as differentiator

Question: A high pass circuit is a differentiator when used under the condition that input frequency of signal is much less than \$1/RC\$. But that region corresponds to stop band of the filter, so how do we get a differentiated wave at output?
Comment: Note that stop band just refers to some frequency below which the signal is attenuated by at least a certain number of decibels. It doesn't refer to a "brick wall".  What happens to the \$\omega\$ when you differentiate \$\sin(\omega t)\$? It goes out to the front: \$\omega\cos(\omega t)\$. I.e. low frequencies (small \$\omega\$) have small-amplitude derivatives. This is connected to high pass filtering.
Comment: What have you looked at so far? What information have you found that backs up the 1/RC condition. Have you looked at op-amp differentiators? Do you understand their limitations?
Answer: I believe I've answered this elsewhere but, regardless, here is the way to look at this.  The transfer function for the RC HPF is:
\$\dfrac{j \omega RC}{1 + j \omega RC} \$
The "trick" is to look at the behaviour at low enough frequency such that \$ j \omega RC << 1\$.  When this holds, the denominator is effectively just \$1\$ and the transfer function is effectively:
\$ j \omega RC\$
But, this is the transfer function for a differentiator with gain equal to \$RC\$.  That's really all there is to it.  For frequencies well below the corner frequency, the output is effectively proportional to frequency just as we would expect from a differentiator.
You're probably misunderstanding "stop band" in this context.  A 1st order high pass filter has a gentle roll-off that is just about 20dB / decade.  Signals aren't "stopped" below the corner frequency, they're increasingly attenuated.
Comment: So,can we say that for a signal whose frequency is above the corner frequency output will be proportional to the input.But for the similar signal whose frequency is much below corner frequency ,we get the differentiated output.
Comment: @Abhishek, that sounds correct to me.
Answer: If the transfer function of a high-pass system is:
$$\frac{Y\left ( s \right )}{X\left ( s \right )}= \frac{s}{s + a}$$
Then,
$$\frac{Y\left ( s \right )}{sX\left ( s \right )}= \frac{1}{s + a}$$
The latter shows the transform of the output, Y, over \$ sX \left ( x \right ) \$, or the transform of the derivative of X.  You'll notice that the right side of the equation now shows a low-pass filter!  Thus, y will be a low-pass filtered version of the derivative of x.

high pass circuit as differentiator


How does one apportion returns to multiple investors when their times and amounts of investment were different?

Question: No accounting experience here.
The problem:
Man A invests $10 on day 1.
Man B invests $5 on day 4.
Man C invests $85 on day 5.
On day 7, the $100 returns 10%. How do you fairly distribute it?
Answer: This sounds like an investment club.  Assuming the securities being purchased can be easily valued at each point of purchase (e.g. if they are public securities being purchased), then you can use a unit valuation system.  See Wikipedia - Unit Valuation System: "UVS is a time weighted performance metric".
Then calculating the rates of return for A, B, and C would be based on their respective unit holdings and purchases.  You could use IRR on each set.
Answer: It depends on the arrangements made at the time of each investment.  Who set it up and what provisions did they make?  In a short timeframe like your example, the arrangements may be simple, like 1 share of ownership for each $5.  Then, on day 7 there are 20 shares, so that man A gets 2/20ths of the distribution, B 1/20th, and C 17/20ths.
If the timeframe were years, then different arrangements would probably be made because the value gained by the $10 over the first 3 years might be significant.  The obvious way to account for this is that the cost of a share would be different for B than A.  If A got 2 shares by putting in $10, but the worth of the investment in year 4 is $20, then B maybe would get only 0.5 shares.  Later, say C gets 6.5 shares for his $85.  Then there are a total of 9 shares, and distributions would be 2/9ths for A, 0.5/9th for B, and 6.5/9ths for C.