How does the anti-bonding eg orbital (eg*) affect the bonding of ligands?

Question: In the molecular orbital for octahedral metal-ligand complexes, there is an eg orbital and an eg* orbital. When the d orbitals on the metal split, it will fill up some of the eg* orbitals I believe. However, my question is that won't these orbitals cancel out with the eg orbitals and make fewer bonds? For example, $\ce{Ni^{2+}}$is a $\ce{d^8}$ metal and will split in the presence of ligands and will partially fill the eg* orbitals. The $\ce{Ni^{2+}}$ metal can then form complexes like $\ce{[Ni(H_2O)_6]^{2+}}$ with 6 ligands attached. My question is how would the filling of the eg* orbitals affect the bonding and chemical properties of the compound? Here is the diagram I am referencing to:
Comment: It might be more clear if you indicate that the t and e levels represent 3 and 2 orbitals, respectively, even though there is only one line. Thus a d8 metal has the e* level only half-filled.
Comment: Short answer: slightly reduced bond order. As for effect on chemical properties, what is your reference point for comparison?
Answer: As you would expect from increasing occupancy of antibonding orbitals, the result is weaker metal-ligand bonding. This is one reason why the octahedral geometry is not as strongly favored for metals with greater numbers of d electrons. For a d8 metal such as the Ni(II) in the example, square planar and octahedral complexes are both common, and planar structures tend to be favored if the ligand is strong enough to result in a low-spin planar complex (as is often the case with Ni(II)). Only a weak field ligand like H2O will tend to form octahedral complexes with Ni(II).
A semi-quantitative approach to this issue is found in "structure energy" approximations and determination of "structure preference energy". Although that approach is not rigorously quantitative, it will show you trends.
It is important to note, though, that even with full occupancy of the eg antibonding orbitals (for example in a d10 metal like Zn(II)), octahedral complexes are possible. One can think of the sigma bonding in that case as being essentially entirely via the s and p metal orbitals, similar to a p-block central atom such as S in SF6.


Data vs Metadata

Question: I am having a discussion with a colleague to define the metadata for data management protocol. The problem is that I cannot define the difference between data and metadata. For example, if I take the measurement of the size of a seagrass plant in a location, in that location I would also take the water depth. So, is water depth a metadatum or a datum? And why?
Comment: Why can't you define it how you want? What does your colleague think? Why is it important to distinguish - what are you going to do differently about data vs metadata that makes the difference relevant?
Comment: Wikipedia actually has quite a useful article about this: https://en.wikipedia.org/wiki/Metadata
Answer: No, the water depth measurements are data.
Metadata is data about the data. That would include things like the units of the numbers (e.g. cm for length), the equipment you used, the date and time of day when you took the measurements.
The location where you measured the sea grass might be metadata or data - depending on whether you want to compare results from different locations or just document the data from this spot.
https://en.wikipedia.org/wiki/Metadata
Comment: So what is a data (or metadata) is dependent on the research? Specifically, it is the measurement that would be investigated in the research. In my case, the seagrass length. However, what it would be for me a metadata to describe the location of the data (depth), it can be a data for someone looking at the bathymetry of the area.
Comment: @Teuz Yes, sometimes. Metadata for a photograph might include the kind of camera. But if you were doing research on how cameras perform that would be data.
Comment: @Teuz Very hands-on approach: assume you have all the data but all the metadata was lost. Does your experiment still make sense? Also, sometimes the difference is totally contextual: for an instance, I have images taken by a digital camera and what is called metadata by convention (exposure, location, ISO...) is crucial to my experiment. It is thus all data to me but it's easier to still call it image metadata so others understand what I'm talking about. It really only may make an impact on how you store the experiment data, the rest is semantics - just make sure everyone's on the same page.
Answer: Metadata depends on the context, or the kind of research being done.
As the term suggests, it lies outside the primary data of a study. It consists of data, but of a different sort or type. From the American Heritage Dictionary: "Data that describes other data, as in describing the origin, structure, or characteristics of computer files, webpages, databases, or other digital resources."
For a clinical trial, metadata would include the trial design, including background, definitions of terms, measurement methods, schedule of data collection, analysis, outcomes, etc. as well as some results such as participation rates, dropout rates, etc. This includes anything that others might need to understand the implications of the results.
For a survey, metadata includes the sample and interview design, data linkages, background, definitions of terms, measurement methods, schedule of data collection, analysis, etc, as well as some results, eg, contact rates, refusal rates, etc. Anything that others need to understand the implications.
Think about giving your data to someone else to use for further analysis. You want them to have information that keeps them on track regarding effective analysis. If you don't give them something critical, eg, "80% of the subjects came from one medical center and the rest were spread across 27 centers." This is very different than "the percent of subjects from 28 centers ranged from 3% to 6%." The analyses they do should be different in each case. In short, any documentation you hand them with the data itself is metadata.
Some items of metadata are recorded as data, eg, withdrawal "time" relative to the data collected and missing. It might not be just a time observation. These items can indicate the quality of the execution of a study and might influence the analysis, but they are not directly related to the goals of a study.
Metadata includes a lot of stuff that isn't data and can include stuff that is collected and recorded as data. The latter might be part of your confusion. There is no simple conceptual test as to whether specific information about respondents is data or metadata but it probably doesn't matter a lot if you call some items both data and metadata.
Metadata is not made up to fit a study. It is accurate information about the design and execution of a study.
Answer: I don't think there's a general answer to this question (hence the lack of any consensus over the past month). Metadata by definition is "data about the data", but what that means is probably more of a field-dependent convention rather than any deep truth that can be derived from first principles.
Two examples:

In the experiments at CERN (at least, the ones I worked on), we didn't really have any concept of "metadata." Everything the machine recorded was data, even timestamps and "environmental" conditions. We had simulated data, and results, but we certainly never considered these "metadata."
When it comes to image processing, pretty much only the images are considered "data." Maybe the labels as well, though I would normally call the  labels "labels" rather than trying to group them under data or metadata.  Anything else (e.g., the time, location, type of camera, camera settings) would be considered "metadata."

In your case, I think you will have to define what you mean by metadata and then answer your question from there. For example, if you are using an underwater gizmo, you could define "data" to be "records from the gizmo" and everything else to be metadata. Or, you could define metadata to be "the gizmo's operating parameters", and everything else is data. Any reasonable choice should be fine so long as you state it clearly and are consistent.
Answer: No, the water depth would also be data and you can look for correlations, for example, between the size and the depth.
But all descriptive statistics are metadata: mean, mode, quartiles, standard deviations, and all the rest. They are data that summarize the basic data. Correlations between size and depth would also be metadata. If you take a lot of samples, then you get the potential for a lot of metadata and it can be analyzed as well. Understanding this is fundamental to the understanding of making predictions with statistics; statistical inference.
You can, of course, make up additional metadata to fit your study if needed.

But in general, metadata is just data that is "about" other more fundamental data or depends in some way on that data. It isn't independent data.
Comment: Statistical results themselves are nut usually regarded as metadata.
Comment: @DavidSmith, perhaps just a semantic distinction. It is what they _are_, not how they are "regarded". In fact, your own answer says exactly this: "describing the origin, structure, or characteristics...". Descriptive statistics describe the structure and characteristics of some set of data. Please be consistent, at least.

Data vs Metadata


Does the H-1B visa program have the effect of reducing wages in the U.S

Question: In either the short or long term, does the H-1B visa program have the effect of reducing wages in the U.S. for U.S. citizens?
Answer: The program would increase the supply of labor to those specific sectors. As a result more foreign people would get into the sectors bidding the price down (lowering the wage). In addition, some Americans would not be able to get hired, that otherwise would have.
In addition, companies would become more profitable so more companies would be started and the reduced labor costs would be visible in other sectors, increasing labor demand elsewhere.
In the very long run free movement of labor is at least in theory more efficient than restricted movement, as people will more efficiently be able to navigate to the most efficient job locations available.
Answer: This is from Wikipedia. The US H1B visa is a non-immigrant visa that allows US companies to employ foreign workers in specialty occupations that require theoretical or technical expertise in specialized fields such as in architecture, engineering, mathematics, science, and medicine.
Assuming the hiring process is competitive, the wages must as well be competitive. But data may say the opposite in a well rounded econometric model.
Comment: The question is the effect on U.S. citizen wages.  So would the competitive  wage be higher in a world without a H-1B program?  I don't understand how your answer addresses that.  If the question was unclear I would appreciate suggestions about how to make it clearer.
Comment: If hiring process is competitive and this type of visa is issued for the persons with the above qualifications and specialisations, I doubt the the program will have any effect on US citizen's wages. If anything, the wages may increase instead as demand for highly skilled employees has always been trending upwards.


Use git as a means to sync/backup two macs

Question: Here's my idea (which I'm currently testing as we speak):
I just got a new macbook pro to use on the road, but I now have the problem of keeping it in sync with my main iMac easily. I'm very familiar with git and just see it as much easier to use and manage than other utilities such as rsync because I can really see what the changes I've made are. I know git was not aimed and syncing these types of files but my idea was to init a git repo on the root directory of both computers, then create a bare directory on an network drive to act like my local github. I could then push and pull to this remote directory from both computers and maybe even setup tunneling so that I wouldn't have to be on the local network to sync. Besides Git not being aimed at this type of work are there any other problems with this that can be foreseen? The initial commit and push will probably take forever but I feel that generally after that the time won't be too bad since git has such a good track of what files change. Just to put it in perspective, I initialized the git repos on both machines and ran a git add -A about 5 minutes ago and its still running.
Just wondering what other people's ideas about this are and if its ever been tried before.
Thanks,
Bryan
Comment: Why oh why would you include the *entire operating system*? Why not just [version control your home directory](http://tensixtyone.com/perma/the-version-controlled-home-directory)?
Answer: Look into RSync unles you need version control.
http://en.wikipedia.org/wiki/Rsync
Comment: Rsync only copies modifications one way. The OP probably wants changes on the iMac to be copied to the MBP, and vice versa.
Answer: If you can wait just a little bit, here's the perfect thing for you: http://www.kickstarter.com/projects/joeyh/git-annex-assistant-like-dropbox-but-with-your-own
Comment: looks great, but still under development.
Answer: Files in your macbook and iMac are not same. lots of system files are different and may use the same file path. you'll end up ignoring a great many of system files, temporary files, hardware dependent files. and you are dealing mostly with binary files, which can't be diff'ed as text files. so all versions are stored in the git repo, not the delta. your git repo will grow super fast in size.
my recommendation is get yourself familiar with rsync, write the sync script, and perhaps set up a cron job for that. then you can basically forget about it and make small changes to parameters over time.
Answer: Why not just use something like DropBox?


Latent Dirichlet Allocation (LDA) implementation

Question: does someone know if there exists some implementation of LDA algorithm (no matter if library or application) for Win32 platform? Maybe in C/C++ or other language that can be compiled?
Answer: Well, honestly I just googled LDA because I was curious of what it was, and the second hit was a C implementation of LDA. It compiles fine with gcc, though some warnings show up. I don't know if it's pure ANSI C or not, but considering that there is gcc for windows available, this shouldn't be a problem. If you have trouble compiling, ask a specific question about that.
Answer: gensim has a very good Python implementation.
Answer: A couple of examples:
Gibbs LDA++ library on Sourceforge
plda for a parallel implementation
As Tamás has offered, please specify the issues that you are having finding a library so that we can help you.
Answer: The original implementation of LDA was written by David Blei and the source code (C) is still available at his website: http://www.cs.princeton.edu/~blei/topicmodeling.html as lda-c. The other implementations are for algorithms based upon LDA.
Answer: We use DCA, written in C, scales well, has hyperparamenter optimization.
You could also consider Mallet, written in Java, widely used.


dropzone.js + paperclip uploading each image as its own post

Question: I am facing a strange issue.
I have Post has_many attachments. as: :imageable
and
 Attachment belongs_to imageable, polymorphic: true
I am trying to upload multiple images attached to a single post using dropzone.js
However, whenever I upload multiple files in the dropzone-powered form, each image gets uploaded as its own post. I upload 4 images, I get 4 posts with each of the attached image.
How can I get all of the images I attach to a post to be associated with that post only?
Here is what the posts.js looks like:
 $(document).ready(function(){
  // disable auto discover
  Dropzone.autoDiscover = false;

 // grap our upload form by its id
 $("#new_post").dropzone({

 // restrict image size to a maximum 1MB
 maxFilesize: 1,

 // changed the passed param to one accepted by
 // our rails app

 paramName: "post[attachments_attributes][][picture]",
 // show remove links on each image upload
 addRemoveLinks: true
  });
});

Create action from the PostsController
def create
@post = Post.create(post_params)

if @post.save
  render json: { message: "success" }, :status => 200
else
  #  you need to send an error header, otherwise Dropzone
      #  will not interpret the response as an error:
  render json: { error: @post.errors.full_messages.join(',')}, :status => 400
end

end

Relevant section of the _form.html.erb for the new Post action:
<%= form_for(@post, html: {class:"dropzone"}) do |f| %>
....

<%= f.label :attachments %>
 <%= f.fields_for :attachments  do |at| %>
   <%= at.file_field :picture %>
 <% end %>

....
<% end %>

The param name is post[attachment_attributes][0][picture] as it appears in the form HTML.
I suspect that this is the cause for the issue, but how do I change it so that the request uploads all the images attached to one post?
Thanks in advance!
Comment: Looking at the dev log, I realized that each file dragged into dropzone file field submits a new request and saves it to the database as a post without title and body (because I had validations turned off) I have to make changes to dropzone.js to combine all requests into one.
Answer: Dropzone Issue It looks like this is an issue that is untested but you can use the development branch of Dropzone to access it. This link has the details.


ModuleNotFoundError: No module named 'fastai.vision'

Question: I am trying to use ImageDataBunch from fastai, and it worked fine, but recently when I ran my code, it showed this error ModuleNotFoundError: No module named 'fastai.vision'
Then, I upgraded my fastai version pip install fastai --upgrade. This error got cleared but landed in NameError: name 'ImageDataBunch' is not defined
Here's my code:
import warnings
import numpy as np
from fastai.vision import *
warnings.filterwarnings("ignore", category=UserWarning, module="torch.nn.functional")
np.random.seed(42)
data = ImageDataBunch.from_folder(path, train='.', valid_pct=0.2,
                                  ds_tfms=get_transforms(), size=224, num_workers=4, no_check=True).normalize(imagenet_stats)

How can I fix this?
Answer: I actually ran into this same issue when I started using Colab, but haven't been able to reproduce it. Here was the thread describing what I and another developer did to troubleshoot: https://forums.fast.ai/t/no-module-named-fastai-data-in-google-colab/78164/4
I would recommend trying to factory reset your runtime ( "Runtime" -> "Factory Reset Runtime")
Then you can check which version of fastai you have (you have to restart the runtime to use the new version if you've already imported it)
import fastai
fastai.__version__

I'm able to run fastai.vision import * on fastai version 1.0.61 and 2.0.13
Comment: Thanks, but my question is about ImageDataBunch and after trying your's solution I got fastai version to be ```2.0.13``` but still I am facing ImageDataBunch error? Does fastai upgraded version supports it or not,  how to fix that?
Comment: Factory Reset Runtime as you recommended did fix it for me. Thanks!
Answer: In Google Colab:
Upgrade fastai on colab:
! [ -e /content ] && pip install -Uqq fastai

Import necessary libraries:
from fastai.vision.all import *
from fastai.text.all import *
from fastai.collab import *
from fastai.tabular.all import *

Get the images and annotations:
path = untar_data(URLs.PETS)
path_anno = path/'annotations'
path_img = path/'images'
print( path_img.ls() )             # print all images
fnames = get_image_files(path_img) # -->> 7390 images
print(fnames[:5])                  # print first 5 images

Answer: The solution that worked for me is to copy to (connect) my google drive & then run the cells. Source
Answer: You might have installed the older version of fastai. You need to upgrade to fastaiv2. You can upgrade fastai by using pip as shown below.
!pip install fastai --upgrade

Also check your fastai version using
import fastai
print(fastai.__version__)


Amorphous Process using Savant Core Demonic Forms

Question: The Savant Core Technology (FoH p.125) states that the skill must be chosen when this Technology is chosen.  What if you use Amorphous? (FoH p.127)  Can it change each time since it's added ad-hoc?  What if you choose it later as a permanent part of your demonic form?  Can you chose a different skill?
Answer: The Amorphous Process allows you to switch out one Technology for another.  The Savant Core Technology gives you access to a skill at the five-dot level.  The question is whether or not you view swapping Savant Core in a different skill is swapping a Technology to a different Technology.
If the StoryTeller would permit a player character to choose Savant Core twice for two different skills, there's no reason not to allow a player to switch skills as a change of Technology.
This isn't overpowered because the player is expending their choice of Process on this ability, and Processes are very powerful Form abilities. A Process should be very powerful.  In addition, switching skills would take Aether, and (oddly) if the player switches from skill A to skill B, to switch to skill C they have to return to skill A first, expending more Aether.
Comment: Once you have the *Amorphous* Process you can, in principle, have access to an infinite number of five dot skills, but only one at a time.   You might even have more than one five dot skill at a time, but at the cost of losing one of your Technologies.  This is the ability you have gained by choosing *Amorphous*, instead of some other (comparably beneficial) Process.
Comment: Taking what you said above, if I took Amorphous and switched out two Technologies, then I could have 2 skills at 5 dots and then reset them when I go back to Cover.  The next time, I could choose two different skills if I swapped them out.   What if I had Savant Core already?  If I "swap it out" for another Savant Core, then I can get a different skill at 5 dots?  I can see this being something like 4 different skills at 5 dots if you have both Technologies as Savant Core and "swap" them for two others.


Bulgarian residency

Question: I am an Egyptian currently in Bulgaria with a "cultural exchange" visa. I want to marry my Bulgarian girlfriend. I don't know where should I go or what will be the procedures? Should we marry here or in Egypt? And can I know the minimum age for marriage because I am 20 and going to be 21 in June? After the marriage, what will be the next step to get residence and how long does it take? I know that these may be many questions but related to one issue.
Answer: You should apply for a residence permit according to Article 24.18 of the Foreigners in the Republic in Bulgaria act.
The minimum age for a marriage is 16, but if one of you is under 18, you will need a permit from a Bulgarian court. You can also merry outside Bulgaria but then you will need to legalize it.

Bulgarian residency


Joule free expansion and differentials in irreversible processes

Question: I am studying thermodynamics (undergraduate level) and I am not sure I understand what happens in irreversible processes.
I thought I understood but then I got confused in the Joule free expansion (not Joule-Thomson). This is my thought process:
I know it's essentially an adiabatic expansion into vacuum. Adiabatic means $q = 0$ and free expansion - vacuum means external pressure $p_{ext} = 0$, therefore for pV work, $w = 0$. So, $ΔU = q + w = 0$.
From my lecture notes, I see that: $dU = 0 = C_V  dT_U + \left(\frac{\partial U}{\partial V} \right)_{T} dV_U$, therefore $\left(\frac{\partial U}{\partial V} \right)_{T} = -C_V \left(\frac{\partial T}{\partial V} \right)_{U}$, which makes sense considering for ideal gas it's $0$.
But my problem is that since it's a free expansion, it's also an irreversible process. What is the meaning of the differential $dU$ in an irreversible process? Isn't the whole problem in irreversible processes that it is not defined since the state is not in equilibrium? Why can we even use data from this experiment in the general expression for $dU$?
From my understanding, the only states in equilibrium are the initial and the final, so $ΔU = 0$ is correct. But why is $dU$ equal to 0?
Also, I am still on the first law and although I know about entropy in general and that $ΔS > 0$ in irreversible processes, I would prefer to understand this without involving entropy if it's possible.
Comment: For a tutorial on how to determine the change in entropy for a system that experiences an irreversible process, see the following link:https://chemistry.stackexchange.com/questions/109654/entropy-change-of-isothermal-irreversible-expansion-of-ideal-gas. This link also has a worked example for this exact problem.
Answer: For the system you describe in which no heat is transferred across the system boundary (insulated) Q=0 and no work is done on the rigid boundary surrounding the contents of the chamber W = 0, the first law of thermodynamics tells us that the change in internal energy of the system is zero:  $$\Delta U=0$$For an ideal gas, the internal energy is a function only of temperature (and not volume) U=U(T), so this means that the change in temperature of the gas is zero:
$$\Delta T=0$$
For a tutorial on how to determine the change in entropy for a system that experiences an irreversible process, see the following link:
https://chemistry.stackexchange.com/questions/109654/entropy-change-of-isothermal-irreversible-expansion-of-ideal-gas
This reference also refers to a link that also has a worked example for this exact problem.


integrating iAD into 3d game

Question: I'm developing first person shooter and want to integrate iAD (and maybe AdMob later). The problem is that all the ad systems that I know use simple UIView's for that and are based on tapping them. I want to use real 3d game objects as triggers, i.e. when you shot some special character an ad is invoked. The user would be notified about that (so if you don't want ads, just don't shot those objects).
I know how to do that from the technical point of view. But is it legal to do that from the ad provider point of view (and from the Apple review team POV)?
p.s. Or maybe someone knows ad system that could be integrated into my game like that.
Answer: You can trigger a popup, bannner or full screen ad by hooking your object to a button press with the RevMob SDK. Their ads tends to be of the 'download a free game' variety.
I don't see how you can do this with Admob or especially iAd as they require the banner ad to be shown on the screen so that they can serve ads. Triggering them like this may be against their terms of service.
Answer: I agree to FiddleMeRagged that you can use RevMob for this purpose. You can show a fullscreen ad whenever the user shoots wrong object.
However you can't use Admob for the same purpose. Since they clearly forbid any such activities in their usage policy. They ask you to put maximum one banner ad per screen
Similarly iAd also doesn't allow this kind of ad display.
Apple doesn't seem to have any problem with this, since our game already passed with this kind of functionality. I'll try to find some documentation regarding this.
Edit: Just found this link on Revmob site, which recommends displaying multiple fullscreen ads.
Answer: the existing answers basically cover this, but to clarify regarding iAd:
iAd is based on presenting an ADBannerView, and having that ADBannerView do the work to fetch and display the ad, and then allowing the user to click through to get the full-screen ad.
Apple's documentation on this topic says that if you obscure or hide ads while they are loaded, the ads that your app gets fed will be affected, and your revenue will thus be affected.  (it also says that the ADBannerView itself must conform to certain characteristics.)
in the end … i don't think you'll be able to trigger the full-screen iAd by something in your game being shot, since you won't be able to affect the ADBannerView doing what it needs to do to process the user-click for the click-through.  (well, ok, you maybe could fake this, but it would probably involve the guts of ADBannerView in a way that apple would reject.)
Answer: I relize you should probably use revmob but incase you need it in the future, heres a link on integrating iAd and adMob check this link: Mixing iAd and AdMob
Answer: RevMob has an ad unit called adLink, this can be called inside you code and will open the iTunes with the advertised game. You can use the following code:
<code>RevMobAds *revmob = [RevMobAds revmob];
[revmob openAdLinkWithDelegate:self];
</code>
You can find more documentation on their site:
RevMob API documentation

integrating iAD into 3d game


How to create default branch with Eclipse?

Question: When I am creating a repository in Git it says "This repository's default branch is empty!"
Earlier I had a master branch and a source button with SSH, HTTP.
So how can I create this default branch, without using the terminal?
Comment: brunch with git? Doesn't sound so romantic...
Comment: Brunch is better without Eclipse.
Answer: Thx all but i resolved my issue.
In repository Admin panel just need to check GitHub Pages, it creates "gh-pages" branch and shows a source button with SSH, HTTP.
Answer: When you create a new, empty, git repository you will have an empty default branch until your first commit.
When using EGit, you can create a new git repository from the Git Repositories view.  See Creating a Repository.  When that's done, I create my workspace projects, uncheck "default location", and specify a directory within my newly created Git repo.  There's more of a discussion on creating git repos in relation to a workspace in Considerations for Git Repos.


Keyframe Issue in blender

Question: I have an object which is accidently got animated. I have other objects in the scene but only that particular object is moving up and down as I scroll timeline. I can see an orange line under timeline but I can not see any keyframe. I tried to delete keyframes by several ways but no use and that orange line is also not disabled. I checked other objects which are not animated and they don't have that orange line in timeline.
Comment: In addition to Edgel3D comment, it looks like you have baked something like rigid body. Could you provide the .blend file?
Comment: Sounds like you've got something acting on it like physics, a modifier, or constraint perhaps?
Comment: I have added Images. Please check. If there is any issue in physics or in a modifier or in constraint then can we edit it in timeline? If so please tell the process because I am new to blender and I tried all possibilities what you suggested but could not find anything.
Answer: This yellow line represents some type of baked movement like rigidbody , or a constraint , to have a look if this is the problem , you can click on the Physics properties tab 2nd block from the modifiers , their if you see a rigidbody constraint , you need to click the cross to remove it and then start your timeline from the first frame .
Comment: Thanks Edgel3d, Mugnozzo,Shikha Mittal for your replies. The problem is solved. It was due to rigid body. Just now, when I started blender that object was not at that place :D. Hence, I found it by cursor first, then relocated it, set its origin reset scale and removed rigid body from  object menu > regid body >  remove. Luckily, I found rigid body in that menu. Huh!! Thanks all for your support.
Comment: you can select the tick mark below the voting in my answer to declare this answer correct

Keyframe Issue in blender


Why does macOS show 100% battery and fully charged when "Charge Remaining" is lower than "Full Charge Capacity"

Question: My Battery percentage shows 100% Mark. But I got this from the System Information section. Why does it say fully charged and shows 100% mark when the actual remaining charge is 95%?
Answer: This is completely normal.
The numbers you see here should not be treated exact values - it is impossible to get exact values for the battery. The full charge capacity varies slightly with various factors - including, for example, the ambient temperature in your room.
The battery will ofcourse report a specific number to the operating system, but it would be a bad idea to expect the numbers to match up exactly. I.e. if you just charged until "Charge Remaining" matched exactly with "Full Charge Capacity" that wouldn't be a good strategy. This is why you see that systems from all manufacturers charge to somewhere "near 100%" - for example 95%.
Comment: And as batteries age they no longer hold as much charge. So if your battery is at 95% charge but can only be charged to 83% of original capacity... well you get the point.
Comment: @SteveChambers That doesn't really come into play here... as the battery ages the "Full Charge Capacity" value is lowered - it doesn't stay at the initial value.
Comment: @lx07 You misunderstood me. I'm not saying that the computer can't display the exact value reported by the battery controller - that would be weird. I'm saying that it doesn't make sense to treat it as an exact value, as the "real value" fluctuates with - for example - temperature. That's why you do not want to go to 100%, but _on purpose_ go for 95% for example.


make a mulitingual wordpress website Arabic-english

Question: I want to make a website in both languages Arabic and English, in the way that I can change from Arabic to English from the upper menu. I want to make it as word-press based website and buy a theme to use it and base my website upon it. note that arabic is written from Right to left, so we have to take this into consideration as well.
is there a possibility for that and how it can be done. if there any plugin I can do?
Comment: yes it is possible and there are plugins for that, although you don't really need them, but the question itself doesn't fit the site as it is too broad and asks for recommendation. This topic was discussed a lot here, please do some searching and when you will have a more specific question there will be better chance of you getting a useful answer to it.
Comment: Include two things into your search: ["WordPress Multisite"](https://www.google.com/search?&q=wordpress+multisite) and ["WordPress Translation"](https://www.google.com/search?&q=wordpress+translation). Good luck.
Comment: Thank you guys for your answers. definitely will put them your input into my consideration.
Answer: If your site has the same content in both languages, you may try the plugin I have written called Transposh, which allows you to handle this with ease.
Support for RTL languages is embedded, where the theme has support for this. On the default themes it works quite well.
If you have different content for different languages, there are other plugins to try, and the multisite route is also quite notable.
Good luck,
Comment: Yes it does have the same content but I want the possibility of adding content to gallery/blog, also I want to ask you about your plugin does it do like google translation type of translation or I get to choose the content I want?


Effects of pectin

Question: I often see recipes (usually for fruit mead or beer) warning against boiling fruit for fear that it will release pectin. I know that this is important for making jam, and bad for home brewing. What I don't quite know is why it's a bad thing. Does pectin have a negative impact on the fermentation process? Is it bad for yeast? Does it negatively affect flavour? Does it affect aging? Why is it so important to avoid pectin?
Answer: Pectin causes a really strong haze.  Of course if you have a lot of pectin you can get some gummy residues or globs, but these settle out.  Pectin haze tends to be tough to get rid of even with cold temps and aging.
All in all, if you are making a cloudy-style wheat beer that you want to add fruit to, worrying about the pectin haze is a but overkill.
Comment: I think so, unless you get so much pectin in there you make beer jelly.  But then again, beer jelly doesn't sound that bad either if you have enough toast.
Comment: So it's really mostly a visual aesthetics issue?
Answer: There are mainly two issues when dealing with pectins:

The haze it can cause, and this is just cosmetics
Pectins being very large molecules make filtration very difficult

A rule of tumb is to use low to medium pectin content fruits:

High pectin content: tart apples, citrus fruits, cranberries, currants, gooseberries and sour plums.
Medium pectin content: Cherries, blueberries, blackberries and raspberries.
Low pectin content: Strawberries, peaches, pear, pineapple, apricots and rhubarb.

Source: BYO
Comment: Just how much difference is there between high pectin and low pectin? I once did a strawberry mead with fresh strawberries and it turned out as cloudy as the cysers that I've made (of course, I expected those to be cloudy). Delicious! ;) ...but still quite cloudy.
Answer: Pectin can make a major contribute to the methanol levels in cider(hard cider).
Methanol results from the decomposition of pectin into Galactose. If you do not add pectinase and/or pasturise your apple juice before fermentation you can significantly reduce the levels of methanol in the final product. Although it is rarely above 0.2%.
Here is an interesting article on the subject: https://www.sciencedirect.com/science/article/pii/S0960852409013194
It can also cause haze as others have suggested.
Answer: Even the clarity issue isn't a big thing, given the methods that can be used to clarify your brew. I think that the maximum flavor extraction outweighs the relatively minor clarity issue, IMHO.

Effects of pectin


Add a new address during multishipping checkout

Question: Is there a good way to allow users to add new addresses during multishipping checkout in-page (not having to go to a dedicated form page) the way many onepage checkouts function?
Answer: The multi-address checkout just isnt designed this way. Its a much neglected part of Magento, and if you go thro the code you can see why they didnt do the add address part, its awful codebase.
I've worked on this code in the past and I'd say if you can get away without putting this in then do so.


Do internal combustion piston engines have a place in an interstellar civilization?

Question: So purely electric vehicles are clearly the future. Battery tech is getting better every day and EVs are gradually getting cheaper. However, they don't sound cool. They don't really sound like anything at all. So let's say humanity advances to the point where we find several habitable planets that we begin colonizing. Because of the lack of infrastructure, would it be more practical to have ICE vehicles that we can synthesize fuel for? Or would it still be more sensible use a centralized power source to charge battery vehicles? Let's assume that humanity found FTL by some means but did not develop the technology themselves. I think expanse-level tech is probably as advanced as it gets in this setting.
Comment: The title of the question asks about *piston* engines (which are probably doomed to be consigned to the museums), but the body of the question asks about internal combustion engines in general (which I am quite sure will be used for a very long time). These are very different questions. Rocket engines are internal combustion engines. Turbine engines are internal combustion engines. (Think about steam engines. *Piston* steam engines are long gone, but turbine steam engines are widely used to in electric power plants and atomic submarines and so on.)
Comment: hydrogen internal combustion engine vehicles could be used for contaminated, surplus, or just low quality rocket fuel. Stuff that would not work well in a fuel cell. especially if they are mining gas giants for hydrogen. Gasoline vehicles became common because gasoline was a waste product and thus dirt cheap.
Comment: What do you specifically mean by "has a place?" We have societies on Earth today who use horse-drawn carts. I still play vinyl records. People still use shovels rather than renting mini excavators. It's trivial to come up with rationale to excuse the use of combustion engines among space-faring civilizations... but that depends on your definition of "has a place." After all, if they only exist in museums, that's a place.
Comment: BTW, while I agree that electric vehicles are "clearly the future," you should be mindful of phrases like that. EVs only exist here in Montana in the bigger cities for in-city use because the batteries still can't handle the cold or the distances. And we're still charging those lovely batteries with primarily coal, propane, or diesel fueled power plants, which isn't an improvement over gas (but the driver feels self-righteous, that's enough, right?). When EVs are powered by solar, nuclear, or hydrogen fuel (or similar), then they're "clearly the future." Until then, they're just a novelty.
Comment: Totally depends on the intended level of handwaving involved. Have we invented anti-grav? Small cold-fusion power sources? teleportation? Sub-orbital ramjets? Whatever is sent, can the people there tear it down and fix it? They're at the loooong end of a supply chain. Possibly a micro-organism there breaks down whatever material is used to create the things, so now they rely on muscle power, or 6 legged cat power, or... where are you going with the STORY, not the trivial supporting things.
Comment: @JBH hahahahahahahahaha.  Ahum, I appreciate the humour.  We are talking FTL and Expanse era technology, and you are still going on about using legacy (even today!  Mining coal *today* costs more than building a solar farm that produces the same energy over a few  years, and the solar farm keeps going) power plants as if it was topical.  The coal power problem *today* is that rich people own nearly worthless coal power plants and they successfully lobby to keep making money off them.
Comment: @Yakk hahahahahahahahaha. If mining coal costs more than building a solar farm for the same energy, *people would be running to convert coal to solar.* Rich people aren't rich because they do stupid things that cost them money (that might not make sense to you...). You are, in fact, in error - and I need only point to the fact that nobody is rushing out to decommission theoretically expensive coal plants in favor of theoretically cheaper solar farms. We have coal plants in industrial areas where people use bicycle drawn wagons, so FTL is irrelevant. I appreciate the humor, though.
Comment: @JBH "US renewable energy farms outstrip 99% of coal plants economically – study" - Guardian "Solar power got cheap. So why aren't we using it more?" - PopSci "99% Of U.S. Coal Plants Are More Expensive Than New Renewables. " - Forbes.  This isn't news, those are year+ old articles.  Who decides who connects to the grid and has the right to sell power, and who owns the coal plants... is usually the same people in much of the USA.  And much electricity prices in USA is cost-plus regulated.
Comment: @JHB "people would be running to convert coal to solar" Some states (like Montana) are [converting coal to wind](https://www.eia.gov/electricity/data/browser/#/topic/0?agg=2,0,1&fuel=vtvv&geo=00000000004&sec=g&linechart=~ELEC.GEN.COW-MT-99.A~ELEC.GEN.WND-MT-99.A&columnchart=ELEC.GEN.ALL-MT-99.A↦=ELEC.GEN.ALL-MT-99.A&freq=A&start=2001&end=2023&ctype=linechart&ltype=pin&rtype=s&maptype=0&rse=0&pin=), probably for the simple reason that coal's Levelized Cost is nearly 3 times higher than that of wind (per Lazard).  Also, turns out that even with 'dirty' grids, EVs are still cleaner than ICE.
Comment: The most plausible place for a
ICE would be as malicious gifts to aliens who are less technological advanced, and who we want to stay that way.
Comment: This question makes no sense.   There will **always** be a situation for which an ICE is the best solution.   "interstellar" means little here unless we assume some hyperspace drive, but those (in scifi stories) tend to be nonfunctional near large masses anyway.
Comment: Around stars prone to flares a IC diesel engine is way more reliable than any electric one.
Answer: This is a false dichotomy
You present the choice as being between synthesized, transportable fuel (distributed?) and a "centralized power source".
The beauty of electricity as a power source is that there are myriad ways to generate it, and the electricity thus generated is indistinguishable from electricity generated by any other of those means.
So I would say that if battery technology is Expanse-level, it makes more sense to have electric vehicles rather than internal combustion.  ICEs are incredibly complicated mechanical marvels - an electric vehicle can be made very simple.  They're easier to maintain, with futuristic high-efficiency solar cells, you will never be stuck anywhere without fuel - they are wildly more practical.
So, where do I get to hear the roar of the engines?
Borrowing an idea from the Honorverse, may I suggest: the Society for Creative Anachronism.
These days, the SCA is mostly concerned with Medieval or Renaissance tech, but if you've got spaceflight and are conquering new planets, the 70s are going to seem a long way off.  So you have a collection of hobbyist weirdos who spend their evenings and weekends building perfect reproduction models of 1970s coupes, cruisers, and muscle cars. (Running on alcohol, obviously, because no one's going to bother to set up a fossil-fuel industry.)
So Piotr Suzuki-Schmidt (SCA name: Tony Malone) has a replica Dodge Challenger that he races on Sundays against his fellow SCA members while other colony members watch, bemused, from the sidelines.
Comment: Calling an electric vehicle simple is only _sort of_ true.  Keep in mind the one thing keeping EVs from having already taken over on Earth: making a good battery is actually incredibly complex, far more complex by itself than the entire drivetrain of an ICE vehicle.  A colony is probably unable to make batteries and will need to import them if they break, however ICE vehicles can be fixed fairly simply without a specialised foundry.
Comment: @Turksarama: What makes batteries complex is the need to have parts of them chemically deform and refofrm without their shape being distorted in such a way as to short out or create other similar problems.  Manufacture of primary-cell batteries is pretty simple if one can get the raw materials.  If e.g. a colony was located in a crater on a planet which received an essentially unlimited supply of solar energy, a facility that could reduce the by-products from spent primary cells and build new cells wouldn't require anything overly exotic.
Comment: In the Honorverse internal combustion engines burning hydrogen are widely used. Honor H. herself is almost killed when the Grayson freedom fighters shoot down a hydrogen powered shuttle she was riding on, and Queen Elizabeth III comes to power due to a tragic accident suffered by a hydrogen powered pleasure yacht. True, *piston* engines can only be found in quaint places.
Comment: My impression from those scenes was that the hydrogen was present to power an internal fusion bottle, but it still leaked and exploded the normal way if the fuel tank was ruptured.
Comment: In fact, Weber states this explicitly - small craft are powered by laser-inertial fusion (rather than the mag bottles on larger ships).  So it's not a combustion turbine, it's electrical, with a big tank of fuel that can still go "boom".
Comment: Nuclear fusion reactors use extremely little amounts of hydrogen. Or from our primitive point of view, will use. No need for fuel tanks, more like fuel vials... Due to *E* = *mc²*, one miserable gram of hydrogen is equivalent to 25 gigawatt-hours of energy. (Maybe those fusion-powered small craft are small *space*craft?)
Comment: @AlexP _I_ am aware of that.  But we also don't have impeller wedges and the ability to generate grav pulse FTL communications, so I'm going to assume that Weber's ships' fuel tanks are a narratively convenient "boom" tied to the science fantasy that makes them go.
Comment: @AlexP and no, even aircars are explicitly fusion-powered.  That said, the explosion that nearly kills Honor in Grayson is that of a _pinnace_, which is a ground-to-space (or ship-to-ship, in space) craft.  I'm not sure what its endurance is meant to be (or how much energy countergrav and impeller wedges require), but maybe that would explain having a big tank of explosive compressed hydrogen gas?
Comment: A facility to do that is _already_ quite advanced.  Again, even on earth (lithium) battery recycling is fairly immature.  It's not actually an easy problem to solve at all.
Answer: Of course you can have them!
Electric vehicles would be charged either from local power plants or from the power grid. Local systems might be solar cells, hydropower, geothermal, stuff like that. Perhaps even burning wood. Mining coal requires a scale that would no longer be local, it would be the colony-wide grid. Other means to power a grid might be fission or fusion.
Assume that a colony-wide power grid is not an option at first due to the dispersal of the settlements and the terrain in between.
Using a solar array on the roof of your house to recharge the rover sounds really good if the rover spends most of the day next to your house, and only occasionally ventures to the fields or to the market village. If the rover is roving a lot, you might need several battery packs, leaving some at home while the others are used. That's expensive, and batteries don't have an infinite number of cycles, either.
Drilling for fossil fuels and refining them might look really good from a storage-and-distribution viewpoint. The tanker truck makes the round of the farms, refuels their tanks, and the rovers and tractors are refueled from there.
An alternative to fossil fuels might be biofuel, either vegetable oils or alcohol. Again they can be stored in liquid tanks. These fuels might be viable at a smaller scale than oil refineries. Imagine little stills or oil mills in every farm, making them self-sufficient in fuel!
On top of that, you get the question of local repairs to the vehicles. Historically, electric vehicles used to rival internal combustion, but at the beginning of the 20th century combustion completely outclassed them. Only in the last years has battery power started to catch up. If high tech is limited by the need to build the tools to build the tools, the easier technology might win.
So you might have:

The initial expedition brings battery-powered vehicles, which recharge from the reactor of the starship or shuttle. They are limited to a certain radius around the landing field.
Early settlers bring a mix of fuel-cell vehicles and internal combustion, fueled by biofuels which can be produced in outlying farms.
As the colony grows, they debate going to a fossil fuel economy (if such fuels exist), or to expand the power grid from the starport/capital city to the outlying settlements, or both. The decision depends on geographic and political factors.
The niche for internal combustion with biofuels or fossil fuels shrinks, but it never goes away completely until the population becomes big enough to worry about man-made climate change.
Comment: Given the tech described, I don't see a role for fossil fuels (with the massive infrastructure required to support them) or biofuels (since you need a lot of excess crops for that) but just hydrogen: you've got cheap, efficient fusion.  As long as you have water, you have fuel.  That said, I think that the argument that ICEs will compete with batteries falls a little flat when faced with an _interstellar civilization_.  I'm pretty sure they'll have better battery chemistries.
Comment: @jdunlop, hydrogen is not as easy to store as gasoline.
Comment: True, but much easier to make in terms of up-front investment.  And you could store it as methane or ammonia.  And, again, _interstellar civilization_.  Pretty sure their materials science is also better than ours.
Comment: @jdunlop, that would perhaps be stage 3 in my model of colony development, not stage 2. There is something to be said for a fuel which can be poured back and forth in jerrycans, which methane cannot.
Comment: @jdunlop Why would you bother storing it as ammonia when ammonia has lower energy density?
Comment: @DKNguyen, to avoid hydrogen embrittlement, maybe? Ammonia is also a gas at room temperature, of course, so that is a point against both of them.
Comment: @o.m. I meant as opposed to gasoline or diesel, not hydrogen.
Answer: The choice between electric motors or ICE ones is a matter of logistics.
If you are only going to be hanging around places with a reliable grid, or if you're capable of generating your own juice with solar panels, electric may be the best option.
But if you have no access to a grid, and you're going to a place where there isn't much sunlight, it would be safer to have an ICE and bring along some fuel.
If you have something hybrid, you can get the best of both worlds.

Notice that it may be preferrable to burn fuel even when you have access to a grid, if the cost of electricity or the total cost of ownership of an electric device is more expensive than the cost of the respective ICE alternative. Right now, in real life, the government of Alberta is ensuring this is the case by taxing the maple out of electric vehicles, for reasons.
When it comes to energy costs, the hybrid option here allows you to have the best of both worlds wherever you go.

Finally, unless the technology of your spaceships is advanced enough to be like magic to us (besides the FTL), you can't propel a vessel in space just with electricity. Solar sails are solar snail slow, and the most usual way use to (relatively) efficiently move around in space involves burning stuff to expel it at high speeds in the opposite direction you wanna go.
Comment: Not strictly true: the _most_ efficient engine that we've conceived of (that still has a substantial delta-V, otherwise I'd be pointing at ion drives) is a [nuclear thermal rocket](https://en.wikipedia.org/wiki/Nuclear_thermal_rocket).  You still have to expel a thing, but you're not burning it.
Comment: @jdunlop indeed. I'm fixing my remark
Answer: In the far future, novel means of electric power storage may outperform our current electric vehicles in terms of charging time, energy density and harvesting renewals such as solar and wind energy. Maybe fusion will save us from reliance on petroleum even if solar and wind don't catch-up with our increasing appetite for more energy.
However, in the mean time, you can implement some reasonable energy-efficient means to generate synthetic fuel.

The Germans synthesized fuel during WW2. Unfortunately, this used coal as the source material. True, it uses more energy sources to generate fuel but it is not more renewable than coal mining.

Biofuel Methanol. Brazil has been using sugar from sugar cane to generate Methanol. It is more efficient than growing corn for that purpose, but still needs some land allocated to the task. That hurdle is what caused the burst of the "dot-corn bubble" (compared to the "dot-com bubble") because that same land could have instead fed more people, and not fuel-guzzling cars.

Methane from sweage water - That's much better - Use anaerobic sewage processors. Modify sewage processing plants to work anaerobically and generate lots of Methane which can be used as fuel. You can do the same with cow manure in farms. Rather than composting them through the thermophillic process, use the anaerobic fermentation to generate Methane.

Carbon sequestation - Collect carbon dioxide from the atmosphere and make it react with water to generate Methanol. Methanol has more energy, so you need energy input in order to make an energy source. You cannot make energy from "nothing". Gladly, you can use catalysts whose process is powered by things like solar energy. This process is still in its infancy.

So in general, this is possible, but I think that in the long run transportation would rely more on electric motors rather than ICEs. Methane generation from sewage water seems to offer the best promise because it treats waste materials while at the same time generating fuel from them. Our current technology allows us to use Methane as fuel for an internal combustion engine, but in the future, it may be possible to build a fuel cell that produces electricity directly from it.
Comment: The OP does specify an "interstellar civilization", so fuel synthesis is unlikely to be a problem, and they must have some pretty enormous sources of energy available.
Comment: @jdunlop correct, nuclear fusion is relatively cheap and efficient in this version of the future compared to anything we have today. Somewhere between the expanse and halo universes.
Comment: So that is to say that biofuel, gassification/liquifaction of solid fossil fuels, or even waste recover is unlikely in the extreme to be necessary.  If someone needs a flammable fuel, it can be synthesized from carbon dioxide and water at a substantial energy cost.  It still doesn't justify inefficient ICEs, barring very specific applications, though.
Comment: @jdunlop Local inefficiency is irrelevant if your energy density is massively higher than competitors.
Comment: methane from waste should also be cheap which encourages its use.
Comment: @jdunlop Right. The interstellar civilization would turn to more advanced technology involving the use of fully electric vehicles. The issue of sustainability applies only to the examples #1 and #2. However, #3 and #4 would remain viable. The issue is that the two latter possibilities would become obsolete as more advanced methods will be used.
Answer: My short answer is: Lots of old technologies are still useful. I'm a software developer so I am not at all afraid of new technology. But I often find that the old tech is distinctly better.
I often see articles on the web with headlines like, "10 new inventions that will change your life". And often, after I read the list, I think to myself, "Not only will none of these inventions revolutionize my life, but most of them sound so useless that if you were giving them away for free, I wouldn't bother to walk across a room to pick one up."
Simple example: I used to carry around a paper appointment calendar. I would hand-write dates of meetings, etc, in it, and then each week I'd look at the appointments for that week and plan accordingly.
Then I saw an ad for an electronic appointment calendar. This seemed like a great idea! I could type in appointments rather than having sometimes hard to read hand writing, it could sort and search, make room as necessary, and many other benefits. So I bought one.
I quickly learned that it had many drawbacks. In order to be small enough to fit in my pocket, it had to have a tiny keyboard that was difficult to type on. The display was also small, about three lines of text. So while on my paper calendar I could see a week at a time, on the electronic calendar I could see part of one day at a time. And then one day the software had a glitch and all my appointments were lost. I suppose theoretically I could drop my paper calendar in a puddle and make it unreadable. But that had never happened to me. I never lost an appointment because of a software error on my paper calendar.
I went back to the paper calendar and continue to use paper to this day.
ICE has many advantages over EV today. ICE vehicles are significantly cheaper to build. They have longer range -- the energy density of gasoline is orders of magnitude greater than the energy density of a battery. EV batteries wear out over time and have to be replaced, at significant cost. Etc.
The simple proof is: Governments have to subsidize EVs to get people to buy them, or even mandate that people buy them. Left to their own, most people prefer an ICE.
Perhaps with continued R&D these problems will be overcome so that eventually EVs will be better than ICEs in every way. But that's pure speculation, bordering on wishful thinking. One might just as well say that with continued R&D, ICEs will become better than EVs in every way.
To make it work in a story, one need only pick ONE advantage of ICEs and create a situation in your story where that advantage is critical. Like, ICEs have longer range. On your remote world, it is not practical to maintain a large network of charging stations. Thus, EVs may be the primary mode of transportation back on civilized and highly-developed Earth, but they are not practical on Aldebaran IV.
Answer: There are entire planets covered in giant lakes and seas of hydrocarbons, liquid methane, etc. or covered in hydrocarbon ice.
There are also gas giants with layers of extremely high pressure methane deep enough to lose 100 Earths in them.
Hell, there are even free floating comets and asteroid of this stuff.
basically, fuel for ICEs is abundant in the universe, and in many cases, you need to get rid of it to make the planet habitable (ex: you cannot have lakes of methane on a planet that you want to Terraform, or build a colony on a surface soaked in benzenes. You need to get rid of this stuff, and whats better way than burn it?)
Answer: Have a series of really tiny nukes go off to generate electricity that ultimately drives the wheels. Hand-wave some reason for not operating in continuous mode, maybe that would simply generate too much energy, making the engine wasteful.
When this tech is ubiquitous, none bothers to store energy, or transmit it on power lines, the generation is at source.
Large objects, like houses, can afford good shielding that muffles the sound to nothing.
Portable objects, like motor cars can only afford bare basic shielding against radiation, but not the mechanical noise of things expanding, etc.
Comment: Hi Dirk, I think you're not really addressing the question, which is asking for a comparison between types engine given the technological scenario.
Comment: True, I'm offering a creative solution to work around the tech level issue.
Answer: So you have a colony on a new world.  It might not have fossil fuels at all.  The obvious path to transport is the one we followed here.  Start with feet.  Next step is riding animals, horses, donkeys, camels, whatever is appropriate to the local ecology.  The next step after that is steam.  The fuel can be practically anything that burns.  If water isn't readily available, you don't have much of a colony.  Steam gives you railways, trucks, cars, and in cities can power cable-cars.  Internal combustion comes next, but you need the industrial base given by steam to make it.  You might be able to bypass ICE for EVs, but I seriously doubt you can bypass steam.  Given the level of pollution involved in making EVs, let's hope that any future civilisation that goes in for them has figured out how to make them last much much longer than ours do.  Show a character preferring to inherit her grand-grandfather's car rather than get one from a fabber.
Answer: Depends if there is scalable generation of power from other sources is available. That is relatively small scale nuclear or fusion generators. From few Megawatt to few dozen Megawatts scale.
If not internal combustion engines make lot of sense for use case like ocean ships or simple backup power generation. That is when you need to bootstrap other generation and you have run out of battery power. And even smaller generators might make sense to power some remote locations when solar or wind is not available and power for communication is needed.
Fuelling even piston engines is relatively simple too. There is wide enough range of options beyond fossil fuels. Such as biogas, alcohol, biodiesel from crops and fats or even hydrogen. That is quite wide range of options that might not require too complicated infrastructure.
Piston engines could also be relatively simple to build. Basic machining and simpler electronics or even no electronics depending on production level of colony allow local industry to be capable to build them relatively quickly. Meaning that everything does not need to be supplied from off planet.
Answer: Let's address this massive misconception first:

So purely electric vehicles are clearly the future.

That's unlikely at best. Unless you count hydrogen fuel cells as 'purely electric' or you're talking about a very far future where portable fusion is commonplace.

Battery tech is getting better every day and EVs are gradually getting cheaper.

It's changing, but not necessarily getting better. The current round of developments are cheaper and less prone to thermal runaway, but they're also significantly heavier. EVs are already heavier than equivalent ICE-powered vehicles.

Because of the lack of infrastructure, would it be more practical to have ICE vehicles that we can synthesize fuel for?

Absolutely it would. At least until we start producing something equivalent to Mr Fusion:

You're going to have to build up a major materials extraction and processing infrastructure before you'll be able to provide the raw materials you need to build EVs for your colonists. Extraction of raw materials takes a lot of energy, and all of the current methods use ICE-powered machinery (and slave labour in some cases, but let's not talk about that) to pull stuff out of the ground and move it around. Lithium extraction and refining is a dirty process, so let's hope we've found something much cleaner in future.
It's going to be a long drag on the way up to EVs, so how are we going to fill that gap?
The same way we did it the first time: animals, steam, then ICEs.
First, ship a sustainable breeding population of horses with your colonists. Might need some food supplements to keep them healthy, but once we replace native vegetation with Earth grasses and so on that won't be a problem. Get started on breeding them early so that you'll have new riding animals within about four years.
With horses we have horse-drawn and horse-powered vehicles and equipment. A cart is easy to throw together out of pretty much any materials you have to hand and a little bit of work. Horses still pull plows today in some places, no reason you need to ship expensive and heavy tractors.
While the farmers are working on their thing, get started on mining and processing the simple stuff: iron, copper, tin, etc. Once you have a supply of reasonable quality iron you make steel and then... well, any half-decent machine shop can make you an ICE that will run on moonshine. Contrary to popular opinion, ICEs are actually quite simple. And producing biodiesels would make the ICEs even simpler. Bonus points: the carbon released came from C-negative sources, so it's technically C-neutral.
These alcohol ICEs will be around for a long while until you reach a high enough level of colonial development to be able to manufacture intricate machinery like the very precise electric motors and the processors that they require to operate. And the roads that they need to maintain their efficiency advantage.
Comment: Colonization doesn't mean giving up all technology, it is a bootstrapping process, You don't drop people naked in the wilderness. fuel is worse than batteries for portability because solar panels are a thing. Fuel still need to be refined and distributed.
Comment: @John Travelling to another star is an *expensive* process. The more you have to carry the more expensive it gets. You don't ship thousands of tons of *cars* you send the minimum you can expect to get away with, with a little redundancy. Better to send the tools to make primitive craft, juvenile breeding stock of animals and so on. Every extra kg of cargo is costly, so you minimize as much as possible.
Comment: @John As for fuel... it's trivial to produce alcohol from pretty much any plant life if you're not concerned about taste. Or toxicity. Solar panels are fine if you have a lot of them - direct solar-powered cars don't exist for a very simple reason after all. We're talking about a few tons of solar panels per vehicle per day of operation. Or a simple brew-and-distill process to get fuel-grade alcohol using a few grams of tailored yeast, a few kg of gear and whatever compatible plant life you have to hand. And just *try* to stop your colonists from brewing alcohols. I dare you.
Comment: And a still if you have a month to wait to fill your gas tank. solar panels can fill it in a day, less if you have a detached power pack.  And as the Russians learned the problem with using alcohol as fuel is stopping people from drinking it.   and who said anything about direct solar  powered cars? also the tools to make cars are also the tools to make nearly everything else you need, a horse on the other hand is really only useful for one thing. which one is saving weight again?
Comment: @John You're ignoring the fact that you need to ship tons of solar panels for each car to get enough of a charge to use them for the day. Or you can ship a small amount of fuel for the few alcohol-powered cars - which incidentally can be much lighter as well - to keep them running until your fuel production is online. As to people drinking the fuel... yeah, desperate, hopeless people with nothing to look forward to and nothing to do with their lives will do stupid crap. Your colonists hopefully aren't in that category.
Comment: except the solar panels can fill it again tomorrow and won't be competing with the very valuable food crops for machinery and space. if your colonist brought little machinery and have animals to feed, crops will be by far among the most limited resource.


What is the potential in a circuit?

Question: I have learnt that the potential in a point in an electric field is defined as being numerically equal to the work done in bringing a unit positive charge from infinity to the point. However, this is in the case of an electric field. What is the potential in a circuit say, consisting of a battery and simple capacitor, at one of the plates? Is it numerically equal in the work done in moving a unit charge from the 'positive' plate to the positive pole of the battery? (by having to do work in overcoming the attractive forces of the nucleus on the electrons of that plate) But from definitions this charge is a unit positive charge. This is all confusing to me and it would help for simple explanations.
Answer: Usually one doesn't discuss potentials at a plate of the capacitor. One discusses the "potential difference" between the two plates of the capacitor. "Voltage" is always a difference between one point and another.
The voltage on the electricity supply in your house is the difference in potential between the line on the socket and the ground outside your house. What potential any of these things are with relation to a point at infinity is too complex a problem for practical purposes.
Comment: Actually, I think there is a practical reason to still think about the voltage between a particle and infinity. Because of the dependence on 1/r it will always be zero, which in essence defines a reference or "ground" voltage.
Answer: In a circuit, you usually define potential differences with respect to a chosen (arbitrary) electrode. This is often the "mass" electrode which is connected to earth. When you measure potential differences in a circuit, you actually measure differences in electrochemical potential, not the difference in electrical potential. This can be easily recognized when measuring the voltage between two connected wires of different metals, e.g. copper and tin. Already without any applied voltages, there is an electrical potential difference, the contact voltage, which, however, cannot be measured with a voltage meter because both wires have the same electrochemical potential.

What is the potential in a circuit?


How to change the blue highlight color of a UITableViewCell?

Question: I'm wondering how to change the blue highlight/selection color of a UITableViewCell, any ideas?
Answer: You can change the highlight color in several ways.

Change the selectionStyle property of your cell. If you change it to UITableViewCellSelectionStyleGray, it will be gray.
Change the selectedBackgroundView property. Actually what creates the blue gradient is a view. You can create a view and draw what ever you like, and use the view as the background of your table view cells.
Comment: Thanks for the great note! This makes it so simple now: you create a new view (no need to even specify the frame: `cell.selectedBackgroundView = [UIView new];` and you set whatever colour you want: `cell.selectedBackgroundView.backgroundColor = [UIColor colorWithHex:@"ecf2f5" andAlpha:1];`
Comment: cool, found a good explanation and example here :http://cocoawithlove.com/2009/04/easy-custom-uitableview-drawing.html
Comment: I realized that in IB you cannot set the UITableViewCell "Selection" to "None" - because `selectedBackgroundView` will then just plain never show up. Only after setting "Selection" to Default, the `selectedBackgroundView` show up. Tested on iOS 6 and 7.
Comment: look at the bottom of this page, there are more recent approaches
Answer: Zonble has already provided an excellent answer.
I thought it may be useful to include a short code snippet for adding a UIView to the tableview cell that will present as the selected background view.
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];

    UIView *selectionColor = [[UIView alloc] init];
    selectionColor.backgroundColor = [UIColor colorWithRed:(245/255.0) green:(245/255.0) blue:(245/255.0) alpha:1];
    cell.selectedBackgroundView = selectionColor;

cell is my UITableViewCell
I created a UIView and set its background color using RGB colours (light gray)
I then set the cell selectedBackgroundView to be the UIView that I created with my chosen background colour

This worked well for me.
Thanks for the tip Zonble.
Comment: @kirk, you mean grouped :)
Comment: This does not work too well when using table views with sections.  When selected, the cell will lose the borders and is not rounded when the first or last cell.
Comment: @Tieme, no, I mean [sections](http://developer.apple.com/library/ios/#documentation/uikit/reference/UITableView_Class/Reference/Reference.html): "A table view is made up of zero or more sections, each with its own rows."
Comment: You have to place it within the 'cellForRowAtIndexPath'. Works fine for me, with one section. Not tried it with multiple sections.
Comment: A little late to the game but I can confirm it works in a tableview with multiple sections (non-grouped)
Comment: `initWithFrame:reuseIdentifier:` is deprecated. You may want to use `initWithStyle:reuseIdentifier:` instead.
Answer: UITableViewCell has three default selection styles:-

Blue
Gray
None

Implementation is as follows:-
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *) indexPath {

     [cell setSelectionStyle:UITableViewCellSelectionStyleNone];
}

Comment: rather than these three default style, we can also customize for our expected style by selectedBackgroundView property.
Comment: Worked for me... Thanks a ton.
Answer: In Swift, use this in cellForRowAtIndexPath
let selectedView = UIView()
selectedView.backgroundColor = .white
cell.selectedBackgroundView = selectedView

If you want your selection color be the same in every UITableViewCell,
use this in AppDelegate.
let selectedView = UIView()
selectedView.backgroundColor = .white
UITableViewCell.appearance().selectedBackgroundView = selectedView

Answer: If you want to change it app wide, you can add the logic to your App Delegate
class AppDelegate: UIResponder, UIApplicationDelegate {

    //... truncated

   func application(application: UIApplication!, didFinishLaunchingWithOptions launchOptions: NSDictionary!) -> Bool {

        // set up your background color view
        let colorView = UIView()
        colorView.backgroundColor = UIColor.yellowColor()

        // use UITableViewCell.appearance() to configure
        // the default appearance of all UITableViewCells in your app
        UITableViewCell.appearance().selectedBackgroundView = colorView

        return true
    }

    //... truncated
}

Comment: this works, but then the selection is cleared directly when pushing the new view controller.
Comment: Perfect. Any idea how to set the text color of that default cell globally on select?
Comment: Nice way of making global changes to UITableViewCell
Answer: for completeness: if you created your own subclass of UITableViewCell you can implement the - (void)setSelected:(BOOL)selected animated:(BOOL)animated method, and set the background color of some view you added in the content view. (if that is the case) or of the contentView itself (if it is not covered by one of your own views.
- (void)setSelected:(BOOL)selected animated:(BOOL)animated
{
    if(selected) {
        self.contentView.backgroundColor = UIColor.blueColor;
    } else {
        self.contentView.backgroundColor = UIColor.whiteColor;
    }
}

(did not use ? to fit the small width of source code DIV's :)
this approach has two advantages over using selectedBackgroundView, it uses less memory, and slightly less CPU, not that u would even notice unless u display hundreds of cells.
Comment: This is works only after a new view assign to the `selectedBackgroundView ` At the very beginning of the method add `self. selectedBackgroundView  = [UIView new];`
Comment: @enadun This methods works for me on iOS 12, with no setting of the `selectedBackgroundView` property at all.
Answer: I have to set the selection style to UITableViewCellSelectionStyleDefault for custom background color to work. If any other style, the custom background color will be ignored. Tested on iOS 8.
The full code for the cell as follows:
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"MyCell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier];
    }

    // This is how you change the background color
    cell.selectionStyle = UITableViewCellSelectionStyleDefault;
    UIView *bgColorView = [[UIView alloc] init];
    bgColorView.backgroundColor = [UIColor redColor];
    [cell setSelectedBackgroundView:bgColorView];

    return cell;
}

Answer: @IBDesignable class UIDesignableTableViewCell: UITableViewCell {
  @IBInspectable var selectedColor: UIColor = UIColor.clearColor() {
    didSet {
      selectedBackgroundView = UIView()
      selectedBackgroundView?.backgroundColor = selectedColor
    }
  }
}

In your storyboard, set the class of your UITableViewCell to UIDesignableTableViewCell, on the Attributes inspector, you may change the selected color of your cell to any color.
You can use this for all of your cells.
This is how your Attributes inspector will look like.
Comment: Very creative! great!
Comment: you can make it even more simple, look at my answer ;) https://stackoverflow.com/a/51764804/537694
Comment: I use a custom cell to set labels, so this works well, thanks! Change for Swift 5: It's now `UIColor.clear`, not `UIColor.clearColor()`. Not sure if that's a change in Swift too but it also works without `@IBDesignable`.
Answer: Based on @user's answer, you can just add this extension anywhere in your app code and have your selection color directly in storyboard editor for every cells of your app :
@IBDesignable extension UITableViewCell {
    @IBInspectable var selectedColor: UIColor? {
        set {
            if let color = newValue {
                selectedBackgroundView = UIView()
                selectedBackgroundView!.backgroundColor = color
            } else {
                selectedBackgroundView = nil
            }
        }
        get {
            return selectedBackgroundView?.backgroundColor
        }
    }
}

Answer: Swift 3.0/4.0
If you have created your own custom cell you can change the selection color on awakeFromNib() for all of the cells:
 override func awakeFromNib() {
    super.awakeFromNib()

    let colorView = UIView()
    colorView.backgroundColor = UIColor.orange.withAlphaComponent(0.4)

    self.selectedBackgroundView = colorView

}

Answer: 1- Add a view to the content view of your cell.
2- Right click your cell.
3- Make the added view as "selectedBackgroundView"
Comment: You can add a new `UIView` to the `UI(Table)ViewController` without adding it to the view hierarchy by dragging it to the bar above the controller in Interface Designer. Then you can do the trick above to set it as `selectedBackgroundView` of the cells.
Answer: Swift 5
Another solution is to just override the set selected method on your UITableViewCell.
override func setSelected(_ selected: Bool, animated: Bool) {
    super.setSelected(selected, animated: animated)

    // Configure the view for the selected state
    let selectionView = UIView()
    selectionView.backgroundColor = UIColor.green
    // selectionView.alpha = 0.3 // optional if you want to tone down a colour
    self.selectedBackgroundView = selectionView
}

Note: Works in Mac Catalyst.


A/c makes the lights turn on and off! No Joke!

Question: The lights on the first floor, upstairs bathroom and upstairs Laundry room won't work.
The breakers did NOT pop
The air conditioning was running this morning but is not working now.
When the thermostat turns the air off those lights turn off, but when the Tstat turns the air on, the lights come back on but they are slightly dim.
I have to let the Tstat think the air is on and let it run the furnace fan constantly. If I turn the A/c off, either at the breaker or the main line at the A/C unit, all of the lights downstairs turn off...no the breakers do not pop but some of the GFI's pop. The compressor on the A/C is not working (no real air conditioning)
I am in the USA. The The A/C is in the upper left of the panel, and most of the affected rooms are on the right side of the panel. The problem affects all but the last couple of breakers on the right side.
The dryer, in the laundry room sounds like it isnt getting enough power and wont completely start.
When I run the garbage disposal, all of the affected lights dim considerably.
Comment: You should contact a local licensed Electrician. This dies not sound like a DIY job.
Comment: Are the light switches in the on, or off position?
Comment: Are the lights that go off CFL's?
Comment: The lights don't work in the on or off position. I have assorted types of light bulbs, some are CFLs. I have modified my inquiry and added some more facts.
Answer: Well, you guys are absolutely brilliant. The problem is nearly fixed. I had comEd come out do just what you said. It turns out that one of the phases coming into the house is bad! So everyone was spot on...the AC was operating at 120 and feeding the rest of the house when it was "on". Half the panel was out because of the bad phase.
The "boys in red" at ComEd put a jumper at the service box as a band aid. This solved all of the issues. They are coming back out to rip up the yard and replace the main feed to the house.
I couldn't be happier.
Thanks for your comments and feedback,
Answer: I sounds like the problem might be that the right side of your service panel either isn't connected to the main at all or has a really bad connection.  I'm guessing what is happening is that when the A/C is "on", it is back feeding the right side of your panel through the breaker. This could also explain why your A/C compressor isn't working - it would be getting a 120v feed instead of a 240v feed.
This is something that would require testing the voltage at the mains in the box, and as @Tester101 pointed out in his first comment, fixing this isn't a DIY job.  Cut the breaker to the A/C in the main service panel to keep this from doing any damage (I'm thinking electronics around the house), and get an electrician out there before you turn it back on.
Answer: Which country, Michael? USA, by any chance, judging from your jargon? If so... I think you may have a grounding issue at the panel or at the line coming in from the pole. I've seen similar issues, and issues with lights burning EXTREMELY brightly for a short while before they burn out, from just such grounding issues.
Especially if the AC and the 1st-floor lights are served by breakers near the bottom of the panel, or from a separate subpanel... in the former case, the grounding problem may be inside the panel itself. In the latter case, it may be in the subpanel or the wiring leading to it.
Comment: I could see a floating neutral causing the voltage to fluctuate wildly, but I'm not sure how it could make lights turn on/off if the switch was in the off position. I also don't understand how the position of the breaker in the panel would make any difference.
Comment: If the A/C is off...the affected lights don't work. Also, if the breaker is off, same thing...no lights. I am thinking that the A/C possibly shorted out one of the two main feeds to the panel.
Comment: If I had a grounding issue at the pole, wouldnt that affect all of my lights?
Comment: Not necessarily, not if the power balancing at your breaker panel is coincidentally pretty "level". It's possible that a (USA) breaker panel could function perfectly well totally ungrounded with no visible indication, if its load balancing happened to be level or very near level.


Can I power my neon sign transformer with a higher frequency?

Question: My neon sign transformer (NST) input says 120 volts 60 hertz. Its output is 15 KV, 30 mA, 60 hertz. I was wondering if I could get a light ballast which I've seen drive fly back transformers at 30 kilohertz. Can I get one of those to drive my NST? I'm really wanting the high frequency instead of the 60 hertz. Would it work or not work?
Comment: Probably the inductance will prevent any significant current from flowing.
Answer: Your existing 60 Hz Neon Sign Transformer (NST) must be fed from a low frequency of approximately 60 Hz.
A lower frequency will reduce the voltage handling, as the core has a constant Vs. You could run it at 50 Hz for instance with a corresponding proportionate de-rating of the voltage.
A higher frequency will increase the core losses, and increase the voltage rating of the magnetics, though not of course the insulation, so there's a limit to how much increase would be useful. If you had a suitable inverter, you could maybe run it up to 100 Hz with a corresponding increase in core heating, and probably not too much effect on the magnetic efficiency. Going all the way to up 400 Hz, a common aircraft frequency used to reduce the amount of iron carried on an aircraft, would probably not work as 400 Hz transformers are built with much thinner laminations than 50/60 Hz transformers.
Going up to 30 kHz would be completely infeasible. You would be better off building a ferrite-cored transformer to be driven by your inverter.
Answer: A mains frequency transformer uses an iron core of high permeability for achieving high magnetic flux in response to the exciting current.  The high magnetic flux is what makes reasonable energy transfer through a changing magnetic field possible.  There are remagnetisation losses with every polarity change: the core is dimensioned in a way where those losses are comparatively insignificant regarding the operating efficiency and related heat-up of the transformer.
Increasing the operating frequency by a factor of 500 is not going to do your core any favors.  Something will die comparatively fast from the developing temperatures.  Power transformers are designed for a narrow range of operating frequencies.
Answer: No.  The frequency response of such a transformer is quite low; disclaimer, I haven't measured one myself, but I would assume it hardly extends into audio frequencies, a few 100 Hz perhaps.
The limitation is due to the design of the transformer, and its high ratio.
The design uses magnetic shunts to increase leakage inductance.  This reduces output voltage some, but importantly limits output current under short circuit conditions.  This is necessary because, before the neon tube is ignited, it requires a very high voltage to break down; and once ignited, its voltage drop is rather low (a few kV?), practically a short circuit in comparison.
The high turns ratio is needed to achieve enough open-circuit voltage, and doubly so for the voltage lost due to the use of magnetic shunts.  So the secondary might tens of thousands of turns.  This is a lot of wire, and anywhere two wires lay adjacent there is capacitance; so there is a lot of capacitance as well.  The combination of leakage inductance and secondary capacitance creates a low-pass filter, and this likely rolls off at some 100s of Hz, maybe kHz at most.  (I have measured standard power transformers: the kind with the primary and secondary "bank" wound side-by-side on a bobbin, but no magnetic shunts between them, typically have a cutoff of some ~10kHz.  Microwave oven transformers are designed somewhat inbetween, with magnetic shunts, but not enough for full short-circuit current limiting; they have a cutoff around ~4kHz.)
To generate high voltages at ~30kHz, not only are much tighter transformer designs required (for lower leakage inductance and stray capacitance), but the bandwidth is still not very wide, typically requiring resonant operation.  A random lamp ballast circuit will likely not be suited to such a task.  Basically, solutions converge on a Tesla coil style of design, above some, to 10s of, kHz.
Answer: 20kHz NST are common and becoming the new industry standard. Much easier to use.  I don't know if any issues develop if you jump to 30kHz.  Searching online for 20kHz neon sign transformer will yield many results.
Comment: No, your on-board transformer must be fed by mains frequency and mains AC voltage.
Comment: Yeah I already own a 60 hertz NST.  I just plug it into the wall socket. Now I'm wondering if I can get a high frequency ballast to drive my NST or will it not work and something go wrong?


How many entries for a given category?

Question: Given a category (not the category group), is there a way to get the count entries assigned to that category? I'm hoping for a native EE solution. This seems to suggest that there isn't one: Anyone know of a plugin to show Category count?. Can I do this in EE only?
Comment: If you have received the answer to your question please choose your desired answer.
Answer: Here is a plugin that will give you the desired result you need without a custom query.
http://devot-ee.com/add-ons/entries-number
Answer: I think the simplest and quickest solution if no one wrote a plug-in already would be:
<code>{exp:query sql="SELECT COUNT(entry_id) AS cat_count FROM exp_category_posts WHERE cat_id=1"}{cat_count}{/exp:query}
</code>
Note: Untested.
Obviously replace the cat_id value with the category ID you want to count entries for. :)
If you don't have the category ID in the URL, but have its category_url_title:
<code>SELECT COUNT(entry_id) AS cat_count
FROM exp_category_posts AS cp
JOIN exp_categories AS c ON cp.cat_id = c.cat_id
WHERE c.cat_url_title = "{segment_X}"
</code>

How many entries for a given category?


Estimating number of balls by successively selecting a ball and marking it

Question: Lets say I have N balls in a bag.  On my first draw, I mark the ball and replace it in the bag.  On my second draw, if I pick up a marked ball I return it to the bag.  If, however I pick up a non-marked ball then I mark it and return it to the bag.  I continue this for any number of draws. What is the expected number of balls in the bag given a number of draws and the marked/unmarked history of draws?
Comment: Possibly related: have you looked at the capture-recapture method to estimate population abundance? http://en.wikipedia.org/wiki/Mark_and_recapture
Comment: "Expected number" cannot be understood in its usual technical sense of an expected value, because there is no probability distribution for $N$. It sounds like you are asking for an *estimator* of $N$.
Answer: Here is an idea. Let $\mathcal{I}$ be a finite subset of the natural numbers which will serve as the possible values for $N$. Suppose we have a prior distribution over $\mathcal{I}$. Fix a non-random positive integer $M$. Let $k$ be the random variable denoting the number of times we mark a ball in $M$ draws from the bag. The goal is to find $E(N|k)$. This will be function of $M,k$ and the prior.
By Bayes rule we have
$$
\begin{align}
P(N=j|k) &= \frac{P(k|N=j)P(N=j)}{P(k)}\\
&= \frac{P(k|N=j)P(N=j)}{\sum_{r \in \mathcal{I}} P(k|N=r)P(N=r)}
\end{align}
$$
Computing $P(k|N=j)$ is a known calculation which is a variant on the coupon collectors problem. $P(k|N=j)$ is the probability that we observe $k$ distinct coupons in $M$ draws when there are $j$ coupons in total. See here for an argument for
$$
P(k|N=j) = \frac{\binom{j}{k}k!S(M,k)}{j^M}
$$
where $S$ denotes a stirling number of the second kind. We can then calculate
$$
E(N|k) = \sum_{j \in \mathcal{I}}jP(N=j|k)
$$
Below are some calculations for various $k$ and $M$. In each case we use a uniform prior on $[k,10k]$
\begin{array}{|c|c|c|}
\hline
M & k & E(N)\\\hline
10 & 5 & 7.99 \\
15 & 5 & 5.60 \\
15 & 10 & 23.69\\
30 & 15 & 20.00\\
30 & 20 & 39.53 \\
\hline
\end{array}


Packet loss rate with iperf and tcpdump

Question: I tested a line for its link quality with iperf. The measured speed (UDP port 9005) was 96Mbps, which is fine, because both servers are connected with 100Mbps to the internet. On the other hand the datagram loss rate was shown to be 3.3-3.7%, which I found a little too much. Using a high-speed transfer protocol I recorded the packets on both sides with tcpdump. Than I calculated the packet loss - average 0.25%. Have anyone an explanation, where this big difference may be coming from? What is an acceptable packet loss in your opinion?
Comment: Wireshark will use the same backend as tcpdump to capture packets, so it won't provide different results (libpcap or winpcap, depending on the platform).
Comment: Can you measure packet loss with `tcpdump` during `iperf` session? It is more proper estimate, than yours.
Second monitor the server status during testing - may be it simply drops packets?
Comment: Which protocol did you use when sniffing with tcpdump?
Was a tcp or udp?
Comment: I used udp for both tests.
Comment: Uhm...could you try with another packet sniffer?
Comment: Which one would you recommend?
Comment: Once i was using one that now i don't remember, can you use wireshark?
Comment: @Lexsys that's a good idea! Haven't tried that out.
Answer: I've experienced significant dataloss with iPerf in UDP mode as a result of the CPU not being able to keep up. For some reason, iPerf with UDP seems to be much more CPU intensive than iPerf with TCP. Do you experience the same loss percentages when you set iPerf to half the rate?
To answer your second question about how much packet loss is acceptable, it really depends on what application you are running, how much traffic you've got. Really, there shouldn't be any loss if you are under your bandwidth limit. For most things, I probably wouldn't complain too much about .25%, but that is still a lot of loss if you are running at really high rates.
[EDIT 1] Some other thoughts that I've had on the topic:

Try incrementing the rates of iPerf. If there is a systemic problem somewhere, it is likely that you'll experience the same percentage of loss no matter what the rate. If you are at the limits of your hardware, or your provider does some sort of RED, then there will likely be no loss up to a certain rate, and then incrementally worse loss the higher above that you go.
Do your tcpdump measurement of the iPerf session, just to verify that your tests are accurate.
Try iPerf with TCP. This won't report loss, but if you are getting loss then the connection won't be able to scale up very high. Since latency will also affect this, make sure to test to an endpoint with as little latency as possible.
Depending on what gear you have on the inside of your connection, make sure you are as close it it as possible. E.g. if you have multiple switches between your test system and the edge router, move to a directly connected switch.
If you have a managed switch, check the stats on it to make sure the loss isn't occurring there. I've encountered some cheaper switches that start dropping when you get close to 100Mbps of UDP traffic on them (mostly old and cheap unmanaged switches though).
Try simultaneous iPerfs from two different clients to two different hosts, so that you can be sure the limit isn't a result of CPU or a cheap local NIC card.
Comment: That could be a good reason. Unfortunately I cant test right now, because of firewall problems. I'll get back to your answer as soon as I performed a new test.
Answer: Well, with TCP there are mechanisms to maximize the utilization of one flow, with UDP there aren't. So each application have to create their own mechanisms, so probably each application use a different approach to do that. Probably, Iperf will allow more packets lost because is trying to reach the maximum available bandwidth with out care about if the information is received or not. The other application probably will try to not lost many packets, and will reduce the packet rate to the available throughput in the connection.
Answer: Have you used tcpdump to check the packet loss when using iPerf to make sure the packet loss you calculate with tcpdump matches iperf?
You may discover that your measurement methods are not comparable.
Answer: does iperf automatically discard packets that arrive out of sequence with UDP? You might be looking at a little bit of jitter on the connection.

Packet loss rate with iperf and tcpdump