Why is there no Islamic architecture with glass in windows before the 18th century?

Question: Why is there no Islamic architecture with glass in windows before the 18th century? Glass windows frequently appear in gothic architecture since the 11th century but why does medieval Islamic architecture lack glasswork?
Comment: I don't know first hand, but I suspect the Arabian peninsula and North Africa are pretty warm places, without too many bugs. There isn't much need for windows there until you have air conditioning. I honestly don't now about Iran or Pakistan though.

I don't know about India / Bangladesh / Indonesia window history at all, so can't comment on that.

Perhaps central Asian Islamic architecture will have windows? Although in the 17th century most of the central Asian plain was nomadic. I wonder what the mosques were like back then in that area.
Comment: _"Cairo abounds in buildings with stained glass windows of all periods from the ninth century to the twentieth."_ http://www.touregypt.net/featurestories/glass.htm (that link may have a malicious ad)
Comment: This is an example of 15th century Islamic architecture of Central Asia https://thumbs.dreamstime.com/z/sher-dor-madrasah-registan-square-samarkand-uzbekistan-54286573.jpg Even central asian islamic architecture lacks glass window. ln lran it appeared in 18th century.
Comment: It might be worth looking into Muslim architecture in North China as well. These structures are likely to have windows, as North China has bugs and cold weather. Although I have not idea if window usage was prevalent during the Ming of Qing dynasty.
Comment: BTW, welcome to stack exchange: history.
Comment: @Markfuxerbergstein6:  See the long article at http://www.islamicspain.tv/Arts-and-Science/The-Culture-of-Al-Andalus/Glass.htm
Answer: The Blue Mosque may have had stained glass windows since 1617.
Nonetheless, consider the tradition of ventilated buildings in Islamic architecture. Buildings for hot, dry climates often have thick walls and small windows. This insulates while maintaining airflow, and may be the only option for earthen construction. In such places it's so bright outside that a small fraction of that light suffices inside. If for some reason you want to block the window, stick something into it. No glass is needed for this arrangement.
In Islamic architecture, latticework screens called jali represent an artistic approach to the principle of ventilated buildings. They provide shade, brilliant highlights, and interesting shadows, just like stained glass. This traditional element may help explain a relative dearth of stained glass windows in monumental buildings.
Comment: I'd be quite surprised if there aren't more examples of pre-18th century glass usage in the Ottoman Empire or Transoxiana. Cities like Istanbul and Bukhara get snow during the winter.
Answer: Some of the earliest (8th and 9th- century) buildings in the Islamic world had colored glass windows and there is no subsequent period during which colored glass windows were not used in architecture (Christian as well as Islamic,, secular and religious) somewhere in those areas of the world in which Islam was a major influence. Because the formal study of Islamic architecture by historians in the "west" is a fairly new discipline and because window-fillings are, at best, a secondary feature of any architecture, the documentation of the recordable history of  colored glass windows in Islamic architecture is a subject in its infancy.
With a Masters Degree in Art History, and a specialization in Islamic art history and a thesis on representations of colored glass windows in Persian miniature paintings, I have read innumerable scholarly articles, often archeological excavation reports, and traveled in Egypt, Turkey, Syria, Jordan, Uzbekistan recording in situ examples of such windows. ,There are few articles about this interesting tradition written for the general public, so "evidence" consists of articles like F B Flood article on windows in the Dome of the Rock in Jerusalem in a "Muqarnas" publication.
Comment: It would still be useful to add citations for one or two or three such articles here.
Comment: Your answer could be improved with additional supporting information. Please [edit] to add further details, such as citations or documentation, so that others can confirm that your answer is correct. You can find more information on how to write good answers [in the help center](/help/how-to-answer).
Comment: With a Masters Degree in Art History, and a specialization in Islamic art histroy and a thesis on representations of colored glass windows in Persian miniature paintings, I have read innumerable scholarly articles, often archeological excavation reports, and traveled in Egypt, Turkey, Syria, Jordan, Uzbekistan recording in situ examples of such windows. ,There are few articles about this interesting tradition  written for the general public, so "evidence" consists of articles  like  F B Flood article on windows in the Dome of the Rock in Jerusalem in a "Muqarnas" publication.
Answer: KAC Creswell in  "Muslim Architecture in Egypt" 1 describes and has photo and drawing of a still in situ  colored glass window attributed to 1140's in Mosque of Al-Azhar in Cairo.
Five bankers boxes of notes, at least 1000 photos taken by me and others are difficult to post!!

K. A. C. Creswell, Early Muslim Architecture I (Oxford, 1932), 42 ff.Creswell42 ffIEarly Muslim Architecture1932
Google Scholar
Comment: [K. A. C. Creswell, Early Muslim Architecture Vol. II](https://archive.org/details/creswell-k.-a.-c.-1979-early-muslim-architecture-volume-ii-early-abbasids-ummaya/page/n7/mode/2up?view=theater) is available on Internet Digital Archive. Perhaps provide a page reference and quote.
Comment: ONE photo would be nice, however.
Comment: Hi Martha, welcome to the History Stack. Am I right in assuming you are also the author of the mmpeters post above? It seems you might have access to a lot of information which would go a long way in answering this question.  I hope you find time edit your answer to include a little more of that information you mention.


Batter. Cross contamination by

Question: I would like to know
Whilst cooking and serving in a fish and chip shop can i
Serve food, All dipped in same batter and rice cone containers, using
beef and chicken made sausages
Fish
Chips
Cod roe
Burgers
Or do i need to use separate batter and rice cone containers?
Thanks.
Comment: I'm not sure of the question here - are you asking if you can use the same containers for all the different foods you batter? If so, the answer will depend on where in the world you are.
Comment: Can you please [edit] and add some punctuation, make your question a bit more clear? I can't understand if you want to serve the food in the same containers used for dipping the batter, or if the batter and rice cone are in the same containers, and what do beef and chicken sausages have anything to do with it. Also please fix the title.
Answer: If your question is about hygiene (dont get people sick from raw meat), if you're frying it fully and making sure the meat is cooked then you should be fine to use the same batter. If you're talking about keeping allergens separate for health or religious reasons you should use separate batters.

Batter. Cross contamination by


iis7 setting for a website that only serves static files, no cookies

Question: if I am setting up a seperate domain name to handle all static file serving, is there anything special I need to do in IIS7 so it doesn't serve cookies etc?
Comment: What exactly are you trying to achieve? Knowing it could help providing more helpful answers :-)
Answer: IIS doesn't serve anything on its own, it only serves pages requested by clients and/or does things if some server-side application requests it to do them.
If you disable scripting and execution support in your web site, ony static file types will be served (HTML, images, etc.).
Of course, even a static HTML page can do whatever it wants on the client (including setting cookies)... but you can't tell IIS something like "only serve HTML pages that don't contain any client side scripting".
Comment: how about turning off modules?
Comment: I'm talking about client-side scripting. There's no way to turn **that** off: if you put a script in a HTML page, it will get executed (unless the client browser disables scripting itself, of course).
Answer: In IIS manager, under session state you have the option to modify the way IIS handle cookies. I did not make test yet.


Type from right to left

Question: Is there a command to make Vim type from right to left? If not us any one aware of this plugin?
Comment: Are you talking about in the context of a right-to-left language such as Arabic of Farsi, or do you just want to advance the cursor to the left when inputting normal western alphabet characters? Please edit your question to be more specific.
Answer: Sure!
:set rightleft

Or, just :set rl. However, this will save the file with the characters in the order you typed them in. If you want to have it save it reversed, type :%!rev before saving.
If you use :set revins (:set ri for short), the inserting is done backwards. You could probably map this to a key combination, but that's up to you.
Here is the appropriate section of Vim help:

Typing backwards *ins-reverse*

In lieu of using full-fledged the
'rightleft' option, one can opt for
reverse insertion.  When the
'revins' (reverse insert) option is set,
inserting happens backwards. This can be used to type right-to-left
text. When inserting characters the cursor is not moved and the text
moves rightwards. A  deletes the character under the cursor.
CTRL-W and CTRL-U also work in the opposite direction.  , CTRL-W
and CTRL-U do not stop at the start of insert or end of line, no matter
how the 'backspace' option is set.
There is no reverse replace mode (yet).
If the 'showmode' option is set, "-- REVERSE INSERT --" will be shown
in the status line when reverse Insert mode is active.
Comment: Was not the effect I was looking for but definitely the right answer to the question I asked. I am actually working in a left to right file. Sometimes I like to define my statements backwards is there a way to just type a few characters right to left with out changing the flow of the document?
Comment: Ty for the update to that I had missed it. I appreciate it.

Type from right to left


What fraction of pre-sale coins have been moved?

Question: I am trying to estimate how many of the pre-sale coins are in circulation. What fraction of pre-sale coins have been moved?
Answer: This calculation is probably wrong, but I'm working on getting all of the kinks worked out. Apparently geth cant handle 9000 calls at once :(
By my calculations, there were around 45 million presale Ether (in actuality, there were probably 60 or 70 million), and the net change in account balances is around 40 million (meaning the sum of the absolute change in balance in all presale accounts is around 40 million). Thus, assuming no one transfered between presale accounts or recieved mining funds (not a great assumption), about 88% of presale ETH has been moved. This is obviously a gross  overestimate, but it's the best I could come up with.
Comment: 45 million pre-sale Ether sounds wrong. There are about 77 million now, and about 1 million blocks. Each block produces about 7 Ether, so there should be about 70 million pre-sale Ether. No?
Comment: Yes, it is wrong. My node crashed halfway through the calculation and I just noticed. I'll add a disclaimer and try to find a fix.


Deploy final model from train dataset or train + test dataset

Question: So I'm a newbie into Data Science field. I've created a model using Gradient Boosting to predict a house price. To evaluate my model, I've splitted my dataset into train and test (0.8 Train / 0.2 Test) and got 0.94 R^2 for train and 0.89 for test.
If I want to deploy this model, for business purpose, do I have to make a new model with train and test data together? If I do that, couldn't my model have a completly different result, like overfitting? Or should I use the model that I've trained from train dataset and create some kind of 'model.joblib', import to google cloud and create an API from train based model?
Answer: Below are the steps followed.

Split data to train and OOT.
Model on train data.
Evaluate on Test set.
Pickle the model
Create an API.

Use the model that you have trained from train dataset and pickle,and create an API


When applications deploying using ClickOnce does prerequisites asks for location

Question: When applications deploying using ClickOnce does prerequisites asks for install location?
Once setup is started does it needs any manual inputs.
Answer: It all depends on the prerequiste.  Something like the VS Report Viewer does not.  I think nearly all MS prerequistes install in silent mode.  If you get a package from some other source it would depend on them.


How best for an old timer to manage type safety in Javascript

Question: I've been writing C/C++/C# for decades, and have used JavaScript as needed for web projects, but want to expand that and do some more in-depth development with Canvas and JavaScript.
My concern is how easily you can make mistakes like setinterval() instead of setInterval(), for example.  I'm using VisualStudio and have Telerik's JustCode plugin that does some static analysis, but there's so much that it doesn't check.
I also worry about calling object methods or properties that just don't exist.  I understand why these things empower the language and developer with greater flexibility, but how do I best protect myself from the unintended consequences of that flexibility?
Comment: Sounds like you're looking for a tool such as JSLint or JSHint
Comment: `"use strict";` at the top of your file is a great start.
Answer: I struggled with JavaScript's dynamically-typed nature for a long time too.  It turned out to be quite liberating when I finally made peace with it.  Here's the mantra that has worked for me:
Program correctness is the most important thing.  If I am confident my program exhibits the correct behavior, either my types are correct, or any existing typing errors don't effect program behavior.
This shift in thinking puts more of an emphasis on testing -- which is a good thing.  If your tests are well-written, and comprehensive, then type errors will be caught.
I also tend to employ much more of a functional paradigm in my JavaScript coding: if you are not mutating state, strong typing has less meaning.
Of course if you really feel that strong typing is important, there is always TypeScript, which compiles directly to JavaScript and is, by all accounts, an excellent language.
Answer: Good design is the answer. Just because it's Javascript and it gives you a lot of freedom doesn't mean the principles you've used until now are any less valid. Design by interfaces (or even better, by contract), make class diagrams, put pen to paper, etc. Do be careful about Javascript's very own brand of object-orientedness, learn about it and the associated patterns (SO has many questions about them) and await ES6 Harmony eagerly.
If you want an IDE, or at least an environment, that tells you what's wrong in a readable and easy-to-use fashion, I recommend simply using your favorite browser's console (your fav browser should be FF or Chrome). Firefox + Firebug is particularly good though, and a favorite among many Web developers. The console, just like in Python, allows you to test snippets of code and to solve your naming errors very fast.
Answer: When I finished university I was a promising young lad and was sure that I will have no problems with finding some work. After a while... Bang! The World Economic Crisis struck. So I had to accept some cheap and ugly job and after I fed up with them, I started to search for something better and I risked everything. You might wonder why I am telling all this to you in a semi-scientific site. I am telling you, because through my story you will understand why I am answering the way I am answering. After 3 years of searching for my place and constantly training and educating myself I've got an offer from a small group of programmers, who were using some technologies which were very alien to me. I have joined them and I had to learn many things: .NET framework, Visual Basic, Javascript, jQuery, CSS, Telerik, a lot of libraries. I knew this was my chance to stabilize my position and I was a very trained learner (I have been constantly learning, but in different areas), so I have spent two weeks working 16 hours instead of 8 and at the end I was a constructive member of the team, still a bit rusty in the newly learned languages and technologies, but my results were quite decent. Shortly after that I became used to all the things used there and had no problems.
The thing is that I learned Javascript while learning a lot of other things as well and working in the meantime, having a tight schedule for the tasks. Just like you, I did not like Javascript has no types. I do not like it even now, after all those years. But I had no time to make it more comfortable to me and now I am so used to it that I am too lazy to create something which would help me and the thing would no longer help me.
If you do not want to get used to it the hard way, I believe something like this would help you:
function StrongType(weakValue) {

    //int
    this.i = function() {
        return parseInt(weakValue);
    };

    //float
    this.f = function() {
        return parseFloat(weakValue);
    };

    //string
    this.s = function() {
        return weakValue + "";
    };

    //boolean
    this.b = function() {
        return !!weakValue;
    };

    //change
    this.c = function(newValue) {
        weakValue = newValue;
    };

    //natural
    this.n = function() {
        return weakValue;
    };
}

This would help you to make sure you always know the type you are using. Function names:
You could create a strategy for yourself about how a name is typed and use that for all your functions and variables. If you are using some function and its name is not ok for you, then you can do something like this:
function MyNameHelpers() {
    this.setTimeOut = function(callback, interval) {
        return setTimeout(callback, interval);
    };
}

Also, let's suppose you have a foo object and you want to use its bar member, possibly with parameters:
function MemberUser() {
    this.useMember = function(owner, member, error, errorParams) {
        if (!!owner) {
            return owner[member];
        } else {
            //error is a function to handle the case when owner is falsy
            return error(errorParams);
        }
    };

    this.callMethod = function(owner, member, params, error, errorParams) {
        if (!!owner) {
            return owner[member](params);
        } else {
            //error is a function to handle the case when owner is falsy
            return error(errorParams);
        }
    };
}

The codes above are just illustrations, I did not test/use them, maybe things are needed to be added and so on, but you get the idea. You will either get used to Javascript like I did, or create a library to prevent you from making mistakes. It is your choice.


Displaying Flickr photos using the Galleria jQuery plugin

Question: I'm trying  to import/show the photos from the Flickr photostream (or set) using Galleria (http://galleria.aino.se/). I couldn't find any useful info in the Galleria documentation. How to go about doing that?
Answer: The easiest way is to use Flickr's JSON feed for a photoset.
1. Get the feed
Make sure the set you're trying to use is set to public through Flickr's 'Organise' menu, then view the set and find the RSS link at the bottom of the page. The RSS feed is in XML by default; to get the JSON version simply add &format=json&jsoncallback=? to the end of the URL:
RSS feed: http://api.flickr.com/services/feeds/photos_public.gne?id=xyzexample&lang=en-us
becomes
http://api.flickr.com/services/feeds/photos_public.gne?id=xyzexample&lang=en-us&format=json&jsoncallback=?

2. Parse JSON
This example uses jQuery, so remember to include the jQuery file before this code. This also assumes your Galleria div has an id of 'gallery':

3. Add Galleria
Start the Galleria plugin on the 'gallery' div:
$("#gallery").galleria();

(obviously you need to include the Galleria plugin and theme, as per their documentation)
Answer: There is a Flickr plugin included in the Galleria download from version 1.2.4 that makes these things really easy. Here is the docs for the plugin, including examples: http://galleria.aino.se/docs/1.2/plugins/flickr/


Slapper only maps one object when selecting multiple objects from database

Question: I have some C# classes which represent database objects, some of which contain one or more other custom objects or enumerables of custom objects. I'm using dapper for queries, and slapper to map to the custom objects. It works great for single object. I can easily grab a parent object with a specific ID from the database, do some inner joins, and map it and all the things it "owns" to my custom objects in C#. Problem comes when I want to do a select over multiple parent-IDs.
Some context, let's say I have a person, that person has a list of hobbies which have an ID and a Description, a list of days they're available which also have an ID and Description, and maybe another custom field such as whether they have or are even willing to be around children which can also boil down to a simple ID and Description. We'll call that last field child status. I'd write a select statement like this:
SELECT
  ,person.id as Id
  ,person.first_name as FirstName
  ,person.last_name as LastName
  ,hobby.Id as Hobbies_Id
  ,hobby.Description as Hobbies_Description
  ,avail.Id as Availabilities_Id
  ,avail.Description as Availabities_Description
  ,child.Id as ChildStatus_Id
  ,child.Description as ChildStatus_Description
FROM
  users.users person
JOIN
  users.userhobbies uhobby
ON
  person.id = uhobby.UserId -- one-to-many with relational table
JOIN
  users.avail hobby
ON
  uhobby.HobbyId = hobby.Id
JOIN
  users.useravailabilities uavail
ON
  person.id = uavail.UserId -- one-to-many with relational table
JOIN
  users.availabilities avail
ON
  uavail.AvailId = avail.Id
JOIN
  users.childstatuses child
ON
  person.ChildStatusId = child.Id

Then I want this mapped to a user like this:
class User
{
  public Guid Id {get; set;}
  public string FirstName {get; set;}
  public string LastName {get; set;}
  public IEnumerable<Hobby> Hobbies {get; set;}
  public IEnumerable<Availability> Availabilities {get; set;}
  public ChildStatus ChildStatus {get; set;}
}

Since I'm using exact naming conventions and everything here, the query from Dapper and the Automapping work great just like this:
  // Using the above sql in a variable
  var data = Connection.Query<dynamic>(sql);

  var dataReal = Slapper.AutoMapper.MapDynamic<User>(data);
  return dataReal;

This works great, but it only ever returns one user. I have a similar method which takes an ID and all of my test users can be retrieved perfectly by passing the ID. I've tried scouring the internet, looking through documentation, and all I found was this: https://github.com/SlapperAutoMapper/Slapper.AutoMapper/issues/57 who seemed to just slip through the cracks. I also tried mapping the dynamic data to various other structures with no luck. Thanks in advance!
Update:
I've come up with a somewhat brutal, "sledgehammer" type solution. I'm not sure if, at this point, I'm forcing myself to use Slapper when there might be a more convenient solution. However, I wanted to ensure anyone in a similar situation might have a chance at making it work. Here's the new C# section:
  var data = Connection.Query<dynamic>(sql);
  IEnumerable<Guid> Ids = data.Select(row => (Guid)row.id).Distinct();
  List<User> results = new List<User>();

  foreach (Guid Id in Ids)
  {
    IEnumerable<dynamic> rows = data.Where(x => { return ((Guid) x.id).Equals(Id); });
    User model = (Slapper.AutoMapper.MapDynamic<User>(rows, false) as IEnumerable<User>).FirstOrDefault();
    if (model != null)
    {
      results.Add(model);
    }
  }

  return results;

As you can see, I'm generating a list of unique "primary object" ID's and selecting those rows into their own lists, which I then pass to Slapper. I've passed the "cache = false" parameter to avoid squeezing unrelated data into every object after the first. I could probably get around this by actually keeping the UserHobby/UserAvailability/UserPhoto Ids in place, but I don't like the way that makes my object look. Hopefully this helps someone.
Answer: I'm not familiar with Slapper, but I'll show you what I've done with Dapper to construct a complex graph of objects with bi-directional references.
In short, construct a Dictionary or KeyedCollection prior to calling connection.Query<>, then reference it inside the Dapper lambda expression.
This method returns a list of service calls.  Each service call is assigned to one technician and one customer.  However, a technician may be assigned multiple service calls to multiple customers.  And a customer may have multiple technicians on-site.
public ServiceCallResponse GetServiceCallsDapper(ServiceCallRequest Request)
{
    var queryParameters = new {statuses = Request.Statuses, createDate = Request.CreateDate};
    const string splitOn = "Number,Id"; // Id indicates beginning of second class (Technician).  Number indicates begining of third class (Customer).
    // Note multiple columns are named "Number".  See note below about how Dapper maps columns to class properties.
    // Note Dapper supports parameterized queries to protect against SQL injection attacks, including parameterized "where in" clauses.
    const string query = @"sql query here..."
    ServiceCallResponse response = new ServiceCallResponse();  // Keyed collection properties created in constructor.
    using (IDbConnection connection = new SqlConnection("DB connection string here..."))
    {
        connection.Open();

        // Dapper adds a generic method, Query<>, to the IDbConnection interface.

        // Query<(1)ServiceCall, (2)Technician, (3)Customer, (4)ServiceCall> means
        //   construct a (1)ServiceCall, (2)Technician, and (3)Customer class per row, add to an IEnumerable<(4)ServiceCall> collection, and return the collection.

        // Query<TFirst, TSecond, TThird, TReturn> expects SQL columns to appear in the same order as the generic types.
        // It maps columns to the first class, once it finds a column named "Id" it maps to the second class, etc.
        // To split on a column other than "Id", specify a splitOn parameter.
        // To split for more than two classes, specify a comma-delimited splitOn parameter.

        response.ServiceCalls.AddRange(connection.Query<ServiceCall, Technician, Customer, ServiceCall>(query, (ServiceCall, Technician, Customer) =>
        {
            // Notice Dapper creates many objects that will be discarded immediately (Technician & Customer parameters to lambda expression).
            // The lambda expression sets references to existing objects, so the Dapper-constructed objects will be garbage-collected.
            // So this is the cost of using Dapper.  We trade unnecessary object construction for simpler code (compared to constructing objects from IDataReader).

            // Each row in query results represents a single service call.
            // However, rows repeat technician and customer data through joined tables.
            // Avoid constructing duplicate technician and customer classes.

            // Refer to existing objects in global collections, or add Dapper-mapped objects to global collections.
            // This avoid creating duplicate objects to represent same data.
            // Newtonsoft JSON serializer preserves object instances from service to client.
            Technician technician;
            Customer customer;
            if (response.Technicians.Contains(Technician.Id))
            {
                technician = response.Technicians[Technician.Id];
            }
            else
            {
                response.Technicians.Add(Technician);
                technician = Technician;
            }
            if (response.Customers.Contains(Customer.Number))
            {
                customer = response.Customers[Customer.Number];
            }
            else
            {
                response.Customers.Add(Customer);
                customer = Customer;
            }
            // Set object associations.
            ServiceCall.Technician = technician;
            ServiceCall.Customer = customer;
            technician.ServiceCalls.Add(ServiceCall);
            if (!technician.Customers.Contains(customer))
            {
                technician.Customers.Add(customer);
            }
            customer.ServiceCalls.Add(ServiceCall);
            if (!customer.Technicians.Contains(technician))
            {
                customer.Technicians.Add(technician);
            }
            return ServiceCall;
        }, queryParameters, splitOn: splitOn));
    }
    return response;
}

Using this technique requires you to set PreserveReferencesHandling = true on the JsonSerializer class so object references are preserved on the client-side.  Otherwise, Json.NET will construct duplicate objects and technician.Customers.Count will always == 1.
For example, if John Doe is assigned a service call at Acme and another at Contoso, his technician.Customers.Count will equal 1 if you leave PreserveReferencesHandling == false (Json.NET will construct two Technician objects each named John Doe).


Google Drive analytics - who download what

Question: I have the G-Suite for business, and I have a directory where I put some data about the company. The directory is private, and only some of my colleagues has the access.
I'd like to know who download/watch what. Is that possibile? Thanks
Answer: On a directory level you can just see major activities: edit/delete/copy/change of permission.
On a single "file" level you can click on Tools --> Activity dashboard to see who and when viewed that file but there is no way to track down the downloads.
More details here: View activity & file versions


Ford figo 1.4 ambiente 2013 petrol model no pulse on my injectors

Question: Hello I have a ford figo 1.4 ambiente 2013 model, I have done all the diagnostic without the diagnostic machine, the spark is there the fuel pump it's pumping, the problem is that I don't have fuel getting into my cylinder, the injectors don't have pulse and one thing is that my engine relay makes a clicking sound repeatly when I make a car on, any suggestions for this matter?
Answer:
engine relay makes a clicking sound repeatly when I make a car on

Might you have a low battery? That sounds like your starter solenoid is trying to engage, but there is not enough juice in the battery.
Try putting a battery charger on it overnight.


Get month from DATETIME in sqlite

Question: I am trying to get extract the month from a DATETIME field in SQLite. month(dateField) does not work as well as strftime('%m', dateStart).
Any ideas?
Answer: I don't understand, the response is in your question :
select strftime('%m', dateField) as Month ...

Comment: what if my format is MM/DD/YYYY instead of YYYY-MM-DD. that function does not work with the former format
Answer: SELECT strftime('%m', datefield) FROM table

If you are searching the month name, text month names does not seems to be supported by the core distribution of SQLite
Comment: this is not correct if datefield is a native datetime type. You need to use strftime('%m', datetime(datefield, 'unixepoch')) as mentioned in another answer.
Answer: I'm guessing you want to get the month as a string. Not the most friendly looking but you probably see the point. Just replace date('now') with your variable.
select case strftime('%m', date('now')) when '01' then 'January' when '02' then 'Febuary' when '03' then 'March' when '04' then 'April' when '05' then 'May' when '06' then 'June' when '07' then 'July' when '08' then 'August' when '09' then 'September' when '10' then 'October' when '11' then 'November' when '12' then 'December' else '' end
as month

Answer: Try using the following:
select strftime('%m', datetime(datefield, 'unixepoch')) as month from table

Comment: Use this if you store your datetime values as integer in the database.
Answer: This is a solution without all the case when statements. Hopefully it's helpful.
select substr('JanFebMarAprMayJunJulAugSepOctNovDec', 1 + 3*strftime('%m', date('now')), -3)

Answer: I guess strftime('%m', dateStart) is not working for you because dateStart variable is date/datetime type.
Then you must use:
strftime('%m', date(dateStart))

Comment: Unfortunately, even this returns None
Answer: After all those years I think I figured out what was your problem.
You probably store your dates as strings.
This way when you search for data  from let's say May you should write sql like this:
Select * from table where strftime('%m', datefield) = '05'
It's important to write '05' and not '5'. Using '5' will give you zero results.
Answer: SQLLite does not support monthnames, you need to use substr(Date, 4, 2) as month to get the months

%sql select substr(date,4,2) as month from ;
Answer: Here is my solution that worked for me
MONTH_DICT={ "Jan" : '01', "Feb" : '02', "Mar" : '03', "Apr" : '04', "May" : '05', "Jun" : '06', "Jul" : '07', "Aug" : '08', "Sep" : '09', "Oct" : 10, "Nov" : 11, "Dec" : 12 }

self.cursor.execute("SELECT * FROM error_log WHERE strftime('%m',Date_column)=?",(MONTH_DICT[query_month],))

print('output:', self.cursor.fetchall())

Answer: select strftime('%Y', nextTime / 1000, 'unixepoch' ) as year,
strftime('%m', nextTime / 1000, 'unixepoch' ) as month,
count(*) as count from task group by year, month order by year, month;

nextTime is an integer which represent the number of milliseconds since January 1, 1970, 00:00:00 GMT. convert it to second unit by divide 1000, then the year and month can be extracted correctly. Read sqlite datefunc for more information.
Answer: SELECT strftime('%m',datetime_col) as "Month" FROM table_name;
just replace 'datetime_col' with your datetime column

Get month from DATETIME in sqlite


citrix session prompts for credentials

Question: In the 7.6 environment, opening an application from storefront in Chrome works, however opening it in Internet Explorer prompts for windows logon.
I'm using single sign on on Citrix receiver.
I don't understand why doesn't work in Internet Explorer. Any ideas?
Answer: There can be a number of IE specific issues:

The Group Policy template includes support for configuring the system for in-session certificates. This places certificates in the user's personal certificate store after logon for application use. For example, if you require TLS authentication to web servers within the VDA session, the certificate can be used by Internet Explorer. By default, VDAs will not allow access to certificates after logon.
If you are using Internet Explorer, click Tools > Internet Options > Advanced tab and clear the option "Do not save encrypted data to disk.". This option should be cleared because the dynamic files are stored in the Temporary Internet Files folder. When applications are clicked, a file is downloaded to the folder, then launched using MIME type. If access to the folder is disabled or not available, the process cannot occur successfully.

Chrome and IE differ in how they manage redirects, and single sign-on relies on redirects:

Internet Explorer 11: The VDA-side IE11 browser viewport is redirected and rendered on the client-side using the client-side installed IE11 and the Citrix Workspace app for Windows process HdxBrowser.exe.
Google Chrome: The VDA-side Chrome browser viewport is redirected and rendered on the client-side using the Citrix Workspace app for Windows embedded Chrome engine and the HdxBrowserCef.exe process. Note that the Browser Content Redirection Extension must be installed and enabled on the VDA before using BCR with Chrome. The Browser Content Redirection Extension is available from the Chrome Web Store.

References

Federated Authentication Service

Federated Authentication Service architectures overview

How to Troubleshoot Browser Content Redirection

Users Prompted to Download, Run, Open Launch.ica File, Instead of Launching Connection

Configure and install using command-line parameters

Elevation level and wfcrun32.exe

citrix session prompts for credentials


Where are AnkhSVN CA certificates stored?

Question: My Subversion repository is available over HTTPS. I've got a self-signed CA root certificate, and the server uses a certificate signed with that.
The CA root certificate is stored in Trusted Root Certification Authorities, which means that (for example) Internet Explorer recognises it.
AnkhSVN, on the other hand, reports "There are some problems with this server's certificate". So: what is AnkhSVN using as its certificate store? It doesn't appear to be the Windows one. And how do I put my CA root certificate in there?
Update: My website is secured with a certificate named 'www.example.com', the parent certificate is 'ca.example.com', which is self-signed. 'ca.example.com' is in the Trusted Root Authorities store. When I browse to https://www.example.com/svn/, IE shows the padlock icon, and the certification path looks good. When I point AnkhSVN at the same place (by using File / Subversion / Open from Subversion), it brings up the warning message.
The SVN command line doesn't complain.
Note: I haven't tried it with TortoiseSVN yet.
On a hunch that it might be Windows' WebDAV client, I checked with Word. It works fine. The Windows 7 "Add Network Location" feature accepts the certificate, prompts for my credentials and then doesn't work (but that's a known problem with WebDAV over HTTPS in Windows).
Answer: The most likely cause is that your certificate chain does not verify or cannot be checked.
To verify, using IE8:

Click the padlock icon to the right of the address bar
Click "View Certificates"
Go to certification path
Check that all certs here report "OK"
Comment: The certificate chain is fine. At least, it is in IE.


Getting Child page title from user control on Master page

Question: I have a user control in the Master page. In the code behind of that ascx, I want to get the title of the page. The title is being set in the head section with  tag in the child pages.
Answer: Try this
var obj = this.Parent.Page;
var title= obj.Title;

Answer: Have you tried Page.Title?
However, I think the head tag needs to be ran server side to use this
Answer: I would think Page.Title would be enough. If not, you have to ride up through the object model a bit until you get to the page. Both solutions have been detailed above. The only variation may be if the ascx is set on the master page rather than the page. Worst case here is getting the title in the master page and feeding to the ascx as the page is rendered.
Now, an understanding of why this gets a bit confusing. Most people think the page sits on the master page. But, technically, the master page is set up as a control on the page. This is largely to avoid a complete rearchitecture of ASP.NET as master pages were introduced. This means the page is requested and starts to render. Then the master page linked tags are hit and that "control" is rendered, etc. In some cases, Microsoft has provided easy short cuts, in others, you have to navigate and the navigation is upside down from many people's expectation.


When to apt-get upgrade

Question: It seems that every time I install software an apt-get update is helpful but when exactly is an apt-get upgrade necessary? Or perhaps, when is it helpful?
Answer: Note that for upgrade or dist-upgrade you must first run an update to get the list of packages to determine what actually needs updated.

This is a breakdown of the apt-get commands:

update - Only updates the software list.
upgrade - Only upgrades to newer versions of the same files.
dist-upgrade - upgrades to newer software versions (same as upgrade) and installs new software.

So to make get a completely upgraded system allyou have to do is:
apt-get update && apt-get dist-upgrade

The most common new files are new kernel versions, since new ones are installed instead of the old one just getting replaced, so that you can run an older one if it breaks the install in some way.
Comment: So, if I am not currently aware of any software upgrades then simply run `apt-get dist-upgrade` whenever an update is needed?
Comment: @BrassApparatus No you need to run apt.get update first or there will be nothing new to install.
Comment: @Alvar: need to mention that `upgrade` will not install/remove any new file.
Comment: @Alvar: yeah, neat :)
Comment: @Alvar no problem, just wanted to improve the formatting.

When to apt-get upgrade


lang.hitch use in ArcGIS API for JavaScript

Question: Can someone explain lang.hitch() function use in ArcGIS API for JavaScript?
Comment: Do you want a demo code or just an explanation?
Comment: @Yogesh Chavan - A demo code would be great help, thanks.
Answer: require(["dojo/_base/lang"], function(lang){

    var myObj = { //A simple object with the property of foo
      foo: "bar"
    };

    var func = lang.hitch(myObj, function(){ //Using lang.hitch we can point to the scope that we want. Now "this" is pointing to myObj
      console.log(this.foo);//Grabbing the contents of foo that is in a different scope
    });

    func(); //Call the function printing out this.foo
  });

In the code above we have a simple myObj object with a property of foo. That object is in a different scope than the function below it. When we call our function called func, we add lang.hitch and specify the scope which is myObj. This allows us to grab the contents of foo even though it is in a different scope by calling this.foo.
If we did not have the lang.hitch we would get an error saying the foo was undefined.
For more info dojo/_base/lang
Comment: As I understand, please correct if I am wrong, using lang.hitch() we can use object properties and functions in different scope or function.
Comment: Yes, that's the main use of the old dojo lang function. In new Code and using the new ArcGIS-JS-API4.x you do not need it anymore since you can use ES6 and array functions.
Comment: @Katah- Please can you provide link of any example to understand it for ArcGIS-JS-API4.x.
Comment: Unfortunately I cannot format code in a comment. You can find information here: http://www.jsrocks.org/2014/10/arrow-functions-and-their-scope in the chapter "Scope"
Anyway, if you go to the Esri documentation https://developers.arcgis.com/javascript/latest/sample-code/ you can find nice samples about that
Answer: Robert Scheitlin answered a similar question on https://community.esri.com/t5/arcgis-web-appbuilder-questions/lang-hitch-what-does-it-do/m-p/436487

lang.hitch enables you to keep a code block in scope. Say you have a
function that has a inline function and you want to call this.map to
get a refernec to the map object well if you are calling this.map from
inside an inline function you are VERY like to see the error that
this.map is undefined. Using lang.hitch before you call your inline
function tell the inline function what 'this' is.
https://dojotoolkit.org/reference-guide/1.10/dojo/_base/lang.html


Why is it a school/shoal of fish, dolphins, porpoises and squids for example, but rather a pod/gam/herd/mob of whales?

Question: Would it be incorrect to say 'a school' of whales?
Comment: Related: [Terms for collections of animals](http://english.stackexchange.com/questions/1115/terms-for-collections-of-animals)
Answer: It seems that it was almost universally a school of whales until around 1930: see this Ngram; school is still used quite frequently. Note that pod is also currently used for dolphins.
I assume that the reason that school of whales is being replaced by pod of whales is that nowadays people are more aware of the fact that whales are not fish, and this wording emphasizes it. But an interesting questions remain: what is the origin of pod as a collective noun for dolphins and whales? The earliest usage I find in Google books is from 1836. In this reference, a pod of whales is a smaller subgroup within a school of whales.

And now the captain is in full chase of the school when, perceiving a pod of whales in the rear of the school, which seemed to lie more quiet than the main body, he bore down upon them with oar and sail.

And an 1837 reference explains the distinction more clearly,

Spermaceti Whales are gregarious, and are met with in what are called schools, or pods. The former consist of from twenty to fifty, being principally females with their young, guarded in the rear by a male of the largest size, who takes up a defensive position, and, when pursued by boats, urges the others to move quicker, by attacking them. A pod consists of eight or ten, generally young ones.
Comment: Until 1930? But Hemingway said in his famous novel 'the Old Man and the Sea 'a school of porpoises'; he used the term with dolphins too. Was he wrong?
Comment: He wasn't wrong. From the Ngram, *school* seems to have been the most-used term for both dolphins and whales until the 1990s. Before 1930 or so, Google Ngrams shows that *school* was almost universally used. In the 1930s, *pod* starts increasing in use, but it does not overtake *school* until the 1990s. I'm editing my answer to be clearer.
Comment: I based my reply in the comment on your answer not the Ngram. Hemingway's novel was published in the 1950s that's why I raised the question. Thanks for answering.
Answer: As @Peter Shor says, school of whales was the standard form until recently. Quite possibly still is, though if the current trend continues pod will probably become the more common term very soon.
It's misleading to ask which form is "correct". There are many different types of whales - a group of killer whales (orca) is often called a pack, and sperm whales (their prey) still often come in herds.
In the age of wildlife documentaries, we're all far more accustomed to seeing marine life in its natural social groupings, so the non-specialist has much more reason to refer to them. Unlike seal-hunters, we don't like to refer to their livelihood as "herds", so "herd of seals" is declining.
As has often been pointed out here on ELU, there is no special committee for English telling us what words we should use, and where. The usage of "pod" has been widely adopted for the whole social group, although it originally meant a consistently-maintained sub-group within that whole. This doesn't make the new usage "wrong" - if enough of people say it, it's by definition acceptable.
Answer: I am very thankful for this clear and well structured answer.  I was always taught that a group of dolphins or whales was a

school /sku:l/.

A group of fish is a

shoal /Sheul/.

These terms are quite distinct and I do not understand why they should be confused and then to have some people then decide that the only correct term for a group of cetaceans is a pod when as this answer makes it clear that the pod originally referred only to a smaller subgroup of a school.
Comment: Welcome to EL&U! This seems like a great answer, but could you improve it by adding references to sources such as a dictionary proving the collective nouns?


django main.app_table__old Error deleting item

Question: I am facing this problem and I tried many solutions but no one works for me or it is not convinient of my case.
First I use Django==2.0 (can't change to version due to problems).
I have I model table named table and my app is appwhen developing it happend that  I can't delete any element in that table (the other works fine). and I get this problem.
OperationalError at /fieldsdetails/25/delete/
no such table: main.app_table__old

I tried to delete all migrations history so the db.sqlite3 and run:
python manage.py makemigrations
python manage.py migrate

Then I tried to delete the table as
python manage.py dbshell
SELECT * FROM sqlite_master WHERE type='table';

then I found a table named app_table__old and deleting it using this:
DROP TABLE app_table__old
.exit

but nothing works?
is there any solution I don't want to upgrade Django version or lose data.
Answer: I just discovered a tricky way to solve this without losing or changing or upgrading Django.
The problem happens when the sqlite lost some information in the data base.
To solve the problem follow those steps:
1- go to your models tables and search for other tables that have ForeignKey or any relation to the table for example:
 class table_Perimeter(models.Model):
     Perimeter    = models.ForeignKey( table, on_delete=models.CASCADE)

then when you define all tables that have relation with table. you need to fix the problem in the database itself db.sqlite3.
install the SQLiteStudio browser from this site https://sqlitestudio.pl/
then go to table_Perimeter and double click on it. you will see something like this.

double click to re-configuration ForeignKey and you will see a red icon:
Here enter to configure it again

from this window select the foreig table and Foreig id and click apply

click to commit the changes

So everything will work perfectly just run your server :)


LLC Partnership Foreign Partner

Question: My wife and I run an LLC in CA. I am a citizen and my wife is French with a permanent resident card. We are equal members of our LLC Partnership. I filed with TurboTax for our business and when asked if my wife was a US Citizen, I said no since she isn't. I then got a notice from the IRS saying we may be required to file other forms such as forms 8804, 8805, and 8813. I am trying to determine if I need to file those and if I filed with TurboTax correctly on that question. Thank you for any help!
Comment: As someone who runs an LLC myself for consulting work, I would **strongly** advise that you consult with a tax accountant or lawyer for determining your needs.  I strongly advise this because any advice you get here is not guaranteed to be legally valid and you may not get precise or accurate information here about what you *really* need to file and what you really *don't* need to file.
Answer: Taking form 8804 for example, a US permanent resident is not considered a "foreign person" according to the instructions.
As to your course of action, it could be to respond to the notice, to keep the notice without responding, and/or to file an amended return. It would depend on what the notice says and what your return contained.
Answer: You should not count your wife as a foreign person in this case. Yes turbotax is wrong (IMO), it should ask US person and not citizen.
Determining if a Partner Is a Foreign Person
A partnership must determine if any partner is a foreign partner subject to section 1446. A foreign partner (as defined in section 1446(e)) is any partner who isn't a U.S. person, as defined in section 7701(a)(30). As such, a foreign person includes a nonresident alien individual, foreign corporation, foreign partnership, foreign trust or estate, or a foreign organization described in section 501(c).
Source: https://www.irs.gov/pub/irs-pdf/i8804.pdf
section 7701(a)(30)
U.S. citizens are automatically U.S. persons under Internal Revenue Code (IRC) section 7701(a)(30)(A), but noncitizens are only U.S. persons if they are U.S. residents (i.e., resident aliens).
Under IRC section 7701(b), a resident alien is either

a lawful permanent resident (i.e., a green card holder) or
an individual who is "substantially present" in the United States. (Under certain circumstances, an individual can also elect to be treated as a U.S. resident.)

Substantial presence is based on day count; if an individual is present in the United States at least 31 days in the current year and the sum of 1) the days that individual is present in the United States during the current tax year, 2) one-third of the days that individual is present in the United States during the first preceding tax year, and 3) one-sixth of the days that individual is present in the United States during the second preceding tax year equals or exceeds 183, then that individual is substantially present in the United States.
Comment: You have stated only (b)(3)(A) of the substantial presence test, but there are exceptions in (B),(C),(D), the most common being individuals exempt under (b)(5) as students or teachers/trainees for certain periods of time. Fortunately the LPR case that applies to this Q is simple: if you have the status, you are a US person for tax purposes, end of story.

LLC Partnership Foreign Partner


Water being sucked into cold air return from humidifier pad

Question: This is a brand new house and have had this problem from day 1.  There is so much suction, or negative pressure, in the cold air duct that the water from the humidifier pad is actually being sucked in the duct and then I get a puddle of water at the base of the furnace.  I have tried several pads hoping that one would be better than the other, but they all have the water sucked out of them.  I am able to hold the pad at slight angle and see this happen, if I let go of the pad, it is sucked back into place.  It is like they put too big of a fan in my furnace or the cold air ducts are plugged.
My water PSI is 60 and the requirement is that it be less than 125 so I am good there.  I have also cranked down the supply line valve to the humidifier so I just get a trickle, and that helps, but doesn't totally solve the problem.
Is there anything else I can do to fix this?
Comment: A diagram would help us understand how the cold air returns, humidifier pads, furnace and hot air ducts all connect together.
Answer: There should be a damper on the 6" pipe from the hot air plenum to the humidifier, closing it part way will help but the most probable cause is not enough return air openings in your house. If you have wall returns, take the grills off and make sure the air is going through and nobody forgot to cut the openings in the bottom of the wall or in the ductwork itself. Also get a copy of the heating design submitted in the building department to make sure it matches what's in your house, including the furnace size. It wouldn't be the first time a furnace was put in that was all they had in stock instead of buying the correct size. Mine was replace with one at double the btu output and I had to modify the orifices to half the output to get proper heating. High efficiency furnaces with too high of an output only wastes fuel since the design only brings them up to the proper efficiency after running for 20 minutes so you don't want it with a much bigger input than called for in the heat loss design. If everything is it's supposed to be and you closed the bypass damper and still having issues, you will need to add more returns in your house, even if it's a floor return grille in your return duct, or if the Return duct running down the sie of your furnce is under 10 to 12" on the narrow side and under 23 or 24" on the width, it should be changed to something around 10 x23" to 12 x 23", if it's still bad then you are really starving for Return airs!
Comment: I have closed the damper as well, forgot to mention that, but I fear you may be correct on the cold air return.  There was some screw-up when house was built, they had designed a chase for the duct work to get to the 2nd floor, but they forgot about steel beam and they couldn't use it.  The ran it through closest and changed the location of the furnace, they put it where the downstairs bath was roughed in (nice of them).  Thanks for great answer, I really appreciate the help.
Comment: Let me know what was wrong and happy you liked the answer, it's hard to solve these troubles when I can't see it but you have enough knowledge of what went on at least. Good Luck!


What is the etymology of the question ending `ㄴ가`/`는가`/`ㄹ가(ㄹ까)`?

Question: Since for the ending ㄴ가/는가/ㄹ가(ㄹ까), there is an obligatorily incorporated "relativiser-looking" particle (ㄴ/는/ㄹ), I am wondering whether this expression has evolved from a "relative clause-dependent noun" structure. Moreover, I have seen expressions such as 있을까를 생각한다, suggesting there is something "nominal" about this ending as it can be attached to by an overt case marker.
Answer: As far as I know, (ㄴ/는)가 does not have special etymological connection to relative clause construction (-ㄹ까 and -ㄴ/는가 are different question endings). They are just question endings that are a little more formal and objective sounding (and thus can create a noun clause more easily) than the most colloquial question endings like -아/어?
In Korean, relative clauses are very easily created with the -ㄴ/는 verb endings.  Although ㄴ/는 appear in (ㄴ/는)가, it can't be considered to be related to a relative clause since 가 is never used as a noun.
Also note that we don't even use the term "relative clause" much because plain adjectives and relative clauses, unlike English, take the same form.  좋은 직업 ("good job" - plain adj), and 내가 가진 직업 ("the job that I have" - rel. clause) have the same connective form of -(으)ㄴ and come before the noun (the difference is just additional words in front), so there is no need for a special category like "relative clause".  Both are just adjective forms - one a single word and the other a clause.  Often times even this distinction may be blurred.
There are many question ending forms with a varying degree in their abilities  to create a clause.  Here are a few common ones.

-(느)냐? = likely the "standard", most frequently used question ending in a clause.
언제 가느냐? (direct question like this is not so common nowadays)
언제 가느냐(고) 물었다 (noun (or adverb?) clause - very common)
언제 가느냐는 질문 (adjective clause - very common)

-아/어? = colloquial. Usually asks something specific about the person.
너 언제 가? (direct question - very common)
This form is not used as a clause much - 냐? handles it as shown above.

-ㄴ/느/ㄹ가? = more formal and suitable for non-personal questions.
평화의 시대는 언제 올 것인가? = literary and directed to people at large.
평화의 시대는 언제 오느냐는 물음 = simplest and most natural sounding  adjective clause form.
'평화의 시대는 언제 오는가'라는 물음 = direct quoting which is always possible.
평화의 시대는 언제 오는가, 라는 물음 = literary, and the connection is not as natural as 오느냐는.

-ㄹ까? = colloquial, (partially) self-directed question ending.
You can use it in a noun clause but it is not the most preferred way.
E.g. 왜 실패했는지(를)/실패했는가(를) 생각해 보았다 sound more proper than 왜 실패했을까(를) 생각해 보았다.
Comment: This I think should be accepted as the answer


Migration To Ubuntu At Work

Question: I'm on my work machine, which is running Windows. I'm pretty sure I can convince the boss to allow me to format and install Ubuntu so long as all the applications I need will work. The only one I think I'm going to have a problem with is Outlook. Is it possible to install Outlook on Ubuntu? If so, what settings should I make sure I take from Outlook on my current Windows machine before doing so?
Answer: It is possible, I used to do it with outlook 2000, but I don't think newer versions of outlook are supported in a way that is sufficient for professional use.
Depending on the way outlook is used in your company, you might prefer switching to evolution, which is what I had done initially.
However, we use outlook as a mail client and have another groupware suite for calendar and tasks.
If you do not use an exchange server or if you have enabled imap on the exchange server you could use any mail client you prefer.
Generally, if most of the work is done on software running natively on linux a migration has good prospects. If you intend running most of the software via wine, I would not do it.
Answer: No... you can't.
However, you can still access your email using an alternate mail client.  You could also use your Exchange server's web client and forego using a native email client altogether.
Comment: Do you know any guides for this sort of thing. I'm very novice with understanding how email works, thus lack the understanding of configuration that would be required (currently).

Migration To Ubuntu At Work


What does maximum normalized frictional force mean in this tutorial?

Question: I tried following this tutorial: https://nccastaff.bournemouth.ac.uk/jmacey/MastersProjects/MSc12/Srisuchat/Thesis.pdf, but in page 19 I ran onto a problem - I don't understand the step 4. It is also not explained before. Could somebody explain what is it and what values may be used?
Answer: An important concept in physics is that "friction never does mechanical work"; it only retards motion by generating heat.
Since mechanical work is calculated as the dot product of the force acting on a body with the displacement of said body (or more specifically, the integral over time of said dot product), this principle means that the total frictional force must always be such as to minimize the amount of mechanical work done by all forces acting on the body. Thus it is always necessary to check and ensure that this is true, else one will have an unrealistic simulation.
The maximum normalized frictional force (at any point of friction) referred to is obtained by multiplying the normal force at that point by the corresponding "coefficient of friction* (static or kinetic as appropriate) for that point of friction.
The normal force is that exerted by the ground/track at that point just sufficient to both prevent the vehicle from dissolving into the ground/track, and from spontaneously starting to rotate off of the track. The latter can only occur when other forces acting away from the ground/track have already reduced the corresponding normal force to zero, usually from aerodynamic lift of some sort.
Update:
The Normal Force and the Frictional Force are respectively the perpendicular and parallel components of the reaction force from a surface when another body comes in contact. Neither can do mechanical work. The usual model is that the Frictional Force varies linearly  as the Normal Force, with the coefficient of friction being the ratio. The coefficient of static friction (applicable to initiating movement or during rolling without slipping) is usually significantly greater than the coefficient of kinetic friction (applicable otherwise). Both are a property of the combination of materials at the point of contact and of the roughness of both - there is no theoretical model I am aware of that will predict these values, so you must simply look up what typical values are for the circumstances of interest.
Comment: Q1 = what is usual coefficient of friction in this case? And if I get you right, it is not what usually "normalize" means than, right?
Q2 = is the `normal force` mentioned in that link?
Comment: @AdriansNetlis: Correct. See my update.
Comment: OK! I mean the values for car. Also - my English knowledge is general and programing only, so I don't understand a lot of physics stuff(my native language is Latvian, which is very different).


How can I fix a shower faucet valve that is sticky?

Question: I have two bathrooms that have been completed in the last year. Both have the same Price Pfister rough-in valve. One is sticky and requires a bit of force to turn on the water (turns on by pulling). It actually has gotten worse over time. The other turns on with a gentle pull of handle. The plumber that installed the sticky one may have pulled out the cartridge and messed it up (rationale: because he messed up other things). I'm wondering if this sounds like something I might be able to fix or should I get a new cartridge? The valve in question is a Pfister 0X9 Brass Single Control.
Comment: I'd get a new one. One can sometimes fix leaks, but not rough operation. It was more likely defective from the start than someone damaging it in such a way it affected smooth operation.
Comment: I finally got around to this. When I removed the cartridge one of the rubber o-ring seals popped off, so I'm fairly certain the o-ring was causing the friction, not being set properly. I did add some teflon grease to the contact points and now it's amazing how smooth it turns on. The grease was probably not necessary and I hope it won't degrade the o-rings over time.
Comment: Misplaced O-ring? I guess I underestimated the ineptitude of some "plumbers". Glad it was an easy fix and you ignored my suggestion :)
Comment: Yeah, this handyman (recommended by realtor) turned the water back on before finishing sweating the pipes. It soaked the area pretty good for about 20 seconds. Fortunately it drained down the chase to the basement furnace room, so no damage, but I was not pleased. Good suggestion nonetheless!
Answer: I would try removing the cartridge and reinstalling it with a small amount of white lithium grease on the stem that connects to the handle. Work the grease in gently with your finger. If that doesn't free it up it was bad manufacturing which happens more often than one might think
Answer: I have sanded out a few valves before.  You would simply remove the cartridge and "sand" the inside of the valve housing.  The sanding needs to be even, so try to work in a circular fashion.  Just sanding out 1/500th of an inch might get rid of your stickiness.  There is some grunt work in this and it takes about 20 mins per valve but has worked on everything I have had issues with.  I have had people suggest plumber's grease too.  I could never find any and sanding is cheap and non-invasive so I have gone that route.
I would initially treat a sticky valve the same way as a sticky door.  You could even sand the cartridge but these usually have ribs in them and I don't know if I would trust myself doing this evenly.  However a person with more artistic talent could certainly go this route given that it is faster.
Comment: Are there any special tools required to remove the cartridge? Hopefully it's a problem with the cartridge since that can be replaced. I don't think I want to try sanding just yet but will keep in mind.
Comment: Just pliers and a screwdriver usually.  The cartridge itself will have a lot of parts that make it up.  Make sure if you are taking apart the cartridge to take pictures on each step.  I would really suggest sanding the valve, because your replacement cartridge might end up being the same thing you put in there.


Playing bass over a guitar solo

Question: How does one create a walking bassline over a guitar solo? Certain song tabs tell you what key the solo is in at certain moments, so I can follow along there, but when I try to improve over a solo, I end up making an out-of-tune droning bassline.
Comment: Playing bass _over_ a guitar solo? Sounds like the band is upside-down...
Comment: @leftaroundabout I might have used the wrong terminology. Under might be a better word. If you want an example -- The bass under Pf - Coming back to lifes third solo. There's a nice bass in there. I can't find out how to recreate it.
Answer: Stick to stuff in one key at a time. Know the appropriate scale notes for that key. A walking bass, in simple terms, is four in a bar, moving up and down in a sort of scalar manner. Think about it. Playing four notes in a bar in C, at least one, more likely two of the notes you play consecutively (up or down) from a C scale will contain a C, E and/or G. The best plan is to make sure one of these notes fits on the more important parts of a bar: beats 1 and 3.
Example - in C, for 2 bars - play C D E F G A B C. It works fine.Because 1st bar - C=1, E=3, 2nd bar - G=1. If the next bar is G, you can play the first note as the B below C, and go B A G F. If the next bar is F, then you may play F E D C, ending on the top C previously played.
All this is very basic walking bass, and you can sometimes merely get away with walking up and down the scale, with occasional jumps. However, it is probably a nice start point. Give it a try. There's a lot more, like chromatics, extra jump notes to stop the timing becoming staid, etc. etc.
Comment: I do really hate to ask to many questions, and I do hope I'm not bothering you -- but a guitar solo in the key of A minor, ranges a bunch of notes and despite it being in A minor, playing A throughout does not make a good bassline. How do I tell what note I shouldplay based on the solo?
Comment: It may be in the key of Am, but it won't stay *on* Am all through. Go with the chords - probably Dm and E(m) feature too. It would be very unusual to stay on Am throughout. Walk up and down from the root note on beat 1, as suggested, and it'll be a start. Use the 1,3 and 5 of each individual chord as the main (1 and 3) beats of each bar, again, as suggested above. Take my whole answer, and it will be several practice sessione before it all drops into place, assuming it is a walking bassline you're after.
Answer: It seems that you haven't figure the key the guitar solo is in, the most important thing is to find in what key you should be playing ,from their you should figure the scales , the notes and the chords you could use in your bassline.
knowing the theory behind the music you're trying to transcribe is crucial since it makes your job much easier.GOOD LUCK.
Comment: I think I might be missing something here -- The bassline for the third solo of Pink Floyds "Coming back to life" is in the key of A minor. During the solo, the bass goes from playing c, to f, to a, to g, to f, to a, to g, to f, etc... How are all of those related to A minor, and how do you know which is currently being played to back it up and bring the notes, "to life" so to speak.

EDIT: Didn't know enter submitted the comment.
Comment: Starting around 4:55 on the the original album version? That progression is in C major, I hear the chords as I-IV-vi-V-IV (C-G-Am-G-F) twice and then vi-IV-vi-bVII-vi-V-I (Am-F-Am-Bb-Am-G-C). The bass is playing the root of each chord except the one little riff on the I. Listen carefully to the rhythm and articulation, I think they're really important to that line. Nice song!

Playing bass over a guitar solo


Can I use multiple regression with categorical variables?

Question: I want to construct a model with 5 categorical variables(no continuous variable), and all of them have more than 2 levels. Should I use ANOVA or other methods to set up my model? And how to express my model in a equation form? Besides, how can I add some interaction terms into model? The response variable is continuous.
Answer: Of course you can. The question remains, however, what the model will tell you. If you have one categorical variable with say 3 levels, you would use dummy coding, i.e. add two dummy variables which indicate whether two of the levels are taken or not. If both dummy variables are zero in a observation, then necessarily the other level has to be "true". This is what is called the reference level (for the reference level there will not be a coefficient $\beta_i$ in the model. The reference level is solely expressed in terms of the absence of the other two levels (and naturally all other variables in the model).
If you plan on using more than one categorical variable, then you can use this standard procedure. Technically you could also simply code the reference categories as additional dummy variables in order to bring all of them into the model. However, you will then end up having severe multicollinearities in the model. This is due to the fact that if for each level of a categorical variable a dummy variable is created, these dummy variables will some up to $\mathbf{1}$, the vector of ones. They are, hence, linearly dependent. However, one usually wants to omit multicollinearities in a model.
One other way would be to create several models for each categorical variable to avoid multicollinearities. Depending on the type of your categorical variables it might also be worth considering effects coding or contrast coding rather than dummy coding.
Comment: The suggestion at the end, that a collection of univariate regressions could substitute for the desired multiple regression, is misleading: that's a completely different approach and ordinarily will produce different answers than the intended model.  Moreover, it is offered to solve a problem that might not exist: there isn't necessarily any collinearity introduced when more than one categorical independent variable is used in a regression.
Comment: I did not mean that there necessarily is a multicollinearity. What I mean that there will always be one if one does dummy code all levels of a variable.
Comment: Thank you for your asking! But I'm still wondering that if I use dummy variables, I may use 20+ variables in my model. And as you said, it may cause severe multicollinearities, thus should I use both dummy coding way and ANOVA to figure out which model is better?


I need help identifying the set for 37 bags

Question: We bought a set of returns of which one should have been the 6020 piece Hogwarts castle.  We received 37 bags that are represented in the pics below packaged neatly in the Hogwarts box.  We have bags 1-37 with no instructions and no idea which set they belong to.  We might as well build it since it's here.  :)  Any help would be great.
Comment: Based on the 2 answers, you seem to have paid for a set worth $400 and received about $80 worth of parts. Have you alerted the seller that they need to be more vigilant about checking their returns?
Comment: Maybe the unusually high numbers on the bags provide a clue. In fact, I have never encountered a set going up 30-something in bag numbers, so maybe it is from some different series (LEGO educational or even LEGO serious play).
Comment: I know.  Pretty frustrating.  It was a big box store, so not sure they will listen, but worth a try.
Comment: 71043 (the big Hogwarts castle) does contain bags numbered that high, 10276 (Colosseum) apparently also does (but the colors of OP's parts rules that set out)h, it seems 75192 does NOT.
Comment: Building instructions for the large castle [can be found here](https://www.lego.com/en-gb/service/buildinginstructions/71043). Sadly it doesn't appear to include a blue door in bag 36 :(
Answer: I believe you have a mix of at least two sets: 11005 Creative Fun and one of either 10717 Bricks Bricks Bricks or 11717 Bricks Bricks Plates.

Bag 36 contains a Door 1 x 4 x 6 with 4 Panes and Stud Handle (Medium Blue) which was featured in 5 sets.
11003 Bricks and Eyes
10264 Corner Garage
10703 Creative Builder Box
10702 Creative Building Set
11005 Creative Fun
10260 Downtown Diner
31025 Mountain Hut
31065 Park Street Townhouse

Bag 36 also contains a Plate, Round 4 x 4 with Hole (Dark Tan) which was featured in 22 sets.
41167 Arendelle Castle Village
75958 Beauxbatons' Carriage: Arrival at Hogwarts
11005 Creative Fun
11013 Creative Transparent Bricks
80102 Dragon Dance
71730 Epic Battle Set - Kai vs Skulkin
70674 Fire Fang
41395 Friendship Bus
71043 Hogwarts Castle
76129 Hydro-Man Attack
70668 Jay's Storm Fighter
70667 Kai's Blade Cycle & Zane's Snowmobile
70675 Katana 4x4
70677 Land Bounty
70680 Monastery Training
30534 Ninja Workout polybag
40342 Ninjago 2019 Minifigure Set blister pack
75270 Obi-Wan's Hut
75937 Triceratops Rampage
70840 Welcome to Apocalypseburg!
70419 Wrecked Shrimp Boat
75255 Yoda

These two pieces have only appeared together in 11005 Creative Fun.

However, bag 32 contains a Slope, Curved 3 x 1 x 2 with Stud (Lime) which was featured in 19 sets - none of which were 11005 Creative Fun.
11011 Bricks and Animals
10717 Bricks Bricks Bricks
11717 Bricks Bricks Plates
70803 Cloud Cuckoo Palace
10703 Creative Builder Box
10702 Creative Building Set
8961  Crystal Sweeper
45810 FIRST LEGO League (FLL) Jr Challenge 2019 - Boomtown Build Inspire Set
41345 Heartlake City Pet Center
71367 Mario's House & Yoshi - Expansion Set
41339 Mia's Camper Van
60270 Police Brick Box
7676  Republic Attack Gunship
75021 Republic Gunship
21208 Resort Designer
76134 Spider-Man: Doc Ock Diamond Heist
70922 The Joker Manor
41455 Unikingdom Creative Brick Box
60125 Volcano Heavy-lift Helicopter

Bag 32 also contains a Slope 45 2 x 4 (Lavendar) which was featured in 7 sets.
10717 Bricks Bricks Bricks
11717 Bricks Bricks Plates
10704 Creative Box
41340 Friendship House
41108 Heartlake Food Market
41310 Heartlake Gift Delivery
41253 Lonesome Flats Raft Adventure

These two pieces have only appeared together in 10717 Bricks Bricks Bricks and 11717 Bricks Bricks Plates.
Comment: I thought one of the sets (and there did seem to me also that there had to be multiple) would be 11011 Bricks and Animals  due to the Dark Pink "fingernail" piece  and the Light Aqua Brick, Modified 1 x 1 with Stud on 1 Side  and Lime Slope, Curved 3 x 1 x 2 with Stud
Answer: TLDR. Although bricks seem to be packed in sealed bags, these looks to be a mixture of parts since none of existing set inventories contain such combination of bricks.

More details below.
Based on the colors of the bricks you have received this is definitely not a Hogwarts Castle.
Let's start with contents of bag #36, since it has elements easier to identify. The combination of Door 1 x 4 x 6 with 4 Panes and Stud Handle mentioned in another answer is definitely not in Medium Blue, but some shade of Azure. Checking Bricklink for colors available for this element we can conclude this is Medium Azure colored item. Now this element come in just 5 sets, none of which have Plate, Round 4 x 4 with Hole OR Brick, Round 4 x 4 with Hole in Dark Tan. So the set this bag comes from doesn't exist.
Now let's see bag #4. Combination of Brick 1 x 2 in Coral color as well as Slope, Curved 2 x 1 x 1 1/3 with Recessed Stud in Lime may suggest this is Bricks and Animals (11011), but it doesn't include any of Slope, Inverted 45 2 x 2 in shades of blue. So no set for this bag as well.
Bag #19 again, suggest combination of Brick, Modified 1 x 1 with Stud on 1 Side in Coral color with Slope, Curved 3 x 1 x 2 with Stud in Lime suggest this may be Bricks and Animals (11011), but this set doesn't contain Plate 4 x 4 in Green.
These bags come from either set that has not been inventoried yet on Bricklink or incorrect bricks have been packaged for particular set (which might explain why they have been returned). The source of these bricks/bags would be some larger set from LEGO Classic series.
Comment: I went back and forth on whether that door was `Medium Azure` or `Medium Blue` and went with the one that I could find a plausible set match for. But the fact that I missed the color of the 4x4 tile too tells me I need to re-calibrate my monitor. +1 for catching that.


Opening a programme in a floating window in i3

Question: I want to open a programme in a floating window.  I tried
exec emacsclient -c ; floating enable, but that made the
window that was active before float, not the new window.
Answer: This is how I did it for my Galculator application:
~/.config/i3/config
for_window [class="Galculator" instance="galculator"] floating enable

To find out what goes in your class="..." and instance="...", type xprop in terminal, then click on the window you want to float. You will find the info somewhere on the bottom under WM_CLASS(STRING)="instance", "Class".
Comment: This is fine if we want _all_ windows of that class to float. I usually find that I don't.
Answer: The proper way to make the currently focused window float in i3 is to run
i3-msg floating enable

This is what your config line does.
The problem now is that i3-msg runs before the window is in focus (if it even grabs focus). Peter O. explains over here how to get a window in focus based on its PID. We can use this as such:
our_application &
pid="$!"

# Wait for the window to open and grab its window ID
winid=''
while : ; do
    winid="`wmctrl -lp | awk -vpid=$pid '$3==pid {print $1; exit}'`"
    [[ -z "${winid}" ]] || break
done

# Focus the window we found
wmctrl -ia "${winid}"

# Make it float
i3-msg floating enable > /dev/null;

# Move it to the center for good measure
i3-msg move position center > /dev/null;

# Wait for the application to quit
wait "${pid}";

Nota bene:

If the application does grab focus by itself, it may be sufficient to just wait for that to happen. See here for ways to determine the currently focused window.
I didn't work through it, but it should be possible to extend the script to return focus to where it was before we changed it.
wmctrl can not always figure out the PID for all windows; ImageMagick's display always has PID 0 in its listing, for example. See here for modified approach that uses the window title.
Wrapping the salient parts of above solution in a script, it should be possible to write something like
exec our_command; grab_focus; floating enable

in the i3 config.
Answer: I would like to sum up HubbleTs post with some other dirty workarounds added information:

TLDR: Append && i3-msg "[id=$(xdotool getactivewindow)] floating enable" to your shortcut definition (requires xdotool).
E.g. bindsym $mod+button exec program && i3-msg "[id=$(xdotool getactivewindow)] floating enable"

You can set up rules for all windows that match a list of criteria that can be set up within your i3-config or equivalently send using i3-msg.
The syntax is for_window [ criteria ] command. You can read more about it here. If you want it to work only on a single window, you might ensure uniqueness of your criteria.
There is not just

class

Compares the window class (the second part of WM_CLASS). Use the special value focused to match all windows having the same window class as the currently focused window.

instance

Compares the window instance (the first part of WM_CLASS). Use the special value focused to match all windows having the same window instance as the currently focused window.

but way more, like title or id:

title

Compares the X11 window title (_NET_WM_NAME or WM_NAME as fallback). Use the special value __focused__ to match all windows having the same window title as the currently focused window.

id

Compares the X11 window ID, which you can get via xwininfo for example.

Assuming emacsclient to be a command line program, you could hence add
for_window [ title="uniquetitle" ] floating enable

to your i3 config and open your favorite terminal using
termite -e emacsclient -t uniquetitle

and it would directly open in floating mode.
If it is not a command line program and has no title options, you could play around with the other criteria or e.g. (using xdotool and i3-msg):
bindsym $mod+button exec program && xdotool getactivewindow set_window --name uniquetitle

or less dirty
bindsym $mod+t exec program && i3-msg "[id=$(xdotool getactivewindow)] floating enable"

Comment: This doesn't work, the "&&" waits for the first half (the exec) to complete before it runs the second half (the floating enable on the current window).  What actually happens is that the new program window is opened, and once it's closed the window focus returns to is made floating.  Adding `--no-startup-id` also doesn't solve that issue.
Answer: Was searching for a way to have a application always start in tiling but at the same time have a way to open it in floating (without changing all the other instances of this app beeing send to floating).
Combining Adaephon-R's suggestion from reddit and Suuuehgi's answer on this question the easiest (and most stable for me) solution I found is using the WM_CLASS(STRING) of the window-property and setting the instance field by passing the --class floating (or similar) parameter to the desired app.
in my .i3/config:
# start a terminal (alacritty)
bindsym $mod+Return exec --no-startup-id alacritty
# start a terminal in floating mode
bindsym $mod+Shift+Return exec --no-startup-id alacritty --class floating

# enable startup in float from exec by setting the x11 class to floating
# many apps support '--class floating' for setting the x11 class (the instance get renamed)
for_window [class="floating"] floating enabled move position center

As the result I can open my terminal-sessions with

$mod+Return while tiling
$mod+Shift+Return while floating
Comment: For `xterm` you need `-class floating`, like `bindsym $mod+Shift+Return exec xterm -class floating`
Answer: A small tweak to termnml's answer made it work for me. The full working result now reads:
bindsym $mod+Shift+Return exec --no-startup-id urxvt --class floating
for_window [class="floating"] floating enabled

Comment: Welcome to the site. If you want to comment on another answer, please don't post this as an answer - the answer section is only intended for definitive solutions to the original problem. Once you have enough reputation, you will be able to comment on other people's posts. In the meantime, consider submitting an edit suggestion if you think that you can improve the other answer.


How to produce nice looking analog (film) grain digitally with Photoshop or other applications?

Question: There are some photographers like Michael ackerman, Daido Moriyama, Igor Posner, Jacob Aue Sobol, who shoot digitally but some also analog who very often achieve to bring a nice looking grain in their images. So, Is it possible to produce nice looking analog grain digitally in Photoshop or other applications?
Comment: Could you clarify your question please.  It is unclear what you are trying to ask.  Are you asking how to simulate film grain in Photoshop?
Comment: There are some photographers like Michael ackerman, Daido Moriyama, Igor Posner, Jacob Aue Sobol .. who shoot digitally but some also analog who very often achieve to bring a nice looking grain in their images. Yes film grain.
Answer: There are multiple solutions for that:
On a vanilla factory Adobe Photoshop without any plugins:
What I use to do is to create a 50% gray layer ( rgb(128, 128, 128) ) that I put in one of the following blending modes: Overlay, Soft Light or Hard Light, doing so your layer won't have any effect because those blending modes are 50% gray centered. Then I do a 'Add Noise...' filter, don't put it too strong, 50% is a good start, you will be able to dial it down afterward anyway, distribution is a matter of taste.
Then the trick is to adjust the grain size is to blur your layer however blurring everything at the same value would result in poor uniform appearance, that's why you want to blur your red, green, blue channels with different values, you can blur your blue channel more than the red or green for instance.
For more control you can even have the red, green, blue grain on different layers so that you can dial their intensity easily. You can even put that in smart objects if you need even more control.
From there it's very easy to create your own actions to simulate various film stocks.
If you can buy plugins:
One I use all the is "Red Giant - Magic Bullet Photolooks", it does a lot of things more than grain, but it's film grain node is quick and easy to use.
I found that while searching for a dedicated plugin: Power Retouche Film Grain, it looks to have a lot of controls.
If you have access to compositing applications:
The Foundry Nuke, Eyeon Fusion all offer comprehensive grain filters, they also have plugins filters suites that can do that: Genarts Sapphire for instance
Comment: Imagenomic RealGrain is also worth considering for realistic film looks, though at $99 (currently) it might be a bit expensive for some. But "expensive" always needs to be balanced against time spent, and for anyone in the biz, a hundred bucks balanced against five additional minutes per image is nothing.
Comment: I just gave a go at [Imagenomic Realgrain](http://imagenomic.com/rg.aspx), it's quite good yeah, it's based on a noise generator. I also tried [Filmconvert](http://www.filmconvert.com/), they apparently claim to use 6K films grain scan in order to generate the grain. One issue you may have with both of them is that they also try to emulate film stock colors either through controls you can deactivate for Imagenomic Realgrain or an always on ( Apparently ) lookup table for Filmconvert. I would suggest to try the demos, you can render the filters on a 50% gray layer and see how they affect it.
Comment: You can actually also deactivate the lookup table with Filmconvert using the **Color** slider.
Answer: An interesting take is to scan an empty film frame and use this noise frame as an overlay. In the following photo, I have moved the grain layer halfway to the right so that you can see the effect more clearly:
http://data.zmotula.cz/img/grain.png
This is how the grain looks in detail (you probably want to open the image to skip the compression and resizing artifacts):
http://data.zmotula.cz/img/grain-detail.png
This looks very nice and natural, as you get all sorts of small blemishes and "grain islands" that appear on film. On the other hand, the grain is always the same on all your pictures, unless you shuffle the overlay with each use somehow (rotate, shift, etc).
Answer: You can add grain to an image using Adobe Lightroom if you want to add the grain digitally during post processing.
Comment: I was looking for more alternative ways to do it in photoshop. So you would have more control over the process and eventualy the size ,color , form an kind of grain...
Comment: You asked for suggestions with Photoshop _or other applications_, of which I'm fairly certain Lightroom is one. :) If you want to know how to do it in Photoshop specifically, edit your question to indicate as such.


How to make play/stop buttons for iframe audio?

Question: I need to make audio players from soundcloud links, which can't be played by audio element, they need an iframe.
I found a lot of tutorials how to make custom play/stop buttons for iframe video. Unfortunately they don't work for iframe audio. Is there a way to make those buttons for iframe audio, too?
Answer: Soundcloud embed links displays as player with play or pause button. https://soundcloud.com/pages/embed
Comment: I suggest you to write to soundcloud support


Connect the controls of SharePoint Visual Web part to MySQL

Question: I have a claims based FBA sharepoint website in sharepoint 2010 where a users data is stored in MYSQL like all there usersid's and password . Now i want to connect some visual webpart controls to MYSQL , So where and how should i define the connection of that visual webpart with MY SQL  ?
Answer: You can define your connection string in the web.config file. In the appSettings of your web.config file add a new key like
<add key="mysqlConnStr" value="path of your mysql serve"/>

No get it in your Web Part like following.
private string mysqlConnStr = WebConfigurationManager.AppSettings["mysqlConnStr "];

Then follow this article to read/write data using C#.
Answer: I think that will depend on your type of Visual Web Part.  The solution for 2010 created Sand boxed Visual webparts and if that is case you won't be able to connect directly as code policy won't allow that. You will need to look at:

Surface the data thru BCS and then use your web part to connect to BCS to display the data
Creating a trusted proxy you can call to make the connection
Or using a farm solution or the "Older" Visual web part method that was used with 2007 (Example: https://smartpart.codeplex.com/ )


Why does a lump of explosive burn's with an explosion?

Question: When we light a solid lump of explosive it burns slowly layer by layer, but when we light up powder form of explosive it just burns with a huge explosion and sound why does it happen. And one more question, what fraction of the energy in a blast is lost just in the form of sound?
Comment: I think you should read the wikipedia article on explosive material http://en.wikipedia.org/wiki/Explosive_material to realize the complexity of explosions and materials.
Answer: It is all about the surface area. On a block of M112 composition C4 explosive, the total surface area is merely 70 inches. However, in a fine grain powder (any flammable powder whether explosive or not, I'll explain in a second.) there could be hundreds of thousands or millions of tiny particles, each with their surface exposed to the flame. The greater the surface area present, the faster the flame ignites. This can be seen in explosions in factories that produce fine particles that are flammable. As the fire spreads out 360 degrees in 3-dimensional space (basically that means it expands as a sphere not a 2-D circle) it can increase in speed. Each particle burns through its fuel supply (the fuel supply being the particulate itself) far more rapidly than a chunk because, as Martin Beckett said, in order to burn through the fuel source as a chunk, it must first burn through the outer layers.
Now, to answer your question more thoroughly, you need to understand a few things. First, in order to create an explosion, you need heat and pressure. The heat will cause pressure to build up; basically, this means that as the material is converted into gas. The rate at which that material converts to gas is what dictates whether you have an explosion (as in high explosives) or you have deflagration, a technical term basically meaning that it burns. Technically, whether the material explodes or deflagrates the process can be understood as a cloud of expanding gas, which is a result of a solid or liquid material being converted to gas. If that rate of expansion exceeds the speed of sound, you will have an explosion. In fact, the "boom" that is produced from the explosion is simply the expansion of that gas passing the sound barrier; it's the sonic boom of the gas. If that expansion does not surpass the speed of sound, it merely deflagrates. Those are the distinctions between high (rate of expansion exceeds the speed of sound) and low (rate of expansion does NOT exceed the speed of sound).
Lastly, I am not sure that there is energy lost to sound, the sound is merely a by-product of the speed. At least, not that I have heard. I may be all over the place here, but I am usually explaining this to people with a rather firm grasp on explosive theory, and have not taught neophytes in years. There is a lot more to it than this and the specifics of the powder and solid explosives matter a great deal as well. I'll clear anything up if needed.
Answer: Gunpowder is a low speed explosive (by strict modern standards it isn't really explosive)
A burning explosive isn't the same as detonating. The combustion (burning) is spread from one part of the explosive to the next by the flame on the surface. In a large piece of explosive the burning can only reach the center slowly as the explosive burns away. In a finely powdered explosive there is a lot of surface area for the flame to reach quickly.
In a detonating explosive the detonation is set off by a supersonic shockwave so the entire explosive reacts 'almost' instantly
Comment: sorry but the term explosive was not coming in my mind I actually meant explosive's i have edited the question
Comment: The answer is for a low-explosive like gunpowder. For a high explosive burning is different from exploding. I fixed up the English in the question
Comment: I actually asked for explosive