Are un-dimensioned orthographic views permitted on a standard drawing?

Question: If I remember correctly, best practice on a drawing is if you fully dimension a part in two out of three orthographic views you don't include a third view with no dimensions. Is this a documented standard, best practice, or not true at all?
An example would be a sheet metal rectangle with a hole. The front and side views would include all the necessary dimensions, leaving a top view with no dimensions. Should that top view be included?
Comment: This is [an example of a sheet metal single view part](https://engineering.stackexchange.com/questions/48153/are-these-cut-lines) from the 1944 in Germany.  There is a note that states "0.8 dick" which translates to 0.8 thick.  And [here is one with just two views](https://engineering.stackexchange.com/questions/48056/concentric-circles-section-breakout-confusion).  I am from a structural background not mechanical, and standards have changed since the 1940s so take it is a few grains of salt.
Answer: My understanding is that redundancy and/or views that are not repeated should not be present in the a drawing. To put it another way: include only the necessary bits to have a complete picture.
So, dimensions that can be derived from other dimensions are discouraged. Having said that there are exceptions where some redundant dimensions/views might be useful and they are included in the drawing.
I can't really comment to whether its in a  standard (there are a few), but its generally considered good practice and encouraged.

Regarding your example with the sheet metal, in one of the two orthonormal view the thickness of the sheet can be seen in one of the views. Also, in most cases you should be able to provide the hole depths in a well placed section view. So normally you don't need all three view.
In my experience, when giving out drawing for plasma/laser/hydro cutting of metal sheets only one view is provided (because through holes are assumed and the thickness is provided in the legend of the drawing).
Answer: Regarding the issue of repeat dimensions, at least for machine drawings as opposed to structural, reference dimensions (either in parentheses, or indicated like "12.34 REF") could be an option, to clarify that it shouldn't be interpreted e.g. with the default tolerance based on number of digits... both ASME Y14.5 and the counterpart ISO standards have this meaning for parentheses.
Regarding undimensioned orthographic views - For a "2D" part, including any sheetmetal without bends, I would say no. More generally, use your judgment case by case. Does it clarify, or confuse? Does having the extra view help relate the projected views in a more intuitive way? Where I work the mech designer always shows a (typically undimensioned) isometric view, so that might take away the need.
Answer: For your example:
The top view of the sheet metal (with "t" stated) will show all necessary information for fabrication. So, it can be a complete drawing by itself for documentation purposes. But, you need two side views to deliver the complete messages, with or without the top view.
There are controversies on whether no-redundant dimensioning or dimension-it-all is the better method. My personal view is it depends on the complexity of the work. It seems adequate and better for the drawing of mechanical parts not to provide the redundant dimensions to prevent conflicts, especially when changes require re-dimensioning. However, for a civil-structural or architectural project that contains numerous drawings, it is sometimes can be considered unfriendly to the users, who have to browse through multiple drawings just to find the information.
So, is there a standard industrial-wide drafting standard/rule? I don't think so. If in doubt, check with your boss, as it may vary from company to company, or job to job.
Answer: I think clarity is more important than following an arbitrary standard.
If the part is complicated, it may help to include a shaded 3d view. If it's not dimensioned, and everything is generated from a cad program (eliminating the possibility of inconsistencies between the views), then it can't hurt. You can even add a label: "for reference only, refer to orthographic views for dimensions"
At big companies the lawyers may get involved leading to rules for purpose of accountability, but in the absence of that your goal is to create a drawing which is easy to read, and which results in a part made consistently and correctly, that's what matters.
Answer: There is no reason why you can not add more views. But you should take care to minimize confusion. Adding a nondimensioned view can be neccesery to clarify some things.
It can be useful but you also have limited realestate on the sheet, more can be harder to read. Each projection requires the recipient to think more unless its clear they can skip the image. You also dont want to overwhelm the recipient with dimensions.
Remember that the technical drawing is often interpretted as a contractual obligation. For example in mechanical engineering typically your dimensioning scheme is interpretted as acceptance criteria. Therefore you dont want to over dimension as this might cause a conflict in your tolerance stackup. This could mean you need to accept parts that at worst are unusable for your purpose. Therefore extra dimensions should be made reference only.
The question of extra views is most probably not a problem if you are using a 3D application to generate them. The rule probably comes from cautioning that in hand drawing you might have a mistake that causes misinterpretation. The whole purpose of technical drawings is to disambiguate so you should avoid situations where you could cause issues. So it may not be worth the trouble.


Warp transform in GIMP doesn't work on first layer

Question: I was following a Youtube tutorial when suddenly the warp transform tool doesn't work. Specifically, it doesn't warp the first layer compared to other layers. How can I fix this?
Answer: There are a couple of possible problems. It's hard to tell precisely what's wrong without access to the XCF file or your setup of GIMP. But anyway, here are some things to check.

The warp tool only works on one layer at a time.  If you want to warp all layers simultaneously, you'd need to merge all the layers first.

If a layer has the pixel lock engaged, then you can't use the warp tool on it. Make sure the layer is unlocked.

If a layer above is hiding (covering over) a layer below, then you might not see anything happen when you use the warp tool on the layer below. Unhide the layer above before trying to warp the layer below.

If you have floating selection (check your layers panel), often the result of copying and pasting an image, then you can only warp the floating selection. You won't be able to select another layer for warping until you have either anchored the floating selection, or have promoted it to a layer of its own.

Check the Tool Options for the Warp tool. It's possible you may have accidentally changed a setting preventing the tool from working properly.

It should look something like this shown below. Maybe also try clicking the tiny menu icon at the top right, and choose Tool Options Menu > Reset Tool Options if you can't work out what you might have changed.


Any examples of life forms on Earth that could have survived on Mars or Moon?

Question: Do we know of any living forms on Earth that could continue to live on Mars?
Comment: Under the current conditions and without an athmosphere? Hardly imaginable.
Comment: Yes, under current conditions and without an atmosphere.
Answer: Yes, research studies that were conducted have found that methanogens (microorganisms) are able to survive in conditions similar to Mars (reference). Another study conducted has also concluded that some lichen and cyanobacteria is also capable of survival.  Surprisingly, they were also found to be active (reference).
There is speculation now on whether organisms from earth have been accidentally transported to Mars on the Mars Curiosity Rover which would be funny or a cause of concern, depending on how you look at it (reference).
Comment: Interestingly, methanogenes are even more useful for terraforming Mars than plants, because they accelerate greenhouse effect.


Get deleted user information from sharepoint

Question: Is there a way to get a user name of the user deleted from sharepoint? I have the id of the deleted user. I need this since I want to present a more user friendly information taken from the audit logs. There I have only the id of the user.
Answer: You should be able to find the information in the content database (the UserInfo table), I'm not sure wether you can get it from the object model though.
Remember Microsoft does not recommend directly querying the database though...


Balanced randomization within clusters

Question: I was hoping someone could point me in the right direction on a randomization method. We want to randomize teachers to receive an educational intervention. The catch is that we have a number of schools and these schools are very different in terms of various socioeconomic factors so we don't want to end up in a situation where all (or nearly all) of the teachers in a given school are randomized to the same intervention (the number of teachers per school is fairly small so this is a possibility). Can someone point me in the direction of a randomization procedure that will result in a near 50/50 split within each school?
Thank you
Answer: Assuming you have one treatment, a simple way to do this would be:

Pick a school
Randomly pick 50% of teachers in that school
Assign those 50% to treatment, and the rest to no-treatment
Repeat for each school

This will assign 50% of all teachers and in each school to treament and 50% to no-treatment

Balanced randomization within clusters


How to verify the following case in JUNIT / Mockito

Question:  public void doFoo(int x, int y, String url) {
    JSONObject json = new JSONObject().put("z", x + y);
     try (final HttpUtility httpUtils = new HttpUtility()) {
          httpUtils.doAuthPutJson(url,json);
      }
}

I want to verify that input to HTTPUtlity. How do I write unit tests for this ?
Answer: Actually the current class and HttpUtility are strongly coupled in the method.
If you consider that HttpUtility is a dependency that you want to be able to mock, you have to use it in a way that allows to set the dependency.
But as actually you have no way to naturally set the HttpUtility dependency  in the current class, you think that PowerMockito will solve your issue.
But in fact it will not.
It will just hide the design issue.
With just some little changes, you can have a more clear design and mock HTTPUtlity instantiation  in a natural and straight way.
To achieve it, I would extract the HttpUtility instantiation as a processing performed by a dependency.
I could so get a code such as :
public class Foo{

   private Supplier<HttpUtility> httpUtilitySupplier;

   public Foo(Supplier<HttpUtility> httpUtilitySupplier){
      this.httpUtilitySupplier = httpUtilitySupplier;
   }

   public void doFoo(int x, int y, String url) {
     JSONObject json = new JSONObject().put("z", x + y);
     try (final HttpUtility httpUtils = httpUtilitySupplier.get()) {
          httpUtils.doAuthPutJson(url,json);
      }
   }
}

Note that I use a constructor to set the dependency as it allows to set an invariant about it but if required a setter could be also used.
Now you can easily check that HttpUtility.doAuthPutJson() is invoked with the expected arguments in your test :
@RunWith(MockitoJUnitRunner.class)
public class FooTest {

    @Mock
    private HttpUtility httpUtilityMock;

    @Test
    public void testName() throws Exception {
        // fixture
        Foo foo = new Foo( () -> httpUtilityMock);
        int x = ...;
        int y = ...;
        String url = ...;

        // action
        foo.doFoo(x, y, url);

        // assertion
        JSONObject expectedJSONObject = ...;
        Mockito.verify(httpUtilityMock).doAuthPutJson(url, expectedJSONObject);
    }
}


Private nameservers and DNS records

Question: I just transferred an existing domain from one registrar to another. It has had private name servers with dnsmadeeasy.com for a long time. At the new registrar, they have the correct nameservers listed as it transferred over, but they prepopulated the DNS Records with their own info. Do I need to change the DNS info to match what I have at dnsmadeeasy or does it not matter. The only change we wanted was to move the domain from one registrar to another...all the DNS records should stay the same.
Answer: It would be easier to check if you advised the domain name, but in the general case, where the nameservers registered with the registrar are not the registrars nameservers any [non NS ] domain records they might have are ignored.  Of-course, the nameservers you are pointing to need to be set up with the appropriate records.
[ I know that Crazy Domains/Dreamscape networks has a list of domain records for domains I manage which I safely ignore as I point DNS for my clients to my own nameservers - I posit many other registrars are similar ]
Comment: Hey thanks for taking the time to answer this. Private name servers are a thing,, just google that. I'm not confusing private domain registration. or anything, the question really is....If I have my nameservers at a place that is different than the registrar, does the DNS info that the registrar prepopulates...matter at all...as that info is NOT the info at the nameservers.
Comment: Private nameservers give you DNS servers under your own domain name.  They require glue records created at the registrar.
Comment: @StephenOstermiller Thanks for that. That term did not exist when I was learning about them.  To me a "private nameserver" is simply a public facing authorative server (a private nameserver would be one with zones only available on a local network/intranet!)

Private nameservers and DNS records


Antenna Size limits at 2-30 MHz (10 m to 150 m wavelength)

Question: I am interested to know what are the smallest antenna sizes that are efficient transmitters for skywave propagation/ham radio applications. Has anyone been able to design a transmit antenna to work in the entire range of 2-30 MHz with the antenna size of 5-10 m or even lower?
Answer: You first need to define "efficient" :)
For narrow band antennas the Chu Harrington limit gives the maximum possible efficiency and bandwidth of an antenna. See the wikipedia article and its references for some details and graphs. There are lots of compact amateur antennas, say for HF on a vehicle, which have low efficiency because of this.
If you want to cover the entire HF band simultaneously without adjusting the antenna or tuning network, there are several travelling wave antenna designs that do this. None of them are compact. All of these have some loss but give fairly good efficiency over the band. Look at

A beverage travelling wave antenna (many wavelengths long)
a rhombic or V antenna (at least a wavelength long)
a travelling wave dipole (at least half wave long)

A large conical monopole could work over the whole band, but it needs to be a full quarter-wave tall which is impractical for most hams at 2 MHz.
Moving up in price, there are various log-periodic structures that can give quite wide band coverage and good efficiency. The LPDA is about half a wave wide at the back and about 1 wavelength long, it needs to be half a wavelength off the ground. The monopole version stands nearly a quarter wave tall.
To answer your question:
For a full-band no-tuning transmitting antenna the best you could do would probably be a monopole or dipole, as fat as possible, with a 4:1 transformer and 400 ohm resistor load at the feed point. The efficiency of this would be ~50% from 15-30 MHz, dropping to maybe 0.1% at 2 MHz. Whether this is good enough is up to you.
Here's a real product example:
The DIPL-A0035 is 6 m long, resistor loaded (but no transformer) and has a gain of -10 dBi at 20 MHz (10% efficiency), dropping at about 10 dB per octave. From an antenna twice as big, at 2 MHz, you can expect about -40 dBi or 0.01% efficiency. A transformer will help a bit.
Answer: Short answer: no.
Long answer: there are compact HF antennas, but they're not efficient.  However they are practical enough for some applications.  Any ground-plane antenna smaller than a quarter-wavelength (λ/4) or non-ground-plane antenna smaller than a half-wavelength (λ/2) will be less efficient than a "full-size" antenna.  The smaller the antenna gets, the worse the efficiency gets.  Lots of small HF antenna designs exist; they are all compromises (OK, any product design is a compromise).  For some situations, the compromises are worthwhile.
For those who would like to get on HF but are severely space-constrained, I can think of a couple antenna designs that might be worthy of consideration.  There are several multi-band vertical antennas on the market that are about 8.2 m (27 feet) high.  Typically the bandwidth of such an antenna, meaning the range of frequencies where the SWR is less than 2:1, doesn't cover the entire 40m or 80m bands.  For those who have transmatches (antenna tuners), a transmatch will allow more bandwidth.  The bandwidth of my HF6V on 80m is quite narrow, 50 kHz at most IIRC, but it works OK inside that narrow range.
Vertical antennas mounted on typical soil, rocks, or pavement require radials; the rule of thumb is at least 16 radials at least λ/4 long.  More radials are better, and longer radials are better.  If the radials are shorter, the performance of the antenna is compromised.  If the radials are longer or shorter in one direction than others, then the performance of the antenna radiating in that direction will be better or worse.
The other type of antenna I'll mention is a magnetic loop antenna.  As the size of an antenna decreases, its radiation resistance decreases also; if the resistance of the magnetic loop antenna is carefully managed to make the resistance as low as possible, then the transmit efficiency of a magnetic loop antenna can be tolerable.  Small magnetic loop antennas must be tuned with a capacitor, and the smaller the loop gets, the more finicky the antenna is to tune.  I've heard that magnetic loop antennas can be difficult to work with, and that they like to cause RFI problems in nearby equipment, but for some situations, they are worthwhile.  Beware of marketing claims though.
I suppose I should mention "screwdriver" antennas also.  These are compact HF vertical antennas that are meant to be mounted on vehicles.  They have large loading coils; the larger the coil the better the efficiency, generally speaking.  But since the ground plane of a vehicle-mounted vertical is the size of the vehicle, which is often much smaller than a quarter-wavelength, the transmit efficiency of such an antenna is often quite poor, but any antenna can be better than no antenna, so people buy them.  The loading coil is usually tuned remotely using an electric motor; one of the first models allegedly used the same motor as a motorized screwdriver, which is how they got their nickname.  Other compact vertical antennas are on the market for people who like backpacking with QRP radios and who can't or won't erect temporary wire antennas hung on trees.


due to technical reasons or for technical reasons

Question: Please suggest me what is the right or the most natural case of using phrases "due to technical reasons" and "for technical reasons"?
Answer: I believe that it's a formal situation. So due to seems more appropriate for such situation.
Service providers use this beginning of tense for notices of technical problems with their services.
Like this:

Due to some technical issues, we are going to reschedule today's Google Hangout for the near future. We sincerely apologize for any inconvenience and will be posting updates here as to the new date and time for the Hangout. Please stay tuned!

Taken from this Facebook post from a bank.
Comment: Thank's for explanation!
Answer: Why would you want to use 'due to' when 'for' works perfectly well?
@ivanleoncz correctly identifies such a usage with 'service providers' and gives an example from a bank. It is 'management-speak': language used, especially in corporate communications to make the writer sound more important (than they really are).
There is seldom, if ever, any good reason to prefer 'due to' when you could say 'for'.
Comment: Thank's for explanation!


Display (render) huge xml file

Question: I've found a bunch of programs that can edit huge XML files, but not render them. I've tried Firefox and Opera, both crash. Any ideas? The filesize is about 75 MB. By render I mean how it looks like in a browser, not the source code. Just like HTML code "transforms" into a web page.
Comment: What do you exactly mean by rendering? Does it have to include xml schema and transformation so you get an actual designed dataset out of your file?
Edit: Also, what kind of filesize are we talking about? Edit2: And please update your question with answers to this comment :)
Answer: If you want the xml to be displayed, just wrap the xml in xmp tags and put it in the body of the html page.
If you want to edit, xmlspy or oxygen can help you. Both have free trials.
Comment: I tried to just open the xml file (becuase firefox should display the file correctly) but it crashes. I won't help if I open it as a html file

Display (render) huge xml file


Difference (if any) between legato scale technique on acoustic vs. electric?

Question: Are there any differences between legato scale technique on acoustic guitar, and how it is explained in this video for electric guitar?
Answer: I don't think there is any more difference between an electric and an acoustic guitar for hammer-on/pull-offs, than there is between two different acoustics, or two different electrics.
The action, the string guage, thus the string tension, all affect exactly how h/o and p/o are executed: some guitars will need a harder h/o and a stronger p/o, others lend themselves to the opposite. Low action with thinner strings is probably the best combination - which could occur on any guitar. Having said that, acoustics often come equipped with heavier strings and higher action - but some players prefer that on electrics anyway.


Can I ask potential advisor what topics he is currently most interested in?

Question: Can I ask potential advisor what topics he is currently most interested in? I am looking for a topic at the moment, so I'm still searching, and there is one advisor who I'd like to work with. His general topic is also what I want to do in my PhD, but I don't know yet what the exact topic might be. I thought of asking him what he is most interested in at the moment, and see if there might be a fit, or will this shine a bad light on me and my interests?
Comment: Maybe take a look at his website and some of his most recent papers before asking. These should give you a clear idea of his current research interests.
Answer: You could ask, but it would be much better to arm yourself with knowledge to facilitate asking a better question.  Do your homework and search for his recent publication record, and find and read the recent results.
So yes, asking "what are you doing now" will reflect somewhat badly on you.  Saying "I'm aware of all your published work, and wonder if you are looking into any new directions that aren't published yet" sounds (and is!) much better


Comparing user flows for products

Question: I am challenged with presenting 2+ applications & their user flows to my product partners as a bird's eye view. Some of the steps will be common & some unique to these products. The purpose is to highlight a common step- user validation that occurs across a few applications but at different points during the experience. Any suggestions on an elegant way to solve this? Here's a quick & dirty visual i came up with. Any thoughts on this representation will be helpful
Comment: I think your example is good. It's simple and highlights the gaps well. What problems do you see with it? What more do you need to show?
Answer: It's a good presentation idea. I would add more details into the flow such as: what devices will be used, what is the environment, perhaps some sketches of the user (storyboard). Basically, more context that allows stakeholders to empathize and understand the user better.

Comparing user flows for products


Where to find out the correct values of AOA of Boeing 737 during different phases of flight?

Question: We can say that practically there are minor differences in AOA for each flight (in the same range of weight). But is there any document that states what flight angle is recommended for each of the flight phases? (takeoff, climb, cruise, descent, and approach)
Comment: Boeing began offering (as an option) an independent AOA indicator on its B737-600 and later models. The article in the link below from a Boeing publication explains the limitations of the AOA indicator's usefulness during normal operations versus using Indicated Airspeed/Mach as appropriate references for takeoff/climb/cruise/approach. Probably does not answer your specific question, but it should provide some insight into the use of an AOA vs indicated/Mach for aircraft performance. https://www.boeing.com/commercial/aeromagazine/aero_12/aoa.pdf
Comment: I don't believe these differences are "minor."  A transport-size plane has to operate over a range of weights, and a moving location of CG, that is well beyond anything that can be expressed in a typical POH "table."  150 KIAS at 90,000 lbs will result in a very different AOA than 150 KIAS at 145,000 lbs.  The dispatcher or the crew will calculate specific Vref's for various stages of flight, and would be using these speeds, and *not* AOA, to optimize performance during normal operations.  The crew may know what the limiting AOA is, but would not know or calculate an "optimum" recommended AOA.
Comment: You are right Max, there can be major changes in the AOA depending on the weight...I will edit the post
Answer: There's no such thing as "recommended angle of attack".
The angle of attack affects the amount of lift generated by the wing. In level flight, the lift of the wing must exactly equal the weight of the plane, so the pilot is just going to fly at whatever AoA gives that amount of lift.
The amount of lift is also affected by the speed at which the airplane flies. So, if the plane speeds up or slows down, the pilot must adjust the AoA to maintain altitude.
There are also things entirely outside the pilot's control that can change the AoA. For instance, updrafts and downdrafts change the direction of the relative wind, which (momentarily) affects AoA.
Answer: Given that is not possible to give proper generic flight angles (it depends on a lot of parameters), I suggest you to have a look to this site. For example you can have a look to the pilot's notes section. Here you can find different notes i.e you can retreive information of the AoA and aerodynamic configurations used in different phases of the flight (e.g here you can find infos about the landing).
Answer: Normally, in commercial aviation crew operate their aircraft based on speeds and thrust settings. The angle of attack (AOA) that is required for each speed/thrust combination and phase of flight will then be attained by flying the correct speed and thrust setting. As there is no AOA instrument on many (most!) aircraft, this is the normal mode of operation. The speeds which are "recommended" (read: required) for each of these phases of flight are given - or at least roughly explained - in the aircraft manuals, from memory you will have a performance section in the Flight Crew Operating Manual (FCOM) and the Quick Reference Handbook (QRH) for normal and non-normal operations. Some operators elect to publish climb angle data (not: AOA!) for their aircraft in the manuals, and there will be tables for body angle/pitch angle (not: AOA, but at least closer) in the QRH to use as a reference in case the speed indicator fails.
For flying the aircraft, that is all that is required, and the angles are more or less a result of controlling speed and thrust.
If you're really after more detailed data for aerodynamics and flight physics modelling, what you get in the QRH for pitch/power tables may serve as a rough indication for the AOA for various conditions, but it's rounded to whatever crew will be able to read on the instruments and is thus not sufficiently precise for meaningful calculations. More detailed data is only available to aircraft operators and their aircraft performance experts. For example, Boeing used to issue a Performance Engineer's Handbook for their aircraft, which contained more detailed data on aerodynamics and engines. However, these reference books are not publicly available, as from the data you could directly derive information on aircraft performance characteristics which one would rather not share with the competitors.
My favourite book to approximate aero models for real life aircraft, by the way, is Obert's Aerodynamic Design of Transport Aircraft.
Comment: I have bought the recommended book, and it is brilliant: simple, and straightforward with crucial information.  Thank you.


Phrase for action "testing and correcting"

Question: What is a phrase to indicate the action testing and correcting? For example, imagine a situation in which you don't know what you should do exactly and step by step you change things and see the results.
Answer: It's called trial and error.
Answer: Some related terms:

cut and try - "marked by trial and error; cut–and–try methods, cut–and–try testing.  First Known Use 1903."
hill climbing - "...starts with an arbitrary solution to a problem, then attempts to find a better solution by incrementally changing [elements] of the solution. If the change produces a better solution, an incremental change is made to the new solution..." Note, gradient methods are related to hill climbing.
kaizen, a continual1 improvement process, via a Plan - Do - Check - Act cycle, somewhat like using a series of small testing-and-correcting steps.

Note 1: wikipedia indicates continual is preferred to continuous here.
Answer: In Programming it is reffered to as debugging

de·bug  (d-bg)
tr.v. de·bugged, de·bug·ging, de·bugs

To search for and eliminate malfunctioning elements or errors in: debug a spacecraft before launch; debug a computer program.


Scripts not appearing in cc.phtml or ccsaved.phtml

Question: I have been trying for days to get the credit forms (anyone of them!) to auto detect credit card type. I found some scripts that work fine until i try to add them to the credit card templates. Then the scripts disappear or don't show up in the template. The css and anything else I add to the templates show up in the source or if I look at the in Chrome "Inspect" but not any scripts.So I tried adding them to parts of the page above and below the credit card templates but can't get that to work either. How can I get the scripts to show up in the templates and why don't they appear there? Is it a built in security feature?
Answer: What you are experiencing is the fact that the HTML is being injected via an XMLHttpRequest. The embedded scripts are being eval()'d as part of the resulting response. You will not see them in the DOM. (I don't recall the technical explanation for this, but google is your friend)
Refer to: http://api.prototypejs.org/language/String/prototype/evalScripts/
Without actually seeing your code, I cannot comment why your code is not available/working. As per the given link, it is possible your scope is wrong?
You can add a debugger statement in your script, and keep the chrome developer console open. If all is working, you should end up on a breakpoint in your eval()'d code.
You can also consider a different approach, keeping your javascript in a separate .js file.
Using the layout directives, you can load this when the initial onepage checkout loads using the following directives in some layout file.
<checkout_onepage_index translate="label">
        <reference name="head">
            <action method="addItem"><type>skin_js</type><name>js/your_file.js</name></action>
        </reference>
    </checkout_onepage_index>

This will load your script when checkout is loaded.
Another alternative, is to inject the given sript into the HEAD, via embedded code in your .phtml.
This will do the job:

The code above will inject your scripts file load into the HEAD when teh .phtml loads
Also check your console for ANY js errors. A leading error, from something else on teh page will most likely block further loading/eval action of the embedded code.
Hope that helps.


What happens with the bitcoin locked in the payment channel if both sides lose the backup?

Question: If none of the sides closes the channel, is the coin locked up forever?
Comment: I wish there would be something like "if no activity for n blocks auto-close". Maybe watchtowers could do it.
Answer: Tl;dr: also in lightning we have: not your keys, not your coins.
More detailed explanation:
I assume you mean with backup the private keys of the lightning node together with the history of the state data.
Then the same would happen as in the onchain case if you loose your keys. You could not move the coins anymore. Or in a onchain 2-2 multisig wallet (remember payment channels are just such a wallet together with some protocol how to spend from it) the same if you and the other person would loose their keys. None of you could move the btc anymore.
In lightning terminology this would mean that the channel stays open forever but no new states can be negotiated (meaning noone can route through that channel or use it to send / receive payments) and additionally the channel cannot be closed.
While this is a pity for you and your channel partner as in the onchain case it is also a pity for the network as other nodes still think the channel is active and will try to route payments over it.
Answer: From what I understand there are two types of backups. On-chain backups which store the keys of your on-chain funds that is on-chain channels and on-chain funds in the lightning implementation. This is the hsm_secret file in C-lightning. The other backup is the channel state which stores the commitment transaction state, the revocation keys etc. This is the lightning.sqlite3 file in C-lightning.
If you lose your backup from lightning.sqlite3 file, you have basically zero insight into what your current commitment state is within the active channels that you have. Your strategy should be to disconnect your node so that the other parties close the channels that they have with you unilaterally. However, since you have mentioned that your channel counterparty has also lost their backup, you cannot use this option.
Since both of you don't know what the current commitment state is and who is owed what amount, the best scenario that you have is to negotiate with your counterparty and make an on-chain transaction to close the channel. Since your and partner's hsm_secret file is safe you can make the on-chain transaction and recover the funds. You will need to derive the keys from the file but it will have to be done in a custom way as the implementations won't be able to handle this by itselves.
If you have lost your hsm_secret and lightning.sqlite3 file then there is no way to recover the funds. Since you have basically lost the keys for the on-chain funds, you have But this is being in the same boat as losing the wallet.dat file in Bitcoin Core.


UICollectionView inside a UITableViewCell -- dynamic height?

Question: One of our application screens requires us to place a UICollectionView inside of a UITableViewCell.  This UICollectionView will have a dynamic number of items, resulting in a height which must be calculated dynamically as well.  However, I am running into problems trying to calculate the height of the embedded UICollectionView.
Our overarching UIViewController was created in Storyboards and does make use of auto layout.  But, I don't know how to dynamically increase the height of the UITableViewCell based on the height of the UICollectionView.
Can anyone give some tips or advice on how to accomplish this?
Comment: The height of the UITableViewCell is supposed to be dynamic, based on the height of the UICollectionView that is part of the table view cell.  The layout of my UICollectionView is 4 columns and a dynamic number of rows.  So, with 100 items, I would have 4 columns and 25 rows in my UICollectionView.  The height of the particular cell -- as indicated by UITableView's heightForRowAtIndexPath -- needs to be able to adjust based on the size of that UICollectionView.  Is that a bit more clear?
Comment: can you tell a bit more about the layout you're trying to accomplish ? Is the height of the `UITableViewCell` different from its acutal tableview ? Do you need vertical scrolling on both the `UICollectionView` and the `UITableView`
Comment: @Shadowman , please suggest me a solution for this situation
Comment: I combined a few concepts that I've read about to achieve something similar. See my answer in https://stackoverflow.com/a/73262222/15027028
Answer: The right answer is YES, you CAN do this.
I came across this problem some weeks ago. It is actually easier than you may think. Put your cells into NIBs (or storyboards) and pin them to let auto layout do all the work
Given the following structure:

TableView

TableViewCell

CollectionView

CollectionViewCell
CollectionViewCell
CollectionViewCell
[...variable number of cells or different cell sizes]

The solution is to tell auto layout to compute first the collectionViewCell sizes, then the collection view contentSize, and use it as the size of your cell. This is the UIView method that "does the magic":
-(void)systemLayoutSizeFittingSize:(CGSize)targetSize
     withHorizontalFittingPriority:(UILayoutPriority)horizontalFittingPriority
           verticalFittingPriority:(UILayoutPriority)verticalFittingPriority

You have to set here the size of the TableViewCell, which in your case is the CollectionView's contentSize.
CollectionViewCell
At the CollectionViewCell you have to tell the cell to layout each time you change the model (e.g.: you set a UILabel with a text, then the cell has to be layout again).
- (void)bindWithModel:(id)model {
    // Do whatever you may need to bind with your data and
    // tell the collection view cell's contentView to resize
    [self.contentView setNeedsLayout];
}
// Other stuff here...

TableViewCell
The TableViewCell does the magic. It has an outlet to your collectionView, enables the auto layout for collectionView cells using estimatedItemSize of the UICollectionViewFlowLayout.
Then, the trick is to set your tableView cell's size at the systemLayoutSizeFittingSize... method. (NOTE: iOS8 or later)
NOTE: I tried to use the delegate cell's height method of the tableView -(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath.but it's too late for the auto layout system to compute the CollectionView contentSize and sometimes you may find wrong resized cells.
@implementation TableCell

- (void)awakeFromNib {
    [super awakeFromNib];
    UICollectionViewFlowLayout *flow = (UICollectionViewFlowLayout *)self.collectionView.collectionViewLayout;

    // Configure the collectionView
    flow.minimumInteritemSpacing = ...;

    // This enables the magic of auto layout.
    // Setting estimatedItemSize different to CGSizeZero
    // on flow Layout enables auto layout for collectionView cells.
    // https://developer.apple.com/videos/play/wwdc2014-226/
    flow.estimatedItemSize = CGSizeMake(1, 1);

    // Disable the scroll on your collection view
    // to avoid running into multiple scroll issues.
    [self.collectionView setScrollEnabled:NO];
}

- (void)bindWithModel:(id)model {
    // Do your stuff here to configure the tableViewCell
    // Tell the cell to redraw its contentView
    [self.contentView layoutIfNeeded];
}

// THIS IS THE MOST IMPORTANT METHOD
//
// This method tells the auto layout
// You cannot calculate the collectionView content size in any other place,
// because you run into race condition issues.
// NOTE: Works for iOS 8 or later
- (CGSize)systemLayoutSizeFittingSize:(CGSize)targetSize withHorizontalFittingPriority:(UILayoutPriority)horizontalFittingPriority verticalFittingPriority:(UILayoutPriority)verticalFittingPriority {

    // With autolayout enabled on collection view's cells we need to force a collection view relayout with the shown size (width)
    self.collectionView.frame = CGRectMake(0, 0, targetSize.width, MAXFLOAT);
    [self.collectionView layoutIfNeeded];

    // If the cell's size has to be exactly the content
    // Size of the collection View, just return the
    // collectionViewLayout's collectionViewContentSize.

    return [self.collectionView.collectionViewLayout collectionViewContentSize];
}

// Other stuff here...

@end

TableViewController
Remember to enable the auto layout system for the tableView cells at your TableViewController:
- (void)viewDidLoad {
    [super viewDidLoad];

    // Enable automatic row auto layout calculations
    self.tableView.rowHeight = UITableViewAutomaticDimension;
    // Set the estimatedRowHeight to a non-0 value to enable auto layout.
    self.tableView.estimatedRowHeight = 10;

}

CREDIT: @rbarbera helped to sort this out
Comment: when setting the frame height to maximum in `systemLayoutSizeFittingSize`, i hit a problem in swift when reloading the cell, apps seems to stuck after the `self.collectionView.layoutIfNeeded()`. I fixed it by setting the frame height with 1 rather than maximum height. Hope its helps if anyone stumble in this problem.
Comment: Here's what fixed it for me - in `systemLayoutSizeFitting`, reverse the order of what's shown in the answer currently, so that first `collectionView.layoutIfNeeded()` runs, then `collectionView.frame = CGRect.init(origin: .zero, size: CGSize.init(width: targetSize.width, height: 1))`
Comment: Yeah. This works. This should be the accepted answer.
Comment: Finally this is worked for me, but I had to do an other trick: `cell.bounds = CGRectMake(0, 0, CGRectGetWidth(tableView.bounds), 10000);` This will "simulate" a long cell with a long collectionView, so the collectionView will compute the size all of its cells. Otherwise the collectionView computed only the visible cell sizes, and set wrongly the talbeViewCell height.
Comment: Can any body provide me a sample code for it? i want to show multiple images in vertical collection view , which is inside of tableview cell..
Comment: If you have a collectionView with elements located outside of the collectionView, it's real size won't be computed, the estimatedSize will be used instead of this. The real size will be computed only if these cell will be visible, bat that's too late, because at this point your tableViewCell has a wrong height setup already. So no, the `estimatedSize` won't do the trick
Comment: @gonso I made it work using a height constraint on the collection view in the systemLayoutSizeFittingSize method.
`collectionViewHeightConstraint.constant = collectionView.collectionViewLayout.collectionViewContentSize().height` then
`return self.contentView.systemLayoutSizeFittingSize(UILayoutFittingCompressedSize)`
Comment: @PabloRomeu I'm having same issue as @WedgeSparda, and I can see why: in `systemLayoutSizeFittingSize` right before calling `layoutIfNeeded` on the collectionview, I can see that `self.bounds` (the bounds of the tableview cell) has a width of 363 pixels. But after calling `layoutIfNeeded` on the collectionview, the size of the collectionview (contentSize, or frame) has a larger width (606 pixels), even though it is pinned with constraints to the inside of the tableview cell. Thus the first time `systemLayoutSizeFittingSize` returns a value, the value is wrong.
Comment: @AlexeyChekanov here is my code, I'm setting constraints with AutoLayout on my Storyboard and using their outlets in my code.
My cell has a label and under it a collection view with varying number of buttons in different sizes.
So I'm letting Autolayout set the position of things and then taking all heights together for the cell height size.
Please see:
https://gist.github.com/boazFrenkel/35b875f5d026e96981225dfcc9ad0623
Comment: Just noticed. Sometimes it doesn't work. Doesn't size the table view cell to take the whole collection view height
Comment: Not working for horizontal scroll. TableView Cell is not resizing.
Comment: Question, how do you link the tableview and the collectionview in the storyboard? I assume you use a segue but i cannot choose which one.
Also i'm coding in swift so i'm already struggling with the traduction of the code
Comment: I create a NIB for the UITableViewCell, and a custom subclass for that cell (E.g. PRTableCell), then I put a UICollectionView -NOT a UICollectionViewController- inside the cell with auto layout constraints. Then I create an outlet for the collectionView into the PRTableCell. If you want to use storyboard, simply do the same with a cell Prototype and using a custom class.
Comment: I can't get this to work in Swift. I have exactly the same problem, I used https://ashfurrow.com/blog/putting-a-uicollectionview-in-a-uitableviewcell-in-swift/ as a guide. But having a "fixed" dynamic height doesnt seem to work for me.
Comment: @PabloRomeu can you please explain it in sample , i am new in ios
Comment: @PabloRomeu Great right up, this really helped me.  Thank you
Comment: @PabloRomeu, My long search ends here. Thanks
Comment: Question (before I go and try this solution): In my case, the collection view is PART of the cell. The cell has other components and currently Autolayout is calculating the cell height for me, since the other components are dynamic. So far the collection view has a fixed height, but I want to make it dynamic too. Will this work? How? My idea is to use this method to change a height constraint for the collection view, not for the cell.... is that the right path?
Comment: @ingaham Exactly, the `cell.bounds` trick is the most important part. I am using a tableView inside a tableView cell (almost the same setup) and without setting the outer table's `cell.bounds` to some huge height it doesn't compute the `contentSize` correctly.
Comment: I'm trying this way but the only thing I've got is the app to freeze :( @ingaham Where did you place that cells.bouds statement?
Comment: @WedgeSparda: When I'm configuring the cell in the `tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath)`. I'm setting at first the `cell.bounds`, then the full cell layout will be configured
Comment: @ingaham Tried that, but have the same problem. If I scroll quickly the height of the cell containing the collectionView if not correct. After a reloadData on the tableView the cell gets the correct height. Is really weird.
Comment: @PabloRomeu, Hello bro, Could you help me to look at my question https://stackoverflow.com/questions/44541403/collection-view-inside-table-does-not-load-immediately-in-swift-3?noredirect=1#comment76078645_44541403   bro?
Comment: @PabloRomeu by this methos the collection has some extra spaces. how to get rid of it. When we have to bindWithModel mentioned in your code
Comment: bindWithModel means you have to set your model to your cell there. That's important because maybe you have to setup -for example- a UILabel that may change the cell's size.
Comment: What if my CollectionView's flow is horizontal? In that case, the collectionViewCell can grow vertically?
Comment: @Nil It will. My collection view had no flow and was multiline, I grew up the tableViewCell to the full size of the collection so it can fit fully inside.
Comment: @xaphod that's because the table cell is still not still at full size...
Comment: I have a UIView inside the TableViewCell and inside that view, I place the collectionView. I create a subclass of this view. This subclass of UIView is the datasource and delegate for collectionView and am putting in the systemLayoutSizeFitting method inside that view subclass however, it is not working. I have the outlet of UIView subclass inside my TableViewCell and outlet for the collectionView inside the UIView subclass.
Comment: Does anybody know how to make it work in Swift with Autolayout? Are there any examples? Thank you!
Comment: This is a great answer! Also @titan's comment is very important
Comment: I have copied this solution exactly except I am using a horizontal scroll on the CollectionView. I cant get it to work. Any ideas?
Comment: This worked for me. Not sure why.   override func systemLayoutSizeFitting(_ targetSize: CGSize,
                                        withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority,
                                        verticalFittingPriority: UILayoutPriority) -> CGSize {
    collectionView.layoutIfNeeded()
    collectionView.frame = CGRect(x: 0, y: 0, width: targetSize.width, height: 1)
    collectionView.layoutIfNeeded()
    return collectionView.contentSize
  }
Comment: This Worked for me. Call super.systemLayoutSizeFitting inside tableview systemLayoutSizeFitting method. in addition no need to assign collection view.frame
Comment: I've only overwrite systemLayoutSizeFittingSize to make it work and didn't use estimatedSize only itemSize, thank you. Also, why did you setNeedsLayout in the collection cell ? You already layoutIfNeeded in the tableviewcell systemLayoutSizeFittingSize and the bindWithModel @PabloRomeu
Comment: This did not work for me...
Answer: I think my solution is much simpler than the one proposed by @PabloRomeu.
Step 1. Create outlet from UICollectionView to UITableViewCell subclass, where UICollectionView is placed. Let, it's name will be collectionView
Step 2. Add in IB for UICollectionView height constraint and create outlet to UITableViewCell subclass too. Let, it's name will be collectionViewHeight.
Step 3. In tableView:cellForRowAtIndexPath: add code:
// deque a cell
cell.frame = tableView.bounds;
[cell layoutIfNeeded];
[cell.collectionView reloadData];
cell.collectionViewHeight.constant = cell.collectionView.collectionViewLayout.collectionViewContentSize.height;

Comment: This one works like champ...simple and efficient...thank you. If for somebody it is not working then probably the reason might be, we need to bind the bottom of collection view to bottom of table view cell. Then it will start working. Happy coding..:)
Comment: I have it worked. I add constraints for `collectionView` to all sides of `UITableViewCell` and set `tableView.estimatedRowHeight = 44;` and `tableView.rowHeight = UITableViewAutomaticDimension;`
Comment: Would this work when the screen is resized, say by rotating an iPad?  That would potentially change the height of the collection view, and therefore the height of the cell, but if on-screen the cell may not necessarily be reloaded by the table view, thus never calling the cellForRowAtIndexPath: method and not giving you a chance to change the constraint constant.  It may be possible to force a reloadData though.
Comment: Have you tried different collectionView cell's sizes? That was my problem. If you have different collectionView's cell sizes it did not work... :(
Comment: Have you actually tried this? It doesn't seem possible to both set a height constraint on the collection view and pin it to the margins of the table view cell. You either end up with too few constraints (hence a zero size warning), or you end up with conflicting constraints (one of which is ignored). Please explain how to set the constraints for this solution.
Comment: I needed to adapt your solution a bit, but it worked in the end!
What I did was reverse the order of these two lines:

`[cell layoutIfNeeded];  [cell.collectionView reloadData];`
Comment: What I don't understand is what this line cell.frame = tableView.bounds; for. Can anybody explain this please?
Comment: I think, yes, it's needed to force reloadData on change Interface orientation.
Comment: Does someone have this working in a sample project they could share?
Comment: @PabloRomeu, I am facing same problem. Any solution?
Comment: @Igor I'm running into a similar issue..can you assist me with my question? https://stackoverflow.com/questions/45176747/how-to-dynamically-change-the-height-of-a-uitableview-cell-containing-a-uicollec
Comment: There's a different EASIER approch for  this, just implment the last line of your code in the table cell's layoutSubviews() class
Comment: this will work But my problem is that inside the collection view I have another collection view and the main collection view has just two page (paging mode) and each page has collection view how can I handle that ?
Comment: @Igor, Do you have any sample code for this? Because I have tried and it won't work for me... It would be great if you can provide any sample code for it.
Comment: The collectionView reload is taking time and if i change my font size of labels inside the collectionview cell and reload, the latest contentsize is not reflected.
Comment: I was using a collectionView inside a collectionViewCell and I couldn't achieve the dynamic height behaviour I wanted. I changed the encapsulating collectionView with a tableView, and now I had a structure like the one described by OP. This method was the only one that worked for me! Thanks @Igor
Comment: This is useful for me like one table view than use CollectionViewCell and tableview inside my tableview. nice work .
Comment: Beast solution. Thank you!
Answer: Both table views and collection views are UIScrollView subclasses and thus don't like to be embedded inside another scroll view as they try to calculate content sizes, reuse cells, etc.
I recommend you to use only a collection view for all your purposes.
You can divide it in sections and "treat" some sections' layout as a table view and others as a collection view. After all there's nothing you can't achieve with a collection view that you can with a table view.
If you have a basic grid layout for your collection view "parts" you can also use regular table cells to handle them. Still if you don't need iOS 5 support you should better use collection views.
Comment: Your answer assumes you are starting from scratch, and don't already have a big complex tableview that you need to fit into. The question specifically asked about putting a collectionview in a tableview. IMO your response is not an "answer"
Comment: @Rivera, your answer is most reasonable and sounds just correct. I have read this suggestion on many places. Could you also share some link to sample or tute on how to accomplish that or at least some pointers. TIA
Comment: This is a bad answer. Having collection views inside table views is such a common thing to do, almost every app does it.
Comment: You've put "treat" in quotes, because you can NOT define different layouts per CollectionView section, right? I haven't found an option to define different layouts for different collection view sections. Am I overlooking something or are you talking of responding differently to 'layoutAttributesForItemAtIndexPath' for different sections in my own custom subclass of UICollectionViewLayout?
Comment: Yes -> Are you talking of responding differently to `layoutAttributesForItemAtIndexPath` for different sections in my own custom subclass of `UICollectionViewLayout`?
Answer: Pablo Romeu's answer above (https://stackoverflow.com/a/33364092/2704206) helped me immensely with my issue. I had to do a few things differently, however, to get this working for my problem. First off, I didn't have to call layoutIfNeeded() as often. I only had to call it on the collectionView in the systemLayoutSizeFitting function.
Secondly, I had auto layout constraints on my collection view in the table view cell to give it some padding. So I had to subtract the leading and trailing margins from the targetSize.width when setting the collectionView.frame's width. I also had to add the top and bottom margins to the return value CGSize height.
To get these constraint constants, I had the option of either creating outlets to the constraints, hard-coding their constants, or looking them up by an identifier. I decided to go with the third option to make my custom table view cell class easily reusable. In the end, this was everything I needed to get it working:
class CollectionTableViewCell: UITableViewCell {

    // MARK: -
    // MARK: Properties
    @IBOutlet weak var collectionView: UICollectionView! {
        didSet {
            collectionViewLayout?.estimatedItemSize = CGSize(width: 1, height: 1)
            selectionStyle = .none
        }
    }

    var collectionViewLayout: UICollectionViewFlowLayout? {
        return collectionView.collectionViewLayout as? UICollectionViewFlowLayout
    }

    // MARK: -
    // MARK: UIView functions
    override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize {
        collectionView.layoutIfNeeded()

        let topConstraintConstant = contentView.constraint(byIdentifier: "topAnchor")?.constant ?? 0
        let bottomConstraintConstant = contentView.constraint(byIdentifier: "bottomAnchor")?.constant ?? 0
        let trailingConstraintConstant = contentView.constraint(byIdentifier: "trailingAnchor")?.constant ?? 0
        let leadingConstraintConstant = contentView.constraint(byIdentifier: "leadingAnchor")?.constant ?? 0

        collectionView.frame = CGRect(x: 0, y: 0, width: targetSize.width - trailingConstraintConstant - leadingConstraintConstant, height: 1)

        let size = collectionView.collectionViewLayout.collectionViewContentSize
        let newSize = CGSize(width: size.width, height: size.height + topConstraintConstant + bottomConstraintConstant)
        return newSize
    }
}

As a helper function to retrieve a constraint by identifier, I add the following extension:
extension UIView {
    func constraint(byIdentifier identifier: String) -> NSLayoutConstraint? {
        return constraints.first(where: { $0.identifier == identifier })
    }
}

NOTE: You will need to set the identifier on these constraints in your storyboard, or wherever they are being created. Unless they have a 0 constant, then it doesn't matter. Also, as in Pablo's response, you will need to use UICollectionViewFlowLayout as the layout for your collection view. Finally, make sure you link the collectionView IBOutlet to your storyboard.
With the custom table view cell above, I can now subclass it in any other table view cell that needs a collection view and have it implement the UICollectionViewDelegateFlowLayout and UICollectionViewDataSource protocols. Hope this is helpful to someone else!
Answer: I read through all the answers. This seems to serve all cases.
override func systemLayoutSizeFitting(_ targetSize: CGSize, withHorizontalFittingPriority horizontalFittingPriority: UILayoutPriority, verticalFittingPriority: UILayoutPriority) -> CGSize {
        collectionView.layoutIfNeeded()
        collectionView.frame = CGRect(x: 0, y: 0, width: targetSize.width , height: 1)
        return collectionView.collectionViewLayout.collectionViewContentSize
}

Comment: should be only accepted answer as it works perefectly with UICollectionview as UITableviewcell thanks
Answer: I was facing the same issue recently and I almost tried every solution in the answers, some of them worked and others didn't my main concern about @PabloRomeu approach is that if you have other contents in the cell (other than the collection view) you will have to calculate their heights and the heights of their constraints and return the result to get the auto layout right and I don't like to calculate things manually in my code. So here is the solution that worked fine for me without doing any manual calculations in my code.
in the cellForRow:atIndexPath of the table view I do the following:
func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    //do dequeue stuff
    //initialize the the collection view data source with the data
    cell.frame = CGRect.zero
    cell.layoutIfNeeded()
    return cell
}

I think what happens here is that I force the tableview cell to adjust its height after the collection view height has been calculated. (after providing the collectionView date to the data source)
Answer: An alternative to Pablo Romeu's solution is to customise UICollectionView itself, rather than doing the work in table view cell.
The underlying problem is that by default a collection view has no intrinsic size and so cannot inform auto layout of the dimensions to use. You can remedy that by creating a custom subclass which does return a useful intrinsic size.
Create a subclass of UICollectionView and override the following methods
override func intrinsicContentSize() -> CGSize {
    self.layoutIfNeeded()

    var size = super.contentSize
    if size.width == 0 || size.height == 0 {
        // return a default size
        size = CGSize(width: 600, height:44)
    }

    return size
 }

override func reloadData() {
    super.reloadData()
    self.layoutIfNeeded()
    self.invalidateIntrinsicContentSize()
}

(You should also override the related methods: reloadSections, reloadItemsAtIndexPaths in a similar way to reloadData())
Calling layoutIfNeeded forces the collection view to recalculate the content size which can then be used as the new intrinsic size.
Also, you need to explicitly handle changes to the view size (e.g. on device rotation) in the table view controller
    override func viewWillTransitionToSize(size: CGSize, withTransitionCoordinator coordinator: UIViewControllerTransitionCoordinator)
{
    super.viewWillTransitionToSize(size, withTransitionCoordinator: coordinator)
    dispatch_async(dispatch_get_main_queue()) {
        self.tableView.reloadData()
    }
}

Comment: bro could you please help my problem https://stackoverflow.com/questions/44650058/how-to-display-dynamically-data-from-server-in-collectionviewcell-in-tableviewce?noredirect=1#comment76287331_44650058 ?
Answer: Easiest approach I've came up with, so far, Credits to @igor answer above,
In your tableviewcell class just insert this
override func layoutSubviews() {
    self.collectionViewOutlet.constant = self.postPoll.collectionViewLayout.collectionViewContentSize.height
}

and of course, change the collectionviewoutlet with your outlet in the cell's class
Comment: The cell's height doesn't calculate properly
Answer: I would put a static method on the collection view class that will return a size based on the content it will have.  Then use that method in the heightForRowAtIndexPath to return the proper size.
Also note that you can get some weird behavior when you embed these kinds of viewControllers.  I did it once and had some weird memory issues I never worked out.
Comment: For me, I was trying to embed a table view controller inside collection view controllers. Every time a cell is re-used, it ended up remembering some autolayout constraints I applied onto them. It was very fiddly and ultimately was a terrible idea.

I think I will just use a single collection view instead.
Answer: Maybe my variant will be useful; i've been deciding this task during last two hours. I don't pretend it's 100% correct or optimal, but my skill's very small yet and i'd like to hear comments from experts. Thank you.
One important note: this works for static table - it's specified by my current work.
So, all I use is viewWillLayoutSubviews of tableView. And a little bit more.
private var iconsCellHeight: CGFloat = 500

func updateTable(table: UITableView, withDuration duration: NSTimeInterval) {
    UIView.animateWithDuration(duration, animations: { () -> Void in
        table.beginUpdates()
        table.endUpdates()
    })
}

override func viewWillLayoutSubviews() {
    if let iconsCell = tableView.cellForRowAtIndexPath(NSIndexPath(forRow: 0, inSection: 1)) as? CategoryCardIconsCell {
        let collectionViewContentHeight = iconsCell.iconsCollectionView.contentSize.height
        if collectionViewContentHeight + 17 != iconsCellHeight {
            iconsCellHeight = collectionViewContentHeight + 17
            updateTable(tableView, withDuration: 0.2)
        }
    }
}

override func tableView(tableView: UITableView, heightForRowAtIndexPath indexPath: NSIndexPath) -> CGFloat {
    switch (indexPath.section, indexPath.row) {
        case ...
        case (1,0):
            return iconsCellHeight
        default:
            return tableView.rowHeight
    }
}

I know, that the collectionView is located in the first row of the second section;
Let the height of the row is 17 p. bigger, than its content height;
iconsCellHeight is a random number as the program starts (i know, that in the portrait form it has to be exactly 392, but it's not important). If the content of collectionView + 17 is not equal this number, so change its value. Next time in this situation the condition gives FALSE;
After all update the tableView. In my case its the combination of two operations (for nice updating of extending rows);
And of course, in the heightForRowAtIndexPath add one row to code.
Answer: I get idea from @Igor post and invest my time to this for my project with swift
Just past this in your
 func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell {
    //do dequeue stuff
    cell.frame = tableView.bounds
    cell.layoutIfNeeded()
    cell.collectionView.reloadData()
    cell.collectionView.heightAnchor.constraint(equalToConstant: cell.collectionView.collectionViewLayout.collectionViewContentSize.height)
    cell.layoutIfNeeded()
    return cell
}

Addition:
 If you see your UICollectionView choppy when loading cells.
func collectionView(_ collectionView: UICollectionView, cellForItemAt indexPath: IndexPath) -> UICollectionViewCell {
  //do dequeue stuff
  cell.layer.shouldRasterize = true
  cell.layer.rasterizationScale = UIScreen.main.scale
  return cell
}

Comment: What will you do if `cellForRowAt` is called multiple times?
Answer: Pablo's solution did not work very well for me, I had strange visual effects (the collectionView not adjusting correctly).
What worked was to adjust the height constraint of the collectionView (as a NSLayoutConstraint) to the collectionView contentSize during layoutSubviews(). This is the method called when autolayout is applied to the cell.
// Constraint on the collectionView height in the storyboard. Priority set to 999.
@IBOutlet weak var collectionViewHeightConstraint: NSLayoutConstraint!

// Method called by autolayout to layout the subviews (including the collectionView).
// This is triggered with 'layoutIfNeeded()', or by the viewController
// (happens between 'viewWillLayoutSubviews()' and 'viewDidLayoutSubviews()'.
override func layoutSubviews() {

    collectionViewHeightConstraint.constant = collectionView.contentSize.height
    super.layoutSubviews()
}

// Call `layoutIfNeeded()` when you update your UI from the model to trigger 'layoutSubviews()'
private func updateUI() {
    layoutIfNeeded()
}

Answer: func configure(data: [Strings]) {

        names = data
        contentView.layoutIfNeeded()
        collectionviewNames.reloadData()
    }

Short and sweet. Consider the above method in your tableViewCell class. You would probably call it from func tableView(_ tableView: UITableView, cellForRowAt indexPath: IndexPath) -> UITableViewCell after dequeing your cell. Before calling reloadData on your collection view, in your tableCell, you need to tell the collection view to lay out its subviews, if layout updates are pending.
Answer: In your UITableViewDelegate:
-(CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return ceil(itemCount/4.0f)*collectionViewCellHeight;
}

Substitute itemCount and CollectionViewCellHeight with the real values. If you have an array of arrays itemCount might be:
self.items[indexPath.row].count

Or whatever.
Comment: I think the main question is to how to calculate `collectionViewCellHeight`  before it renders.
Answer: 1.Create dummy cell.
2.Use collectionViewContentSize method on UICollectionViewLayout of UICollectionView using current data.
Comment: It should be the best answer... since there is no possibility to set the height of cell with 'uicollectionview' without putting the content to the dummy cell, get height, and then set it again to the proper cell
Comment: how do i use that method?
Comment: Add an example.
Answer: You can calculate the height of the collection based on its properties like itemSize, sectionInset, minimumLineSpacing, minimumInteritemSpacing, if your collectionViewCell has the border of a rule.


When applying for a new US passport at a Passport Acceptance Facility, can I go to any Passport Acceptance Facility or does it have to be nearby?

Question: I wonder whether, when applying for a new US passport at a Passport Acceptance Facility (e.g., some USPS or county clerk locations) via Passport Application Form DS-11, I can go to any Passport Acceptance Facility or does it have to near my domicile (e.g., in the same state or USCIS district).
Comment: Once you're a US citizen USCIS no longer has anything to do with you. At most you'll need them if you need to reissue your naturalization certificate. Once you're a US citizen, immigration enforcement does no longer apply to you and USCIS, ICE, immigration judges, and any other agency involved in dealing with foreigners no longer have anything to do with you. Similarly, state boundaries are meaningless when it comes to the Federal government (although some of the Federal district boundaries follow state boundaries occasionally, and state boundaries and US boundaries overlap for border states).
Comment: @littleadv thanks, great to know!
Answer: You can go to any facility.
The actual passport issuance in the US is centralized and all the passports are issued by the State Department (as opposed to other countries where you may see "Issued at city X"). The Federal government doesn't care where you live. Notice that the address field on DS-11 is for mailing address. They ask for your residence address (on page 2) if it differs from mailing, but it is not a criteria for passport issuance.


Elephant Park within a day trip from Bangkok

Question: I'm familiar with elephant parks in Northern Thailand, near Chiang Mai. Are there any good elephant parks (preferably with humane treatment) within a day trip's distance from Bangkok?
Comment: I don't know about elephant conservation parks, but you can see elephants in the wild in Khao Yai National Park (~200 km from Bangkok).
Answer: I stayed in Hua Hin about 2 years ago, and went on a trip to see elephants right outside of town.  I believe the park at this link is the correct one: http://www.thailand-huahin.com/huahin-elephants.htm
Hua Hin is approximately 200km south of Bangkok. I cannot attest to the treatment of the elephants, but everything appeared on the up and up when I was there.  I remember this park as being family friendly and enjoyable.
I hope this helps. If you need any further information, just ask!


How to convert a standard font to a web-font

Question: Is it possible to take a standard font <code>.ttf</code> and make a web-font like Google Web Fonts, embedded into a web-page?
Thanks.
Answer: I've built a simple webfont generator called Fontie, which might be what you're looking for.
Fontie takes an OTF or TTF file and generates you a webfont-package, which contains everything you need (the required font-files, the CSS, etc.) to use the font on your site. It even does some extra work to ensure that your font looks good in any browser. If you want to know what it is doing in detail, you should read my post on Pixels vs. Bytes about how to create webfonts.
PS: I'm aware that linking to my own sites won't be appreciated here, but I think my tool is a good solution to the problem, so I posted it anyway. Please leave a comment if you want me to remove this post and I'll do so.
Comment: It was offline due to server problems, but it is back online now.
Comment: Looks like Fontie is no longer operational? Or has it been moved?
Answer: WOFF (Web Open Font Format - see wikipedia for more details) files can be created as wrappers on TTF files and then hosted as web fonts.
First you have to be sure that you have permission to redistribute the TTF.
If it is your own font and you specifically wanted to add it to google fonts,  you can submit it at http://code.google.com/p/googlefontdirectory/. Google Web Fonts is an Open source project.
The source code should contain tools for packaging your TTF file with metadata to create the WOFF web font. There is also an excellent forum where you can find out more about what is involved:
https://groups.google.com/forum/?fromgroups#!forum/googlefontdirectory-discuss
The developer API is a very useful resource, search google for web fonts developer api.
The web font mechanism is not restricted to open source, I believe you can use it to distribute proprietary fonts. E.g. see the web font loader github project which allows custom/proprietary providers.


Should I use a 1H or a 2H as a battle mage?

Question: I really love the idea of a warrior charging into battle with the powers of destructive magic as his ally.  Being brand new to Skyrim, I did some reading on the topic but haven't been able to find the answer to my question: Should I go 1H with a spell at the ready, or 2H and switch to dual-handed magical destruction as needed?
Comment: Mostly a matter of preference as both could work. Whichever you choose, the favorites bar will be your friend to quickly switch between whatever spells/weapons you want to use.
Answer: It makes more sense for a battle mage to be one handed.  That way you aren't forced to make the decision to give up one of your preferred source of damage in order to use the other.  Other than the master level spells, you can cast everything else with 1 hand while swinging a weapon in the other, this makes for great versatility.
Also, you can be more defensive if you choose by equipping a ward spell in one hand while swinging a sword in the other.  A good ward spell can stop most things including pesky dragon breaths.
Comment: That was the original image I had in my head as well.  But then I read a very convincing argument (links to allocated points and all) that had me second-guessing myself.  Thinking that I could dual-cast until they close in then pwn them with a 2h.
Comment: @Indelaceo the problem with 2 handers is their super slow swing time.  Even though they look cool you will never beat the DPS output of a 1 hander once you factor in enchantments and smithing.  The only real reason to use one is for some of the unique 2 handers sch as the [Bloodskaal blade](http://elderscrolls.wikia.com/wiki/Bloodskal_Blade) from dragonborn


Can I use 12 awg ground copper for 14 awg electrical box wirings?

Question: My electrical box has 14 awg wires and I have a 12 awg copper ground wire lying around.  Can I use the 12 awg copper or do I need to get a 14 gauge?
Answer: Should be fine. If it's just pigtails in the box it won't even affect your fill, IIRC. If you are running 12Ga ground wire (not just in-box pigtails) you do have to allow for it in box volume calculations, but it would rarely cause a problem since the equipment grounding conductor is only counted once for box fill.
Comment: I plan on putting three ground wires from the 3 switches into a twist nut and then pigtailing the extra copper ground to the metal electric box.
Answer: No problem.  Just make sure all the terminals are rated for 12 AWG, and any connectors are sized to accept the number and size of wires being connected.


Sent outbound email related to case Salesforce

Question: We would like to place a custom email with template button inside a case layout. What should we do to ensure that if our client replies to that email, this gets automatically added to the case thread?
Answer: Case emails usually contains the thread id, which helps Salesforce to recognize under which case it should attach the email. You can contain that thread id into those emails.
When creating template, you can use  {!Case.Thread_Id} in the template used on the button. Also make sure to make the appropriate settings in email to case settings.
Also go through the below link to know more:
Check out the link.
Comment: where should I place the thread id?
Comment: Insert Thread ID in the Email Subject **AND**

Insert Thread ID in the Email Body
Comment: any of them is fine
Comment: You should try with both places once, then try removing one at a time. I have implemented this in past, but don't exactly remember where did I place that. Please try at both.


Photoshop icon missing after deleting desktop shortcut in Windows 7

Question: I deleted a bunch of shortcut icons on the desktop in Windows 7 to clear the screen. One of them was Photoshop cs5. Ever since its icon has gone missing. I get the default icon for unknown app in the start menu. The properties dialog for the PS shows the correct PS icon and the path. I've tried changing the icon, rebuilding the icon cache by deleting Icon cache database, re-adding the desktop shortcut. Nothing works. How can I fix this?
Comment: I get this problem from time to time with Acrobat and it's very annoying. It changes the icon to that of Windows Photo Viewer with two arrows on the icon. Usually you have to fix it by going to the location of the actual EXE and then copying and pasting it as a shortcut in the Start menu (replacing the old shortcut).
Answer: There are 2 things you can try.

Open the folder "C:\Program Files\Adobe\Adobe Photoshop CS5", or "C:\Program Files (x86)\Adobe\Adobe Photoshop CS5" if you have a 64-bit installation of windows.

Inside there, you should see a program named photoshop.exe. Right click it, point to Send to, and click Send the desktop (create shortcut).
If it still doesn't work, or if you cannot find the above, uninstall then reinstall Photoshop and your problem should fix itself.
Comment: Yeah I tried that too. The shortcut is created with the proper icon but the start menu and running application still show no icon for PS.
Comment: @koogee - When you install photoshop, select custom install. Make sure that "put shortcut in start menu" is ticked.
Comment: Use this link http://www.sevenforums.com/tutorials/135246-start-menu-all-programs-windows-7-restore-default-shortcuts.html
Comment: @koogee Try adding the shortcut to the Start menu as well.
Answer: I know this is a bit old but I had the same problem and I managed to fix it much easier. I right clicked on the premiere pro (or photoshop or whatever, it happened with premiere with me), click properties, then icon change (or something like this, my computer isnt in english idk what its called in english but basically the butt with which you change the icon), chose a random icon, click use and then ok, then go back to properties and change icon and change it to the original icon, for me it was the first icon, and there were other similar adobe icons provided by adobe by default. Its important to click ok and close the window before otherwise it wont work.


how to connect my server to internet

Question: We have a project which very resource consuming in databse part and we found that database hosting which is satisfied our needs is lot money consuming.
We want to built own server and connect our database to it. The question is how to make our server avaliable from internet.
Answer: You generally do not want to make your database server accessible from the general internet. Where do the applications run that need this database? Try to install the database server there too. If that cannot be done, create a VPN or ipsec tunnel between the application and the database and make sure the database is accessible only through that tunnel. How that is done depends on the database and the operating system, so you will need to give us a lot more details if you want us to (be able to) help you.

how to connect my server to internet


Why does my hardiness zone not match the historical weather?

Question: I looked up my town on this website and it says that I'm in zone 9b (25F - 30F average minimum temperature). However, the historical data shows that the temperature never dropped below 41F in the winter. I can also attest from living here for a year that it has never dropped to freezing temperatures. I live a block away from the bay, so the water should keep the weather more temperate. So why does my zone not match the historical weather?
Answer: Just looking at weatherunderground for your location, it shows the temps for your city dipping down into the mid 30's early this January, and even colder temps last January. It may not happen often that the temps drop that low, but the hardiness zone is accounting for the worst case scenario.
That said, hardiness zones really only tell you about your macroclimate, and in a coastal region like you're in, that can be deceiving. It could very well be that since you are so close to the ocean, your yard never does see the low temps that someone living a few miles inland would. It is very possible that you could get away with planting something that should be a half a zone (or possibly even a full zone) warmer than what your hardiness zone says.
My yard is in zone 4B, but I have a spot on the south side of my house where I can get away with 5B plants most years. I say most years, because we had a terribly cold winter this year and my garden has yet to wake up - I won't be sure for another month whether the marginal plants made it through this time.
Answer: USDA zones are reviewed from time to time, but the fact you're zoned as 9b should mean that, historically (I don't know how far back you went) it was possible for temperatures to drop that low. The point of zoning is knowing what the temperature you're likely to encounter in any given area will be, in particular, the coldest. There is, though, a problem with the USDA map in the west, where it fails to reflect accurately what the weather actually does (according to the National Gardening Association). Tucson and Seattle are both Zone 8, but coastal Seattle has far different growing conditions from Tucson.
Weather is unpredictable (more so in the UK) but even in 'settled' weather zones, changes are now taking place, many of which can't accurately be predicted. The chances of anyone's weather continuing to conform to any zoning map are growing less with each decade - climate change is bringing different weather to many areas.


Thermodynamics : Pressure of a gas

Question: While reading The kinetic Theory of gases in Feynman Lectures , i was hoping for an explanation concerning the factor (2) that shows that only half of the atoms are headed towards a piston, while the other half is heading on other directions.
Actually , also in Class , the professor , gave the same explanation , but i didn't quiet understand why , i imagine some (say 7 balls) thrown at the different time on a while with different velocities , i cannot imagine how the half of them are going directly towards the wall while half of them are going on other ways after hitting the wall. another question pop up to my mind ,when we say half of them , we are talking about number of molecules or atoms inside an enclosure , then , how come the half can be interpreted if the number of molecules is odd?
I may wish for a profound explanation if it is possible , besides , a demonstration  , i think probabilities will be needed and some approximations ,but truly this question is making me a bit nervous .
Thank you .
Comment: The argument to get from $P=2nm v_{x}^2$ to $P=nm\langle v_{x}^2\rangle$ was stated nicely by @Jeffrey J Weimer. To get from $P=nm\langle v_{x}^2\rangle$ to $P= nm\langle v^2\rangle/3$, where $\langle v^2\rangle=\langle v_{x}^2\rangle+\langle v_{y}^2\rangle+ \langle v_{z}^2\rangle$ you have to account for all $3$ directions by dividing by $3$.  In the end, you're dividing by $6$.This can be re-written as $P=\frac{2}{3} nm\langle v^2\rangle/2$ where $m\langle v^2\rangle/2$ looks like the kinetic energy.
Answer: The half is taken statistically.
The gas law theory is based on statistical behaviour of a large set of molecules.
22.4 L of air contains at normal conditions about 6.023e+23 molecules.
For a large set of molecules, the probability of a positive/negative vertical component of the velocity of an atom is 0.5/0.5.
Half of atoms move upwards, half downwards, regardless of horizontal velocity components.
The same for any other direction line.
Answer: Nothing profound is required to understand the physical system that is tied to the equations.
First, distinguish between unsteady state and steady state. The initial action of "throwing the balls at the wall" is unsteady state. Nothing should be said about this state with regard to pressure because the concentration of particles (number per volume) in this case is not uniform throughout the container. To appreciate this, realize that gas flows due to a concentration gradient, "throwing balls at the wall" is the equivalent of having gas flow only in one direction, and flow in one direction indicates an unsteady state gradient.
Using the last statement from above, recognize that a steady state conditions means, we will have no net flux of gas at the plane of the wall. The only way to have no net flux is to have equal amounts of gas moving to and from the plane at any instant in time. Amounts are normalized as concentration using numbers of particles per unit volume. The amounts move with a velocity to and from the wall. Concentration (number per volume) times velocity (distance per time) is flux (number per area per time). To have zero net flux at the wall, we either have zero concentration or zero net velocity. The former is nonsense. This means, net velocity is zero. Therefore, the number of particles that hit the wall at any instant must be equal to the number of particles that leave the wall at that same instant.
The apparent dilemma of half a particle is resolved by recognizing that half of a particle is striking the wall while half of some other particle is leaving the wall. Also, the flux expression deals with finite areas. The analysis for an infinitesimal area where perhaps only one particle or even a partial particle strikes is not amenable to this approach. As area goes to the limit of zero, the concept of pressure as a macroscopic measure of the system vanishes with it.
Answer: Feynman's words might've meant the following; suppose that all particles in the volume $nv_xtA$ were moving towards the piston (let us say that the piston is on the right). If that was the case, wouldn't there be an empty region of space as all molecules in that volume moved towards the right? If you say that the neighbouring particles on the left (left of the volume under consideration) fill in this space, then who fills their space? If we follow this reasoning then it seems that the gas molecules have a net rightwards motion. We know this isn't true. A box filled with gas doesn't have extra pressure on any one face of the box.
Thus, to prevent this 'imbalance' or to maintain the randomness of motion of gas molecules, we can say that only half the molecules in that volume will hit the piston while the other half move towards the left. This causes no voids to be formed at any point in the box.
This is just an intuitive understanding as to why statistics gives us the half.

Thermodynamics : Pressure of a gas


Updating a class after changing its Interface

Question: Say I add a function to an outstanding Interface.
In Visual Studio, within a class which implements it I can right click the Interface declaration and re-implement it. This will update the code to reflect the changes made. Is there anyway to do the same thing in eclipse?
It'd be nice if there was.
I've searched the net, alas no joy.
Answer: Put the cursor on the name of the class and press CTRL+1 to activate the quick-fix. That should offer the option of adding the new method.
UPDATE: BTW, here's a really handy list of Eclipse keyboard shortcuts. If you're on Mac, you can usually substitute ⌘ for CTRL.
Answer: You can also use the source menu. Select Source > Override/Implement methods.


G forces of Starship 1 when leaving Earth orbit?

Question: Is there a stated estimate of what the G forces an astronaut would experience on Starship 1 when leaving Earth orbit?
Answer: In vacuum maneuvers will be taking place with the three vacuum Raptors, target hoped for thrust somewhere around 2500 kN each. For a loaded Starship at around 1000 tonnes F/m=a gives 7.5 m/s2 or just under one G. As the tanks empty this would increase to around 82 m/s2 or just over 6G.
If you use the current actual Raptor thrust around 2000 kN this gets a peak acceleration of 50 m/s2 or 5G.
This puts the forces around those on an Apollo crew, but higher than the 3G peak targeted for the space shuttle, though the same throttle bucket approach may be used.
Actual G forces departing earth depend a lot on final engine thrust, final Starship mass and mission profile (how empty the tanks get during departure).
While less efficient it would be possible to operate all six engines which would close to double the forces, though there are few cases where this would make sense.
Comment: Why use as many as three engines? I would imagine one, throttled fairly well down to give a 1g or so acceleration would be plenty
Comment: @steve Linton, the current info on Starship lists three vacuum engines. I'm assuming to give the thrust to reach LEO. Which makes it less optimal for Mars/Moons missions but many space decisions are not single axis optimal. In practice for a number of reasons would expect a 3G maximum for planned maneuvers, throttling and cutting engines as required. Oberth effect does mean that injections are best done at the highest thrust your vehicle can efficiently achieve.
Comment: @GremlinWranglerI know the engines are there, presumably, as you say, to reach LEO and also to provide redundancy,  I'm familiar with the Oberth effect, but I can't believe making am injection of a few km/s in five minutes instead of one will make much difference. You will  not be significantly further from Earth at the end of the burn.
Comment: For the Moon and Mars missions outlined, the burn to leave Earth orbit wouldn't come close to emptying tanks, since fuel must be carried for landing and possibly takeoff from the destination. Even using all three engines, I think that keeps acceleration under 4G or so.


Does .NET assembly size affect performance?

Question: Does the size of a .net assembly affect performance at all? How about the number of assemblies in your windows forms/web forms project?
Answer: From Microsoft's Patterns & Practices Improving .NET Application Performance and Scalability Chapter 5:
Prefer Single Large Assemblies Rather Than Multiple
Smaller Assemblies
To help reduce your application's working set, you should prefer single larger
assemblies rather than multiple smaller assemblies. If you have several assemblies
that are always loaded together, you should combine them and create a single
assembly.
The overhead associated with having multiple smaller assemblies can be attributed
to the following:

The cost of loading metadata for smaller assemblies.
Touching various memory pages in pre-compiled images in the CLR in order
to load the assembly (if it is precompiled with Ngen.exe).
JIT compile time.
Security checks.

Because you pay for only the memory pages your program accesses, larger
assemblies provide the Native Image Generator utility (Ngen.exe) with a greater
chance to optimize the native image it produces. Better layout of the image means
that necessary data can be laid out more densely, which in turn means fewer overall
pages are needed to do the job compared to the same code laid out in multiple
assemblies.
Sometimes you cannot avoid splitting assemblies; for example, for versioning and
deployment reasons. If you need to ship types separately, you may need separate
assemblies.
Answer: Well, each time an assembly is loaded there will be some hit due to the resolution penalty - finding the right file, potentially verifying the version number etc. This is likely to be primarily at start-up.
However, I don't believe it will affect "steady-state" performance significantly.
Answer: A compact framework DLL will always be loaded into a 64 kb minimum memory space, no matter how small it is. So, loading four separate 10 kb CF DLLs will cost you 256 kb on the device. If you combined them (ILMerge) it would only cost you 64 kb of memory on the device.
Answer: I have never encountered a significant hit to performance that I tracked down to either size or number of assemblies.  The vast majority of significant performance problems I've tracked down have been the result of algorithmic weaknesses.
As Jon Skeet says, there will likely be some small hit due to resolution at startup.  lassevk also has a point regarding the dynamic resolution of assemblies via reflection.  Neither one of these should impact performance more than once over the course of the program, though, and in the normal course of things that probably isn't a significant performance hit unless you're working under some awfully strict perf constraints.
Perhaps some additional context as to the problem would be helpful.  Are you asking this question because you have a piece of software with a lot of big assemblies and you're trying to speed it up, for example?
Comment: In that case, I'd say you were probably reading something written by the obfuscators' marketing team, not from a technical team with numbers to back up their claims.  :)
Comment: just asking in general, I was reading marketing material for obfuscators and they say they trim down the assembly which is good for performance.
Answer: I highly doubt it affects performance to any measurable degree. There will be some penalty for loading it at startup; and the memory usage will probably be increased by a MB or two, but other than that - no. Well, unless you make code that suffers because of this yourself.
That said, I haven't seen any tests, so I might be wrong.
Answer: One thing I know will affect performance, in relation to assembly size, at least if assembly size is related to number of classes, methods, etc.
If you use reflection and use a loop like for all assemblies, for all types in those assemblies, check if they have attributes, etc.. This might JIT static constructors and call these in some instances.
Ah, saw Jon's answer, forgot to mention. JIT'ing of code will only happen once per piece of code of course, so if all you do is reflect over the types, and never touch them afterwords, the size of the assembly will affect the duration of that reflection loop, but after that it shouldn't matter at all.
Answer: I agree with Dan's answer and just to add a bit more info: here's another relevant blog post to support that point of view: http://blogs.msdn.com/junfeng/archive/2004/02/23/78139.aspx
Answer: No , it does not affect
Answer: Unused local variables and unnecessary assignments increase the size of an assembly and degrade performance.


Miele condenser dryer T8013C not drying, takes too long to dry, why?

Question: My Miele dryer is taking 5hrs to dry clothes. I have cleaned all the lint traps. What else should I do? I am fairly handy (e.g. small repairs, building computers), except I have never done a dryer before. Please advise.
Comment: Can you add some detail to the question? Is this a recent change, or has it always taken this long? Is it possible the issue is with the spin cycle on your washer, meaning the clothes are wetter than normal when they go into the dryer? It looks like the dryer has a "dryness" setting, have you changed that at all?
Comment: You mentioned you have cleaned the lint traps, but have you also removed and cleaned the condenser itself? It looks like the instruction indicate it could be due to having clothes with lots of metal (zippers, etc). which could interfere with the moisture sensors. You can try running a timed program for a shorter period and see if your clothes are actually dry after maybe 2 hours, and the sensor is just making the dryer run longer than needed.
Answer: I have fixed my problem. Here is what I did as reference for others.
After cleaning out all the lint in all the "air" filters, I found the condenser was completely clogged with lint.

The condenser is a long box. In the manual and online posts, the instruction is to rinse it with a shower head. However, there is so much lint stuck in the honey-comb-like structure, water from a shower head just could not flush everything out.
Ultimately after various attempts, I filled the bathtub with water to submerge the condenser, and moved the condenser vigorously back and forth to create strong "waves" in the bathtub water. The water pushed all the lint out.
Be sure to collect the lint before you drain the tub, so your tub doesn't get clogged.
Once the condenser was cleaned, the dryer was normal again.
Comment: Excellent! Glad you got it solved, and thanks for coming back to post your answer. Be sure to click the check-mark so others will know it's been resolved, too. (I think the system makes you wait 24 hours before you can do that, though.)
Comment: Thanks! Didn't even know we were supposed to service this. Also, next level clean option here: https://youtu.be/AUEX5B5Xi4s?si=3gb7Oo4Rr7rLX5Ju _however_ watch to the very end and I might try just removing the very bottom panel
Answer: Woah, there is no filter in front on the intake fan. Try this:
Remove the two screws, slide the grille to the left then out
The fan isn't sharp, if you have small enough hands simply reach in. Use a small brush if you have one


Is there a fast tool to show all the unique unicode characters in a file and their count?

Question: Does anybody know a tool to tabulate all the unique unicode characters and their counts in a file?
Answer: I'm not sure what you mean exactly with "unicode characters". To count the different characters in a file you could do something like this:
$ awk -v FS="" -v OFS="\t" '{for(i=1;i<=NF;i++) char[$i]++} END { for(i in char) print i,char[i]}' input.txt

With -v FS="" we set the field separator to nothing. So each character is handled as a single field. In each line we iterate over these fields using the character as a key for the list and increment the count with ++. If all lines were read, we iterate over the counting list and print each key (which represents the character) and its count.
Comment: Note that this is going to be locale-dependent (and there are certainly conceptions of "unicode character" that it doesn't satisfy, as you noted).