Thrust produced by a Lycoming O-360

Question: How would I determine the thrust produced by a Lycoming O-360? I have looked for conversions of horsepower to pounds of thrust but have not had any success.
Comment: At what airspeed?
Comment: Can you tell us more about what you need this for?  Do you need a detailed model of thrust as it varies with throttle setting, altitude, and airspeed?  Do you just need to know the maximum thrust available?  Is the engine driving a fixed pitch or constant speed prop in this case?  Do you care about fuel consumption at all?
Comment: You have to know the details of the propeller. The value for static thrust is typically 4-4.5 lb/hp. An O-360 with a fixed pitch prop is somewhere around 700lbs static. Maybe with a CS prop, with blade pitch optimized, 750-800lbs.
Comment: Please consider the following: https://aviation.stackexchange.com/a/81009/7532 https://aviation.stackexchange.com/a/101652/7532 https://aviation.stackexchange.com/a/101679/7532 https://aviation.stackexchange.com/a/101657/7532 https://aviation.stackexchange.com/a/101650/7532
Answer: A reciprocating engine generates a power on its shaft which is measured in horsepower or Watt. That's all a reciprocating engine can do. What happens with this power depends on what is attached to the shaft.
If you attach a millstone to it then you're going to get some tons of flour per hour.
If you attach four wheels to it then you're going to get a car bringing around a couple of passengers and suitcases at some km/h.
And if you attach a propeller to it then you're going to get some thrust measured in lb or Newton. A quick and dirty estimation of the thrust produced by this propeller given the engine power can be found here.
Comment: @usual impolite downvoter: explain your doubts so that I can improve my answer, thanks
Comment: Your answers get downvoted because they've little value, show little consideration for the question being asked.  People are not interested in answers that *promote* other related answers, or another answer that seemingly answers the question, all written by you.  Add value to se-aviation with answers that inform, rather than answers that provide. *Teach* what is going on here, power plant to thrust, show some interpersonal skills, & consideration for the poster. Such answers may take *hours* to craft & compose... *Integrate references to other answers appropriately.* We value your knowledge!
Comment: @ThomasPerry: seriously? I explained that an engine supplies power, not thrust. I explained that you have to attach a propeller to the engine in order to convert that power into thrust. I explained how to estimate that thrust from the power... Sorry but I can't do more than this. If you're so sure that my answer is garbage then just flag it and I'll delete it...
Comment: You have to include a propeller efficiency factor in front of the cube root no or is that what k is for? In this video, a Cont C-85 with a fixed pitch prop produced about 320+ lbs of actual measured static thrust. The engine would've been well below its power peak tho, so probably only about 70-80 hp until it gets rolling.  https://www.youtube.com/watch?v=i_tX-U_GbI0
Comment: **Seriously!**  Do not delete your answer. I edited your answer, with all due respect to you, to informatively direct the answer to the question being asked.  If you find the edit acceptable, then let it stand, or if you wish, edit the answer otherwise.
Answer: Welcome to the club.  Unfortunately, in aviation, some people are loathe to describe engine/prop output by thrust because prop efficiency, especially fixed pitch, will change with airspeed.
Generally, a fixed pitch prop is designed as a "climb prop" or a "cruise
prop", with finer or coarser prop pitch, respectively.
Props generate thrust by mass acceleration as spinning airfoils, so angle of attack of the prop is critical.
What one can do is build a "thrust curve" at various speeds (a power curve if you will), by first determining the thrust requirement in level flight at various airspeed with gliding tests.
Now you see how much excess thrust  (at full power) you have by climbing at those airspeeds.

level flight thrust + climbing thrust = total thrust

The level flight thrust is determined by sine glide angle × weight.
The climbing thrust is determined by sine climb angle × weight.
This method will give, to an approximation, the thrust output of the engine/prop combination at various airspeeds.

Thrust produced by a Lycoming O-360


Modifying ClickOnce Output Folder Hierarchy

Question: I'm attempting to publish a ClickOnce Office Extension project (VS2010). By default the output folder of ClickOnce has a child folder (with each version of the binary files) named "Application Files." I need to change this to something without a space in the name, for example "AppFiles."
I haven't found any place in the docs where this is explained and the few answers I have found have said to use Mage to manually modify .VSTO file next to the bootstrap setup.exe. I'd like to avoid that if at all possible.
What is the best way to go about changing this?

I have tried a few different things. Instead of using the built in Microsoft.Common.props, In a copy of   Microsoft.Common.targets I've modified the _DeploymentApplicationFolderName property inside the _CopyFilesToPublishFolder target to "Application_Files." Also in a copy of Microsoft.VisualStudio.Tools.Office.targets, I've modified the Value of the ApplicationFilesFolderName property set inside InitializePublishProperties to "Application_Files."
Even after doing that, when I publish I get the following error:
<code>Error 121   Publish failed with the following error: Could not find a part of the path '<path to output directory>\app.publish\Application Files\ProjectStats_1_0_0_15'.
</code>
I'm guessing the problem is this is happening when the copy from the output dir to the publish dir happens but I don't know. Either way, the output directory hierarchy seems fine and the VSTO refers to the proper path in the hierarchy for the relevant dlls. It's just the publish process fails.
Answer: It turns out there's no way to fix this and still use the Publish wizard in Visual Studio. After looking at the code for the Publish method in Microsoft.VisualStudio.Tools.Applications.Project.ClickOnceProvider.BuildManager class in the Microsoft.VisualStudio.Tools.Applications.Project.dll assembly, the directory name "Application Files" is hard coded. There is no way to automatically fix this from what I can tell.


How do I monitor the temperature ever 3 seconds without entering new commands?

Question: I just bought a heat sink kit for my pi and I'm using Raspbian and would like to monitor the temperature continuously every 3 seconds via SSH while I perform tasks on the pi so that I don't have to keep manually entering in a command to display the current temperature, how do I do that?
Answer: I think using watch command is much easier, for example:
watch {your command}

In your case, it will be:
watch vcgencmd measure_temp

That will refresh by 2 seconds, if you want to define the interval by yourself (5 second maybe), you can type:
watch -n 5 <your command>

In your case, it will be:
watch -n 5 vcgencmd measure_temp

You can cancel that with Ctrl+C.
Comment: much more elegant and simple, thanks for the response
Comment: the use of *watch* is new to me. very elegant.
Answer: The command for viewing the current temperature is found in this post: https://raspberrypi.stackexchange.com/a/1847/22221
To automate this such that you can view the temperature every 3 seconds without entering new commands can be accomplished by writing a simple shell script that has an infinite loop:
#!/bin/bash

echo "Press [ctrl+c] to end monitoring"
echo ""

while true
do
  vcgencmd measure_temp
  sleep 3s
done

Place that text in a file called monitor-temp and place it in ~/bin/ (if !/bin/ doesn't already exist, then just create it with mkdir ~/bin). Make monitor-temp executable: chmod 755 ~/bin/monitor-temp. End your terminal (or ssh) session and start a new one. Now you can run monitor-temp from any location in the file system via ssh or directly on the machine and you'll see something like the following:
pi@raspberrypi ~ $ monitor-temp
Press [ctrl+c] to end monitoring

temp=48.7'C
temp=48.7'C
temp=49.2'C
temp=49.2'C
temp=48.7'C

Answer: If you want a few more bells as whistles, see the following script:
#!/bin/bash

for count in $(seq 1 100); do
    echo -n "$(vcgencmd measure_temp | echo "$(sed -E 's/.*([0-9][0-9]\.[0-9]).*/\1/g')" | echo "$(xargs)*1.8" | bc | echo "$(xargs)+32" | bc | echo "$(xargs)'F / $(vcgencmd measure_temp | sed -E 's/.*([0-9][0-9]\.[0-9]).*/\1/g')'C")\r"
    sleep 3s
done

The main benefit of this script is that the line carriage is removed so that you don't overflow your terminal window with new lines. Additionally, the temperature in F and C is displayed.
Sample output:
94.1'F / 35.0'C

This will terminate after 100 checks but can easily be modified to run indefinitely if preferred.
I created the following alias for this script in my ~/.bash_profile:
alias temp="sh temp_script.sh"

NOTE: The removed carriages returns only works when executing via "sh" command (i.e. executing script via ./temp_script.sh does not respect the \r special character for some reason). Also, there is some redundancy in the echo command, but I made the tradeoff of having it be a one liner. Lastly, Fahrenheit conversion is a bit wonky and doesn't match up perfectly, although the input formula should be correct.


System protection against low memory crashes when not using swap

Question: What would be a good alternative whole-system-crash prevention method? Preferably not based on maximum (per-terminal) memory allocation limits but the other way around: some way to reserve enough memory for system (critical) processes (a few whitelisted processes). Or simply (put) some way to block running new processes when the system reaches some limit. Or at least some monitoring application with notifications/warnings.
Comment: Not exactly what you're asking for here but in limited environments tuning the `/proc/sys/vm/overcommit_memory` setting can be a last-resort effort to have some applications crash less or at least later.
Answer: One option might be to adjust the value of /proc/<pid>/oom_score_adj to prevent the oom killer to kill the process in case of low memory situation. Setting the value to -1000 will prevent the kernel to kill the process completely.
Comment: I changed "crash" to "whole-system-crash". I hope this made my question clearer.


To check who is running scripts in On premise farm

Question: Is there any way to get detailed report of who is running CSOM/JSOM scripts in SharePoint 2013 environment and what those scripts are doing?
Answer: CSOM is using web services so you would have to look at the IIS logs to determine the operations. But I am not sure is there way to determine what is the source. (ie. you might be using some other software for migration/moving content around that might be using the web services as well)


How to set a role in DataSource from Spring

Question: I have to use a default Role so that after the datasource has been defined and connected that role will allow me to use select statements. I know its little weird but I have to do it due to security concerns. So here is the code in my Spring's applicationContext.xml:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
        destroy-method="close">
    <property name="driverClassName" value="com.ibm.db2.jcc.DB2Driver" />
    <property name="url"
            value="jdbc:db2://host_name:Port/DB_NAME:INFORMIXSERVER=SERVER_NAME;DELIMIDENT=y;" />
    <property name="username" value="user" />
    <property name="password" value="password" />
    <property name="minIdle" value="2" />
</bean>

Everything is fine I am able to connect to the datasource but I also need to tell the database that all the queries will be through this ROLE so that I do have select rights and stuff:
For command prompt I am doing like this:
set role ROLE_ACCESS_SELECT;

before executing sql commands but don't know how to set it up here.
Please advice.
Answer: DBCP's BasicDataSource allows you to pass SQL statements to be executed during initialization of the connection. Something like this:
<bean id="dataSource" class="org.apache.commons.dbcp.BasicDataSource"
    destroy-method="close">
    <property name = "connectionInitSqls">
        <list><value>set role ROLE_ACCESS_SELECT</value></list>
    </property>
    ...
</bean>

Answer: Never mind, I have fixed this issue. Thanks to all who looked at my post the solution is like this:
add this line after  minIdle property:
<property name="initSQLCommands">
            <list>
                <value>SET ROLE ROLE_WEB_OPERATORS</value>
            </list>
        </property>

and define a class such as:
public class ExtendedBasicDataSource extends BasicDataSource {
    public void setInitSQLCommands(List<String> initSQLCommands) {
        this.initSQLCommands = initSQLCommands;
        setConnectionInitSqls(initSQLCommands);
    }

}

And use that bean instead of org.apache.commons.dbcp.BasicDataSource while defining the datasource bean in Spring's ApplicationContext.xml.
Comment: axtavt's suggestion is better, since it doesnt require any extra coding... I think you should flag his response as the answer...
Comment: @HansWesterbeek: Enrique's (self)answer is basicaly the better version of what axtavt is saying (it has correct synthax) and it shows you how to set it programatically if you want. +1


Overwriting a files in place on NTFS

Question: Let's say I have a Python program that opens a file and overwrites it with zeros, and I run it on a Windows 7 computer formatted in NTFS. If this is done on an HDD (not an SSD) will the file be overwritten in place on the disk, or will the changes be written in a new sector and the file link updated?
Answer: Short answer:
Will the file be overwritten in place on the disk? Maybe.
For secure deletion of files, maybe, is not acceptable.
Longer answer:

I believe that depends on the flags used when opening the file and whether the file is compressed or encrypted.  It seems many applications that look like they are just overwriting end up writing the new content to another location on the disk and leaving the original content still on the disk as well.
To check the before and after location of the file you can use the DiskView tool from http://technet.microsoft.com/en-au/sysinternals/bb896650.aspx
Are you looking for a tool that will write all free space with zeroes?
There is a MS tool available for that but the way it works is that it creates new files filled with the same content (by default not zeros but compresses well anyway), and then deletes them all.  See http://support.microsoft.com/kb/833138 for more info.  It is also called "Virtual Disk Precompactor.ISO" and it is installed with Virtual PC or XP mode.
However this does create a short time when the disk is full and if the system is in use at the time it will spray new files all over the disk.  I was thinking that if you could make use of the defragmentation APIs to move a zero filled file to all free space locations on the disk it would have less impact on the running system.  But I've not seen any tools for doing this.
If you are looking for a tool to securely delete files there is one available from Microsoft on http://technet.microsoft.com/en-au/sysinternals/bb897443.aspx called sdelete which actually does some tricky things with the defragmentation API to actually erase sparse and compress files while just writing zeroes to those types of files will not write the zeroes to the same location as the old content due to the way ntfs works.  The link for the sdelete program gives a description of this.  Note that sdelete does not need to be installed as it is self contained.
Comment: No, it is a program that I wrote. It opens a file, fills everything with zeros, and then closes the file.
Comment: but why? are you trying to secure delete files?
Comment: Yes, and without having to install a program.
Comment: The program is already finished, quick and easy. I just want to know if it works.

Overwriting a files in place on NTFS


Samsung Galxy S2 cracked touchscreen, need to access contacts

Question: +I accidentally cracked my Samsung Galaxy S2 screen. I can't read the screen anymore. It would seem that the phone would work in every other way, if only was able to read and operate the screen. I looked up on the net for a replacement screen, but it is over $107.00. Not only don't I have that sort of money at the moment. But even if I did I would have to do all the taking apart and replacing of the damaged screen with the new screen. I found an awesome youtube instructional video that I can use once I get the money to buy the new touch screen. But I desperately need my contact details ASAP. I mean desperately. I have read where there is software that can do that sort of thing. But it also says that the phone needs to have been "rooted" I am not tech savy AT ALL. So any simple step by step instructions from anyone in the know would be so, so appreciated. Thanks in advance.
Comment: Are the contacts saved in your phone memory, SIM or Google account?
Comment: G'day I have removed my sim and the external memory card having found nothing on them. I suspect the details are on the motherboard. Don't understand the google reference.
Answer: The S2 supports usb on the go i believe use a usb keyboard and mouse and you'll be able to use the device as normal without touchscreen functionality however dont hold me to this as wikipedia states the following
The micro USB port on this device also supports USB On-The-Go (USB OTG) standard which means the Galaxy S II can act as a 'host' device in the same way as a desktop computer in allowing external USB devices to be plugged in and used.[12] These external USB devices typically include USB flash drives and separately powered external hard drives. A video demonstration on YouTube[56] has shown the OTG function to be readily available with an ordinary micro USB (B-type) OTG adaptor. The same YouTube video goes on to mention a successful test completed on a 2 TB USB external hard drive (requiring own power source) but however reports of failure when trying to connect USB keyboards, tested USB mice and tested USB game pads. Currently the only file-system supported for USB drives within OTG is FAT32.
Comment: Sorry i didn't realise you said you cant read the screen if you could somehow get the screen to display on another device with a usb port booster adapter and a micro-usb to mhl-hdmi adapter or another way then it could be possible maybe! i'm currently trying to do something similar with my xperia z3, fortunately i can still read the screen but all touch functionality has gone.


Why does snow seem to reflect red light best?

Question: I've noticed that snow seems to reflect red light more than any other wavelength at night. It's seen in the sky, as well as the snow itself, both of which take on a reddish tint. Why exactly does it do this? Additionally, why is this only noticeable under moonlight? If it's the moonlight that's tinted red, then alternatively, why is that? My apologies for the rather basic question, but I can't seem to find information on the matter elsewhere.
Comment: We don't get snow that much in the UK, but my memory of the last major snowfall was that everything looked bluish rather than reddish. This was during the day, but moonlight is also bluish provided the Moon isn't near the horizon. Was the Moon low in the sky when you saw the reddish colour?
Comment: I believe it was around 30 degrees from the horizon, so it could have been atmospheric interference. I actually hadn't thought about that.
Comment: During winter nights I observed reddish lighed snow below streetlights ([sodium-vapor lamp](http://en.wikipedia.org/wiki/Sodium-vapor_lamp) which has amber/yellow light) while the areas that were lighted by the moon looked blueish.  This makes sense. Since you mentioned moonlight, I guess you've observed the same like me?
Answer: According to most sources such as this university page on albedo and this modeling paper on albedo versus wavelength, the typical albedo of snow is virtually 1 throughout the visible region, so it seems unlikely that it is the snow itself which is causing this effect.
Also, I've never personally observed this as John Rennie stated, so perhaps it's caused by something else in your case, such as an atypical source of illumination.
Answer: Since red is on the opposite spectrum of blue, I would assume we perceive the reflection of red in greater concentration because the blue sky is reflected on the neutral(white) snow.  This is more intuition based however.  A good experiment would be to test different colors in pitch darkness to see if red still is the dominant reflected color.


Many subscriptions to a single queue with RabbitMQ STOMP

Question: Is it possible to bind a single queue to many topics using RabbitMQ STOMP client?
Each time a client sending SUBSCRIBE frame server creates a new queue for it, it makes usage of "prefetch-count" useless for me, because it applies to each subscription individually.
I am just looking for any way to get messages with many topics in the single queue via RabbitMQ Web-STOMP. Any ideas?
Comment: can you show us some of your code?
Comment: There was nothing special in my code. This time I've changed design of my app, but the question is how to bind one queue to many routing keys in RabbitMQ using its STOMP adapter. Currently the server creates new queue when receives SUBSCRIBE frame, but it is not the RabbitMQ style, as far as I understand it.
Comment: If this can help, this two frames will cause creation of two different queues:
Comment: SUBSCRIBE
id:worker-1
destination:/topic/topic-A
ack:client-individual
Comment: SUBSCRIBE
id:worker-1-2
destination:/topic/topic-B
ack:client-individual
Comment: The "id" field is required to be unique per session.
Comment: This is exactly what I am looking for. Any luck since then ?
Comment: No, but there is node.js and web sockets, since it works fine RabbitMQ is needed no more.
Answer: See Documentation:User generated queue names for Topic and Exchange destinations

The header x-queue-name specified queue name should binding to same queue if there exist, but will exist multiple subscription on client.
The different between AMQP and STOMP concept not compatible in some ways.
Comment: This is the feature of version 3.5.7 released 15 December 2015, I asked in 2012, but thank you :)


How do sharp objects deflect radio waves?

Question: This technology is used in stealth aircraft.The pointed nose of aircraft deflect those incident waves but not reflect back.Also speculate in case of rounded object with those waves.
Comment: This is just the ordinary law of specular reflection. Angle of reflection equals angle of incidence.
Answer: Flat metal surfaces reflect radio waves the same way that mirrors reflect light beams. for the case of a flat metal surface on a plane being hit with a radar beam from an antenna on the ground a distance away, almost none of the incident beam bounces off backwards in the direction of the receiving antenna and so a plane built of such flat surfaces yields a very small signal return and becomes hard to see on radar.
For a curved surface facing an incoming radar beam,  a significant fraction of the energy of the incoming beam bounces off the curve and heads back towards the antenna. Airplanes with curved surfaces are therefore easier to see with radar.


Setting up router with DSL dialer

Question: Ok I have a DSL connection at my home. The ISP has given me a username, a password and the service name. It is a PPPOE connection. I get an ethernet cable from the ISP, which I have directly plugged in my Ubuntu 12.04 machine. I dial using Ubuntu's default network manager DSL connection. Which is basically PPPOECONF.
So I have a router Linksys WRT54G, on which I have installed DD-WRT. I want to hook up my internet to the wifi, but I need to dial before I can use the internet. Can someone please help me with this. My machine has just one working Ethernet port. What would I have to do, which will enable me to dial via the router(I will need a modem for that), or dial via my system, but when the connection has been dialed via my system, and my system stays on, I must be able to use wifi.
Answer: Install wv-dial. First download the wv-dial from net.
Then go to terminal and simple give the following codes. sudo apt-get updateIt will take some time for processing. then to install the wvdial give this code: sudo apt-get install wv-dial  this will install the router. then simply restart the computer with the connection on. Starting of ubuntu it will configure the network.
To on the net go to terminal, go to root , then sudo pon dsl-provider. it will switch on the connection. To see the log give sudo plog. To switch off the connection give sudo poff.

Setting up router with DSL dialer


how can I check to see if a 4" slab of concrete was actually poured?

Question: I had a driveway poured three years ago. After a crack in the walkway appeared and two more developed in the driveway itself, my husband began to get suspicious that I wasn't given a 4" slab. If we dig around the side of the drive and measure the concrete, should it be 4"? or could it settle to a little over 3".
Comment: 4" of concrete doesn't really 'settle'. So what was poured is the thickness you'd be left with. As for the edges, that may not necessarily be the overall thickness depending on how well the base was prepared. As for cracking, that happens. There should have been expansion joints in the driveway that would control the cracking. If there weren't, that's a different issue than the thickness. It could also be that there was a poorly prepared based, settling out of their control, bad rebar, or all sorts of other issues. As for checking the actual depth, probably best to drill a hole in the center.
Comment: Good list, but there's always the "Reinforcing? What's that?" option for extensive cracking - either missing altogether or improperly placed. And no, concrete itself does not shrink or settle, so 4" should be 4."
Comment: Can you describe the approximate length and width of the cracks? What is the drainage like in the driveway area? Are there any expansion joints in the driveway?
Comment: Concrete settling, LOL.
Answer: If you are only interested in thickness of your concrete slab there is a method to measure it. Sometimes when someone doesn't know the strength of some old concrete element which was poured by someone else people hire specialist for this; they use special tool which is cylinder shaped and which drills the concrete and extracts concrete cylinder, which than you can measure. Don't be afraid that you will damage the slab because it is only inch or two wide. On the other hand if you are wondering what is wrong and how to fix it you need to provide us with more details. People who wrote comments have asked the right questions, especially Ecnerwal.
Answer: Cracking concrete rarely has anything to do with its thickness.
If the concrete has no footing below the frost line, cracking is virtually certain in an area with hard freezes.
If a no-load paving like a concrete sidewalk cracks, it is either because of a root, or because it is improperly drained. If concrete sits in water, it will absorb the water and then crack when the water freezes. Sometimes a sidewalk will crack due to adiabatic expansion of an improper subsurface (like dirt), but 95% of the time it is a water-related problem.
Comment: What is adiabatic expansion?
Comment: What are you talking about?  There is tons of good concrete with footings.  I have a 150 foot driveway poured in the late 60s that is in perfect condition.  It has no footings and is about 6 inches thick.  Thickness is a huge factor for cracks, as is rebar use, as is concrete formula, as is a proper bed, and a few other factors.   But thickness matters.  It might not have been the main issue but what you are saying is just wrong.
Comment: @DMoore Where do you live? The OP lives in a winter area with hard freezes. As for using rebar, it is true it will prevent cracking, at least until the rebar rusts, but I don't think the OP has rebar in her driveway.
Comment: Midwest.  We have 3 months of freeze and terrible heat in summer.  Terrible for concrete.  I have been dealing with concrete and mixing plants half my life.  Thickness matters.  There might be a point where it doesn't but it is no where near 2-3 inches.
Comment: @DMoore Midwest where? What state?


How I do configure the BigBlueButton module?

Question: I have installed the BigBlueButton module. Its demo is working fine. How do I create a meeting?
Comment: I'm voting to close this question as off-topic because it's a support request to a third-party dependency (hosted on drupal.org or elsewhere) and there must be reported to it's issue queue, not here. Thank you for your understanding.
Answer: I have resolved the problem following these steps.

Install the module
On the module settings page (admin/settings/bigbluebutton), put values for Server base URL and Security salt key, and save the settings
Create a new content type, for example Conference
On the content type setting panel (for the Big Blue Button module),
select Treat this node type as meeting and Display meeting status on node, and save the settings
Create a new Conference node and go to meeting


Utilizing emacs' or vim's syntax highlighter for command-line program?

Question: I have a command-line program that spews JSON and YAML. By default it detects if pygments (pygmentize) is available and if it does, pass the output throught it to get a nice colorized output. However, pygments is not installed by default on most computers that this program will run on. But most computers will have either emacs or vim, however, does. Is there a way to get one of these editors to syntax-highlight some text using ANSI escape sequences and then output it again?
Comment: Another option would be [GNU Source-highlight](http://www.gnu.org/software/src-highlite/source-highlight.html).  I use this to get colors with [less](http://superuser.com/a/71593/79870).
Comment: BTW, I just found out about coderay. It's ruby-based and its command-line program is much faster than pygmentize.
Comment: @RandyMorris: yup, there's even a CPAN module for it (my program is Perl-based). The only problem is that the dependency is quite large (installing source-highlight and its dev libraries to build the CPAN module pulls about 100MB of Debian packages).
Comment: I solved my problem by creating a JSON and YAML color dumper. Turns out I don't really need a syntax highlighter (blush). But I thank the advices in the answers.
Answer: as the editor can already do the ansi stuff, rather easy to make a screen capture of the editor, no?
script -qc "stty rows 10000
emacs -nw -visit YOURFILE.YAML -eval '(redisplay t)' -f kill-emacs
resize"

(redisplay is only needed for GNU FSF Emacs)
now clean up the capture
perl -p0E 's/\A(?s:.*)\e\[27m\r\n
\e\[A\n((?s).*?)
(?:\e\[K\n)+
\e.*\e\[27m\r$(?s:.*)\Z/$1/mx' < typescript

if you don't want the recording process visible on screen, you can wrap it in a hidden terminal with something like perl's IO::Pty
Comment: Nice trick! A bit overkill for the problem at hand though. Thanks.
Answer: Matthew Wozniski wrote a script called vimcat.sh that does this with Vim. His version is at https://github.com/godlygeek/vim-files/blob/master/macros/vimcat.sh. I've made a few modifications to it (if memory serves, the modifications allowed it to run on my Mac OS X system; I know the substitution of /dev/fd/9 for /proc/self/fd/9 had that purpose); see my gist at https://gist.github.com/4090959.
I believe both versions of the script have trouble with returning to default background color if Vim's highlighting changes the background.
Answer: Like Emacs (cp. ataylor's answer), Vim can render a buffer with full syntax highlighting to HTML; see :help 2html.vim. You could probably re-use much of the plugin's code that goes through the buffer's syntax, and change it to render to ANSI escape sequences, but you'd have to re-implement all the rendering logic by yourself.
Though there are some plugins that employ Vim as a pager, I don't think it is possible to just use Vim to output the buffer with ANSI escape sequences. After all, Vim wants to retain control of the terminal, and clears it when exiting.
I'd suggest to look for another, dedicated solution outside Vim, although that means you need to install it.
Answer: Emacs includes a function called htmlfontify that will convert a fontified buffer to HTML.  You can use this in batch mode with a small elisp script to render a file as HTML.  For example:
emacs -q --batch --file myfile.rb --eval '(progn (require (quote htmlfontify)) (htmlfontify-buffer) (set-buffer-modified-p t) (save-buffer))'

Comment: Thanks. Sorry didn't make it clear, I need it in ANSI escape sequences since I'm outputting to terminal. My EmacsLisp-fu is severely limited, but you've given me some pointers to play around.
Answer: If you don't want to follow @IngoKarkat advice and rewrite standard plugin to support ANSI escape sequence you may use my formatvim plugin, it supports rendering to ANSI escape sequence by using
Format format csi to /path/to/file

. Initially my plugin was a rewrite of standard 2html targeting for different formats support with easy addition of a new format (I spent about 30 minutes to add ANSI escape sequence support, mostly reading specification of these sequences), but current code has gone too far to mention similarities. It is known to work faster for big files or when you use one instance of vim to render a number of files (i.e. when warmup ("compiling" and cache fill) stage is masked by the benefit of further run).


I got an 'F' -- How can I improve my grade?

Question: I was working on the "All I want for Christmas is Sewers" mission in Rusty Hearts, (Canals B3, Very Hard) and I got an 'F'. How can I improve my grade? I got hit a few times, and I got what I thought was a huge combo (50ish?) Is there something else I need to do?
Comment: Study, study, study.
Comment: But the video in the answer does show the player getting an A rank (I believe the objective is to get B or better). Try going with Frantz. It seems like ranking is based on style and is improved by using not just combos, but overkills, chain kills, and blocks.
Comment: Perhaps this answers your question: http://gaming.stackexchange.com/questions/43756/in-rusty-hearts-how-do-i-get-the-a-simple-task-mission-to-complete-the-all-i
Comment: @Krazer That question is about how to obtain the mission. This question is about completing it.
Comment: I was able to double S rank the mission on my first try soloing it with Tude. Maybe it's easier to do with some characters?
Comment: @Krazer Yeah, I watched the video, but I can't follow his every command perfectly, so I was just mostly following the process, and I failed.
Answer: Your rank in a dungeon is affected by 3 factors:
Time
Self-explanatory. The longer you take to clear the various rooms, the lower your rank will go.
Style Points
The more Style Points you get, the better your grade will be. Ways to rack up Style Points include:

Perform high combos: Performing several attacks in succession and comboing your Skills with your normal attacks will help increase this quickly.
Overkill: Hitting corpses that are already dead will cause Overkill, as will doing more damage on a killing blow than life a monster has left.
Grab Finishers: Killing monsters with grab skills will give you bonus points, though apparently it also lowers the speed you kill/clear a bit, so you'll have to weight the benefits for yourself.
Chain Kills and Rising Hits: Slaying lots of monsters one after another will get you Chain Kills and doing air combos/juggling will get you lots of Rising Hits.
Blocking: Timing your blocks to do a Just Guard in order to counterattack. This is also good because the third factor is...

Getting Hit
The more you get hit, the lower your rank will go. It seems that the number to avoid is 16. After being hit 16 times, your rank will go down a level. So if you're at rank SSS and get hit 16 times, you'll go down to SS, another 16 hits, and you'll go down to S (excluding other factors). According to some, it may even be impossible to get SSS if you have massive Style points, but were still hit 16 or more times.
Some dungeons also have requirements where you must have a certain amount of Style Points by the time you get to a certain room, or your rank will drop. The playerbase has speculated on the formula a bit, but there seems to be either an element of randomness or there's just not enough information yet.


Slide In button effect of List View item for Android

Question: I'm porting an iPhone app into android app and one of the difficulties is recreating functionalities that are native to iPhone.
I found a native functionality of iPhone:
When user execute slide touch on a listed item in list view, a delete button appears.
Is there a version for this in android?
Can it be used and reused/customized?
Comment: instead of it they have specific behaviour.. Like on Long Click a list of options come..
Comment: I really want to know this....:)
Answer: This is just a bit more complicated to achieve.  This is what I would do talking from a higher level.

Create a custom ViewGroup/Layout to hold a list item.  Inside this layout you have your text lines images or what ever you have and also the delete button.  You also here listen for gestures to hide or unhide the delete button.
In your list adapter you are going to need to keep track of which item is showing the delete button and which is not.  Also, you are going to need to apply a click listener to each of the list item delete buttons.  Every time you assign these states on the list item you should setTag(...) and store the list item position so that when it's clicked you can tell which item number must be deleted.
After deleting you must refresh the list in order for it to take effect.  Depending on what type of adapter you are using that's going to determine how you refresh the adapter.

Hopefully this makes some sense.  But I definitely think this is the easiest way since I've done this a couple times with similar functionality.
Answer: I guess you could either try to implement gesture listener over the listview itself but it might be hard to get the correct id. Since I haven't done it myself I can not answer exactly.
Otherwise you might be able to your own view as the item in the listview and the have a gesture listener on all the childs.
Fling gesture detection on grid layout
For some basic reading and code examples
Answer: I dont think there is any built-in API function to do this.
However, a workaround would be to use the onFling function on the view in listitem.  You might be able to use this to accomplish what you want.
Answer: This is how I realize this effect. We have a ListView lvSimple and we add onTouchListener to our lvSimple. This is my working code.
<code>float historicX = Float.NaN, historicY = Float.NaN;
static final int DELTA = 50;
enum Direction {LEFT, RIGHT;}
...
ListView lvSimple = (ListView) findViewById(R.id.linLayout);
...
lvSimple.setOnTouchListener(new OnTouchListener() {
    @Override
    public boolean onTouch(View v, MotionEvent event)
    {
        // TODO Auto-generated method stub
        switch (event.getAction())
        {
            case MotionEvent.ACTION_DOWN:
            historicX = event.getX();
            historicY = event.getY();
            break;

            case MotionEvent.ACTION_UP:
            if (event.getX() - historicX < -DELTA)
            {
                FunctionDeleteRowWhenSlidingLeft();
                return true;
            }
            else if (event.getX() - historicX > DELTA)
            {
                FunctionDeleteRowWhenSlidingRight();
                return true;
            } break;
            default: return false;
        }
        return false;
    }
});
</code>
where function FunctionDeleteRowWhenSlidingLeft() is calling when when we sliding to the left, FunctionDeleteRowWhenSlidingRight - to the right respectively. In this function you need paste code for animation.
ps. I'm sorry for my bad english. Always glad to help.


Is it more cost effective to wash a car at home or take it to a car wash?

Question: Now that spring is here this becomes an option.  Is it more cost effective to wash a car at home (increasing water utility expense) or to pay to have it washed at a car wash?  Also which is more environmentally friendly?
Answer: In most of North America, water rates are cheap enough that it will save in actual dollars to do this at home; but there are other considerations.
You might also factor in your own enjoyment; if you like washing the car, more power to you, if you do not, then your time might be better spent doing something else.
The environmental factors are harder.  The car-wash probably uses more electricity, and the amount of water is difficult to judge, as it depends on how you wash the car yourself.
One major difference, from an environmental perspective would be that all your soap and other grime and oils, in the city, are all washing down a storm drain and going untreated into your local waterway.  The car-wash likely is connected to a sanitary sewer, so the water would be treated before being released.
I tend to take the most cost and environmentally effective approach; and wait for rain.  :-)
Answer: One of the local university researcher's report on environment suggests that environmental footprint of washing a car at home is greater than getting it done at the car wash.
Comment: I can see that.  Do you have a link to the report?
Comment: I shall try to locate it... it was posted some time ago in the newsletter of our university.
Answer: I think that it is cheaper to wash the car at home and maybe to ask your family members, so you can talk why you are doing it. Also with practice you can do this with the minimal amount of water. On the other hand, if I take my car to a car-wash I tend to go and have a coffee or something while I am waiting, so this again adds to the cost of not doing myself.
Answer: I have never used it, but there are products called "waterless car wash" which seems to be some chemicals and wax.
http://www.freedomwaterlesscarwash.com/index.html
This would use less water and electricity still, but I couldn't tell you how long your $20USD will wash a car.  It says 10 car washes, but I would bet your mileage may vary.


How to apply a theme to a spfx web part?

Question: I have a  spfx web part the gets and displays list items. I'm not sure how to apply a theme to this web part so that the font type and style of the web part title and list items match the rest of the site. Are there recommended best practice ways of doing this?
Answer: The most common and straightforward way doing it is through SASS variables, available in office-ui-fabric module.
Prerequisites: you have SPFx template generated with React as javascript framework (knockout also works).
Now open any of your .scss files or modules (.module.scss) and add import at the top of the file:
@import '~@microsoft/sp-office-ui-fabric-core/dist/sass/SPFabricCore.scss';

By doing this you effectively include a set of variables available in ui-fabric-core module into your scss file.
Now you can start using themed varibles to make your styles aligned with theme on a SharePoint website:
.my-selector {
  background-color: $ms-color-themeDark; // use dark color from SharePoint site theme
  border-color: $ms-color-themePrimary; // use primary color from SharePoint site theme
  color: $ms-color-white; // use white color from SharePoint site theme
}

During the build it will be translated to something like background-color: "[theme: themeDark, default: #005a9e]"; SharePoint understands this syntaxis and replaces it with actual values from the current theme. Which means that if you change a theme on your site, your webpart's colors will also be updated to match the theme.
To see the full list of all color varibles available, simply open node_modules\@microsoft\sp-office-ui-fabric-core\dist\sass\ThemeOverrides.scss
You can even go one step further and use spfx-uifabric-themes. With this module you can import the same list of variables, additionally, it contains some useful functions.
For example, if you want to apply error styles to your text, you can simply do below in your scss file:
@import './node_modules/spfx-uifabric-themes/office.theme';
.error {
  padding: 0 1em;
  line-height: 2em;
  @include stateStyle('error');
}

which get translated to:
.error {
  padding: 0 1em;
  line-height: 2em;
  background-color: "[theme:errorBackground, default: #fde7e9]";
  color: "[theme:errorText, default: #333333]"
}

This module also contains some useful functions for typography (based on SharePoint).
More reading - Use theme colors in your SharePoint Framework customizations
Comment: They should inherit if you don't override them with custom values.
Comment: Thank you this is very helpful. Are font styles in the web part inherited from the sites theme?
Comment: Hi Sergei, we have implemented $ms-color-themeDark in our office-ui-fabric-react webpart however it's not inherit the Theme of SharePoint Online.


Chicken breast out of oven after cooking a while; can I return it to the oven to continue cooking?

Question: I cooked boneless chicken breast at 350 F (175 C) for 30 min, then took it out of the oven. I left it out for 30 mins or so; the temperature was 104. Can I return it to the oven to cook to a temperature of 165 now?
Comment: Was that the temp when you took it out of the oven or after it sat for 30 min? You might not need to cook it more if that was the temp after sitting for so long.
Comment: @Kat I highly doubt that a chicken breast will go from a safe internal temp to 104F in 30 min.
Answer: In safety terms, yes. It's been in the 'danger zone' for a short enough time.
For texture, I'd say 30 mins was already borderline over-cooked, so it's only going to toughen up still further.
Comment: I agree, in principle, but tough to make a recommendation on this given the wording.  Remember, time in the danger zone is cumulative.  This assumes the chicken was never in the danger zone before cooking. It would be helpful to have more information.


How can I best debug solr in intelliJ-idea?

Question: How can I best debuging solr in intelliJ-idea? Which way is easy? when post a query to solr, I want to handle this.
Answer: You can set up the remote debugging. In the Run/Debug Configurations:

Then when starting your solr with the default jetty (this one is in multicore mode), pass in:
java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=8000 -Dsolr.solr.home=multicore -jar start.jar

After solr has started hit Run -> Debug button and choose the debug config. The IntelliJ IDEA attaches to the Solr java process and all the debugging goodies should be available to you.
Answer:
Run SOLR with command

solr -f -a "-Xdebug -Xrunjdwp:transport=dt_socket,server=y,suspend=y,address=4044"

This run configuration:


Incomplete File

Question: Sometimes, but not always, after taking shots with my Nikon D3100 it will show the preview on the camera screen and when I go to put them on the computer it will say incomplete file. I am wondering if anyone else is seeing this and if there is a reason for it?
Comment: How do you transfer the files to the computer? Memory card? USB cable? Etc.?
Answer: It sounds like the files are becoming corrupted, however there are any number of possibilities how this could be occurring.  If you are shooting RAW, it is possible that the preview jpeg (used for on screen display on camera and thumbnails on a PC) are actually intact, but the much larger raw data portion of the file gets corrupted.  If shooting JPEG, there are slightly fewer possibilities since the on camera preview would indicate the file was intact on the camera, but many of the possible problems are the same.
At some point along the file's path it is getting corrupted.  It could be a problem with the camera itself causing the file to never be fully written, it could be a problem with the memory card that results in the storage failing, it could be a problem with the memory card reader failing to read the file entirely or without error, and it could be a problem with the USB port or software opening the file on the PC that could be resulting in data loss or false indication of an error.
The best way to trouble shoot this kind of thing is to start replacing factors from that list, one or more at a time and see if you can get the problem to stop.  Try connecting the camera direct instead of using a card reader, or use a difference card reader, use the same card in a different camera and see if it gets corruption, use a different card in the same camera and see if you get the problem, try switching between RAW and JPEG, see if that makes a difference, try installing another piece of software to look at your images and see if that works.  Try accessing them on another computer altogether.
Based on the results of those kinds of tests, you should be able to narrow down what the problem is and what needs to be done to fix it.

Incomplete File


Is there a way to capture screenshot of an element in appium for python?

Question: I want to capture screenshots by elements in appium similar to the one in selenium. I am using python. Could not find much about this, is there any way to achieve this?
Answer: I think you can use the Appium driver.get_screenshot_as_base64() command described in the documentation: http://appium.io/docs/en/commands/session/screenshot/
Now you should have a screenshot of the full page. You can ask the element its location and crop the screenshot. This is described for Python and Selenium in detail here: https://stackoverflow.com/questions/15018372/how-to-take-partial-screenshot-with-selenium-webdriver-in-python
Although I didnt try it myself I think the cropping should work the same for Appuim based elements and screenshots.
Answer: This post is a little old, but for everyone else who ends up here appium does have this built in.
First find the element you want to screenshot (you can use the self.driver.find_element() function). Then the web element returned has different properties including "screenshot_as_png".
There are several options in my autocomplete (but I didn't see any documentation readily available but I did find https://stackoverflow.com/a/47959716/20523639):

Function: screenshot()
attribute: screenshot_as_base64
attribute: screenshot_as_png


How to Evaluate a Programmer's Communication Skills

Question: If I was interested in interview questions like "Describe how you explained a difficult technical issue to a non-technical person" I would use the Googles to search on communication skill interview questions.. But, what I really would like is to have someone actually explain to me some sort of relatively difficult technical issue. So I'm interested in are answers that identify a useful topic for this purpose or examples of what others have do to create scenarios for the purpose of evaluating a candidate's communications. In other words some exercise that actually forces the candidate to communicate something challenging rather than describe some time in their past when they were required to do so.
Comment: @orangepips: "wether or not it's actually true".  How do you establish this for **any** part of the interview?
Comment: This seems awfully contrived. What's wrong with "Describe a difficult technical issue to me"?  That seems perfect. What's wrong with it?
Comment: @orangepips: An interview involves significant judgement of veracity.  This is what the task is.  Creating or finding a tidy problem that the questioner has somehow "pre-studied" -- without any mistakes or errors -- before interviewing a technical expert seems to be impossible.  I can't see how this would work.  Can you clarify how it's possible for the questioner to be an expert in advance of interviewing a technical expert?
Comment: I'm not sure you can evaluate how they exmplain something if you don't know the answer ahead of time.
Comment: @S.Lott: so that I can evaluate not only how something is communicated, but whether or not it's actually true. And, have point of reference for comparison between candidates.
Comment: @S.Lott: because the question is on known topic to the questioner. The setup could be that prior to the interview a candidate is instructed to make themselves knowledgeable about that topic.
Comment: @orangepips: "because the question is on known topic to the questioner". What about the situation where the questioner happens to have bad or incomplete topic knowledge?  What then?
Comment: @S.Lott: one possible answer to this question is identifying a useful topic for this purpose and an understanding about why its useful. A questioner would need to educate themselves about it ahead of time before conducting an interview.
Answer: Easy, ask what they've worked on, or what tools they used, or what techniques were used. Whatever, it really doesn't matter, as long as you don't know about it. Everyone has some bit of niche knowledge about the last thing they worked on.
Then ask him to explain it to you. Not just what he did, or how he did it, rather get him to explain how it works. Like if his last job included hashing algorithms. Ask him to explain them to you. Maybe not the actual hashing algorithm, but how they work, what they're used for, their limitations, you know, technical stuff.
In short, to test his communication skills, you're going to have to communicate with him.
Edit
If you wanted to test their ability to communicate with non-technical people, pull in a non-technical person and quietly sit to the side as the interviewee explains something to the non-tech. For this, I'd choose a topic that you're familiar with, so that you can detect bullshit. But remember, no analogy is going to be perfect. Also, make sure that the non-tech is at least a little interested, or is willing to put in an effort to learn something new. Horse -> water.
Comment: Great answer.  There's always _something_ on their resume I haven't used before.  And you can always verify the facts after the interview if the answer sounds fishy.
Comment: +1 fair enough. Do you think it's possible to evaluate that person's communication skills with a non-technical person using that approach? In other words, say the idea would be explaining hashing algorithms to an accountant instead of a programmer. Would you evaluate that differently?
Comment: I don't think this is challenging enough. Procedural description (i.e. the _how_) is a relatively easy form of communication, one in which esp. programmers are skilled because that's how we communicate to the computer. A greater challenge would be tasking the interviewee to communicate the _why_. That is the gist of my answer: http://programmers.stackexchange.com/questions/91984/how-to-evaluate-a-programmers-communication-skills/92338#92338
Comment: @matthew Rodatus: ehhhhh, "how they did it" is procedural. "How it works, what it's used for, and it's limitation" goes a bit beyond that.  You have very good advice, but it gauges their rationality more then their communication skills. Although that's arguably more important.
Comment: If your own communication skills are suspect, you may not be the best *evaluator* of someone else's skills. Get a skilled communicator to do the evaluation (or at least observe).
Comment: @Philip Good point. I do see now that you mentioned limitations in your answer. That would test their reasoning skills. Also, I would argue that rationality (i.e. logic) is the primary attribute of good communication skills. It affects the organization and coherence of the content, the consideration of context, conciseness, etc.
Answer: If you're trying to evaluate how someone communicates, it'd seem like a good idea to hold what is communicated constant. Give the candidate all the information they need -- maybe a chunk of code or a diagram of some sort of system -- and sufficient time to digest it. Then ask the candidate to explain the information to you, or ask them how they would explain it to a smart but non-technical person, etc.
By providing the subject matter, you put all the candidates on an equal footing, and you can also make sure that you understand the material yourself.
Comment: +1 this is along my lines of thinking, looking a good example of that constant.
Answer: Agree with many of the comments, that this seems overly contrived/complicated but...
It seems you have a few choices

Ask a question from a domain outside of the field of expertise - "Explain how a transmission works"  Which helps you see how they communicate their understanding of black box systems.
Ask a question from inside the programming domain - "Explain how distributed version control works"  Which helps you understand how they understand something you both know and have experience in.
Ask a question that targets their understanding but not yours - "Explain to me the X algorithm/system/interaction you worked on for those five years from 2003-2008"  Which helps you understand how they communicate their (deep) understanding to a novice.  (note - you can also separately test for correctness of their understanding in another part of the interview, you don't need to test for communication and correctness together)

I'm probably missing one or two :-)
Comment: +1 - first two bullets are perhaps the most concrete examples of any answer thus far.
Answer: Persuasive communication is a form of critical thinking and the hardest form of communication. So, I would test their ability to consider competing ideas and formulate a rational argument supporting one of them.
Ideas:

Ask them a question that is loaded with heated subjectivity, such as their preference of static typing or dynamic typing. A good result would be if they objectively evaluate the facts, the applicability of both approaches in different situations.
Ask them a question that is ambiguous and open-ended, such as "What is the best sort of developer to have on a software team?" A good result would be if they list a handful of attributes that are characteristic of all good developers and then discuss how a team-oriented philosophy doesn't require all developers to have the same set or level of skills; rather, you want at least one developer with skill set A and other developers with skill sets B or C.

An open-ended question involving technology choice could be "What is the best programming language for a web application?"
Or design-related: "What are the most important design patterns to have in a code base?"

Bad responses would have:

Unclear rambling
Primarily subjective preference
No objective evaluation
No consideration of opposing viewpoints

Most programmers are adequately skilled at procedural description (i.e. the how question) since that is how we communicate with computers, so I would test their ability to formulate an answer to the why question. By asking an open-ended question, you get to discover if they are able to distill the possibilities into a useful and wise conclusion.
Comment: +1 for the "it takes a village" sorts answers these questions require.
Answer: Relatively difficult could be a rather loaded term to my mind.  Was it just difficult at the time?  Difficult as in the problem could be a Ph.D. thesis?  As difficult as one of the Millennium Prize Problems?  There are various interpretations of the term here as one could infer that this was just the hardest problem someone faced to date, hardest someone faced and resolved, or hardest someone ever read to give a few different directions here.
What you may perceive as difficult may or may not be to someone else.  Thus, I'd suggest breaking the question down into 2 parts.  First, have the candidate identify their hardest past problem and tell just the facts about the problem.  The second part is explaining where was the difficulty, which is giving an opinion on where was the challenge and how was this seen and tackled.  While this starts with what was done, the second part is where there may be all kinds of follow-up questions to see how did someone see this as hard.
Comment: I'd like to think that answers provide possible topics for this purpose. I'd suggest that's what Programmers stack exchange purpose is: answers to qualitative questions, whereas SO wants quantitative.


Is the 'isa' variable in objective-C equal to 'instanceof' in Java

Question: Simple question: is it fair to say that the 'isa' instance variable in Objective-C provides the same functionality as the 'instanceof' operator in Java?
Comment: Should help: http://stackoverflow.com/questions/3405224/what-does-isa-mean-in-objective-c
Answer: These are different concepts.
One is a member of a struct, while another is an operator.
To mimic a strict interpretation of the instanceof operator in Java, you can do pointer comparison on the isa member:
if(obj->isa == [SomeClass class]) {
  //obj is an instance of SomeClass
}

But it is recommended that you use the NSObject protocol's -isMemberOfClass: method to accomplish this instead:
if([obj isMemberOfClass:[SomeClass class]]) {
  //obj is an instance of SomeClass
}

If you are interested in knowing if the specified class is an instance of, or is a subclass of another class, you should use the NSObject protocol's -isKindOfClass: method.
Answer: From the Objective-C programming guide:

id is defined as pointer to an object data structure:

typedef struct objc_object {
  Class isa;
} *id;

Every object thus has an isa variable that tells it of what class it is an instance. Since the Class type is itself defined as a pointer:

typedef struct objc_class *Class;

the isa variable is frequently referred to as the "isa pointer."
Answer: No. instanceof is more like the isKindOfClass: method in Objective-C because it also evaluates to true for subclasses while the isa pointer only points to a single class.
Answer: In 64-bit implementations of the Objective-C runtime, isa became 64-bits - like all other pointers.
Apple is using a clever trick to speed things up: they are relying on the fact that all 64-bits aren't used for the address, so they are using some of the bits to store things like retain count. This way they don't need to go modify the retain count for an object in a separate table with all the performance implications that that entails.
What this means is that direct comparison of the isa pointer does not work at all. This is true for OS X and now iOS 7 on the 64-bit A7 (iPhone 5s).
Treat isa as an implementation detail. Do not access it directly. Use -isMemberOfClass: which will do the proper thing (which in 64-bit OSes now involves masking off part of isa).
More info: http://www.sealiesoftware.com/blog/archive/2013/09/24/objc_explain_Non-pointer_isa.html


Retrieve GPS Data

Question: I have tried to Google this but not sure how or if it's possible.  How can I retrieve my gps data from my android phone from an older date to prove I was not speeding?
Answer: Even if you had a continuous stream of GPS fixes from the time you're interested in, you couldn't use it in court to prove you weren't speeding. GPS doesn't record speed, only a sequence of positions, and there's enough error on each position that the speed can be inaccurate - inaccurate enough to look like you're speeding when you're not, or vice-versa.
Location History doesn't record GPS co-ordinates often enough to be any use for this purpose even if it were accurate enough anyway. You can get apps to record this information continuously, but they need to run all the time so they really drain the battery. And of course you can't go back in time to install the app before the date you want.
Answer: Go to your location history here: https://www.google.com/maps/timeline.
Keep in mind that the location history might not be complete and also doesn't contain any speed information.
Comment: Tried that but it doesn't show anything for that date.
Comment: Then there is no way (I know of) to get any GPS information unless you actively tracked it.

Retrieve GPS Data


How do I ensure my website or web app based on html works on all browsers properly

Question: I am wondering if there is a way or settings I need to do in html file so that my asp.net website/html based website works properly with correct length/height dimensions in all the browsers (IE/Firefox/Opera)...etc.... Whats the settings and where I need to do it ?
Answer: Go to the Test Center at http://crossbrowsertesting.com/user and run live tests. You'll have options for multiple browsers and versions.
Comment: well, I spent a lot of time typing to get schooled in 2 sentences... I'll have to check that site out! Good stuff, Scorpio!
Answer: There really isn't one way to check all browser compatibilities...
The main problem with this is that each browser uses its own variation of the CSS3 standards. Gecko and webkit browsers seem to be fairly consistent, but IE usually throws a wrench in the gears, especially between versions.
In all honesty, you are best making sure you comply with the standards and include browser engine specific styles to target each browser.
For instance, if you are setting the background and you wish to have a CSS styled gradient, you may need to do something like this:
<code>.gradient-bg {
    background: #ececed;
    background: -moz-linear-gradient(top,  #ececed 0%, #fefefe 100%);
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,#ececed), color-stop(100%,#fefefe));
    background: -webkit-linear-gradient(top,  #ececed 0%,#fefefe 100%);
    background: -o-linear-gradient(top,  #ececed 0%,#fefefe 100%);
    background: -ms-linear-gradient(top,  #ececed 0%,#fefefe 100%);
    background: linear-gradient(top,  #ececed 0%,#fefefe 100%);
    filter: progid:DXImageTransform.Microsoft.gradient( startColorstr='#ececed', endColorstr='#fefefe',GradientType=0 );
}
</code>
This ensures that we address legacy browsers that don't support any gradient transformations, as well as various versions that do support but in different ways (i.e. -ms-linear-gradient vs. filer: progid:DXImageTransform.Microsoft.gradient or -webkit-gradient vs. -webkit-linear-gradient). Also note that any CSS attribute that is not recognized by the browser is simply ignored and the browser's rendering falls to the next recognized style variant.
It is becoming more and more industry standard that you develop for CSS3 and let unorthodox browsers render unorthodoxically.
The only way to be truly sure is to check it in each supported browser and see for yourself. Also be aware, though, that while IE comes with developer tools that allow you to view your content rendered as if in previous versions of IE, it still may be drastically different from the actual (non-compatibility view) version.
Easiest way to get IE to render the same (or close to it) across various version numbers is to force compatibility through a META tag. ( renders in IE7 mode and supports DOCTYPE directive).
Long story short... try to stick to standards to make webkit & gecko compatible, then address IE issues as you stumble upon them. Since IE is about the only browser not in the other 2 categories, you should be good.
Comment: Thank you so much Eric for your very detailed reply. Appreciate your attitude and help always :) Thanks for sharing your knowledge, it helps me grately :) Cheers
Answer: Use a service that allows you to view your page in multiple browsers like Adobe Browser Lab.


Identify unmarked leads on a 9-lead motor

Question: How would I go about identifying unmarked leads on a 9-lead motor?
I also need to establish whether this is wired delta or Y.
Comment: Large motor? Any idea on the kW rating and any other nameplate information?
Answer:
You would need to measure the continuity of each winding with a digital multimeter or similar device. Doing a quick google search found this schematic. It should become fairly obvious whether it is in star or delta once you start taking the measurements as there can only be a certain pattern of readings - providing the windings are in sound condition.
Comment: Conceivably it could be an 8 way connection (e.g. a 4 coil stepper) with an earth.
Comment: If there are just 9 unmarked leads, and it is a three phase AC motor, you will also need to determine the phasing of each winding before attempting to connect it.
Answer: The schematics above provided by Joshyp00 are helpful in determining the leads, but alone do not provide enough information to mark all 9 leads.  To do that, you can use a battery flashing method, outlined below.  You will need a 6 or 12 V lantern battery and preferable an analog voltmeter, like the old Simpson 260. You will also a sensitive ohm meter. Before proceeding, it is a good idea to check the motor for grounds.  A megger is the best way to see if any of the leads show leakage to the frame of the motor.
Next, use an ohm-meter to determine if the motor is Y or Delta connected.  A Y-connected motor will have 3 groups of 2 wires each which show nearly 0-ohms between each pair, and a 4th group which shows near 0-ohms between 3 wires.  A Delta connected motor will have 3 groups of 3 wires each which show near 0-ohms (see diagrams above).  There should not be any ohm reading, i.e., infinite ohms, between the groups. (Don't hold the meter leads with your fingers as you will get a resistance reading through your body). If there is a reading, the motor may be bad or it is a different type of motor other than an AC induction. Put different colored tape on the wires in each group to keep the groups separate. The remaining steps below are different, depending on whether you have a Y or Delta connected motor. You will need a 6 to 12V lantern battery.
Y-connected Motor

Randomly assign the numbers 7,8,9 to the 3 leads which are part of the 3-lead group.
You will be touching the battery between leads 8 and 9 (polarity not important on this step), and monitoring the voltage deflection on each of the other 3 pairs of wires, each in succession.  Find the pair with the minimum or no voltage deflection. This will be the 1-4 pair. Use this pair for the next step.
Differentiate which is 1 or 4 by moving the battery to the 7-8 wires, with + on 7 and - on 8.  Connect the volt meter between 1&4, swapping the leads in such a way as to get a positive deflection when the battery is connected (will go negative when removed).  The + lead of the volt meter will be lead #1 and negative voltmeter lead will be lead # 4.
Move the battery to the 7-9 leads with positive the #9 lead and negative on the #7 lead. Find lead #3 by looking for a positive deflection on one of the other pairs. The other lead is #6.
Finally move batter to 8-9 pair with + lead on #8 and negative flashed to #9. Positive deflection on the meter will identify #2 lead and the other is #5.

Delta-connected Motor

For the delta connection, a sensitive ohm-meter usually works at least on smaller motors. Measure the resistance between any 2 of the 3 leads in a group. Find the lead that is commonly the lowest reading between the two and that will labeled either 1,2 or 3.  Just pick a label for each group. If the ohm reading is too low to determine the center wire, you can pass a low-voltage DC through the pairs of wires and measure voltage drops to determine which on is in the center.
Connect the minus of the battery to both of the two of the leads from group #1 which are not labeled. You will be flashing the positive battery lead to the other lead which should be labeled #1. Connect one of the voltmeter leads to lead #2. You will be monitoring the other two leads from the #2 group to find the one with the largest deflection. That lead will be #7. The other lead in the group will be #5. The deflection occurs when the battery is connected.
Keeping the battery the same as above, repeat the procedure for the other group. Put the voltmeter between lead #3 and one of the other leads in the same #3 group. Look for the largest deflection between lead #3 and the other two wires. The wire with the largest deflection will be lead #6 and the other one lead #8.
Last step is to determine which is #4 and #9.  Move the battery negative lead to both #5 and #7, and the other battery terminal will be flashed to #2 during the test. Connect the voltmeter between #1 and one of the other 2 wires in the same #1 group. The wire with the largest deflection will be #4. The other wire is #9.
Comment: Otto quick question for you. I totally understand the science behind this operation however when I am using it on known leads the two leads that I'm looking for have the most inflection on my meter. Can you please explain.


Problem with Monero GUI and Ledger Nano S Plus

Question: First I read this guide.
My system: Windows 10 (64)
A few months ago I created a Monero Wallet on the Ledger Nano S plus.
I transferred 1 Monero for test.
The Monero was displayed on the wallet.
A few days ago I wanted to restore my Monero Wallet on a new notebook with simple mode, but it appears only 0, no transactions are displayed.
I thought the 24 seed of ledger is enough to restore the wallet.
When I restore the wallet, which mode should I use, the simple or advanced mode?
Answer:
but it appears only 0, no transactions are displayed

See: I am missing (not seeing) a transaction to (in) the GUI (zero balance)

I thought the 24 seed of ledger is enough to restore the wallet.

See: How do I restore / recreate my Ledger Monero wallet?


Can one instantiate RAM with 2 read ports and 1 write port as IP in Quartus?

Question: As part of MIPS design we have something called as register file. It only has 32 registers each 32 bit which only makes 1024 bits or 128 bytes. I am not sure how to tell Quartus to instantiate this as a memory block with 2 read ports and 1 write port. The Dual Port RAM in Quartus seems to be having 2 read/write ports. It is not possible to have 2 read and 1 write port. How do I create a 2 read port + 1 write port memory using the memory blocks in Altera Quartus II?
Comment: Can the write port share the same address bus as one of the read ports? (Or is write access mutually exclusive with read access on one port?)
Comment: It is mutually exclusive
Answer: There's a trick for doing this in Xilinx technologies : instantiate two memory blocks, with their Write ports tied together. (Each block is configured to have 1 read and 1 write port, independently addressable).
I can see no reason why the same pattern wouldn't work in Altera FPGAs. Last time I looked, their memory blocks had similar dual-port (just not 3-port!) capability.
Comment: well that looks like a good idea, I will do that
Answer: Given from the comments your design writes and reads at different times, you can actually use a True Dual Port RAM for this.
For one of the read ports, you would wire up port A so that it is say read-only (tie the write enable permanently to 0).
For the other read, and the write, these would both share the same port on the RAM. You would use a multiplexer on the address input which is controlled by the write enable signal - so basically when you perform a write, the multiplexer will select your write address and connect it to the address pins of the memory. When you are not doing a write, the read address will be connected to the memory allowing you to perform read operations. This should work because as you say you never need to write and read on that port in the same clock cycle.
If you need more clarification, I draw up a diagram to explain further.
Answer: You can't, as far as I know, because there is only the logic for two ports in the hardwired parts.
Your options are:

delay loading the second operand until the next pipeline stage
delay writing the result if the currently decoded instruction has two register operands
implement the register file in LUTs.


As a contractor, should I own the GitHub repo until final payment?

Question: I know a contractor generally owns the code being developed until final payment from the client. If using GitHub, does this mean the contractor should pay for a private repo on GitHub, work on the project from his/her account, then transfer ownership of the repo once final payment is received?
Answer: There are a couple reasons why I would not recommend the approach you're entertaining:

In many cases, the client expects you to collaborate with their own employees while you are working. You may even need to work in a repo that they already control. Though it sounds like you aren't dealing with that here, since such scenarios are common, you ought to have a way of working that accommodates them.
You will be much more successful as a consultant if you can establish relationships based on trust rather than distrust. Keeping the repo to yourself may provide you with the leverage to ensure that final payment, but it doesn't create the "warm fuzzy" that will get you future work, recommendations, etc. (See reference below.)

Instead I would suggest adopting the stance that the client owns the code from day one, and make sure they have visibility, access, and even the ability to boot you out when they want to. The idea is to make yourself easy to fire. (Again, see reference below.)
Then do other things to increase the chances of getting paid:

Bill incrementally.
Demo your work regularly so that if there are concerns, you catch them early.
Charge enough so that if the client stiffs you on the last payment, you'll survive.
If the client is smaller and you don't feel comfortable that you'll be paid, you might ask for a reasonable advance payment. (Larger clients won't typically do this, just because you shouldn't have to worry that a large client won't pay.)

Finally, related to the points above (including the "warm fuzzy" idea, the idea of making yourself easy to fire, etc.), I can't recommend this article highly enough:
http://www.unixwiz.net/techtips/be-consultant.html
Comment: Almost all of my work collaborating on code has been in my clients' own git repositories on existing projects, and I billed monthly to make it easier on the clients (who paid alongside employees). The contractors on the job were essentially temporary full time employees and we were involved in all company meetings and we managed our own sprints, etc.
Answer: I mostly agree @willie.  I think all those points are valid, but I also think it is reasonable to maintain some control over the work product.  This should be clearly stated in the contract as well.
I did some work that was back loaded on payment and got burned.  My next contract clearly spelled out payment points.  1/3 up front, 1/3 at beta demo, 1/3 on final delivery.
My contract clearly stated deliverables and what form they would take.  I did not really state what technologies I would use for source control, just that I would turn over full access to the source after final acceptance and payment.
If the client is very concerned about access to the servers and access to the source code and wants to do payments backload, these should be red flags about a client that may likely stiff you.
Answer: If you are doing any work that will be available to the client (or client's employees) then you might consider not doing ANY work unless you receive a deposit as a guarantee that the client doesn't disappear with your work-product.  (this happens every day)
If you're starting a four-week project, get a deposit for the first week and bill weekly.  DON'T start week 2 until you've been paid for it.  This minimizes the risk to you.
It is perfectly okay to explain to a client that part of your business practice includes minimizing risk to yourself.  You don't have to be a jerk about it and declaring this up front gives you a platform to compromise with, according to how you're feeling that this client will perform (in terms of paying your invoices) in the long term.
Overall, just don't walk in with a blind eye.  Everybody's not honest.  Keep your Github repo private and if the client is asking to dig into it, make sure some money changes hands first.


Minecraft alpha 1.2.6 lags when loading new chunks. Anyway to tone down the lag?

Question: Recently I've noticed that when I'm loading new chunks in minecraft alpha 1.2.6, it lags. Since this is an old version, there might not be a way to combat this, but if there is, how can I tone down the lag? I have 4G RAM and the latest version of Java. My memory usage is at about 20-25%. Also, I normally get about 60FPS in small window mode. (I just like small window better.)
Comment: @shanodin because I just love the old versions of minecraft, back when it still had it's magic....
Comment: I'm pretty sure chunk loading is CPU intensive, not ram intensive
Comment: Why are you using such an out-dated edition of Minecraft?!
Comment: @Ender I'm still going to include it if does involve anything.
Comment: Could you go in-game and press the f3 button? In the top right it should say the memory usage. Could you add that result into your question?
Comment: @Geertsma Updated my question.
Answer:
How can I tone down the lag?

You can do the classic "allocate more RAM" mixed with a NORMAL or SHORT render distance. That way the game will load a small number of chunks at the time.
Just set -Xmx to the maximum RAM that you want to allocate for the game. As an example:
-Xmx512M # 512MB
-Xmx2G # 2GB

As far as I know, there is no OptiFine version available for Alphas, Betas or Snapshots.

Since this is an old version...

Yep, I did some testing with Alpha 1.2.6, Beta 1.5 and Release 1.12.2 and even my "light gaming capable" PC struggled to keep up. Looks like this version is not optimized for recent PCs.
This is my benchmark of the Alpha 1.2.6 (old_alpha a1.2.6):
Average framerate  :   70.1 FPS
Minimum framerate  :   19.7 FPS
Maximum framerate  :  122.9 FPS
1% low framerate   :    4.1 FPS
0.1% low framerate :    3.0 FPS

Just in case, a benchmark of the Beta 1.5 (old_beta b1.5):
Average framerate  :   81.2 FPS
Minimum framerate  :   39.6 FPS
Maximum framerate  :  157.7 FPS
1% low framerate   :   15.1 FPS
0.1% low framerate :   5.6 FPS

And a more recent game version, Release 1.12.2
Average framerate  :  126.5 FPS
Minimum framerate  :   43.8 FPS
Maximum framerate  :  222.9 FPS
1% low framerate   :   27.9 FPS
0.1% low framerate :   16.2 FPS

All of them used the same world and graphics settings (medium render distance and fast graphics preset) plus none of them were modified. The resolution used was 1366x768.
Answer: Lowering the render distance to 10 and capping max frame rate at 60 keeps most lag away for me. And I have an old ass Mac.
Answer: I had a similar issue, what worked for me was getting the Technic launcher and installing the old days modpack. It works fine in fullscreen mode and I played for about 2 hours with no lag at 120fps on a 2014 Mac Mini (8gb RAM).


How to migrate from Windows 7 to Windows 10 double bootcamp boot on Macbook late 2011 - MacOS High Sierra

Question: I am running from long time windows 7 on double boot with bootcamp on a Macbook late 2011 i5 with MacOS High Sierra 4Gb mem.
Due to discontinuation of win 7 support I wish to migrate to win 10.
I read some similar questions but I get confused and, therefore, I ask for HELP.
Thank a lot
Dino Vitale
Comment: We can only answer specific questions. You need to say what port of a similar question you don't understand
Answer: As per my understanding, If you have a Macbook running a "genuine" copy of Windows 7/8/8.1 (properly licensed and activated), you can follow the same steps I did to upgrade it to Windows 10.
Boot your MacBook from your Windows 7 and carry the steps:
To get started, go to the Download Windows 10 webpage and click the Download tool now button. After the download completes, run the Media Creation Tool.

Choose the Upgrade this PC now option and be done with it.
Then just follow the prompts to complete the upgrade. You will not be asked for a product key, and when the upgrade is complete and you've connected to the Internet, you'll have a digital license to Windows 10, which you can confirm by going to Settings > Update & Security > Activation.
The digital license is associated with that specific device, which means you can reformat the disk and perform a clean installation of the same edition of Windows 10 anytime. You won't need a product key, and activation is automatic.
Comment: And just for an extra comment - if you will be asked for a product key, then just use the Windows 7 product key, this key can also be used on any install, on any PC - if you would want to do this.
Comment: Also note that Apple does not officially support Windows 10 on that Mac. That means that some things may not work because Apple does not have updated drivers (officially) for Windows 10 on that Mac. People have been successful doing this but it may require a bit of fiddling and/or putting up with things that don't work.


Cannot connect to my RPi via ssh

Question: I installed raspbian stretch on my Rpi 3 and it works perfectly using HDMI display. But when I run it using ssh on my laptop. I cannot connect it using the ethernet. My laptop sends the packets but it does not receive them. when I ping it says "Request timed out". Please help
I'm trying to connect via ethernet
Comment: Please can you edit your question and insert the output as text and not as a screen shot image? I can't read it. How is your laptop connected to the raspi? Ethernet? Wifi?
Comment: step 1 - verify IP address of the raspberry pi
Answer: Sometimes your hostname and IP are not in up-to-date. try connecting via the RPi IP address instead of its hostname. If that works, then you know the problem (or better, you know the Pi is not the problem). If it does not work, you'll have to dig deeper. Is ssh enabled? By default, a fresh install has ssh disabled and you have to enable yourself.
To enable it you can either run sudo raspi-config, or, if you still have the sd mounter on your OS (the one you used to copy the image to the sd), you can create an empty file in the boot partition of the sd, named 'ssh', and that's it.
Comment: Please tell me how to connect Rpi via IP address

Cannot connect to my RPi via ssh


How to change default terminal of Geany to Konsole (or another emulator that supports CTL)?

Question: I am using Konsole as a terminal to contribute to wikimedia pages. I use Konsole because unlike most terminal emulators it supports CTL (complex text layout) so I can clearly read my language (Tamil) in Konsole. The default terminal of Geany is not so good. I want to change the default terminal. How can I do that?
Comment: What version of Geany do you have?
Comment: 1.27 (Rezer-built on or after 2016-04-17)
Comment: Does any terminal appear in Geany? I have the same version but only see Status, Compiler, Messages, and Scribble. No terminal at all.
Comment: [See settings.](https://commons.wikimedia.org/wiki/Category:Geany#/media/File:Geany_0.10_de.png). Check here. Edit-->Preferences-->manyTabs-->Terminal
Comment: Sorry, I still don't see a terminal tab. I hope someone can help you! You could also sign up at https://lists.geany.org/cgi-bin/mailman/listinfo/users where Geany devs are available.
Answer: Way 1: You can change the terminal in the Tools tab in Geany's preferences.
In its Edit → Preferences dialog, Geany has a Tools tab. (This is separate from the Terminal tab.) One of the utility selections that you can configure from the Tools tab is Terminal.

It has this as its default value, but you can change it to whatever you like:
x-terminal-emulator -e "/bin/sh %c"

So one way to make it use Konsole instead of whatever x-terminal-emulator is configured to run is to replace x-terminal-emulator with konsole. (Don't capitalize the k.) That is, one solution is to change that command to this one:
konsole -e "/bin/sh %c"

Geany itself substitutes for %c when it actually launches a terminal emulator. Whatever terminal emulator it calls does have to support a -e flag--or you can change that commmand accordingly if it doesn't. (Specifically what to write instead would depend on whatever syntax it did accept.) But most terminals do, and this includes Konsole.
Way 2: You can change what program x-terminal-emulator points to.
As an alternative solution that you might prefer, if you pretty much always want Konsole in any context where a terminal is opened, then you might want to just reconfigure x-terminal-emulator to launch Konsole instead of whatever other terminal it is currently launching.
If you choose to do this, then I recommend still checking in the Preferences dialog in Geany to make sure that it is actually using that x-terminal-emulator command shown above.
In Debian and Ubuntu, the x-terminal-emulator symlink is managed by the alternatives system. To adjust it so that it points to a different terminal command, you can run:
sudo update-alternatives --config x-terminal-emulator

You will be prompted to select one of the terminal emulators that is currently installed. Assuming Konsole is installed on your system, you should be able to select /usr/bin/konsole.
Acknowledgements
Zanna contributed substantially toward this answer.
See also the Geany manual (linked from this question, though that is not asking for the same thing, as the VTE is Geany's built-in terminal, which it sounds like you do not want to use).
Comment: Also, In Geany 1.36 Poliff, on debian+XFCE change to `xfce4-terminla` works


Complex lighting situations issues_light intensity decreases > number lights increases

Question: I'll try to explain the issue as best as possible, I'll attach some pictures to better explain the problem.
I have noticed that the more "lights" are introduced in a scene (both interior and exterior) the more the intensity of each lamp is reduced.
I've notices the same issue with HDRI images. Again, adding more sources of light into the scene, results in a decreased intensity of the HDRI image itself.
Clearly, the problem becomes extremely limiting especially in situations where multiple sources of illumination are required.
In the attachments I'm showing the aforementioned issue, as you can see the source of lighting (in this case a simple Point lamp) decreases its intensity as the number lights increases. On every picture I'm adding one or more lamps.
Comment: Can you try rendering again without clamping? That could be the cause for your issues but not 100% sure.
Answer: The default "Path Tracing" integrator is coded so that for each sample, it will bounce light from a randomly-chosen lamp.
My suggestion is that you change the integrator to "Branched Path Trace", which you can change from the Sampling sub-tab.
Using Branched PT will make cycles take bounces from every light for each sample.  This comes at the cost of increasing render times, but with the added benefit of reducing noise.
More info here: https://docs.blender.org/manual/en/dev/render/cycles/settings/integrator.html
EDIT: As a further note, Blender 2.79 will feature probablistic termination of lights based on contribution.  Basically, it will randomly skip sampling from lights if their contribution to a sample would be below a certain threshold, causing it to spend less time computing bounces for lights which make little or no difference for a given sample.  This provides speed gains in complex lighting setups, particularly where some of the lights are distant or occluded.  More info here: https://developer.blender.org/rB26bf230
Answer: Well, first of all thanks for answer!
In another discussion  came out that the problem was due to the clamping, as indeed @GottfriedHofmann supposed.
Stefan Werner write:
"Try setting the clamp direct/indirect render settings to 0, that might make it go away. Stochastic sampling of many lights can lead to very bright individual samples, and when those samples get clamped before added to a pixel, energy (light) is lost."
...and again:
"Setting clamp to 0 does not make fireflies.
Setting clamp to values other than 0 imposes a maximum brightness limit on individual samples. In many cases, limiting that brightness hides fireflies, but in cases like this, it can take away important contributions.
A simple case to demonstrate this is if you take an object with a bright and sharp specular highlight and have that reflection be blurred either by depth of field or motion blur. Setting a clamp value on direct light very quickly dims what otherwise is a bright spot/streak.
With many lights and path tracing, the following situation takes place:
In standard path tracing, only one light is being sampled per pixel sample, all other lights are ignored. To compensate for that, the contribution of that light must be divided by the probability of that light being sampled, that is, divided by the number of lights. With 100 light sources, that means any given light source will be considered for only 1 in 100 pixel samples, but its contribution to that sample will be 100 times that of what it would be if it were just one light source. When that sample is now being clamped, this brightness gets limited and the appears darker than it should be."
I think that Stefan has nailed the point, the problem in that and, i think, in many other scenes with a lot of light source should be the clamp. In particular, the one that contributes the most at this issue is the "direct clamp".
As Stefan says, it isn't the "0 Clamp" that produce fireflies, contrarily, the scope of Clamp is to avoid it. But in this particular case, increasing the number of light sources seems to influence the overall intensity of each light.
However, the most fireflies seems to come from indirect bounces, so I resolved the intensity issues in this scene setting only clamp direct to 0 and leaving the indirect clamp to 4.
As @Gottfried suggest, I've rendered again the scene with direct clamp set to 0.
I'll attach an explaining screen.


A question about maximizing the volume of a particular kind of convex set

Question: Let C be a compact convex subset of 3-dimensional Euclidean space E(3) whose interior is non-empty and whose diameter is d. What is the largest volume that C can have if every subset of C that is a straight line segment of length d is a subset of the boundary of C (or-equivalently-if no chord of C that contains an interior point of C has length d)? It looks as though this maximum might be close to the volume of a right circular cone whose base radius is d/2 and whose height is ((3^(1/2))/2)*d. I am unable to say more. Perhaps there is no maximum volume-only a least upper bound. Although C is a convex body, it is not what would be called stricly convex. To keep things simple I am avoiding any discussion of higher dimensional versions of this question.
Comment: The equivalent form of the question is to maximize the volume of a convex set of diameter $d$ such that it contains one segment of length $d$ on its surface. (Then you may compress everything a bit to make this segment unique.)
Answer: I would suggest yet another larger set. Take two points $A$ and $B$ in the plane with $|AB|=d$. Let $S$ be the set of all points $X$ in this plane lying in one halfplane defined by $AB$ and satisfying $|XA|,|XB|\leq d$. Then rotate $S$ around the perpendicular bisector of $AB$; you get the convex body containing your cone. Then, after smashing it a bit you get a desired set --- still of larger volume.
Answer: It seems you could curve the base of the cone, making it a sector of a sphere of
radius $r > d$ slightly larger than $d$, centered at a point $c$ directly above the
apex of the cone:

(Arrows indicate segments of length $d$ that cannot fit.)
If this is correct, the max volume can be approached but not achieved, as you suggest.
Update. And here is Ilya Bogdanov's larger body, a half-lune:
Comment: Thanks to all of you for your many interesting examples. They all reinforce my feeling there is a least upper bound
Comment: Thanks to all of you for your many interesting examples. They all reinforce my feeling that there is a least upper bound on the volume but no actual maximumum volume. But  apart from playing around with examples, I can see no way to make further progress on this problem and actually prove something. It is interesting that a solid hemisphere having diameter d is a convex set of this kind which is larger than the right circular cone I mentioned. But one cannot seem to add volume to the hemisphere as one can to the cone.