index
int64
0
1.03k
original
stringlengths
12
7.84k
translated
stringlengths
11
7.53k
original_reply
stringlengths
15
17.7k
translated_reply
stringlengths
12
11k
100
The following article from CNN describes a Michigan police officer being put on administrative leave for having KKK material at his home: https://www.cnn.com/2019/08/10/us/michigan-officer-placed-on-leave-kkk-document-house/index.html. The materials were discovered while a potential buyer was touring his house. Although I vehemently condemn the KKK, doesn't this officer have the right to display whatever he wants in his home so long as it doesn't actively and deliberately call for violence? Aren't these articles protected under the first amendment? I realize this is an extreme example, and as a police officer his job requires interacting with all races, but unless it can be shown that he's bigoted and that it negatively affected his job performance, isn't it illegal to fire him? Employers can restrict speech according to company policy while at work, but we all have to go home at some point. Can those restrictions follow us after clocking out?
CNN'den aşağıdaki makale, evinde KKK materyali bulundurduğu için Michigan'dan bir polis memurunun idari izne çıkarıldığını anlatıyor: https://www.cnn.com/2019/08/10/us/michigan-officer-placed-on-leave-kkk-document-house/index.html. Materyaller, potansiyel bir alıcının evini gezerken keşfedildi. KKK'yı şiddetle kınamama rağmen, bu memurun, şiddeti aktif ve kasıtlı olarak çağırmadığı sürece evinde istediğini sergileme hakkı yok mu? Bu makaleler birinci değişiklik kapsamında korunmuyor mu? Bunun aşırı bir örnek olduğunu ve bir polis memuru olarak işinin tüm ırklarla etkileşim kurmasını gerektirdiğini biliyorum, ancak onun bağnaz olduğu ve bunun iş performansını olumsuz etkilediği gösterilemedikçe onu kovmak yasa dışı değil mi? İşverenler, işyerindeyken şirket politikasına göre konuşmayı kısıtlayabilirler, ancak hepimizin bir noktada eve gitmemiz gerekiyor. Bu kısıtlamalar mesai saatleri dışında da bizi takip edebilir mi?
In general, employers in the United States are free to fire you for your speech. The First Amendment does not apply to anyone except the government (other than a narrow set of circumstances where private parties act on behalf of the government or take on government roles, like when private universities employ campus police). If the officer was being fired from a job at a private company, this would not be an interesting question -- the answer would clearly be "no, there is no First Amendment claim here." That’s not to say labor laws might not come into play (for instance, federal law prohibits firing an employee for organizing a union, and some states prohibit firing for off-duty political speech); however, labor law protections exist by statute and are not derived from the First Amendment. What makes this interesting is that the government is involved. Unlike private employers, government agencies are bound by the First Amendment. In Pickering v. Board of Education, the Supreme Court held that this does restrict them in their role as employer and that they can't necessarily fire an employee for speech. Pickering imposes a balancing test, where the harm to the employee's First Amendment rights is weighed against the government's interest in efficient operation. Courts have given particular leeway to police departments punishing speech that would undermine public trust and confidence in the department. A police officer expressing racist views, even privately, can seriously hamper the effectiveness of the department if the speech gets linked back to them. For instance, see Pappas v. Giuliani, where the Second Circuit upheld the firing of an NYPD officer for anonymously mailing racist diatribes from home in his off-duty time. Another answer suggests that the main question is a public safety one: whether the officer could be trusted to carry out his duties without bias. But that's not the only legitimate consideration for the government employer. The courts have repeatedly held that public perception of an agency is a legitimate concern, especially when it comes to agencies (like the police) whose job requires maintaining good relations with the community. In Pappas, the officer was assigned as a computer operator who had no contact with the public, but he was still a police officer whose speech had a high potential to undermine NYPD community relations.
Genel olarak, Amerika Birleşik Devletleri'ndeki işverenler sizi konuşmanız nedeniyle işten çıkarmakta özgürdür. Birinci Değişiklik, hükümet dışındaki hiç kimseye uygulanmaz (özel tarafların hükümet adına hareket ettiği veya üniversite polislerini işe alan özel üniversiteler gibi hükümet rollerini üstlendiği dar bir durum kümesi dışında). Memur, özel bir şirketteki işinden kovuluyorsa, bu ilginç bir soru olmazdı -- cevap açıkça "hayır, burada Birinci Değişiklik iddiası yok" olurdu. Bu, işçi yasalarının devreye girmeyeceği anlamına gelmez (örneğin, federal yasa bir çalışanı sendika örgütlediği için işten çıkarmayı yasaklar ve bazı eyaletler görev dışı siyasi konuşmalar nedeniyle işten çıkarmayı yasaklar); ancak işçi yasası korumaları yasa gereği vardır ve Birinci Değişiklik'ten türetilmemiştir. Bunu ilginç kılan şey, hükümetin dahil olmasıdır. Özel işverenlerin aksine, devlet kurumları Birinci Değişiklik ile bağlıdır. Pickering v. Board of Education davasında Yüksek Mahkeme, bunun onları işveren olarak rollerinde kısıtladığına ve bir çalışanı mutlaka konuşma nedeniyle işten çıkaramayacaklarına hükmetmiştir. Pickering, çalışanın Birinci Değişiklik haklarına verilen zararın hükümetin verimli çalışma konusundaki çıkarına karşı tartıldığı bir dengeleme testi uygular. Mahkemeler, departmana olan kamu güvenini ve inancını zedeleyecek konuşmaları cezalandıran polis departmanlarına özel bir serbestlik alanı tanımıştır. Bir polis memurunun ırkçı görüşlerini, hatta özel olarak ifade etmesi, konuşma kendilerine bağlanırsa departmanın etkinliğini ciddi şekilde engelleyebilir. Örneğin, İkinci Daire'nin, bir NYPD memurunun görev dışı zamanında evinden isimsiz ırkçı hicivler gönderdiği için işten çıkarılmasını onayladığı Pappas v. Giuliani davasına bakın. Başka bir cevap, ana sorunun kamu güvenliği olduğunu öne sürüyor: memurun görevlerini önyargısız bir şekilde yerine getirmesine güvenilip güvenilemeyeceği. Ancak bu, hükümet işvereni için tek meşru husus değildir. Mahkemeler, bir kurumun kamuoyunun algısının, özellikle de işi toplulukla iyi ilişkiler sürdürmeyi gerektiren (polis gibi) kurumlar söz konusu olduğunda meşru bir endişe olduğunu defalarca belirtmiştir. Pappas davasında, memur halkla hiçbir teması olmayan bir bilgisayar operatörü olarak görevlendirilmişti, ancak yine de konuşmasının NYPD topluluk ilişkilerini baltalama potansiyeli yüksek bir polis memuruydu.
101
What does strength refer to in mathematics? Is it a formal idea?
Matematikte kuvvet neyi ifade eder? Bu resmi bir fikir midir?
Suppose you have a theorem that says "If $X$, then $Y$." There are two ways to strengthen such a theorem: * Assume less. If you can reduce the number of hypotheses, but still prove the same conclusion, then you have proved a more "powerful" result (in the sense that it applies in more situations). * Prove more. If you can keep the same hypotheses, but add more information to the conclusion, then you have also produced a more "powerful" result. Here is an easy example from Geometry. Let $ABCD$ be a (non-square) rectangle. Then the internal angle bisectors of the vertices intersect at four points $WXYZ$, which are the vertices of a rectangle. (You need the condition that $ABCD$ is not a square because if it is a square then all four angle bisectors coincide at a single point.) Here are a few ways to strengthen the theorem: * The hypothesis "$ABCD$ is a (non-square) rectangle" can be relaxed to the more general "$ABCD$ is a (non-rhombic) parallelogram". The conclusion that $WXYZ$ is a rectangle still holds. * Alternatively, you can keep the original hypothesis that $ABCD$ is a (non-square) rectangle, and strengthen to the conclusion to say that $WXYZ$ is not just a rectangle, but a square. * Having done that, you can then strengthen the conclusion of the theorem even more, by noting that the diagonal of square $WXYZ$ is equal in length to the difference of the lengths of the sides of $ABCD$. * Once you know that, you can now strengthen the theorem even more by (finally) removing the hypothesis that $ABCD$ is non-square, and including the case in which the four angle bisectors coincide at a single point as forming a "degenerate" square with a diagonal of length zero.
"Eğer $X$ ise, o zaman $Y$" diyen bir teoreminiz olduğunu varsayalım. Böyle bir teoremi güçlendirmenin iki yolu vardır: * Daha az varsayım. Hipotezlerin sayısını azaltabilir, ancak yine de aynı sonucu kanıtlayabilirseniz, daha "güçlü" bir sonuç kanıtlamış olursunuz (daha fazla durumda uygulanabilir anlamında). * Daha fazlasını kanıtlayın. Aynı hipotezleri koruyabilir, ancak sonuca daha fazla bilgi ekleyebilirseniz, daha "güçlü" bir sonuç üretmiş olursunuz. İşte Geometriden kolay bir örnek. $ABCD$ bir (kare olmayan) dikdörtgen olsun. O zaman köşelerin iç açıortayları $WXYZ$ dört noktasında kesişir ve bu noktalar bir dikdörtgenin köşeleridir. ($ABCD$'nin bir kare olmadığı koşuluna ihtiyacınız vardır çünkü kare ise dört açıortayı tek bir noktada çakışır.) Teoremi güçlendirmenin birkaç yolu vardır: * "$ABCD$ bir (kare olmayan) dikdörtgendir" hipotezi, daha genel "$ABCD$ bir (eşkenar olmayan) paralelkenardır" şeklinde gevşetilebilir. $WXYZ$'nin bir dikdörtgen olduğu sonucu hala geçerlidir. * Alternatif olarak, $ABCD$'nin bir (kare olmayan) dikdörtgen olduğu orijinal hipotezi koruyabilir ve $WXYZ$'nin sadece bir dikdörtgen değil, bir kare olduğunu söylemek için sonucu güçlendirebilirsiniz. * Bunu yaptıktan sonra, $WXYZ$ karesinin köşegeninin uzunluğunun $ABCD$ kenarlarının uzunlukları arasındaki farka eşit olduğunu belirterek teoremin sonucunu daha da güçlendirebilirsiniz. * Bunu öğrendikten sonra, $ABCD$'nin kare olmayan olduğu hipotezini (son olarak) kaldırarak ve dört açıortayının tek bir noktada çakıştığı durumu, sıfır uzunluğunda bir köşegeni olan "bozuk" bir kare oluşturarak dahil ederek teoremi daha da güçlendirebilirsiniz.
102
Does vegetarianism affect life expectancy? Is an average vegetarian supposed to live longer just because of their diet?
Vejetaryenlik yaşam süresini etkiliyor mu? Ortalama bir vejetaryen sadece beslenme şekli nedeniyle daha uzun yaşar mı?
Yes, according to a paper by the American Society for Clinical Nutrition. > Results: Our review of the 6 studies found the following trends: 1) a very low meat intake was associated with a significant decrease in risk of death in 4 studies, a nonsignificant decrease in risk of death in the fifth study, and virtually no association in the sixth study; 2) 2 of the studies in which a low meat intake significantly decreased mortality risk also indicated that a longer duration (≥ 2 decades) of adherence to this diet contributed to a significant decrease in mortality risk and a significant 3.6-y (95% CI: 1.4, 5.8 y) increase in life expectancy; and 3) the protective effect of a very low meat intake seems to attenuate after the ninth decade. Some of the variation in the survival advantage in vegetarians may have been due to marked differences between studies in adjustment for confounders, the definition of vegetarian, measurement error, age distribution, the healthy volunteer effect, and intake of specific plant foods by the vegetarians. TL;DR: * less meat = less risk of death, * less meat for a longer time = an average of a 3 year longer lifespan + less risk of death, * after 90 years of no meat it stops decreasing your risk of death. > Conclusion: Current prospective cohort data from adults in North America and Europe raise the possibility that a lifestyle pattern that includes a very low meat intake is associated with greater longevity. So yes, scientific research says that vegetarianism could help you live longer, but it primarily decreases your risk of death. (i.e. you might not live to 105, but you probably won't die at 55)
Evet, Amerikan Klinik Beslenme Derneği'nin bir makalesine göre. > Sonuçlar: 6 çalışmanın incelemesinde şu eğilimler bulunmuştur: 1) çok düşük et tüketimi 4 çalışmada ölüm riskinde önemli bir azalma ile ilişkilendirilmiştir, beşinci çalışmada ölüm riskinde önemsiz bir azalma ve altıncı çalışmada neredeyse hiç ilişki bulunmamıştır; 2) düşük et tüketiminin ölüm riskini önemli ölçüde azalttığı çalışmalardan 2'si, bu diyete daha uzun süre (≥ 2 on yıl) uymanın ölüm riskini önemli ölçüde azalttığını ve yaşam beklentisinde önemli bir 3,6 yıllık (95% CI: 1,4, 5,8 yıl) artış olduğunu da belirtmiştir; ve 3) çok düşük et tüketiminin koruyucu etkisi dokuzuncu on yıldan sonra azalmaktadır. Vejetaryenlerde sağkalım avantajındaki bazı farklılıklar, çalışmalar arasındaki karıştırıcı faktörler için ayarlama, vejetaryen tanımı, ölçüm hatası, yaş dağılımı, sağlıklı gönüllü etkisi ve vejetaryenler tarafından belirli bitkisel gıdaların alımı arasındaki belirgin farklılıklardan kaynaklanmış olabilir. Özetle: * daha az et = daha az ölüm riski, * daha uzun süre daha az et = ortalama 3 yıl daha uzun ömür + daha az ölüm riski, * 90 yıl et yememekten sonra ölüm riskinizi azaltmayı bırakır. > Sonuç: Kuzey Amerika ve Avrupa'daki yetişkinlerden alınan mevcut prospektif kohort verileri, çok düşük et tüketimi içeren bir yaşam tarzı modelinin daha uzun ömür ile ilişkili olabileceği olasılığını ortaya koymaktadır. Yani evet, bilimsel araştırmalar vejetaryenliğin daha uzun yaşamanıza yardımcı olabileceğini söylüyor, ancak öncelikle ölüm riskinizi azaltıyor. (yani 105 yaşına kadar yaşamayabilirsiniz, ancak muhtemelen 55 yaşında ölmezsiniz)
103
What is the difference between an object and a companion object in a class in kotlin? Example: ```class MyClass { object Holder { //something } companion object { //something } } ``` I already read that companion object shall be used, if the containing parameters/methods are closely related to its class. But why is there also the possibility of declaring a normal object in the class? Because it behaves exactly like the companion, but it must have a name. Is there maybe a difference in its "static" (I'm from the java side) lifecycle?
Kotlin'de bir sınıftaki nesne ve arkadaş nesne arasındaki fark nedir? Örnek: ```class MyClass { object Holder { //bir şey } companion object { //bir şey } } ``` İçeren parametrelerin/yöntemlerin sınıfıyla yakından ilişkili olması durumunda arkadaş nesnenin kullanılması gerektiğini zaten okudum. Peki neden sınıfta normal bir nesne tanımlama olasılığı da var? Çünkü tıpkı arkadaş gibi davranıyor, ancak bir adı olmalı. "Statik" (Java tarafındayım) yaşam döngüsünde bir fark var mı?
There are two different types of ```object``` uses, expression and declaration. Object Expression An object expression can be used when a class needs slight modification, but it's not necessary to create an entirely new subclass for it. Anonymous inner classes are a good example of this. ```button.setOnClickListener(object: View.OnClickListener() { override fun onClick(view: View) { // click event } }) ``` One thing to watch out for is that anonymous inner classes can access variables from the enclosing scope, and these variables do not have to be ```final```. This means that a variable used inside an anonymous inner class that is not considered ```final``` can change value unexpectedly before it is accessed. Object Declaration An object declaration is similar to a variable declaration and therefore cannot be used on the right side of an assignment statement. Object declarations are very useful for implementing the Singleton pattern. ```object MySingletonObject { fun getInstance(): MySingletonObject { // return single instance of object } } ``` And the ```getInstance``` method can then be invoked like this. ```MySingletonObject.getInstance() ``` Companion Object A companion object is a specific type of object declaration that allows an object to act similar to static objects in other languages (such as Java). Adding ```companion``` to the object declaration allows for adding the "static" functionality to an object even though the actual static concept does not exist in Kotlin. Here's an example of a class with instance methods and companion methods. ```class MyClass { companion object MyCompanionObject { fun actsAsStatic() { // do stuff } } fun instanceMethod() { // do stuff } } ``` Invoking the instance method would look like this. ```var myClass = MyClass() myClass.instanceMethod() ``` Invoking the companion object method would look like this. ```MyClass.actsAsStatic() ``` See the Kotlin docs for more info.
```object``` kullanımının iki farklı türü vardır, ifade ve bildirim. Nesne İfadesi Bir sınıfın küçük bir değişikliğe ihtiyacı olduğunda ancak bunun için tamamen yeni bir alt sınıf oluşturmanın gerekli olmadığı durumlarda nesne ifadesi kullanılabilir. Anonim iç sınıflar bunun iyi bir örneğidir. ```button.setOnClickListener(object: View.OnClickListener() { override fun onClick(view: View) { // tıklama olayı } }) ``` Dikkat edilmesi gereken bir şey, anonim iç sınıfların çevreleyen kapsamdan değişkenlere erişebilmesidir ve bu değişkenlerin ```final``` olması gerekmez. Bu, ```final``` olarak kabul edilmeyen anonim bir iç sınıf içinde kullanılan bir değişkenin erişilmeden önce beklenmedik bir şekilde değer değiştirebileceği anlamına gelir. Nesne Bildirimi Bir nesne bildirimi, bir değişken bildirimine benzer ve bu nedenle bir atama ifadesinin sağ tarafında kullanılamaz. Nesne bildirimleri, Singleton kalıbını uygulamak için çok kullanışlıdır. ```object MySingletonObject { fun getInstance(): MySingletonObject { // nesnenin tek örneğini döndür } } ``` Ve ```getInstance``` yöntemi daha sonra şu şekilde çağrılabilir. ```MySingletonObject.getInstance() ``` Eşlik Eden Nesne Eşlik eden nesne, bir nesnenin diğer dillerdeki (Java gibi) statik nesnelere benzer şekilde davranmasına izin veren belirli bir nesne bildirimi türüdür. Nesne bildirimine ```companion``` eklemek, Kotlin'de gerçek statik kavramı bulunmamasına rağmen bir nesneye "statik" işlevsellik eklemeye olanak tanır. İşte örnek yöntemleri ve eşlik eden yöntemleri olan bir sınıf örneği. ```class MyClass { companion object MyCompanionObject { fun actsAsStatic() { // bir şeyler yap } } fun instanceMethod() { // bir şeyler yap } } ``` Örnek yöntemi çağırmak şu şekilde görünecektir. ```var myClass = MyClass() myClass.instanceMethod() ``` Eşlik eden nesne yöntemini çağırmak şu şekilde görünecektir. ```MyClass.actsAsStatic() ``` Daha fazla bilgi için Kotlin belgelerine bakın.
104
I've rooted my phone. Now what? What do I gain from rooting?
Telefonumu rootladım. Şimdi ne olacak? Rootlamadan ne kazanırım?
In few words, rooting an Android system means overcome the limitations that were imposed over it by the manufacturer. People may want that for different reasons, but the main one is freedom. Having a rooted phone means you've got all the control over your device. The main reason people root phones is to install a custom ROM. Custom ROMs are often known for improvements in performance and exclusive features that are not present on manufacturer ROMs, like installing apps on sdcard or taking screenshots. Custom ROMS can also become a system update alternative for those devices that were abandoned by their manufacturers. You can see a review of popular ROMS, as an example, here. Rooting Android also allows you to uninstall stock apps that you don't use or don't want, besides those that violates user's privacy (see CarrierIQ). Another main reason for doing that is to gain more space on internal storage. A rooted device lets you install almost any app that requires root access. Those apps generally aim to do something that would not be possible without that privilege. A lot of useful apps were shown on the previous answer, but you may find a lot more available on Google Play. You can find a list of good apps here.
Kısaca, bir Android sistemi köklendirmek, üretici tarafından uygulanan sınırlamaların üstesinden gelmek anlamına gelir. İnsanlar bunu farklı nedenlerle isteyebilir, ancak ana neden özgürlüktür. Köklendirilmiş bir telefona sahip olmak, cihazınız üzerinde tam kontrole sahip olduğunuz anlamına gelir. İnsanların telefonları köklendirmelerinin ana nedeni özel bir ROM yüklemektir. Özel ROM'lar genellikle performanstaki iyileştirmeler ve üretici ROM'larında bulunmayan özel özellikler, örneğin uygulamaları SD karta yükleme veya ekran görüntüsü alma gibi özellikler nedeniyle bilinir. Özel ROM'lar ayrıca üreticileri tarafından terk edilen cihazlar için bir sistem güncellemesi alternatifi haline gelebilir. Örneğin, popüler ROM'ların bir incelemesini burada görebilirsiniz. Android'i köklendirmek ayrıca kullanmadığınız veya istemediğiniz stok uygulamalarını, kullanıcı gizliliğini ihlal edenler (CarrierIQ'ya bakın) dışında kaldırmanıza da olanak tanır. Bunu yapmanın bir diğer ana nedeni de dahili depolama alanında daha fazla yer kazanmaktır. Köklendirilmiş bir cihaz, kök erişimi gerektiren hemen hemen tüm uygulamaları yüklemenize olanak tanır. Bu uygulamalar genellikle bu ayrıcalık olmadan mümkün olmayacak bir şey yapmayı amaçlar. Birçok yararlı uygulama önceki cevapta gösterilmiştir, ancak Google Play'de çok daha fazlasını bulabilirsiniz. Burada iyi uygulamaların bir listesini bulabilirsiniz.
105
Is there a better way to determine whether a variable in ```Pandas``` and/or ```NumPy``` is ```numeric``` or not ? I have a self defined ```dictionary``` with ```dtypes``` as keys and ```numeric``` / ```not``` as values.
```Pandas``` ve/veya ```NumPy```'deki bir değişkenin ```sayısal``` olup olmadığını belirlemenin daha iyi bir yolu var mı? ```dtypes```'ları anahtarlar ve ```sayısal``` / ```değil```'i değerler olarak içeren kendi tanımladığım bir ```sözlük``` var.
You can use ```np.issubdtype``` to check if the dtype is a sub dtype of ```np.number```. Examples: ```np.issubdtype(arr.dtype, np.number) # where arr is a numpy array np.issubdtype(df['X'].dtype, np.number) # where df['X'] is a pandas Series ``` This works for numpy's dtypes but fails for pandas specific types like pd.Categorical as Thomas noted. If you are using categoricals ```is_numeric_dtype``` function from pandas is a better alternative than np.issubdtype. ```df = pd.DataFrame({'A': [1, 2, 3], 'B': [1.0, 2.0, 3.0], 'C': [1j, 2j, 3j], 'D': ['a', 'b', 'c']}) df Out: A B C D 0 1 1.0 1j a 1 2 2.0 2j b 2 3 3.0 3j c df.dtypes Out: A int64 B float64 C complex128 D object dtype: object ``` ```np.issubdtype(df['A'].dtype, np.number) Out: True np.issubdtype(df['B'].dtype, np.number) Out: True np.issubdtype(df['C'].dtype, np.number) Out: True np.issubdtype(df['D'].dtype, np.number) Out: False ``` For multiple columns you can use np.vectorize: ```is_number = np.vectorize(lambda x: np.issubdtype(x, np.number)) is_number(df.dtypes) Out: array([ True, True, True, False], dtype=bool) ``` And for selection, pandas now has ```select_dtypes```: ```df.select_dtypes(include=[np.number]) Out: A B C 0 1 1.0 1j 1 2 2.0 2j 2 3 3.0 3j ```
```np.issubdtype```'ı, dtype'ın ```np.number```'ın bir alt dtype'ı olup olmadığını kontrol etmek için kullanabilirsiniz. Örnekler: ```np.issubdtype(arr.dtype, np.number) # burada arr bir numpy dizisidir np.issubdtype(df['X'].dtype, np.number) # burada df['X'] bir pandas Serisidir ``` Bu, numpy'ın dtype'ları için çalışır ancak Thomas'ın belirttiği gibi pd.Categorical gibi pandas'a özgü türler için başarısız olur. Kategoriler kullanıyorsanız, pandas'tan ```is_numeric_dtype``` işlevi np.issubdtype'tan daha iyi bir alternatiftir. ```df = pd.DataFrame({'A': [1, 2, 3], 'B': [1.0, 2.0, 3.0], 'C': [1j, 2j, 3j], 'D': ['a', 'b', 'c']}) df Out: A B C D 0 1 1.0 1j a 1 2 2.0 2j b 2 3 3.0 3j c df.dtypes Out: A int64 B float64 C complex128 D object dtype: object ``` ```np.issubdtype(df['A'].dtype, np.number) Out: True np.issubdtype(df['B'].dtype, np.number) Out: True np.issubdtype(df['C'].dtype, np.number) Out: True np.issubdtype(df['D'].dtype, np.number) Out: False ``` Birden çok sütun için np.vectorize kullanabilirsiniz: ```is_number = np.vectorize(lambda x: np.issubdtype(x, np.number)) is_number(df.dtypes) Out: array([ True, True, True, False], dtype=bool) ``` Ve seçim için pandas'ın artık ```select_dtypes```'ı var: ```df.select_dtypes(include=[np.number]) Out: A B C 0 1 1.0 1j 1 2 2.0 2j 2 3 3.0 3j ```
106
I've come across the polynomial algorithm that solves 2SAT. I've found it boggling that 2SAT is in P where all (or many others) of the SAT instances are NP-Complete. What makes this problem different? What makes it so easy (NL-Complete - even easier than P)?
2SAT'yi çözen polinom algoritmasıyla karşılaştım. 2SAT'nin P'de olması beni şaşırttı çünkü SAT örneklerinin tamamı (veya birçoğu) NP-Tamam'dır. Bu problemi farklı kılan nedir? Onu bu kadar kolay (NL-Tamam - P'den bile kolay) yapan nedir?
Here is a further intuitive and unpretentious explanation along the lines of MGwynne's answer. With $2$-SAT, you can only express implications of the form $a \Rightarrow b$, where $a$ and $b$ are literals. More precisely, every $2$-clause $l_1 \lor l_2$ can be understood as a pair of implications: $\lnot l_1 \Rightarrow l_2$ and $\lnot l_2 \Rightarrow l_1$. If you set $a$ to true, $b$ must be true as well. If you set $b$ to false, $a$ must be false as well. Such implications are straightforward: there is no choice, you have only $1$ possibility, there is no room for case-multiplication. You can just follow every possible implication chain, and see if you ever derive both $\lnot l$ from $l$ and $l$ from $\lnot l$: if you do for some $l$, then the 2-SAT formula is unsatisfiable, otherwise it is satisfiable. It is the case that the number of possible implication chains is polynomially bounded in the size of the input formula. With $3$-SAT, you can express implications of the form $a \Rightarrow b \lor c$, where $a$, $b$ and $c$ are literals. Now you are in trouble: if you set $a$ to true, then either $b$ or $c$ must be true, but which one? You have to make a choice: you have 2 possibilities. Here is where case-multiplication becomes possible, and where the combinatorial explosion arises. In other words, $3$-SAT is able to express the presence of more than one possibility, while $2$-SAT doesn't have such ability. It is precisely such presence of more than one possibility ($2$ possibilities in case of $3$-SAT, $k-1$ possibilities in case of $k$-SAT) that causes the typical combinatorial explosion of NP-complete problems.
İşte MGwynne'in cevabı doğrultusunda daha sezgisel ve iddiasız bir açıklama. $2$-SAT ile yalnızca $a$ ve $b$ değişkenlerinin olduğu $a \Rightarrow b$ biçimindeki çıkarımları ifade edebilirsiniz. Daha kesin olarak, her $2$-madde $l_1 \lor l_2$ bir çift çıkarım olarak anlaşılabilir: $\lnot l_1 \Rightarrow l_2$ ve $\lnot l_2 \Rightarrow l_1$. $a$'yı doğru olarak ayarlarsanız, $b$'nin de doğru olması gerekir. $b$'yi yanlış olarak ayarlarsanız, $a$'nın da yanlış olması gerekir. Bu tür çıkarımlar basittir: başka seçenek yoktur, yalnızca $1$ olasılığınız vardır, durum çoğaltmaya yer yoktur. Her olası çıkarım zincirini takip edebilir ve $l$'den hem $\lnot l$ hem de $\lnot l$'den $l$ türetip türetmediğinize bakabilirsiniz: eğer bir $l$ için türetirseniz, 2-SAT formülü karşılanamaz, aksi takdirde karşılanabilir. Olası çıkarım zincirlerinin sayısının girdi formülünün boyutunda polinomik olarak sınırlandırılmış olması durumudur. $3$-SAT ile $a$, $b$ ve $c$ değişkenlerinin olduğu $a \Rightarrow b \lor c$ biçimindeki çıkarımları ifade edebilirsiniz. Şimdi başınız dertte: $a$'yı doğru olarak ayarlarsanız, $b$ veya $c$'nin doğru olması gerekir, ancak hangisi? Bir seçim yapmanız gerekir: $2$ olasılığınız vardır. İşte durum çoğaltmanın mümkün hale geldiği ve kombinatoryal patlamanın ortaya çıktığı yer burasıdır. Başka bir deyişle, $3$-SAT birden fazla olasılığın varlığını ifade edebilirken, $2$-SAT böyle bir yeteneğe sahip değildir. NP-tam problemlerin tipik kombinatoryal patlamasına neden olan şey tam da birden fazla olasılığın varlığıdır ($3$-SAT durumunda $2$ olasılık, $k$-SAT durumunda $k-1$ olasılık).
107
Why isn't Sectumsempra an Unforgivable Curse?
Sectumsempra neden Affedilmez Bir Lanet değil?
Not many people knew Sectumsempra - they'd need to know it exists to ban it. Severus Snape invented Sectumsempra while at Hogwarts, and wrote it down in his Potions book. He doesn't seem to have told many people about it, it's possible he didn't tell anyone at all. “Harry was about to put his book away again when he noticed the corner of a page folded down; turning to it, he saw the Sectumsempra spell, captioned ‘For Enemies’, that he had marked a few weeks previously.” - Harry Potter and the Half-Blood Prince, Chapter 24 (Sectumsempra) His book was hidden away until Harry found it, and Harry didn't tell the rest of the wizarding world about it either. Severus himself was seen using Sectumsempra when the Order was moving seven Harrys, and Harry had used it a few times after he found it in Snape's old book. Lupin knows of it, since he described it as one of Snape's specialties. However, they are probably some of the only people who know it - it isn't widely known like the three Unforgivable Curses. No one else, either in the Death Eaters or the Order of the Phoenix, is ever said to use it. It's likely that the Ministry didn't even know of it. Therefore, the Ministry wouldn't have even been able to make the decision to classify it as an Unforgivable Curse, since they would likely not have even known it existed. If the Ministry knew about it, would it be classified as Unforgivable? The reason it wasn't classified as an Unforgivable Curse is because the Ministry wouldn't have known about it - they would be unable to make any decision on something they don't know exists. That, by itself, doesn't say whether the Ministry would classify it as one if they knew about it. Not all potentially harmful spells are classified as Unforgivable Curses. It's nowhere near guaranteed, though, that if the Ministry knew about Sectumsempra, that they'd classify it as an Unforgivable Curse. There are other spells that could clearly do harm. Just to give a few examples - Confringo, Flagrante, and the creation of Fiendfyre are all potentially harmful but not Unforgivable. It's never mentioned why those three curses are classified as Unforgivable and others aren't, but it seems likely that it's because there are little to no uses for them that aren't evil. The punishment for using an Unforgivable Curse is a lifetime sentence in Azkaban, so only the worst curses, that are highly unlikely to ever have a non-Dark use, would be made Unforgivable. “Now … those three curses – Avada Kedavra, Imperius and Cruciatus – are known as the Unforgivable Curses. The use of any one of them on a fellow human being is enough to earn a life sentence in Azkaban.” - Harry Potter and the Goblet of Fire, Chapter 14 (The Unforgivable Curses) Now, would Sectumsempra fit the criteria for being made an Unforgivable Curse? Probably not - it cuts through things like a sword. It can be used for anything a sword, knife or other cutting tool can be used for. While using it on people might be considered Unforgivable, the spell itself is simply the act of cutting. There are many things a wizard might reasonably want to cut with no malicious intent; vegetables, rope, cloth, building materials. Because of this, it seems unlikely that even if the Ministry had known about it, it would be classified as an Unforgivable Curse. In addition, there is a countercurse for Sectumsempra. “Pushing Harry roughly aside, he knelt over Malfoy, drew his wand and traced it over the deep wounds Harry’s curse had made, muttering an incantation that sounded almost like song. The flow of blood seemed to ease; Snape wiped the residue from Malfoy’s face and repeated his spell. Now the wounds seemed to be knitting. - Harry Potter and the Half-Blood Prince, Chapter 24 (Sectumsempra) While the wounds from Sectumsempra can't be healed by simple healing spells, they can in fact be healed by the countercurse. So - Sectumsempra likely wouldn't be made Unforgivable if the Ministry knew it.
Sectumsempra'yı pek çok kişi bilmiyordu; yasaklamak için varlığını bilmeleri gerekirdi. Severus Snape, Sectumsempra'yı Hogwarts'tayken icat etti ve İksirler kitabına yazdı. Görünüşe göre pek çok kişiye bundan bahsetmemiş, hatta hiç kimseye söylememiş olması da mümkün. "Harry kitabını tekrar kaldırmak üzereyken bir sayfanın köşesinin katlanmış olduğunu fark etti; sayfayı çevirdiğinde, birkaç hafta önce işaretlediği 'Düşmanlar İçin' başlıklı Sectumsempra büyüsünü gördü." - Harry Potter ve Melez Prens, Bölüm 24 (Sectumsempra) Kitabı, Harry bulana kadar saklıydı ve Harry de büyücülük dünyasının geri kalanına bundan bahsetmedi. Severus'un kendisi, Zümrüdüanka Yedi Harry'yi taşıdığında Sectumsempra'yı kullanırken görüldü ve Harry de Snape'in eski kitabında bulduktan sonra birkaç kez kullandı. Lupin, büyüyü Snape'in uzmanlıklarından biri olarak tanımladığı için büyüyü biliyor. Ancak, muhtemelen büyüyü bilen tek kişiler bunlardır; Üç Affedilmez Lanet gibi yaygın olarak bilinmemektedir. Ölüm Yiyenler veya Zümrüdüanka Yoldaşlığı'nda başka hiç kimsenin büyüyü kullandığı söylenmez. Bakanlığın büyüyü bilmemesi muhtemeldir. Bu nedenle, Bakanlık büyünün varlığını bilmediği için onu Affedilmez Lanet olarak sınıflandırma kararı bile alamazdı. Bakanlık büyüyü bilseydi, Affedilmez olarak sınıflandırılır mıydı? Affedilmez Lanet olarak sınıflandırılmamasının nedeni, Bakanlığın büyüyü bilmemesidir; varlığından haberdar olmadıkları bir şey hakkında karar veremezler. Bu, Bakanlığın büyüyü bilselerdi Affedilmez olarak sınıflandırıp sınıflandırmayacaklarını kendi başına söylemez. Potansiyel olarak zararlı tüm büyüler Affedilmez Lanetler olarak sınıflandırılmaz. Ancak Bakanlık Sectumsempra'yı bilse bile onu Affedilmez Lanet olarak sınıflandıracağı kesin değildir. Açıkça zarar verebilecek başka büyüler de vardır. Sadece birkaç örnek vermek gerekirse; Confringo, Flagrante ve Fiendfyre'ın yaratılması potansiyel olarak zararlıdır ancak Affedilmez değildir. Bu üç lanetin neden Affedilmez olarak sınıflandırıldığı ve diğerlerinin neden sınıflandırılmadığı hiçbir zaman belirtilmez, ancak bunun nedeni muhtemelen onlar için kötü olmayan çok az kullanım alanı olmasıdır. Affedilmez Lanet kullanmanın cezası Azkaban'da ömür boyu hapistir, bu nedenle yalnızca kötü olmayan bir kullanım olasılığı çok düşük olan en kötü lanetler Affedilmez olarak kabul edilir. "Şimdi... bu üç lanet - Avada Kedavra, Imperius ve Cruciatus - Affedilmez Lanetler olarak bilinir. Bunlardan herhangi birinin bir insana kullanılması, Azkaban'da ömür boyu hapis cezası almak için yeterlidir." - Harry Potter ve Ateş Kadehi, Bölüm 14 (Affedilmez Lanetler) Peki, Sectumsempra bir Affedilmez Lanet olma kriterlerine uyar mı? Muhtemelen hayır; bir kılıç gibi şeyleri keser. Bir kılıcın, bıçağın veya başka bir kesici aletin kullanılabileceği her şey için kullanılabilir. İnsanlar üzerinde kullanılması Affedilmez olarak kabul edilebilirken, büyünün kendisi sadece kesme eylemidir. Bir büyücünün kötü niyet olmaksızın kesmek isteyebileceği birçok şey vardır; sebzeler, ip, kumaş, yapı malzemeleri. Bu nedenle, Bakanlık büyüyü bilse bile Affedilmez Lanet olarak sınıflandırılması pek olası görünmüyor. Ayrıca, Sectumsempra için bir karşı büyü vardır. "Harry'yi sertçe bir kenara iterek Malfoy'un üzerine eğildi, asasını çekti ve Harry'nin lanetinin açtığı derin yaraların üzerinden geçirerek neredeyse şarkı gibi gelen bir büyü mırıldandı. Kan akışı azalmış gibiydi; Snape, Malfoy'un yüzündeki kalıntıları sildi ve büyüsünü tekrarladı. Şimdi yaralar iyileşmeye başlamıştı. - Harry Potter ve Melez Prens, Bölüm 24 (Sectumsempra) Sectumsempra'nın yaraları basit iyileştirme büyüleriyle iyileştirilemezken, aslında karşı büyü ile iyileştirilebilirler. Yani; Bakanlık bilse bile Sectumsempra muhtemelen Affedilmez olmazdı.
108
How can I add a delay to a program in C#?
C# içinde bir programa gecikme nasıl ekleyebilirim?
Use a timer with an interval set to 2–3 seconds. You have three different options to choose from, depending on which type of application you're writing: * ```System.Timers.Timer``` * ```System.Windows.Forms.Timer``` * ```System.Threading.Timer``` Don't use ```Thread.Sleep``` if your application need to process any inputs on that thread at the same time (WinForms, WPF), as ```Sleep``` will completely lock up the thread and prevent it from processing other messages. Assuming a single-threaded application (as most are), your entire application will stop responding, rather than just delaying an operation as you probably intended. Note that it may be fine to use Sleep in pure console application as there are no "events" to handle or on separate thread (also ```Task.Delay``` is better option). In addition to timers and ```Sleep``` you can use ```Task.Delay``` which is asynchronous version of ```Sleep``` that does not block thread from processing events (if used properly - don't turn it into infinite sleep with ```.Wait()```). ``` public async void ClickHandler(...) { // whatever you need to do before delay goes here await Task.Delay(2000); // whatever you need to do after delay. } ``` The same ```await Task.Delay(2000)``` can be used in a ```Main``` method of a console application if you use C# 7.1 (Async main on MSDN blogs). Note: delaying operation with ```Sleep``` has benefit of avoiding race conditions that comes from potentially starting multiple operations with timers/```Delay```. Unfortunately freezing UI-based application is not acceptable so you need to think about what will happen if you start multiple delays (i.e. if it is triggered by a button click) - consider disabling such button, or canceling the timer/task or making sure delayed operation can be done multiple times safely.
2-3 saniyelik bir aralık ayarlanmış bir zamanlayıcı kullanın. Yazdığınız uygulama türüne bağlı olarak aralarından seçim yapabileceğiniz üç farklı seçeneğiniz vardır: * ```System.Timers.Timer``` * ```System.Windows.Forms.Timer``` * ```System.Threading.Timer``` Uygulamanızın aynı anda o iş parçacığında herhangi bir girdiyi işlemesi gerekiyorsa ```Thread.Sleep``` kullanmayın (WinForms, WPF), çünkü ```Sleep``` iş parçacığını tamamen kilitler ve diğer iletileri işlemesini engeller. Tek iş parçacıklı bir uygulama (çoğu gibi) varsayıldığında, muhtemelen amaçladığınız gibi bir işlemi geciktirmek yerine tüm uygulamanız yanıt vermeyi durdurur. İşlenecek "olaylar" veya ayrı iş parçacığı olmadığından salt konsol uygulamasında Sleep kullanmanın sorun olmayabileceğini unutmayın (ayrıca ```Task.Delay``` daha iyi bir seçenektir). Zamanlayıcılara ve ```Sleep```'e ek olarak, iş parçacığının olayları işlemesini engellemeyen (doğru kullanılırsa - ```.Wait()``` ile sonsuz uykuya dönüştürmeyin) ```Sleep```'in eşzamansız sürümü olan ```Task.Delay```'i kullanabilirsiniz. ``` public async void ClickHandler(...) { // gecikme başlamadan önce yapmanız gereken her neyse buraya gelir await Task.Delay(2000); // gecikmeden sonra yapmanız gereken her neyse. } ``` C# 7.1 kullanıyorsanız aynı ```await Task.Delay(2000)``` bir konsol uygulamasının ```Main``` yönteminde kullanılabilir (MSDN bloglarında Async main). Not: ```Sleep``` ile işlemi geciktirmenin, potansiyel olarak zamanlayıcılarla/```Delay``` ile birden fazla işlem başlatmaktan kaynaklanan yarış koşullarından kaçınma avantajı vardır. Ne yazık ki, kullanıcı arayüzü tabanlı uygulamayı dondurmak kabul edilemez, bu nedenle birden fazla gecikme başlatırsanız ne olacağını düşünmeniz gerekir (yani bir düğme tıklamasıyla tetiklenirse) - böyle bir düğmeyi devre dışı bırakmayı veya zamanlayıcıyı/gölevi iptal etmeyi veya gecikmeli işlemin güvenli bir şekilde birden çok kez yapılabildiğinden emin olmayı düşünün.
109
I'm trying to write a Bash script that will overwrite an existing directory. I have a directory ```foo/``` and I am trying to overwrite ```bar/``` with it. But when I do this: ```cp -Rf foo/ bar/ ``` a new ```bar/foo/``` directory is created. I don't want that. There are two files in ```foo/```; ```a``` and ```b```. There are files with same names in ```bar/``` as well. I want the ```foo/a``` and ```foo/b``` to replace ```bar/a``` and ```bar/b```.
Mevcut bir dizini üzerine yazacak bir Bash betiği yazmaya çalışıyorum. ```foo/``` dizinim var ve ```bar/``` dizinini onunla üzerine yazmaya çalışıyorum. Ancak bunu yaptığımda: ```cp -Rf foo/ bar/ ``` yeni bir ```bar/foo/``` dizini oluşturuluyor. Bunu istemiyorum. ```foo/``` dizininde ```a``` ve ```b``` adında iki dosya var. ```bar/``` dizininde de aynı adlı dosyalar var. ```foo/a``` ve ```foo/b``` dosyalarının ```bar/a``` ve ```bar/b``` dosyalarının yerini almasını istiyorum.
If you want to ensure ```bar/``` ends up identical to ```foo/```, use ```rsync``` instead: ```rsync -a --delete foo/ bar/ ``` If just a few things have changed, this will execute much faster than removing and re-copying the whole directory. * ```-a``` is 'archive mode', which copies faithfully files in ```foo/``` to ```bar/``` * ```--delete``` removes extra files not in ```foo/``` from ```bar/``` as well, ensuring ```bar/``` ends up identical * If you want to see what it's doing, add ```-vh``` for verbose and human-readable * Note: the slash after ```foo``` is required, otherwise ```rsync``` will copy ```foo/``` to ```bar/foo/``` rather than overwriting ```bar/``` itself. * (Slashes after directories in rsync are confusing; if you're interested, here's the scoop. They tell rsync to refer to the contents of the directory, rather than the directory itself. So to overwrite from the contents of ```foo/``` onto the contents of ```bar/```, we use a slash on both. It's confusing because it won't work as expected with a slash on neither, though; rsync sneakily always interprets the destination path as though it has a slash, even though it honors an absence of a slash on the source path. So we need a slash on the source path to make it match the auto-added slash on the destination path, if we want to copy the contents of ```foo/``` into ```bar/```, rather than the directory ```foo/``` itself landing into ```bar/``` as ```bar/foo```.) ```rsync``` is very powerful and useful, if you're curious look around for what else it can do (such as copying over ssh).
```bar/```'ın ```foo/``` ile aynı olmasını sağlamak istiyorsanız bunun yerine ```rsync``` kullanın: ```rsync -a --delete foo/ bar/ ``` Sadece birkaç şey değiştiyse, bu tüm dizini kaldırıp yeniden kopyalamaktan çok daha hızlı çalışacaktır. * ```-a```, ```foo/``` içindeki dosyaları ```bar/```'a sadakatle kopyalayan 'arşivleme modudur' * ```--delete```, ```foo/``` içinde olmayan ekstra dosyaları da ```bar/```'dan kaldırır ve ```bar/```'ın aynı olmasını sağlar * Ne yaptığını görmek istiyorsanız ayrıntılı ve insan tarafından okunabilir olması için ```-vh``` ekleyin * Not: ```foo```'dan sonraki eğik çizgi gereklidir, aksi takdirde ```rsync```, ```bar/```'ın kendisini üzerine yazmak yerine ```foo/```'ı ```bar/foo/```'ya kopyalar. * (rsync'de dizinlerden sonraki eğik çizgiler kafa karıştırıcıdır; ilgileniyorsanız, işte bilgi. rsync'ye dizinin kendisinden ziyade dizinin içeriğine başvurmasını söylerler. Bu nedenle ```foo/```'nun içeriğinden ```bar/```'ın içeriğine üzerine yazmak için her ikisinde de eğik çizgi kullanırız. Ne eğik çizgiyle ne de eğik çizgisiz çalışmayacağı için kafa karıştırıcıdır; rsync, kaynak yolunda eğik çizgi olmamasına rağmen, hedef yolunu her zaman eğik çizgi varmış gibi yorumlar. Bu nedenle, ```foo/``` dizininin kendisinin ```bar/```'a ```bar/foo``` olarak düşmesi yerine ```foo/```'nun içeriğini ```bar/```'a kopyalamak istiyorsak, hedef yolda otomatik olarak eklenen eğik çizgiyle eşleşmesi için kaynak yolda bir eğik çizgiye ihtiyacımız vardır.) Merak ediyorsanız ```rsync``` çok güçlü ve kullanışlıdır, başka neler yapabileceğine bakın (ssh üzerinden kopyalama gibi).
110
Is there a particular reason the elves die off so fast? After the first war against Sauron, I recall the elves being decimated, to the point that they're almost useless army-wise in the trilogy. But I'm guessing men suffered equal or greater losses as well. Anyways, other races just seem much more capable of repopulating, while is seems like there are incredibly few (if any?) elven children. Considering the fact that elves are immortal, wouldn't their population be the fastest to grow? Also the seem to be perpetually 40 years old, so aren't they eternally fertile as well? Why don't they have more kids and build bigger societies?
Elflerin bu kadar hızlı ölmesinin özel bir nedeni var mı? Sauron'a karşı ilk savaştan sonra, elflerin neredeyse onursuz bir ordu haline geldikleri noktaya kadar azaldığını hatırlıyorum. Ama sanırım insanlar da eşit veya daha fazla kayıp yaşadı. Her neyse, diğer ırklar yeniden çoğalmada daha yetenekli görünüyor, oysa inanılmaz derecede az (varsa?) elf çocuğu var gibi görünüyor. Elflerin ölümsüz olduğu gerçeğini göz önünde bulundurursak, nüfusları en hızlı büyüyen nüfus olmaz mıydı? Ayrıca sürekli 40 yaşında görünüyorlar, bu yüzden sonsuza kadar doğurgan değiller mi? Neden daha fazla çocukları olmuyor ve daha büyük toplumlar kurmuyorlar?
Tolkien himself addresses this in an essay called "Laws and Customs Among the Eldar". There are essentially two problems: * Elvish libido diminishes over time. Contrary to popular belief (and outward appearance, from a human perspective), Elves do age; and as they get older, they get less interested in procreation. * Having children is exhausting. The Elves believe that their child-bearing process draws a heavier physical and spiritual toll on them, compared to what it does to humans. They're understandable reluctant to have a lot of kids, because what's the point in having a dozen kids if doing so might literally kill you? From "Laws and Customs": It might be thought that, since the Eldar do not (as Men deem) grow old in body, they may bring forth children at any time in the ages of their lives. But this is not so. For the Eldar do indeed grow older, even if slowly: the limit of their lives is the life of Arda, which though long beyond the reckoning of Men is not endless, and ages also. Moreover their body and spirit are not separated but coherent. As the weight of the years, with all their changes of desire and thought, gathers upon the spirit of the Eldar, so do the impulses and moods of their bodies change. [...] Also the Eldar say that in the begetting [conceiving], and still more in the bearing of children, greater share and strength of their being, in mind and in body, goes forth than in the making of mortal children. For these reasons it came to pass that the Eldar brought forth few children; and also that their time of generation was in their youth or earlier life, unless strange and hard fates befell them. History of Middle-earth X Morgoth's Ring Part 3: "The Later Quenta Silmarillion" Chapter 2: "The Second Phase" Laws and Customs Among the Eldar That last point about the toll on their mind and body is worth expanding on, and fortunately Tolkien does this later in the essay: [A]ll the Eldar, being aware of it in themselves, spoke of the passing of much strength, both of mind and of body, into their children, in bearing and begetting. Therefore they hold that the fëa [soul], though unbegotten, draws nourishment directly from the fëa of the mother while she bears and nourishes the hrondo [body; later changed to the word hroä], and mediately but equally from the father, whose fëa is bound in union with the mother's and supports it. History of Middle-earth X Morgoth's Ring Part 3: "The Later Quenta Silmarillion" Chapter 2: "The Second Phase" Laws and Customs Among the Eldar
Tolkien'in kendisi bunu "Eldarlar Arasındaki Yasalar ve Gelenekler" adlı bir denemede ele alır. Esasen iki sorun vardır: * Elf libidosu zamanla azalır. Yaygın inanışın (ve insan bakış açısından dış görünüşün) aksine Elfler yaşlanır; ve yaşlandıkça üremeye daha az ilgi duyarlar. * Çocuk sahibi olmak yorucu bir iştir. Elfler, çocuk sahibi olma sürecinin, insanlara kıyasla kendilerinde daha ağır bir fiziksel ve ruhsal yük oluşturduğuna inanırlar. Bir düzine çocuk sahibi olmanın anlamı sizi öldürebilecekse, çok fazla çocuk sahibi olmaya isteksiz olmaları anlaşılabilir bir durumdur. "Yasalar ve Gelenekler"den: Eldarların (İnsanların düşündüğü gibi) bedensel olarak yaşlanmadıkları için hayatlarının herhangi bir döneminde çocuk sahibi olabilecekleri düşünülebilir. Ancak durum böyle değildir. Çünkü Eldarlar gerçekten de yaşlanırlar, yavaş da olsa: Hayatlarının sınırı Arda'nın hayatıdır, bu da İnsanların hesaplamasının çok ötesinde olsa da sonsuz değildir ve o da yaşlanır. Dahası, bedenleri ve ruhları ayrılmaz, uyumludur. Yılların ağırlığı, tüm arzu ve düşünce değişiklikleriyle birlikte Eldarların ruhu üzerinde toplanırken, bedenlerinin dürtüleri ve ruh halleri de değişir. [...] Ayrıca Eldarlar, çocuk sahibi olmada [gebe kalmada] ve daha da fazlası çocuk doğurmada, ölümlü çocukların yapımından daha fazla varlıklarının, zihinsel ve fiziksel olarak daha fazla güçlerinin payı ve gücünün ortaya çıktığını söylerler. Bu nedenlerden dolayı Eldarların çok az çocuk sahibi olduğu; ayrıca onların üreme zamanının gençliklerinde veya daha erken yaşamlarında olduğu, aksi takdirde garip ve zor kaderlerle karşılaşmadıkları ortaya çıktı. Orta Dünya Tarihi X Morgoth'un Yüzüğü Bölüm 3: "Sonraki Quenta Silmarillion" Bölüm 2: "İkinci Aşama" Eldarlar Arasındaki Yasalar ve Gelenekler Zihinleri ve bedenleri üzerindeki yük hakkındaki son nokta üzerinde durmaya değer ve neyse ki Tolkien bunu denemenin ilerleyen bölümlerinde yapıyor: [T]üm Eldarlar, bunun kendilerinde farkında olarak, çocuklarına hem zihinsel hem de fiziksel olarak çok fazla güç aktarımından, doğurmada ve gebe kalmada bahsettiler. Bu nedenle, fëa'nın [ruh] doğmamış olsa da, anne onu doğururken ve hrondo'yu [beden; daha sonra hroä kelimesine değiştirildi] beslerken doğrudan annenin fëa'sından besin aldığını ve dolaylı olarak ama eşit derecede annenin fëa'sı ile birlik içinde bağlı olan ve onu destekleyen babadan aldığını savunurlar. Orta Dünya Tarihi X Morgoth'un Yüzüğü Bölüm 3: "Sonraki Quenta Silmarillion" Bölüm 2: "İkinci Aşama" Eldarlar Arasındaki Yasalar ve Gelenekler
111
Reasons for being vegetarian or vegan other than ethical reasons?
Etik nedenler dışında vejetaryen veya vegan olmanın nedenleri?
There are multiple reasons why people are/become Vegetarian/Vegan apart from ethics, including but not limited to * Religion/Culture - most of the worlds Vegetarians reside in India, mainly due to culture/personal beliefs but often interlinked with some of their major religions (Hinduism/Sikhism/Jainism etc) which promote the diet. Some strains of Buddhism also look positively at not eating meat, as does the Seventh-day Adventist Church. * Environment - reducing land degradation, climate change, reducing harm to bio-diversity etc. Animal agriculture causes a huge amount of problems to our planet and environment. * Health - another major point. Being Vegetarian or Vegan won't automatically improve your health of course (it's easy to live off junk food, believe me), but there are lots of scientifically proven benefits to eat a plant based diet over a standard Western diet including a lower risk of heart disease, lower BMI, lower cholesterol etc. * Political - a slightly less common reason but still; some people go Vegetarian or Vegan based on their political beliefs once they realise how much the two share intersectional values (e.g. from Anarchism to Veganarchism)
İnsanların etik nedenlerin dışında vejetaryen/vegan olmasının/olmalarının birden fazla nedeni vardır, bunlar şunları içerir ancak bunlarla sınırlı değildir: * Din/Kültür - Dünyadaki vejetaryenlerin çoğu Hindistan'da yaşamaktadır, bunun başlıca nedeni kültür/kişisel inançlardır ancak genellikle diyetlerini teşvik eden büyük dinlerinden bazılarıyla (Hinduizm/Sihlik/Jainizm vb.) bağlantılıdır. Bazı Budizm türleri de Yedinci Gün Adventist Kilisesi gibi et yememeye olumlu bakar. * Çevre - Arazi bozulmasını, iklim değişikliğini azaltmak, biyolojik çeşitliliğe verilen zararı azaltmak vb. Hayvancılık gezegenimize ve çevremize çok fazla sorun yaratmaktadır. * Sağlık - Bir diğer önemli nokta. Vejetaryen veya vegan olmak elbette sağlığınızı otomatik olarak iyileştirmez (bana inanın, abur cuburla yaşamak kolaydır), ancak kalp hastalığı riskinin daha düşük olması, BMI'nın daha düşük olması, kolesterolün daha düşük olması gibi standart bir Batı diyetine göre bitki bazlı bir diyet yemenin bilimsel olarak kanıtlanmış birçok faydası vardır. * Siyasi - Biraz daha az yaygın bir nedendir ancak yine de; bazı insanlar iki kesişimsel değerin ne kadar paylaşıldığını fark ettiklerinde (örneğin Anarşizm'den Veganarşizm'e) siyasi inançlarına dayanarak vejetaryen veya vegan olurlar.
112
My mom has a green card that expires 2028 but has been out of the US in the UK for over a year due to COVID travel restrictions. Can she enter now?
Annem 2028'de süresi dolacak bir yeşil karta sahip ancak COVID seyahat kısıtlamaları nedeniyle bir yıldan fazla süredir İngiltere'de ABD dışında. Şimdi girebilir mi?
Assuming she doesn't have a valid Re-entry Permit, she technically doesn't have one of the accepted documents for entry of a returning immigrant, as listed in 8 CFR 211.1(a). A green card is not one of the accepted documents after an absence of more than 1 year, and she doesn't have any of the other documents, like a Re-entry Permit or an immigrant visa. However, under 8 CFR 211.1(b)(3) and 8 CFR 211.4, the immigration officers at the port of entry have the authority to waive her failure to meet the documentary requirements, if they determine that she has not abandoned residence. They often will grant the waiver if it's the first time, the absence is not too much over a year, and/or there is a good reason for not returning earlier (e.g. COVID-19). So if she manages to make it to a US port of entry, there is a good chance they will just let her in, perhaps with a warning. The officer could deny her entry, and pressure her to voluntarily sign I-407 to relinquish her permanent residency. This is voluntary, and she can refuse. If she refuses, they will give her a Notice to Appear for removal proceedings in immigration court at a later date. There, she will be able to present her case to the immigration judge, and if the immigration judge determines that she has not abandoned residence, the immigration judge can grant the waiver for her failure to meet the documentary requirements (think of it as a second opinion on the immigration officer's decision). The other option to all this is that she can apply for an SB1 returning resident visa at a US consulate (which will meet the documentary requirements since it is an immigrant visa). However, this requires showing that she could not return any earlier due to circumstances beyond her control (which may be harder to prove than showing that she did not abandon residence). Also, there is no appeal for visa denials.
Geçerli bir Yeniden Giriş İzni olmadığını varsayarsak, teknik olarak 8 CFR 211.1(a)'da listelendiği gibi geri dönen bir göçmenin girişine izin verilen kabul edilen belgelerden birine sahip değildir. 1 yıldan fazla bir süre uzak kaldıktan sonra yeşil kart kabul edilen belgelerden biri değildir ve Yeniden Giriş İzni veya göçmen vizesi gibi diğer belgelere sahip değildir. Ancak, 8 CFR 211.1(b)(3) ve 8 CFR 211.4 uyarınca, giriş limanındaki göçmenlik görevlileri, ikameti terk etmediğine karar verirlerse, belgesel gereklilikleri karşılayamamasını affetme yetkisine sahiptir. Genellikle ilk kezse, yokluk bir yıldan fazla değilse ve/veya daha erken dönmeme için iyi bir neden varsa (ör. COVID-19) muafiyet verirler. Bu nedenle, bir ABD giriş limanına ulaşmayı başarırsa, muhtemelen onu içeri alacaklar, belki de bir uyarı ile. Görevli girişine izin vermeyebilir ve kalıcı ikametinden vazgeçmek için gönüllü olarak I-407'yi imzalaması için baskı yapabilir. Bu gönüllüdür ve reddedebilir. Reddederse, daha sonra bir göçmenlik mahkemesinde sınır dışı etme işlemleri için Görünme Bildirimi verecekler. Orada, davasını göçmenlik yargıcına sunabilecek ve göçmenlik yargıcı ikameti terk etmediğine karar verirse, göçmenlik yargıcı belgesel gereklilikleri karşılayamaması için muafiyet verebilir (bunu göçmenlik görevlisinin kararına ikinci bir görüş olarak düşünün). Tüm bunlara diğer seçenek, belgesel gereklilikleri karşılayacağı için (göçmen vizesi olduğu için) bir ABD konsolosluğunda SB1 geri dönen ikamet vizesine başvurabilmesidir. Ancak, bu, kontrolü dışındaki koşullar nedeniyle daha erken dönemediğini göstermeyi gerektirir (bu, ikameti terk etmediğini göstermekten daha zor olabilir). Ayrıca, vize reddi için itiraz yoktur.
113
What is the LXX and why is it so noteworthy that there is a Greek translation of the OT? Wouldn't it be better to directly reference manuscripts in the original languages?
LXX nedir ve Eski Ahit'in bir Yunanca çevirisinin olması neden bu kadar dikkate değerdir? İlk dillerindeki el yazmalarına doğrudan atıfta bulunmak daha iyi olmaz mıydı?
Before 1947, a good case could be made that the Septuagint represented a more ancient tradition than the Masoretic versions of the Tanakh. Since the Septuagint was produced before 132 BCE (and probably in the 3rd century BCE) and the earliest known Masoretic manuscripts date to the 10th century CE, the Greek translation might have fossilized an early rendering of the Scriptures while the Hebrew continued to be copied and potentially altered. To further support the primacy of the Septuagint, the early Christian and Hellenistic Jewish texts, tended to use that translation rather go back to Hebrew sources. An interesting counter-argument arises from the observation that during the 600 years from Jerome's translation into Latin (the Vulgate) to the earliest Masoretic manuscripts, the Hebrew seems to have been faithfully copied. That suggests that Jewish scribes were exceptionally careful to duplicate their scriptures. After 1947, the evidence changed. According to Wikipedia: [Most] of the Qumran fragments can be classified as being closer to the Masoretic text than to any other text group that has survived. According to Lawrence Schiffman, 60% can be classed as being of proto-Masoretic type, and a further 20% Qumran style with bases in proto-Masoretic texts, compared to 5% proto-Samaritan type, 5% Septuagintal type, and 10% non-aligned. Joseph Fitzmyer noted the following regarding the findings at Qumran Cave 4 in particular: "Such ancient recensional forms of Old Testament books bear witness to an unsuspected textual diversity that once existed; these texts merit far greater study and attention than they have been accorded till now. Thus, the differences in the Septuagint are no longer considered the result of a poor or tendentious attempt to translate the Hebrew into the Greek; rather they testify to a different pre-Christian form of the Hebrew text". Another another article describes the meaning of the categories in detail. A few caveats are in order: * Surveying the Qumran about religious texts seems something akin to surveying a hippie commune about political issues—you're likely to experience some bias. If we could obtain a similar collection from Jerusalem, we'd likely find more agreement and likely the side of MT. Given the diversity in non-Scriptural texts, 60% seems quite solid support. * While it's unlikely, there exists a chronological possibility the scrolls associated with the Septuagint-aligned Hebrew were influenced by the Greek. (Any references one way or the other would be appreciated.) What remains therefore is a window into the community of Alexandrian Jews that produced the translation. For those who are interested in the development of Jewish belief, that can be extremely useful. N. T. Wright's book, The Resurrection of the Son of God, shows that the LXX translators chose to interpret key texts from Daniel and Ezekiel about the resurrection as literal rather than metaphorical. He argues from this that belief in bodily resurrection was more common in Jesus' day than other scholars assert.
1947'den önce, Septuagint'in Tanah'ın Masoretik versiyonlarından daha eski bir geleneği temsil ettiği iyi bir argüman sunulabilirdi. Septuagint'in MÖ 132'den önce (ve muhtemelen MÖ 3. yüzyılda) oluşturulduğu ve en eski bilinen Masoretik el yazmalarının MS 10. yüzyıla tarihlenmesine rağmen, Yunanca çeviri metinlerin Kutsal Kitap'ın erken bir çevirisini taşıyor olabileceği ve İbranice metinlerin kopyalandığı ve potansiyel olarak değiştirildiği düşünülebilir. Septuagint'in önceliğini daha da desteklemek için, erken Hristiyan ve Helenistik Yahudi metinlerinin, İbranice kaynaklara geri dönmek yerine, bu çeviriyi tercih etme eğiliminde oldukları görülmüştür. Ilginç bir karşı argüman, Latincede Jerome'un çevirisinden (Vulgata) en erken Masoretik el yazmalarına kadar geçen 600 yıllık süre içinde İbranice metnin sadık bir şekilde kopyalandığının gözlemlenmesinden ortaya çıkmaktadır. Bu durum, Yahudi yazmanlarının yazmalarını dikkatle çoğalttıklarını göstermektedir. 1947'den sonra, kanıtlar değişmiştir. Vikipedi'ye göre: "Qumran parçalarının çoğu, hayatta kalan diğer herhangi bir metin grubuna göre Masoretik metne daha yakın olarak sınıflandırılabilir. Lawrence Schiffman'a göre, %60'ı proto-Masoretik türünde sınıflandırılabilir, ve %20'si Qumran tarzında olup proto-Masoretik metinlere dayanır, %5'i proto-Samaritan türünde, %5'i Septuagint türünde ve %10'u hizasızdır. Joseph Fitzmyer, özellikle Qumran Mağara 4'teki bulgularla ilgili şunları belirtti: "Eski Ahit kitaplarının bu eski redaksiyon biçimleri bir zamanlar var olduğuna dair tanıklıkta bulunurlar; bu metinler şimdiye kadar verdiklerinden çok daha fazla araştırma ve dikkat hak etmektedir. Bu nedenle, Septuagint'teki farklılıklar artık İbraniceyi Yunanca'ya kötü veya yanlış bir şekilde çevirme girişimi sonucunda değil, aksine farklı bir Hristiyan öncesi İbranice metin şekline tanıklık etmektedir." Başka bir makale de kategorilerin anlamını detaylı şekilde açıklıyor. Birkaç uyarı yapılmalıdır: * Dini metinler hakkında Qumran'ın incelenmesi, politik konularda bir hippi topluluğunu incelemeye benzer bir durumu andırıyor—muhtemelen bazı önyargılarla karşılaşacaksınız. Eğer Kudüs'ten benzer bir koleksiyon elde edebilseydik, muhtemelen daha çok anlaşma ve muhtemelen MT tarafını bulabilirdik. Kutsal olmayan metinlerdeki çeşitlilik göz önüne alındığında, % 60 oldukça sağlam bir destek gibi görünüyor. * Muhtemelen olmasa da, Septuagint ile uyumlu gözüken İbranice ile ilişkilendirilen yazmaların Yunanca etkilendiği bir kronolojik olasılık mevcuttur. (Bu konuda herhangi bir referans memnuniyetle karşılanacaktır.)]}, Bu nedenle, çeviriyi gerçekleştiren İskenderiyeli Yahudiler topluluğuna bir pencere açık kalmıştır. Yahudi inancının gelişimine ilgi duyanlar için bu son derece faydalı olabilir. N. T. Wright'ın "Tanrı'nın Oğlunun Dirilişi" kitabı, LXX tercümanlarının Daniel ve Yehezkiel'den gelen kilit metinleri doğrudan yorumlamayı tercih ettiklerini, mecazi değil, gerçek anlamlı olarak aldıklarını gösteriyor. Bu durumdan yola çıkarak bedensel diriliğe inancın, diğer bilim adamlarının iddia ettiklerinden daha yaygın olduğunu savunuyor.
114
I have to disable inputs at first and then on click of a link to enable them. This is what I have tried so far, but it doesn't work. HTML: ``` ``` jQuery: ```$("#edit").click(function(event){ event.preventDefault(); $('.inputDisabled').removeAttr("disabled") }); ``` This shows me ```true``` and then ```false``` but nothing changes for the inputs: ```$("#edit").click(function(event){ alert(''); event.preventDefault(); alert($('.inputDisabled').attr('disabled')); $('.inputDisabled').removeAttr("disabled"); alert($('.inputDisabled').attr('disabled')); }); ```
İlk önce girdileri devre dışı bırakmam ve ardından bunları etkinleştirmek için bir bağlantıya tıklamam gerekiyor. Şimdiye kadar denediğim şey bu, ancak işe yaramıyor. HTML: ``` ``` jQuery: ```$("#edit").click(function(event){ event.preventDefault(); $('.inputDisabled').removeAttr("disabled") }); ``` Bu bana önce ```true``` ardından ```false``` gösteriyor ancak girdiler için hiçbir şey değişmiyor: ```$("#edit").click(function(event){ alert(''); event.preventDefault(); alert($('.inputDisabled').attr('disabled')); $('.inputDisabled').removeAttr("disabled"); alert($('.inputDisabled').attr('disabled')); }); ```
Always use the ```prop()``` method to enable or disable elements when using jQuery (see below for why). In your case, it would be: ```$("#edit").click(function(event){ event.preventDefault(); $('.inputDisabled').prop("disabled", false); // Element(s) are now enabled. }); ``` jsFiddle example here. Why use ```prop()``` when you could use ```attr()```/```removeAttr()``` to do this? Basically, ```prop()``` should be used when getting or setting properties (such as ```autoplay```, ```checked```, ```disabled``` and ```required``` amongst others). While what you want to do can technically be done using ```attr()```/```removeAttr()```, it doesn't mean it should be done - and can cause strange/problematic behaviour, as in this case. "The difference between attributes and properties can be important in specific situations. Before jQuery 1.6, the ```.attr()``` method sometimes took property values into account when retrieving some attributes, which could cause inconsistent behavior. As of jQuery 1.6, the ```.prop()``` method provides a way to explicitly retrieve property values, while ```.attr()``` retrieves attributes." "Properties generally affect the dynamic state of a DOM element without changing the serialized HTML attribute. Examples include the ```value``` property of input elements, the ```disabled``` property of inputs and buttons, or the ```checked``` property of a checkbox. The ```.prop()``` method should be used to set ```disabled``` and ```checked``` instead of the ```.attr()``` method. The ```.val()``` method should be used for getting and setting ```value```." - jQuery documentation for prop() Pre-jQuery 3.0 (before 2016) The reason why you should use ```prop``` over ```removeAttr()``` is that ```removeAttr()``` completely removes the ```disabled``` attribute itself - as this method would simply set the corresponding property name to ```false```: Prior to jQuery 3.0, using .removeAttr() on a boolean attribute such as checked, selected, or readonly would also set the corresponding named property to false. This behavior was required for ancient versions of Internet Explorer but is not correct for modern browsers because the attribute represents the initial value and the property represents the current (dynamic) value. - jQuery 3.0 Breaking Changes While ```prop()``` merely sets the property's underlying boolean value to false.
jQuery kullanırken öğeleri etkinleştirmek veya devre dışı bırakmak için her zaman ```prop()``` yöntemini kullanın (nedenini aşağıda bulabilirsiniz). Sizin durumunuzda şöyle olurdu: ```$("#edit").click(function(event){ event.preventDefault(); $('.inputDisabled').prop("disabled", false); // Öğeler artık etkinleştirildi. }); ``` jsFiddle örneği burada. Bunu yapmak için ```attr()```/```removeAttr()``` kullanabileceğiniz halde neden ```prop()``` kullanmalısınız? Temel olarak, ```prop()```, (diğerlerinin yanı sıra) ```autoplay```, ```checked```, ```disabled``` ve ```required``` gibi özellikleri alırken veya ayarlıyorken kullanılmalıdır. Yapmak istediğiniz şey teknik olarak ```attr()```/```removeAttr()``` kullanılarak yapılabilirken, yapılması gerektiği anlamına gelmez ve bu durumda olduğu gibi garip/sorunlu davranışlara neden olabilir. "Özellikler ve öznitelikler arasındaki fark, belirli durumlarda önemli olabilir. jQuery 1.6'dan önce, ```.attr()``` yöntemi bazı öznitelikleri alırken bazen özellik değerlerini hesaba katardı ve bu da tutarsız davranışlara neden olabilirdi. jQuery 1.6 itibarıyla, ```.prop()``` yöntemi özellik değerlerini açıkça almak için bir yol sağlarken, ```.attr()``` öznitelikleri alır." "Özellikler genellikle seri hale getirilmiş HTML özniteliğini değiştirmeden bir DOM öğesinin dinamik durumunu etkiler. Örnekler arasında giriş öğelerinin ```value``` özelliği, girişlerin ve düğmelerin ```disabled``` özelliği veya bir onay kutusunun ```checked``` özelliği bulunur. ```.prop()``` yöntemi, ```.attr()``` yöntemi yerine ```disabled``` ve ```checked``` değerlerini ayarlamak için kullanılmalıdır. ```.val()``` yöntemi, ```value``` değerini almak ve ayarlamak için kullanılmalıdır." - prop() için jQuery belgeleri jQuery 3.0 öncesi (2016'dan önce) ```prop```'u ```removeAttr()``` yerine kullanmanızın nedeni, ```removeAttr()```'un ```disabled``` özniteliğinin kendisini tamamen kaldırmasıdır; çünkü bu yöntem yalnızca karşılık gelen özellik adını ```false``` olarak ayarlar: jQuery 3.0'dan önce, checked, selected veya readonly gibi bir Boole özniteliğinde .removeAttr() kullanmak, karşılık gelen adlandırılmış özelliği de false olarak ayarlar. Bu davranış, Internet Explorer'ın eski sürümleri için gerekliydi ancak öznitelik ilk değeri temsil ettiği ve özellik geçerli (dinamik) değeri temsil ettiği için modern tarayıcılar için doğru değildir. - jQuery 3.0 Breaking Changes ```prop()``` ise yalnızca özelliğin altında yatan Boole değerini false olarak ayarlar.
115
I'm no expert in darkroom photography, but it seems a little odd that there is a type of light that doesn't affect film or developing paper etc. So why is a dark-room safelight safe?
Karanlık oda fotoğrafçılığı konusunda uzman değilim ama filmi veya banyo kağıdını vb. etkilemeyen bir ışık türünün olması biraz tuhaf görünüyor. Peki neden karanlık oda güvenli ışığı güvenlidir?
Photo films and papers are made from salts of silver that naturally only darken when exposed to violet or blue light. In the early days of photography, this was all that was available. Therefore these films and papers are able to be handled under any light source that does not radiate blue light. By the way, the violet and blue frequencies of light are the shortest, and are the most energetic when it comes to inducing a chemical change. These early films and papers could all be be handled safely under red light as well as yellow light. These lamps do not emit violet or blue. These blue-sensitive-only films did an OK job, with some exceptions. Women’s faces with cosmetics, like lipstick and rouge on the cheeks, came out weird. Warm tones reproduced super dark, and most times lips and cheeks turned black, void of detail on the finished picture. The bottom line is, many colors in nature reproduced incorrectly with this early blue-sensitive-only film. The cure was accidental. Professor Hermann Vogel at Berlin Technical was trying to solve the problem of halation. This results when taking a picture of bright objects, like light sources or gemstones and the like. These objects play on the film with lots of light energy. This energy often goes completely through the film and hits something behind the film. The light is then reflected back into the film. The result is a halo around bright objects. The professor had one of his students dye the silver salts yellow, thinking the yellow dye would filter out the annoying reflected blue from the rear. He tried this dyed film and it did the trick, plus the film gained sensitivity to green light. He named this blue/green sensitive film orthochromatic (Latin for correct color). The year was 1857, and the quality of film reproducing the colors of nature moved forward by a big leap. A few years later, one of his graduate students, experimenting with different dyes, discovered how to make films sensitive to blue, green and red light. This film was called panchromatic (the pan prefix in Greek means "all"). Thus panchromatic film reproduces all colors found in nature with high accuracy. The bad news was, the darkroom folks were forced to give up the red and yellow safelight. A super dim green safelight could be used for a short period of time during developing. Photo papers remained insensitive to red for the most part - no need, as they work OK with just blue and green sensitivity. Modern variable contrast photo papers have two sensitive coats, one for blue light and one for green light. We can use a safelight on these papers; it is amber with reduced brilliance. Films and papers that make color pictures are panchromatic, and most safelights are not safe. We can use infrared lamps with a specialized night vision infrared scope to view and handle most panchromatic films and papers, because these materials have low sensitivity to infrared.
Fotoğraf filmleri ve kağıtları, doğal olarak yalnızca mor veya mavi ışığa maruz kaldıklarında koyulaşan gümüş tuzlarından yapılır. Fotoğrafçılığın ilk günlerinde, mevcut olan tek şey buydu. Bu nedenle bu filmler ve kağıtlar, mavi ışık yaymayan herhangi bir ışık kaynağı altında işlenebilir. Bu arada, ışığın mor ve mavi frekansları en kısa olanlardır ve kimyasal bir değişikliği başlatma konusunda en enerjik olanlardır. Bu ilk filmler ve kağıtların tümü, kırmızı ışığın yanı sıra sarı ışık altında da güvenli bir şekilde işlenebilirdi. Bu lambalar mor veya mavi ışık yaymaz. Yalnızca maviye duyarlı bu filmler, bazı istisnalar dışında iyi bir iş çıkardı. Ruj ve allık gibi kozmetikler sürmüş kadınların yüzleri garip çıktı. Sıcak tonlar çok koyu çıktı ve çoğu zaman dudaklar ve yanaklar siyahlaştı ve bitmiş resimde ayrıntıdan yoksun kaldı. Sonuç olarak, doğadaki birçok renk bu ilk yalnızca maviye duyarlı filmle yanlış çıktı. Çare tesadüfen bulundu. Berlin Teknik Üniversitesi'nden Profesör Hermann Vogel, halasyon sorununu çözmeye çalışıyordu. Bu, ışık kaynakları veya değerli taşlar gibi parlak nesnelerin fotoğrafını çekerken ortaya çıkar. Bu nesneler, film üzerinde çok fazla ışık enerjisiyle oynar. Bu enerji genellikle filmden tamamen geçer ve filmin arkasındaki bir şeye çarpar. Işık daha sonra filme geri yansıtılır. Sonuç, parlak nesnelerin etrafında bir hale oluşmasıdır. Profesör, sarı boyanın arkadan gelen rahatsız edici yansıyan maviyi filtreleyeceğini düşünerek gümüş tuzlarını sarıya boyattı. Bu boyalı filmi denedi ve işe yaradı, ayrıca film yeşil ışığa karşı hassasiyet kazandı. Bu mavi/yeşil duyarlı filme ortokromatik (Latincede doğru renk anlamına gelir) adını verdi. Yıl 1857'ydi ve doğanın renklerini yeniden üreten filmin kalitesi büyük bir sıçrama yaptı. Birkaç yıl sonra, farklı boyalarla deney yapan yüksek lisans öğrencilerinden biri, filmleri mavi, yeşil ve kırmızı ışığa duyarlı hale getirmeyi keşfetti. Bu filme pankromatik (Yunancada pan öneki "tüm" anlamına gelir) adı verildi. Böylece pankromatik film, doğada bulunan tüm renkleri yüksek doğrulukla yeniden üretir. Kötü haber, karanlık oda çalışanlarının kırmızı ve sarı güvenli ışığı bırakmak zorunda kalmalarıydı. Geliştirme sırasında kısa bir süre için çok loş yeşil bir güvenli ışık kullanılabilirdi. Fotoğraf kağıtları büyük ölçüde kırmızıya duyarsız kaldı - sadece mavi ve yeşil duyarlılıkla iyi çalıştıkları için buna gerek yoktu. Modern değişken kontrastlı fotoğraf kağıtlarında, biri mavi ışık için diğeri yeşil ışık için olmak üzere iki hassas katman bulunur. Bu kağıtlar üzerinde güvenli ışık kullanabiliriz; parlaklığı azaltılmış kehribardır. Renkli fotoğraflar çeken filmler ve kağıtlar pankromatiktir ve çoğu güvenli ışık güvenli değildir. Bu malzemeler kızılötesine karşı düşük hassasiyete sahip olduğundan, çoğu pankromatik film ve kağıdı görüntülemek ve işlemek için özel bir gece görüş kızılötesi dürbünüyle kızılötesi lambalar kullanabiliriz.
116
With the command: ```ls -la * ``` I can list all my symbolic links. How can I remove all symbolic links which are linked to a special folder? For example: In my directory ```usr/local/bin``` I have the following entries: ```lrwxrwxrwx 1 root root 50 Apr 22 14:52 allneeded -> /usr/local/texlive/2011/bin/x86_64-linux/allneeded lrwxrwxrwx 1 root root 47 Apr 22 14:52 amstex -> /usr/local/texlive/2011/bin/x86_64-linux/amstex lrwxrwxrwx 1 root root 24 Apr 23 19:09 arara -> /home/marco/.arara/arara ``` Now I want to remove all links with the path ```/usr/local/texlive/```
Şu komutla: ```ls -la * ``` Tüm sembolik bağlantılarımı listeleyebilirim. Özel bir klasöre bağlı olan tüm sembolik bağlantıları nasıl kaldırabilirim? Örneğin: ```usr/local/bin``` dizinimde şu girdiler var: ```lrwxrwxrwx 1 root root 50 Apr 22 14:52 allneeded -> /usr/local/texlive/2011/bin/x86_64-linux/allneeded lrwxrwxrwx 1 root root 47 Apr 22 14:52 amstex -> /usr/local/texlive/2011/bin/x86_64-linux/amstex lrwxrwxrwx 1 root root 24 Apr 23 19:09 arara -> /home/marco/.arara/arara ``` Şimdi ```/usr/local/texlive/``` yoluna sahip tüm bağlantıları kaldırmak istiyorum
Please make sure to read the alternative answer. It's even more to the point although not voted as high at this point. You can use this to delete all symbolic links: ```find -type l -delete ``` with modern ```find``` versions. On older find versions it may have to be: ```find -type l -exec rm {} \; # or find -type l -exec unlink {} \; ``` To limit to a certain link target, assuming none of the paths contain any newline character: ``` find -type l | while IFS= read -r lnkname; do if [ "$(readlink '$lnkname')" == "/your/exact/path" ]; then rm -- "$lnkname"; fi; done ``` or nicely formatted ``` find -type l | while IFS= read -r lnkname; do if [ "$(readlink '$lnkname')" = "/your/exact/path" ]; then rm -- "$lnkname" fi done ``` The ```if``` could of course also include a more complex condition such as matching a pattern with ```grep```. Tailored to your case: ```find -type l | while IFS= read -r lnk; do if (readlink "$lnk" | grep -q '^/usr/local/texlive/'); then rm "$lnk"; fi; done ``` or nicely formatted: ```find -type l | while IFS= read -r lnk do if readlink "$lnk" | grep -q '^/usr/local/texlive/' then rm "$lnk" fi done ```
Lütfen alternatif cevabı okuduğunuzdan emin olun. Şu anda çok fazla oy almamış olsa da daha da konuya uygun. Tüm sembolik bağlantıları silmek için bunu kullanabilirsiniz: ```find -type l -delete ``` modern ```find``` sürümleriyle. Daha eski find sürümlerinde şu şekilde olması gerekebilir: ```find -type l -exec rm {} \; # veya find -type l -exec unlink {} \; ``` Belirli bir bağlantı hedefini sınırlamak için, yolların hiçbirinde yeni satır karakteri bulunmadığını varsayarak: ``` find -type l | while IFS= read -r lnkname; do if [ "$(readlink '$lnkname')" == "/your/exact/path" ]; then rm -- "$lnkname"; fi; done ``` veya güzelce biçimlendirilmiş: ``` find -type l | while IFS= read -r lnkname; do if [ "$(readlink '$lnkname')" = "/your/exact/path" ]; then rm -- "$lnkname" fi done ``` Elbette ```if```, ```grep``` ile bir kalıbı eşleştirme gibi daha karmaşık bir koşul da içerebilir. Sizin durumunuza göre uyarlanmış: ```find -type l | while IFS= read -r lnk; do if (readlink "$lnk" | grep -q '^/usr/local/texlive/'); then rm "$lnk"; fi; done ``` veya güzelce biçimlendirilmiş: ```find -type l | while IFS= read -r lnk do if readlink "$lnk" | grep -q '^/usr/local/texlive/' then rm "$lnk" fi done ```
117
Did Aztecs know how many continents there are on earth?
Aztekler dünyada kaç kıta olduğunu biliyor muydu?
Do you know how many continents there are on Earth? Is Europe a separate continent from Asia? Is Australia the biggest island or the smallest continent? Is Antarctica an ice-locked archipelago or a continent? Are the Americas one continent or two? (All of those questions can be answered reasonably either way.) The separation of Europe from Asia into two continents happened because, from the point of view of the Greek Mediterranean world, all of Asia that mattered was across the sea from all of Europe that mattered. They knew that Europe and Asia were connected north of the Black Sea (though they didn't know how big a connection) but they didn't care, because for their purposes, they were separate continents. The idea of a continent is more a cultural thing than anything else. From a proper scientific point of view continents are probably better defined by tectonic plates so now you're dealing with twenty or so. Maybe a continent is a tectonic plate with dry land attached? That still leaves quite a few. (And how much dry land is needed? And is Los Angeles on a separate continent from New York?) If the Aztecs knew the geography of the whole Earth it would still be very surprising if they had counted continents the same way the Ancient Greeks have led us to do. And there's no evidence they knew the geography of the whole Earth and considerable evidence that they didn't.
Dünya'da kaç kıta olduğunu biliyor musunuz? Avrupa, Asya'dan ayrı bir kıta mıdır? Avustralya en büyük ada mı yoksa en küçük kıta mıdır? Antarktika buzla kaplı bir takımada mı yoksa bir kıta mıdır? Amerika kıtaları bir kıta mı yoksa iki kıta mıdır? (Tüm bu sorular makul bir şekilde her iki şekilde de cevaplanabilir.) Avrupa'nın Asya'dan iki kıtaya ayrılması, Yunan Akdeniz dünyasının bakış açısından, önemli olan tüm Asya'nın önemli olan tüm Avrupa'dan deniz yoluyla ayrılmış olmasından kaynaklanmıştır. Avrupa ve Asya'nın Karadeniz'in kuzeyinde birbirine bağlı olduğunu biliyorlardı (bağlantının ne kadar büyük olduğunu bilmeseler de) ancak bunun önemi yoktu çünkü amaçları doğrultusunda ayrı kıtalardı. Bir kıta fikri, her şeyden çok kültürel bir şeydir. Uygun bir bilimsel bakış açısından kıtalar muhtemelen tektonik plakalarla daha iyi tanımlanır, bu nedenle şimdi yirmi civarında kıtayla uğraşıyorsunuz. Belki bir kıta, üzerinde kuru toprak bulunan bir tektonik plakadır? Bu yine de birçoğunu dışarıda bırakır. (Ve ne kadar kuru toprağa ihtiyaç vardır? Ve Los Angeles, New York'tan ayrı bir kıtada mıdır?) Aztekler tüm Dünya'nın coğrafyasını bilselerdi, kıtaları Antik Yunanlıların bizi yapmaya yönlendirdiği şekilde saymış olmaları yine de çok şaşırtıcı olurdu. Ve tüm Dünya'nın coğrafyasını bildiklerine dair hiçbir kanıt yok ve bilmediklerine dair önemli kanıtlar var.
118
What did the Soviet Union and Russia bring to the ISS?
Sovyetler Birliği ve Rusya ISS'ye ne getirdi?
Initially, everything. The ISS started out as Mir-2 with some extra modules added soon afterwards. Then lots more over the next 10 years. The initial modules, Zarya and Zvezda, which housed living quarters, reboost, attitude control, solar power, life support, and docking modules. Each additional component and module made the system better, but the ISS is still dependent on the Russian operating segment. Each function that the Russian segment supplied initially was enhanced or replaced by the US side (solar power, life support, etc.). The major component this is mostly still Russian is half the crew quarters and reboost/attitude control (beyond what the control gyros can handle). Initially the Shuttle and Soyuz provided crew services, and now only Soyuz (till SpaceX/ULA get their acts together in 2019) provides crew. Initially the Russians provided cargo (as did the Shuttle till retirement), but specifically Progress could refuel the engines on the ISS for reboost. The Russian theoretical plan is that the next two modules they launch (if ever, now, after being so delayed) Nauka and the UM will be able to separate from the ISS and form the core of their next space station. One of those theories was to take Zarya and Zvezda (or just one) with them as well.
Başlangıçta her şey. ISS, Mir-2 olarak başladı ve kısa süre sonra bazı ek modüller eklendi. Sonraki 10 yıl boyunca çok daha fazlası. Yaşam alanları, yeniden hızlandırma, tutum kontrolü, güneş enerjisi, yaşam desteği ve yerleştirme modüllerini barındıran ilk modüller Zarya ve Zvezda. Her ek bileşen ve modül sistemi daha iyi hale getirdi, ancak ISS hala Rusya'nın işletme segmentine bağımlı. Rus segmentinin başlangıçta sağladığı her işlev, ABD tarafınca geliştirildi veya değiştirildi (güneş enerjisi, yaşam desteği, vb.). Bunun büyük bir kısmı hala Rusya'ya ait olan ana bileşen, mürettebatın yarısının bulunduğu yerler ve yeniden hızlandırma/tutum kontrolüdür (kontrol jiroskoplarının kaldırabileceğinin ötesinde). Başlangıçta Mürettebat hizmetlerini Uzay Mekiği ve Soyuz sağladı ve şimdi sadece Soyuz (SpaceX/ULA 2019'da harekete geçene kadar) mürettebat sağlıyor. Başlangıçta Ruslar kargo sağladı (emekli olana kadar Uzay Mekiği de sağladı), ancak özellikle Progress, ISS'deki motorlara yeniden hızlandırma için yakıt ikmali yapabilirdi. Rusların teorik planı, fırlattıkları bir sonraki iki modülün (eğer fırlatılırsa, şimdi, bu kadar geciktikten sonra) Nauka ve UM'nin ISS'den ayrılabilmesi ve bir sonraki uzay istasyonlarının çekirdeğini oluşturabilmesidir. Bu teorilerden biri, Zarya ve Zvezda'yı (veya sadece birini) da yanlarına almaktı.
119
What utility can move my Windows boot partition over to another hard drive? My preference is that it would be really easy. * Boot into Windows * Pick drive to move * Pick target drive * It copies everything over, and reboots to the correct partition.
Windows önyükleme bölümümü başka bir sabit sürücüye taşıyabilecek hangi yardımcı program? Tercihim gerçekten kolay olması yönünde. * Windows'u başlat * Taşınacak sürücüyü seç * Hedef sürücüyü seç * Her şeyi kopyalar ve doğru bölüme yeniden başlatır.
## DriveImage XML DriveImage XML will do the job. It runs from within Windows and it can copy directly from drive to drive. A lot of people rave about it after good experiences with the software. DriveImage XML is an easy to use and reliable program for imaging and backing up partitions and logical drives. Image creation uses Microsoft's Volume Shadow Services (VSS), allowing you to create safe "hot images" even from drives currently in use. Images are stored in XML files, allowing you to process them with 3rd party tools. Never again be stuck with a useless backup! Restore images to drives without having to reboot. DriveImage XML is now faster than ever, offering two different compression levels. ## EASEUS Disk Copy EASEUS Disk Copy is a great alternative if you don't want to go for a 'hot' backup that runs from within Windows. Good review at lifehacker and on a par with DriveImage XML. They quite clearly state that it is ideal for moving from one disk to a larger one. Like other suggestions, this requires that you create a boot CD. > EASEUS Disk Copy is a potent freeware providing sector-by-sector disk/partition clone regardless of your operating system, file systems and partition scheme by creating a bootable CD. The sector-by-sector method assures you a copy 100% identical to the original. Disk Copy can be used for copy, cloning, or upgrading your original small hard drive to a new larger drive. Simply speaking, it can copy anything from the old hard drive including the deleted, lost files and inaccessible data. So, the freeware is a perfect tool for Data Recovery Wizard to recover files from a backup disk.
## DriveImage XML DriveImage XML işi halleder. Windows içinden çalışır ve doğrudan sürücüden sürücüye kopyalayabilir. Birçok kişi yazılımla iyi deneyimler yaşadıktan sonra bundan övgüyle bahsediyor. DriveImage XML, bölümleri ve mantıksal sürücüleri görüntülemek ve yedeklemek için kullanımı kolay ve güvenilir bir programdır. Görüntü oluşturma, Microsoft'un Volume Shadow Services (VSS) hizmetini kullanır ve bu da size şu anda kullanımda olan sürücülerden bile güvenli "sıcak görüntüler" oluşturma olanağı tanır. Görüntüler XML dosyalarında saklanır ve bu da bunları üçüncü taraf araçlarla işlemenize olanak tanır. Bir daha asla işe yaramaz bir yedeklemeyle uğraşmayın! Sürücülere yeniden başlatmaya gerek kalmadan görüntüler geri yükleyin. DriveImage XML artık her zamankinden daha hızlı ve iki farklı sıkıştırma düzeyi sunuyor. ## EASEUS Disk Copy Windows içinden çalışan "sıcak" bir yedekleme istemiyorsanız EASEUS Disk Copy harika bir alternatiftir. Lifehacker'da iyi bir inceleme var ve DriveImage XML ile aynı seviyede. Oldukça açık bir şekilde, bir diskten daha büyük bir diske geçmek için ideal olduğunu belirtiyorlar. Diğer öneriler gibi, bu da bir önyükleme CD'si oluşturmanızı gerektirir. > EASEUS Disk Copy, önyüklenebilir bir CD oluşturarak işletim sisteminizden, dosya sistemlerinizden ve bölüm şemanızdan bağımsız olarak sektör sektör disk/bölüm klonu sağlayan güçlü bir ücretsiz yazılımdır. Sektör sektör yöntemi, orijinaline %100 özdeş bir kopya almanızı sağlar. Disk Copy, orijinal küçük sabit sürücünüzü yeni, daha büyük bir sürücüye kopyalamak, klonlamak veya yükseltmek için kullanılabilir. Basitçe söylemek gerekirse, silinmiş, kaybolmuş dosyalar ve erişilemeyen veriler de dahil olmak üzere eski sabit sürücüden her şeyi kopyalayabilir. Bu nedenle, ücretsiz yazılım, yedek bir diskten dosyaları kurtarmak için Data Recovery Wizard için mükemmel bir araçtır.
120
What's the difference between ASCII and Unicode?
ASCII ve Unicode arasındaki fark nedir?
ASCII has 128 code points, 0 through 127. It can fit in a single 8-bit byte, the values 128 through 255 tended to be used for other characters. With incompatible choices, causing the code page disaster. Text encoded in one code page cannot be read correctly by a program that assumes or guessed at another code page. Unicode came about to solve this disaster. Version 1 started out with 65536 code points, commonly encoded in 16 bits. Later extended in version 2 to 1.1 million code points. The current version is 6.3, using 110,187 of the available 1.1 million code points. That doesn't fit in 16 bits anymore. Encoding in 16-bits was common when v2 came around, used by Microsoft and Apple operating systems for example. And language runtimes like Java. The v2 spec came up with a way to map those 1.1 million code points into 16-bits. An encoding called UTF-16, a variable length encoding where one code point can take either 2 or 4 bytes. The original v1 code points take 2 bytes, added ones take 4. Another variable length encoding that's very common, used in *nix operating systems and tools is UTF-8, a code point can take between 1 and 4 bytes, the original ASCII codes take 1 byte the rest take more. The only non-variable length encoding is UTF-32, takes 4 bytes for a code point. Not often used since it is pretty wasteful. There are other ones, like UTF-1 and UTF-7, widely ignored. An issue with the UTF-16/32 encodings is that the order of the bytes will depend on the endian-ness of the machine that created the text stream. So add to the mix UTF-16BE, UTF-16LE, UTF-32BE and UTF-32LE. Having these different encoding choices brings back the code page disaster to some degree, along with heated debates among programmers which UTF choice is "best". Their association with operating system defaults pretty much draws the lines. One counter-measure is the definition of a BOM, the Byte Order Mark, a special codepoint (U+FEFF, zero width space) at the beginning of a text stream that indicates how the rest of the stream is encoded. It indicates both the UTF encoding and the endianess and is neutral to a text rendering engine. Unfortunately it is optional and many programmers claim their right to omit it so accidents are still pretty common.
ASCII'nin 0'dan 127'ye kadar 128 kod noktası vardır. Tek bir 8 bitlik bayta sığabilir, 128'den 255'e kadar olan değerler diğer karakterler için kullanılma eğilimindeydi. Uyumsuz seçimlerle kod sayfası felaketine neden oldu. Bir kod sayfasında kodlanan metin, başka bir kod sayfasını varsayan veya tahmin eden bir program tarafından doğru şekilde okunamaz. Unicode bu felaketi çözmek için ortaya çıktı. Sürüm 1, genellikle 16 bit olarak kodlanan 65536 kod noktasıyla başladı. Daha sonra sürüm 2'de 1,1 milyon kod noktasına genişletildi. Mevcut sürüm 6.3'tür ve mevcut 1,1 milyon kod noktasının 110.187'sini kullanır. Bu artık 16 bite sığmıyor. V2 ortaya çıktığında 16 bitlik kodlama yaygındı, örneğin Microsoft ve Apple işletim sistemleri tarafından kullanılıyordu. Ve Java gibi dil çalışma zamanları. V2 özelliği, bu 1,1 milyon kod noktasını 16 bite eşlemek için bir yol buldu. UTF-16 adı verilen bir kodlama, bir kod noktasının 2 veya 4 bayt alabildiği değişken uzunlukta bir kodlama. Orijinal v1 kod noktaları 2 bayt alır, eklenenler 4 bayt alır. *nix işletim sistemlerinde ve araçlarında kullanılan çok yaygın olan bir başka değişken uzunluklu kodlama UTF-8'dir, bir kod noktası 1 ila 4 bayt arasında alabilir, orijinal ASCII kodları 1 bayt alır, geri kalanı daha fazla alır. Değişken uzunlukta olmayan tek kodlama UTF-32'dir, bir kod noktası için 4 bayt alır. Oldukça israf olduğu için sık kullanılmaz. UTF-1 ve UTF-7 gibi yaygın olarak göz ardı edilen başka kodlamalar da vardır. UTF-16/32 kodlamalarındaki bir sorun, baytların sırasının metin akışını oluşturan makinenin endianlığına bağlı olmasıdır. Bu nedenle UTF-16BE, UTF-16LE, UTF-32BE ve UTF-32LE'yi karışıma ekleyin. Bu farklı kodlama seçeneklerine sahip olmak, kod sayfası felaketini bir dereceye kadar geri getiriyor ve programcılar arasında hangi UTF seçeneğinin "en iyi" olduğu konusunda hararetli tartışmalara yol açıyor. İşletim sistemi varsayılanlarıyla ilişkileri büyük ölçüde çizgileri çiziyor. Bir karşı önlem, BOM'un, Bayt Sıra İşaretinin, bir metin akışının başında akışın geri kalanının nasıl kodlandığını gösteren özel bir kod noktası (U+FEFF, sıfır genişlikli boşluk) tanımlanmasıdır. Hem UTF kodlamasını hem de endianlığı gösterir ve bir metin işleme motoruna karşı nötrdür. Ne yazık ki isteğe bağlıdır ve birçok programcı bunu atlama hakkını talep eder, bu nedenle kazalar hala oldukça yaygındır.
121
Reasons why healthy people would intentionally want to get infected?
Sağlıklı insanların neden kasıtlı olarak enfekte olmak istediklerinin nedenleri?
Because some self-proclaimed health guru claims that it's good for you to have that disease. The miracle-virus causes your body to absorb free cosmic energies. Your constantly raising body temperature is proof that it works. The headache you feel is because your brain is reconfiguring itself to become more effective. When the process is over, you will be far more intelligent. Some of our patients even gained psychic powers. The vomiting, blood-coughing, explosive diarrhea and the open sores you have all over your body are actually all the poisons your body accumulated over your life which are now leaving your body. The weakness you feel and the periodical blackouts are also part of the cleansing process. Your body is concentrating all its energy on cleaning you. That's in fact a good sign and shows that it works. Some of us were even able to communicate with alien angel-spirits during these intensive cleaning phases. All of that is of course bullshit. The infected are simply sick. The guru just claims all those pseudo-scientific benefits exist to get people to pay them ridiculous amounts of money for infecting them with the disease. Sounds ridiculous? Then you might want to take a look at the community of people drinking bleach.
Çünkü kendini sağlık gurusu ilan eden bazı kişiler bu hastalığa yakalanmanın sizin için iyi olduğunu iddia ediyor. Mucize virüs, vücudunuzun serbest kozmik enerjileri emmesine neden olur. Sürekli yükselen vücut ısınız bunun işe yaradığının kanıtıdır. Hissettiğiniz baş ağrısı, beyninizin daha etkili hale gelmek için kendini yeniden yapılandırmasından kaynaklanmaktadır. Süreç tamamlandığında çok daha zeki olacaksınız. Hastalarımızdan bazıları hatta psişik güçler kazandı. Kusma, kan tükürme, patlayıcı ishal ve vücudunuzun her yerinde oluşan açık yaralar aslında vücudunuzun hayatınız boyunca biriktirdiği ve şimdi vücudunuzu terk eden tüm zehirlerdir. Hissettiğiniz halsizlik ve periyodik bayılmalar da temizlenme sürecinin bir parçasıdır. Vücudunuz tüm enerjisini sizi temizlemeye yoğunlaştırıyor. Bu aslında iyi bir işarettir ve işe yaradığını gösterir. Bazılarımız bu yoğun temizlik aşamaları sırasında uzaylı melek ruhlarıyla bile iletişim kurabildik. Bunların hepsi elbette saçmalıktır. Enfekte olanlar sadece hastadır. Guru, insanları hastalığa bulaştırmak için onlara saçma miktarlarda para ödetmek amacıyla tüm bu sözde bilimsel faydaların var olduğunu iddia ediyor. Kulağa saçma mı geliyor? O zaman ağartıcı içen insan topluluğuna bir göz atmak isteyebilirsiniz.
122
In The Avengers, the Council contacted Nick Fury and supposedly, they want to nuke Manhattan. Nick didn't agree so they contacted a S.H.I.E.L.D. operative to nuke Manhattan. When they found out that an unauthorized jet was trying to fly, Nick grabbed a rocket launcher and fired it at the jet, which was a decoy and the real jet was able to escape. However, why would he do that? If that was the real plane carrying a nuke enough to level Manhattan, wouldn't the nuke explode and destroy the base along with them if he fired a rocket launcher at it?
Avengers'ta Konsey, Nick Fury ile iletişime geçti ve Manhattan'ı nükleer silahla vurmak istediklerini söyledi. Nick kabul etmeyince Manhattan'ı nükleer silahla vurmak için bir S.H.I.E.L.D. ajanıyla iletişime geçtiler. Yetkisiz bir jetin uçmaya çalıştığını öğrendiklerinde Nick bir roketatar kaptı ve jete ateş etti, ancak bu bir sahteydi ve gerçek jet kaçmayı başardı. Ancak neden bunu yapsın ki? Eğer bu Manhattan'ı yerle bir edecek kadar nükleer silah taşıyan gerçek uçak olsaydı, Nick roketatarla ateş etseydi nükleer silah patlamaz mıydı ve üssü de yok etmez miydi?
If that was the real plane carrying a nuke enough to level Manhattan, wouldn't the nuke explode and destroy the base along with them if he fired a rocket launcher at it? No. Detonating a modern nuclear device is, in fact, incredibly difficult and merely shooting down the aircraft carrying it would not be sufficient. In fact, several aircraft carrying older nuclear devices have either crashed or otherwise been lost without the device on board detonating. It's likely that the crash might cause a release of nuclear material but detonation is practically impossible. In 1966... ...another B-52 carrying four hydrogen bombs crashed near the Spanish town of Palomares on Spain’s southeast coast after colliding with a refueling tanker. One of the four bombs was recovered virtually intact, according to The Washington Post, but two others released plutonium when their explosive triggers detonated. A fourth bomb fell into the sea, prompting a search that involved thousands of uniformed personnel, millions of dollars and 20 ships that ranged from submarines to minesweepers. The fourth bomb was eventually recovered, but radiation released by the damaged weapons required a U.S.-led effort to decontaminate 640 acres of topsoil in the farmland around Palomares, Tad Sczulc reported in the Times. Military personnel initially wore face masks and gloves as they removed the soil, according to Sczulc’s account, and more than 1,600 tons of contaminated soil were sealed in steel drums and shipped to the U.S. for disposal. Washington Post 1964 In 1964, a B-52 carrying two unarmed atomic bombs crashed in western Maryland. In 1961, two nuclear-laden B-52s went down — one near Yuba City, Calif., and another north of Goldsboro, N.C. The bombs survived both crashes without detonating
Manhattan'ı yerle bir edecek kadar nükleer silah taşıyan gerçek uçak buysa, ona roketatarla ateş etmesi durumunda nükleer silah patlamaz mı ve üssü de onlarla birlikte yok etmez mi? Hayır. Modern bir nükleer cihazı patlatmak aslında inanılmaz derecede zordur ve onu taşıyan uçağı sadece düşürmek yeterli olmaz. Aslında, daha eski nükleer cihazlar taşıyan birkaç uçak, cihaz patlamadan düştü veya kayboldu. Kazanın nükleer madde salınmasına neden olması muhtemeldir ancak patlama neredeyse imkansızdır. 1966'da... ...dört hidrojen bombası taşıyan bir başka B-52, bir yakıt ikmal tankerine çarptıktan sonra İspanya'nın güneydoğu kıyısında Palomares kasabası yakınlarında düştü. Washington Post'a göre dört bombadan biri neredeyse sağlam bir şekilde kurtarıldı, ancak diğer ikisi patlayıcı tetikleyicileri patladığında plütonyum saldı. Dördüncü bir bomba denize düştü ve denizaltılardan mayın tarama gemilerine kadar binlerce üniformalı personel, milyonlarca dolar ve 20 geminin yer aldığı bir arama başlatıldı. Dördüncü bomba sonunda bulundu, ancak hasarlı silahların yaydığı radyasyon, Palomares çevresindeki tarım arazilerinde 640 dönümlük üst toprağın ABD liderliğindeki bir çabayla kirlenmesinden arındırılmasını gerektirdi, diye bildirdi Tad Sczulc Times'ta. Sczulc'un anlatımına göre, askeri personel toprağı temizlerken başlangıçta yüz maskeleri ve eldivenler taktı ve 1.600 tondan fazla kirlenmiş toprak çelik varillere kapatılarak imha edilmek üzere ABD'ye gönderildi. Washington Post 1964 1964'te iki silahsız atom bombası taşıyan bir B-52, Maryland'in batısında düştü. 1961'de nükleer yüklü iki B-52 düştü - biri Kaliforniya'nın Yuba City yakınlarında, diğeri Kuzey Carolina'nın Goldsboro'nun kuzeyinde. Bombalar patlamadan her iki kazadan da sağ kurtuldu
123
Since I created my repository it appears that the tags I have been creating are not pushed to the repository. When I do ```git tag``` on the local directory all the tags are present, but when I logon to the remote repository and do a ```git tag```, only the first few show up. What could the problem be?.
Depoyu oluşturduğumdan beri oluşturduğum etiketlerin depoya yüklenmediği anlaşılıyor. Yerel dizinde ```git tag``` yaptığımda tüm etiketler mevcut, ancak uzak depoya giriş yaptığımda ve ```git tag``` yaptığımda yalnızca ilk birkaç etiket görünüyor. Sorun ne olabilir?
In default git remote configuration you have to push tags explicitly (while they are fetched automatically together with commits they point to). You need to use ``` $ git push <remote> tag <tagname> ``` to push a single tag, ``` $ git push <remote> --tags ``` to push all tags (or ```git push --tags``` to push to default remote, usually ```origin```). This is very much intended behavior, to make pushing tags explicit. Pushing tags should be usually conscious choice.
Varsayılan git uzaktan yapılandırmasında etiketleri açıkça itmeniz gerekir (otomatik olarak işaret ettikleri commit'lerle birlikte alındıklarında). Tek bir etiketi itmek için kullanmanız gerekir ``` $ git push <uzaktan> etiket <etiket adı> ``` tüm etiketleri itmek için (veya varsayılan uzaktan, genellikle ```origin```'e itmek için ```git push --tags```) ``` $ git push <uzaktan> --tags ``` Bu, etiketleri itmeyi açık hale getirmek için çok amaçlanan bir davranıştır. Etiketleri itmek genellikle bilinçli bir seçim olmalıdır.
124
How do I add Git submodule to a sub-directory?
Git alt modülünü bir alt dizine nasıl eklerim?
You go into ~/.janus and run: ```git submodule add <git@github ...> snipmate-snippets/snippets/``` If you need more information about submodules (or git in general) ProGit is pretty useful.
~/.janus'a gidin ve çalıştırın: ```git submodule add <git@github ...> snipmate-snippets/snippets/``` Alt modüller (veya genel olarak git) hakkında daha fazla bilgiye ihtiyacınız varsa ProGit oldukça kullanışlıdır.
125
Given that Kohn-Sham DFT is strictly a ground-state method (at 0 K), how is it sufficient to describe materials in real-life applications?
Kohn-Sham DFT'nin kesinlikle bir temel durum yöntemi (0 K'de) olduğu göz önüne alındığında, gerçek yaşam uygulamalarındaki malzemeleri tanımlamak için nasıl yeterlidir?
These are a few extra points to complement Andrew Rosen's comprehensive response: * To be absolutely clear, typical DFT calculations are not performed at 0K, a better description of what happens is that they are performed "for a static crystal". Static crystal means that the atoms are fixed at their crystallographic positions (which is what a typical DFT calculation does), but this situation is different from 0K. Even at 0K, the atomic nuclei move due to quantum zero-point motion (also called quantum fluctuations). This quantum zero-point motion is very small for compounds containing heavy elements, which means that in these cases "0K" and "static crystal" are almost the same and many people use the terms interchangeably. However, quantum zero-point motion can be very large for light elements, for example in solid hydrogen (the lightest of all compounds) it dominates even at room temperature. To perform a calculation at 0K (as opposed to a static crystal calculation), the strategy that Andrew Rosen proposed would still work if you use quantum statistics. For example, solving the vibrational problem within the harmonic approximation at the quantum mechanical level with give you the zero-point energy as the ground state of a quantum harmonic oscillator. A good reference for hydrogen is this review article. * Although Andrew Rosen is correct in that the potential energy surface is largely temperature independent, there are a few situations in which the potential energy surface does vary significantly with temperature. An example of this is provided by many perovskite crystals (e.g. $\ce{BaTiO_3}$), which undergo a series of temperature-induced structural phase transitions. For example, at very high temperatures the structure is cubic, and this structure sits at a minimum of the potential free energy surface. However, if you calculated the potential energy surface (instead of the free energy surface), then it has a double-well shape and the cubic structure is at the saddle point, so the structure will lower its energy by distorting and going to one of the minima. This is precisely what happens at low temperatures because the corresponding free energy surface acquires a double-well shape, and the system undergoes a structural phase transition. A good early DFT reference for this is this paper. * As already pointed out by others, the differences between DFT and TDDFT or $GW$-BSE are not related to the inclusion or exclusion of temperature. In this language, both TDDFT and $GW$-BSE have no temperature for the behaviour of the nuclei, and you could incoporate it in a similar fashion to what Andrew Rosen described for DFT.
İşte Andrew Rosen'in kapsamlı cevabını tamamlayan birkaç ek nokta: * Kesinlikle açık olmak gerekirse, tipik DFT hesaplamaları 0K'de yapılmaz, olan bitenin daha iyi bir açıklaması "statik bir kristal için" yapıldıklarıdır. Statik kristal, atomların kristalografik konumlarında sabitlendiği anlamına gelir (tipik bir DFT hesaplamasının yaptığı şey budur), ancak bu durum 0K'den farklıdır. 0K'de bile atom çekirdekleri kuantum sıfır noktası hareketi (kuantum dalgalanmaları olarak da bilinir) nedeniyle hareket eder. Bu kuantum sıfır noktası hareketi, ağır elementler içeren bileşikler için çok küçüktür, bu da bu durumlarda "0K" ve "statik kristal"in neredeyse aynı olduğu ve birçok kişinin terimleri birbirinin yerine kullandığı anlamına gelir. Ancak kuantum sıfır noktası hareketi hafif elementler için çok büyük olabilir, örneğin katı hidrojende (tüm bileşiklerin en hafifidir) oda sıcaklığında bile baskındır. 0K'de (statik bir kristal hesaplamasının aksine) bir hesaplama yapmak için Andrew Rosen'in önerdiği strateji, kuantum istatistikleri kullanırsanız yine de işe yarayacaktır. Örneğin, titreşim problemini kuantum mekanik seviyesinde harmonik yaklaşım içinde çözmek, size kuantum harmonik osilatörünün temel durumu olarak sıfır noktası enerjisini verecektir. Hidrojen için iyi bir referans bu inceleme makalesidir. * Andrew Rosen, potansiyel enerji yüzeyinin büyük ölçüde sıcaklıktan bağımsız olduğu konusunda haklı olsa da, potansiyel enerji yüzeyinin sıcaklıkla önemli ölçüde değiştiği birkaç durum vardır. Buna örnek olarak, bir dizi sıcaklık kaynaklı yapısal faz geçişine uğrayan birçok perovskit kristali (ör. $\ce{BaTiO_3}$) verilebilir. Örneğin, çok yüksek sıcaklıklarda yapı kübiktir ve bu yapı potansiyel serbest enerji yüzeyinin minimumunda yer alır. Ancak potansiyel enerji yüzeyini (serbest enerji yüzeyi yerine) hesaplarsanız, o zaman çift çukurlu bir şekle sahiptir ve kübik yapı eyer noktasındadır, bu nedenle yapı enerjisini bozarak ve minimumlardan birine giderek düşürecektir. Bu, düşük sıcaklıklarda tam olarak olan şeydir çünkü karşılık gelen serbest enerji yüzeyi çift çukurlu bir şekil alır ve sistem yapısal bir faz geçişine uğrar. Bunun için iyi bir erken DFT referansı bu makaledir. * Diğerleri tarafından daha önce de belirtildiği gibi, DFT ile TDDFT veya $GW$-BSE arasındaki farklar, sıcaklığın dahil edilip edilmemesiyle ilgili değildir. Bu dilde, hem TDDFT hem de $GW$-BSE, çekirdeklerin davranışı için sıcaklığa sahip değildir ve bunu Andrew Rosen'in DFT için tanımladığına benzer bir şekilde dahil edebilirsiniz.
126
I don't really get the difference between gain and volume boost. So if I understand correctly, gain directly boosts a signal from a line or input while volume handles the output. Volume isn't really for boosting either. Would this mean, in most settings, getting 'close to' as much gain as possible without any hiss/background noise is ideal?
Gain ve ses yükseltme arasındaki farkı tam olarak anlamıyorum. Dolayısıyla doğru anladıysam, gain doğrudan bir hat veya girdiden gelen bir sinyali yükseltirken ses çıkışı işler. Ses yükseltme de yükseltme için değildir. Bu, çoğu durumda, tıslama/arka plan gürültüsü olmadan mümkün olduğunca fazla gain elde etmenin ideal olduğu anlamına mı gelir?
Here's a brief overview to get you started. Hopefully this helps! * 'Gain' controls are typically used to get a good input level. So for example if you had a microphone with a very low output signal, you would boost the gain to get a better level into your mixing desk or audio interface. If you had a synthesizer plugged in you might need to turn the gain down to stop the signal distorting. Gain controls are often controlling an amplifier behind the scenes - i.e. your signal can 'gain' strength after going through the gain stage of your audio equipment. So gain is usually the first control in the signal path of your recording equipment. * 'Volume' controls on the other hand tend to be at the end of the signal chain and are more likely to be attenuating rather than amplifying the signal. So on a mixing desk, having got a good level from each input at the gain stage, you use the volume faders to adjust the relative volumes of each channel to achieve a good mix. You are not typically amplifying those signals any more though. A guitar amp is a good example of how this works. The first control is often called "Gain" or 'drive' and guitarists often deliberately turn this really high to get a nice distorted sound from a tube preamp. However, the final control is called Volume and governs simply how loud the sound coming out of your speaker is. With gain right up and volume low you can play distorted sounds without annoying the neighbours. With gain low and volume high you get a loud sound but no distortion.
İşte başlamanız için kısa bir genel bakış. Umarım yardımcı olur! * 'Gain' kontrolleri genellikle iyi bir giriş seviyesi elde etmek için kullanılır. Yani örneğin çok düşük bir çıkış sinyaline sahip bir mikrofonunuz varsa, miksaj masanıza veya ses arayüzünüze daha iyi bir seviye elde etmek için gain'i yükseltirsiniz. Takılı bir synthesizer'ınız varsa, sinyalin bozulmasını durdurmak için gain'i azaltmanız gerekebilir. Gain kontrolleri genellikle perde arkasında bir amplifikatörü kontrol eder - yani sinyaliniz, ses ekipmanınızın gain aşamasından geçtikten sonra güç 'kazanabilir'. Bu nedenle gain genellikle kayıt ekipmanınızın sinyal yolundaki ilk kontroldür. * Öte yandan 'Volume' kontrolleri genellikle sinyal zincirinin sonunda yer alır ve sinyali yükseltmekten ziyade zayıflatma olasılıkları daha yüksektir. Bu nedenle bir miksaj masasında, gain aşamasında her bir girişten iyi bir seviye elde ettikten sonra, iyi bir miks elde etmek için her bir kanalın göreceli ses seviyelerini ayarlamak için volume fader'larını kullanırsınız. Artık bu sinyalleri yükseltmiyorsunuz. Bir gitar amfisi bunun nasıl çalıştığına dair iyi bir örnektir. İlk kontrol genellikle "Gain" veya 'drive' olarak adlandırılır ve gitaristler güzel bir tüplü preamp sesinden bozuk bir ses elde etmek için bunu genellikle gerçekten yükseğe çevirirler. Ancak son kontrol Volume olarak adlandırılır ve hoparlörünüzden çıkan sesin ne kadar yüksek olduğunu yönetir. Gain yüksekte ve volume düşükken komşularınızı rahatsız etmeden bozuk sesler çalabilirsiniz. Gain düşük ve volume yüksekken yüksek bir ses elde edersiniz ancak bozulma olmaz.
127
I recently had someone claim (on an unrelated SE site I won't link to) that it is the responsibility of a player to correctly identify their hand, that what you &quot;call&quot; your hand determines the winner: For example, you have an Ace, King, Queen, Jack, and Ten. You call your hand and say, &quot;I have a Straight!&quot; But that was a bad move on your part because you are a novice player and you did not notice that all of your cards are Spades. You actually had a Straight Flush, but now you have lost because one of the remaining players had a Full House. Your hand has not been determined until you call your hand. Is this true? Clearly you might play your hand differently if you misunderstand what you have, but I always thought that the cards speak for themselves once they are revealed. Or would it depend on the specific poker variation/house rules?
Yakın zamanda biri (bağlantısını vermeyeceğim alakasız bir SE sitesinde) bir oyuncunun elini doğru bir şekilde tanımlamasının kendi sorumluluğu olduğunu, elinize "ne dediğinizin" kazananı belirlediğini iddia etti: Örneğin, bir As, Papaz, Kız, Vale ve On'unuz var. Elinizi çağırıp "Straight'im var!" diyorsunuz. Ama bu sizin için kötü bir hamleydi çünkü acemi bir oyuncusunuz ve tüm kartlarınızın Maça olduğunu fark etmediniz. Aslında bir Straight Flush'ınız vardı ama şimdi kalan oyunculardan birinin Full House'u olduğu için kaybettiniz. Eliniz, elinizi çağırıncaya kadar belirlenmemiştir. Bu doğru mu? Elinizde ne olduğunu yanlış anlarsanız elinizi farklı oynayabilirsiniz, ancak kartların ortaya çıktıktan sonra kendi kendilerini konuştuğunu her zaman düşünmüşümdür. Yoksa bu, belirli poker varyasyonuna/ev kurallarına mı bağlı olur?
Casinos in the US generally have the "cards speak" rule. That is, when a hand is properly tabled--exposed to everyone at showdown--it is the responsibility of all players, the dealer, floormen, and anyone else present to see that the pot is awarded to the best hand shown, regardless of what the players might say. Some players object to this rule: they believe that if a player or railbird says "Wait, Bob has a flush", that's unfairly helping a player. But the rule is clear: once the hand is tabled, others have not only the right but the obligation to help ensure the pot is awarded correctly. There are a couple of caveats: if a player only shows his hand to another player, or to the dealer, or to any other person, without properly tabling it for everyone, that player has no rights yet and those to whom the hand was shown should remain silent to protect other players' properly shown hands. But once the hand is tabled, it's fair game and everyone can and should assist in reading the hands. Finally, in some cases, if a floorman feels that a player has deliberately overcalled his hand to induce a player with a better hand to fold, he may penalize that player by awarding the pot to someone else, even possibly to a folded hand. Some California lowball clubs even had a rule that a player who remained silent rather than explicitly calling out a pair could be ruled against in this way.
ABD'deki casinolar genellikle "kartlar konuşur" kuralına sahiptir. Yani, bir el düzgün bir şekilde masaya konduğunda (açılışta herkese gösterildiğinde), oyuncuların, krupiyenin, salon görevlilerinin ve orada bulunan diğer herkesin, oyuncuların ne söylediğine bakılmaksızın, potun gösterilen en iyi ele verilmesini sağlama sorumluluğu vardır. Bazı oyuncular bu kurala itiraz eder: Bir oyuncunun veya seyircinin "Bekleyin, Bob'un bir floşu var" demesinin bir oyuncuya haksız yere yardım ettiğine inanırlar. Ancak kural açıktır: El masaya konduktan sonra, diğerleri sadece potun doğru bir şekilde verilmesini sağlama hakkına değil, aynı zamanda yükümlülüğüne de sahiptir. Birkaç uyarı vardır: Bir oyuncu elini yalnızca başka bir oyuncuya, krupiyeye veya başka bir kişiye gösterirse ve herkese düzgün bir şekilde masaya koymazsa, o oyuncunun henüz hiçbir hakkı yoktur ve eli gösterilen kişiler, diğer oyuncuların düzgün bir şekilde gösterilen ellerini korumak için sessiz kalmalıdır. Ancak el masaya konduktan sonra, herkesin elini okumaya yardım etmesi adildir ve herkes bunu yapmalıdır. Son olarak, bazı durumlarda, bir salon görevlisi bir oyuncunun daha iyi bir eli olan bir oyuncuyu fold ettirmek için kasıtlı olarak elini fazla söylediğini düşünürse, o oyuncuyu cezalandırarak potu başka birine, hatta fold edilmiş bir ele bile verebilir. Bazı Kaliforniya lowball kulüplerinde, bir çift söylemek yerine sessiz kalan bir oyuncunun bu şekilde aleyhine karar verilebileceğine dair bir kural bile vardı.
128
How to get the first item from an associative PHP array?
Bir PHP ilişkisel dizisinden ilk öğeyi nasıl alabilirim?
PHP If you don't know enough about the array (you're not sure whether the first key is foo or bar) then the array might well also be, maybe, empty. So it would be best to check, especially if there is the chance that the returned value might be the boolean FALSE: ```$value = empty($arr) ? $default : reset($arr); ``` The above code uses ```reset``` and so has side effects (it resets the internal pointer of the array), so you might prefer using ```array_slice``` to quickly access a copy of the first element of the array: ```$value = $default; foreach(array_slice($arr, 0, 1) as $value); ``` Assuming you want to get both the key and the value separately, you need to add the fourth parameter to ```array_slice```: ```foreach(array_slice($arr, 0, 1, true) as $key => $value); ``` To get the first item as a pair (```key => value```): ```$item = array_slice($arr, 0, 1, true); ``` Simple modification to get the last item, key and value separately: ```foreach(array_slice($arr, -1, 1, true) as $key => $value); ``` performance If the array is not really big, you don't actually need ```array_slice``` and can rather get a copy of the whole keys array, then get the first item: ```$key = count($arr) ? array_keys($arr)[0] : null; ``` If you have a very big array, though, the call to ```array_keys``` will require significant time and memory more than ```array_slice``` (both functions walk the array, but the latter terminates as soon as it has gathered the required number of items - which is one). A notable exception is when you have the first key which points to a very large and convoluted object. In that case ```array_slice``` will duplicate that first large object, while ```array_keys``` will only grab the keys. PHP 7.3+ PHP 7.3 onwards implements ```array_key_first()``` as well as ```array_key_last()```. These are explicitly provided to access first and last keys efficiently without resetting the array's internal state as a side effect. So since PHP 7.3 the first value of ```$array``` may be accessed with ```$array[array_key_first($array)]; ``` You still had better check that the array is not empty though, or you will get an error: ```$firstKey = array_key_first($array); if (null === $firstKey) { $value = &quot;Array is empty&quot;; // An error should be handled here } else { $value = $array[$firstKey]; } ```
PHP Dizi hakkında yeterince bilginiz yoksa (ilk anahtarın foo mu yoksa bar mı olduğundan emin değilseniz), dizi muhtemelen boş olabilir. Bu nedenle, özellikle döndürülen değerin boolean FALSE olma ihtimali varsa kontrol etmek en iyisidir: ```$value = empty($arr) ? $default : reset($arr); ``` Yukarıdaki kod ```reset``` kullanır ve bu nedenle yan etkileri vardır (dizinin dahili işaretçisini sıfırlar), bu nedenle dizinin ilk öğesinin bir kopyasına hızlıca erişmek için ```array_slice``` kullanmayı tercih edebilirsiniz: ```$value = $default; foreach(array_slice($arr, 0, 1) as $value); ``` Anahtarı ve değeri ayrı ayrı almak istediğinizi varsayarsak, ```array_slice```'a dördüncü parametreyi eklemeniz gerekir: ```foreach(array_slice($arr, 0, 1, true) as $key => $value); ``` İlk öğeyi bir çift olarak almak için (```key => value```): ```$item = array_slice($arr, 0, 1, true); ``` Son öğeyi, anahtarı ve değeri ayrı ayrı almak için basit bir değişiklik: ```foreach(array_slice($arr, -1, 1, true) as $key => $value); ``` performans Dizi gerçekten büyük değilse, aslında ```array_slice```'a ihtiyacınız yoktur ve bunun yerine tüm anahtarlar dizisinin bir kopyasını alıp ilk öğeyi alabilirsiniz: ```$key = count($arr) ? array_keys($arr)[0] : null; ``` Ancak çok büyük bir diziniz varsa, ```array_keys``` çağrısı ```array_slice```'dan önemli ölçüde daha fazla zaman ve bellek gerektirecektir (her iki işlev de diziyi dolaşır, ancak ikincisi gerekli sayıda öğeyi (bir tane) toplar toplamaz sonlanır). Önemli bir istisna, çok büyük ve karmaşık bir nesneye işaret eden ilk anahtara sahip olduğunuz zamandır. Bu durumda ```array_slice``` ilk büyük nesneyi kopyalayacakken, ```array_keys``` yalnızca anahtarları alacaktır. PHP 7.3+ PHP 7.3 ve sonrası, ```array_key_first()``` ve ```array_key_last()```'ı uygular. Bunlar, yan etki olarak dizinin dahili durumunu sıfırlamadan ilk ve son anahtarlara verimli bir şekilde erişmek için açıkça sağlanır. Bu nedenle PHP 7.3'ten bu yana ```$array```'in ilk değerine şu şekilde erişilebilir: ```$array[array_key_first($array)]; ``` Yine de dizinin boş olmadığını kontrol etmeniz daha iyi olur, aksi takdirde bir hata alırsınız: ```$firstKey = array_key_first($array); if (null === $firstKey) { $value = &quot;Array is empty&quot;; // Burada bir hata işlenmelidir } else { $value = $array[$firstKey]; } ```
129
Why do people write #!/usr/bin/env python on the first line of a Python script?
İnsanlar neden bir Python betiğinin ilk satırına #!/usr/bin/env python yazarlar?
In order to run the python script, we need to tell the shell three things: * That the file is a script * Which interpreter we want to execute the script * The path of said interpreter The shebang ```#!``` accomplishes (1.). The shebang begins with a ```#``` because the ```#``` character is a comment marker in many scripting languages. The contents of the shebang line are therefore automatically ignored by the interpreter. The ```env``` command accomplishes (2.) and (3.). To quote &quot;grawity,&quot; > A common use of the ```env``` command is to launch interpreters, by making use of the fact that env will search $PATH for the command it is told to launch. Since the shebang line requires an absolute path to be specified, and since the location of various interpreters (perl, bash, python) may vary a lot, it is common to use: ```#!/usr/bin/env perl``` instead of trying to guess whether it is /bin/perl, /usr/bin/perl, /usr/local/bin/perl, /usr/local/pkg/perl, /fileserver/usr/bin/perl, or /home/MrDaniel/usr/bin/perl on the user's system... > On the other hand, env is almost always in /usr/bin/env. (Except in cases when it isn't; some systems might use /bin/env, but that's a fairly rare occassion and only happens on non-Linux systems.)
Python betiğini çalıştırmak için kabuğa üç şey söylememiz gerekir: * Dosyanın bir betik olduğunu * Betiği çalıştırmak istediğimiz yorumlayıcıyı * Söz konusu yorumlayıcının yolunu Shebang ```#!``` (1.)'i gerçekleştirir. Shebang ```#``` ile başlar çünkü ```#``` karakteri birçok betik dilinde yorum işaretidir. Bu nedenle shebang satırının içeriği yorumlayıcı tarafından otomatik olarak göz ardı edilir. ```env``` komutu (2.) ve (3.)'ü gerçekleştirir. &quot;grawity&quot;'den alıntı yapmak gerekirse, > ```env``` komutunun yaygın bir kullanımı, env'in başlatılması istenen komut için $PATH'i arayacağı gerçeğinden yararlanarak yorumlayıcıları başlatmaktır. Shebang satırının mutlak bir yol belirtilmesini gerektirmesi ve çeşitli yorumlayıcıların (perl, bash, python) konumları çok değişebileceğinden, ```#!/usr/bin/env perl``` kullanmak, /bin/perl, /usr/bin/perl, /usr/local/bin/perl, /usr/local/pkg/perl, /fileserver/usr/bin/perl veya /home/MrDaniel/usr/bin/perl'in kullanıcı sisteminde olup olmadığını tahmin etmeye çalışmaktan daha yaygındır... > Öte yandan, env neredeyse her zaman /usr/bin/env'dedir. (Olmadığı durumlar hariç; bazı sistemler /bin/env kullanabilir, ancak bu oldukça nadir bir durumdur ve yalnızca Linux dışı sistemlerde olur.)
130
Nowadays each graphic card has some driver in operating system that translates some (typically) standard API such as OpenGL, so that programmers use some standardized API code to tell graphics cards how and what they want to render. (Actually that's already a bit hard-core most programmers really use various game engines that do this for them). In times of old computers - how was this done? Did every programmer of every game implemented all possible various API's that old graphic cards supported? Or did the old game studios from MS-DOS times had their own "game engines" that provided some abstraction when it came to these graphic cards? I remember there were many various card vendors and I remember old games asked me which one I have - so I suppose these games contained code / drivers for all these cards?
Günümüzde her grafik kartının işletim sisteminde, OpenGL gibi bazı (genellikle) standart API'leri çeviren bir sürücü vardır, böylece programcılar grafik kartlarına nasıl ve neyi işlemek istediklerini söylemek için bazı standartlaştırılmış API kodları kullanırlar. (Aslında bu biraz zorlu bir iştir, çoğu programcı bunu onlar için yapan çeşitli oyun motorlarını kullanır). Eski bilgisayar zamanlarında - bu nasıl yapılırdı? Her oyunun her programcısı, eski grafik kartlarının desteklediği tüm olası çeşitli API'leri mi uyguladı? Yoksa MS-DOS zamanlarından kalma eski oyun stüdyolarının, bu grafik kartları söz konusu olduğunda bir miktar soyutlama sağlayan kendi "oyun motorları" mı vardı? Birçok farklı kart satıcısı olduğunu ve eski oyunların hangisine sahip olduğumu sorduğunu hatırlıyorum - bu yüzden bu oyunların tüm bu kartlar için kod/sürücü içerdiğini düşünüyorum?
> Did every programmer of every game implemented all possible various API's that old graphic cards supported? Yes - but it went even deeper than that. Early graphics cards had virtually no callable code associated with them at all, the concept of "drivers" had not quite become a reality yet. There was the concept of a Video BIOS, which were extensions to the ```INT 10h``` BIOS video services, that were effectively limited to initialization and switching video modes. Instead, graphics cards, at least in DOS land, all had memory mapped display RAM, and extensive documentation was available about exactly how setting various bits in display RAM would affect the pixels that appeared on the screen. There were no drawing APIs to call, if you wanted something to appear on the screen (whether it be a pixel, a character, a line, a circle, a sprite, etc) you would write the code to move the bytes into the right places in display RAM. Entire books were written about how to write efficient code to draw graphics. There were some systems like the Borland Graphics Interface that abstracted graphics drawing primitives into an API with different drivers that one could call to draw things on different graphics cards. However, these were typically slower than what would be required for building action type games. An action game would typically be optimized for a particular graphics display mode on a particular card. For example, a popular display mode was VGA 640x480 with 16 colors. This would be listed in the software requirements, and you needed to have the right hardware to support the game. If you bought a VGA game but you only had an EGA card, then the game would not work at all. As you said, some games would ask what you had and you had to know what the right answer was, otherwise the game would not work.
Herhangi bir oyunun her programcısı, eski grafik kartlarının desteklediği tüm olası çeşitli API'ları uyguladı mı? Evet - ancak bundan daha da derine indi. İlk grafik kartlarının neredeyse hiç çağrılabilir kodu yoktu, "sürücüler" kavramı henüz tam olarak bir gerçeklik haline gelmemişti. ```INT 10h``` BIOS video hizmetlerine uzantı olan ve etkili bir şekilde başlatma ve video modlarını değiştirme ile sınırlı olan bir Video BIOS kavramı vardı. Bunun yerine, grafik kartları, en azından DOS alanında, belleğe eşlenmiş ekran RAM'ine sahipti ve ekran RAM'indeki çeşitli bitlerin ayarlanmasının ekranda görünen pikselleri nasıl etkileyeceği hakkında kapsamlı belgeler mevcuttu. Çağrılacak çizim API'leri yoktu, ekranda bir şeyin görünmesini istiyorsanız (bir piksel, bir karakter, bir çizgi, bir daire, bir sprite vb. olsun) baytları ekran RAM'indeki doğru yerlere taşımak için kodu yazardınız. Grafik çizmek için verimli kod yazma hakkında kitaplar yazılmıştır. Borland Graphics Interface gibi, grafik çizim ilkelini farklı grafik kartlarında bir şeyler çizmek için çağrılabilecek farklı sürücülere sahip bir API'ye soyutlayan bazı sistemler vardı. Ancak bunlar genellikle aksiyon türü oyunlar oluşturmak için gerekenlerden daha yavaştı. Bir aksiyon oyunu tipik olarak belirli bir karttaki belirli bir grafik görüntüleme modu için optimize edilirdi. Örneğin, popüler bir görüntüleme modu 16 renkle VGA 640x480'di. Bu, yazılım gereksinimlerinde listelenirdi ve oyunu desteklemek için doğru donanıma sahip olmanız gerekirdi. Bir VGA oyunu satın aldıysanız ancak yalnızca bir EGA kartınız varsa, oyun hiç çalışmazdı. Dediğiniz gibi, bazı oyunlar neye sahip olduğunuzu sorardı ve doğru cevabın ne olduğunu bilmeniz gerekirdi, aksi takdirde oyun çalışmazdı.
131
Why is it "behead" and not "dehead"?
Neden "behead" ve "dehead" değil?
We didn’t use de-head because we already had a verb behead by the time we started using de- to create verbs: behead was a verb in Old English, behéafdian. So behead was already used long before the de- privative prefix came to be used productively in English. That didn’t happen until Modern English with a few productive examples in the 17ᵗʰ century but most coming from the 19ᵗʰ century or after. As Janus mentions in comments, the de- word meaning the same thing, decapitate, was imported in full with the de- already there, from Latin via French, in the 17ᵗʰ century. There are many different possible senses of be- in verbs; the OED lists six different primary senses with subsenses. This here in behead is one of the rarer ones. Under be- sense 6c, it says that this privative sense of be- used to create behead is an ancient sense that means bereave of: Forming trans. verbs on substantives used in an instrumental relation; the primary idea being; * a. To surround, cover, or bedaub with, as in becloud, to put clouds about, cover with clouds, bedew. Thence, by extension, * b. To affect with in any way, as in benight, beguile, befriend. In both sets there is often an accompanying notion of ‘thoroughly, excessively,’ as in 2. * c. An ancient application, no longer in living use, was to express the sense of ‘bereave of,’ as in behead, belimb, etc., q.v. Cf. 3, above. Although 6a and 6b are still productive, 6c no longer is so in the living language. Another Old English verb formed using 6c was belandian, meaning to deprive of one’s land. However, this verb did not survive into Modern English. El destierro Apropos de nada, the Spanish equivalent of the obsolete verb beland still very much exists in the verb desterrar, which combines the privative des‑ prefix with the noun tierra meaning land then puts that into an infinitive verb form. This is normally translated as “exile” in English, but sometime as “expel” or as a noun “expulsion”. There is also a substantive version, destierro, is famously found in “Cantar del destierro”, which is the title of the first canto from that most ancient of Castilian epic poems, El Cantar de Mio Cid. Truly, el Cid was belanded of his lands by the King.
Başını kesmek için de- ön ekini kullanmadık çünkü de- ön ekini kullanarak fiil oluşturmaya başladığımızda zaten behead fiilimiz vardı: behead, Eski İngilizcede behéafdian şeklinde bir fiildi. Yani behead, de- olumsuzluk ön eki İngilizcede üretken bir şekilde kullanılmaya başlamadan çok önce kullanılıyordu. Bu, Modern İngilizcede 17. yüzyılda birkaç üretken örnekle ortaya çıktı ancak çoğu 19. yüzyılda veya sonrasında ortaya çıktı. Janus'un yorumlarda belirttiği gibi, aynı anlama gelen de- kelimesi, yani decapitate, 17. yüzyılda Latince'den Fransızca aracılığıyla de- ön ekiyle birlikte ithal edildi. Fiillerde be- ön eklerinin birçok farklı olası anlamı vardır; OED, alt anlamlarıyla birlikte altı farklı birincil anlam listeler. Burada behead'deki be- ön eki daha nadir olanlardan biridir. Be- anlamı 6c'de, behead'i oluşturmak için kullanılan bu olumsuzluk anlamının, "mahrum bırakmak" anlamına gelen eski bir anlam olduğunu söyler: İsmin araçsal bir ilişkide kullanıldığı geçişli fiiller oluşturmak; birincil fikir; * a. Bulutlamak, bulutlarla örtmek veya bulutlarla kaplamak gibi bulutlarla çevrelemek, örtmek, ıslatmak. Oradan, genişleme yoluyla, * b. Gece yapmak, kandırmak, dost olmak gibi herhangi bir şekilde etkilemek. Her iki kümede de genellikle 2'de olduğu gibi "tamamen, aşırı" eşlik eden bir kavram vardır. * c. Artık canlı dilde kullanılmayan eski bir uygulama, behead, belimb vb.'de olduğu gibi "mahrum bırakmak" anlamını ifade etmekti. Yukarıdaki 3'e bakın. 6a ve 6b hala üretken olsa da, 6c artık canlı dilde öyle değildir. 6c kullanılarak oluşturulan bir başka Eski İngilizce fiil, birinin toprağından mahrum bırakmak anlamına gelen belandian'dı. Ancak bu fiil Modern İngilizceye kadar gelmedi. El destierro Konuyla ilgili olarak, beland fiilinin İspanyolca karşılığı olan desterrar fiili, olumsuzluk des‑ ön ekini toprak anlamına gelen tierra ismiyle birleştirir ve ardından onu bir fiil kipi biçimine sokar. Bu normalde İngilizcede "sürgün" olarak çevrilir, ancak bazen "kovmak" veya bir isim olarak "kovma" olarak çevrilir. Ayrıca bir isim hali olan destierro, Kastilya destan şiirlerinin en eskisi olan El Cantar de Mio Cid'in ilk cantosunun başlığı olan "Cantar del destierro"da ünlüdür. Gerçekten de, el Cid, Kral tarafından topraklarından mahrum bırakıldı.
132
Why do many vinyl albums of classical music have Sides 1 / 4 on the first record and 2 / 3 on the second? An example of this is the RCA Red Seal recording of Beethoven's 9th Symphony by the Boston Symphony Orchestra.
Neden birçok klasik müzik vinil albümünün ilk plağında 1/4, ikinci plağında ise 2/3 tarafları vardır? Bunun bir örneği, Boston Senfoni Orkestrası tarafından icra edilen Beethoven'ın 9. Senfonisi'nin RCA Red Seal kaydıdır.
Many phonographs were able to play multiple records in sequence with a mechanism that would hold one or more records on the turntable, and one or more additional records elevated on the center post. At the end of one record, the mechanism sensed the tone arm reaching close to the center of the record, and then lifted it, pulled it out beyond the edge of the records. The system then dropped the bottom record of those on the center post, leaving the rest of them. Then the tone arm mechanism moved the tone arm to the outside of the record and lowered it to the record. The mechanism was pretty ingenious, but it couldn't flip records over. So, to play a long piece, it would play one side of each record until the stack was exhausted. Then it was up to a person to flip the stack to play the opposite sides in sequence. So, when playing records 1A/1B, 2A/2B, 3A/3B, 4A/4B in such a mechanism, the play order would be 1A, 2A, 3A, 4A, (flip), 4B, 3B, 2B, 1B. The "B" sides would go the other way because flipping the whole stack would put them in the opposite order. Purists would take offense at the idea of letting records drop like that, but it was an irresistible convenience to people who could tolerance slightly quicker wear of their records.
Birçok fonograf, pikapta bir veya daha fazla plak tutan ve orta direğe bir veya daha fazla ek plak yükselten bir mekanizma ile sırayla birden fazla plak çalabiliyordu. Bir plağın sonunda, mekanizma ton kolunun plağın merkezine yaklaştığını algıladı ve ardından onu kaldırdı, plağın kenarının ötesine çekti. Sistem daha sonra orta direkteki plaklardan en alttaki plağı düşürdü ve diğerlerini bıraktı. Ardından ton kolu mekanizması ton kolunu plağın dışına taşıdı ve plağa indirdi. Mekanizma oldukça ustaca idi, ancak plağı çeviremiyordu. Bu nedenle, uzun bir parçayı çalmak için, yığın bitene kadar her plağın bir tarafını çalardı. Ardından, karşı tarafları sırayla çalmak için yığını çevirmek bir kişiye kalmıştı. Bu nedenle, 1A/1B, 2A/2B, 3A/3B, 4A/4B kayıtlarını böyle bir mekanizmada çalarken, çalma sırası 1A, 2A, 3A, 4A, (çevir), 4B, 3B, 2B, 1B olurdu. "B" tarafları ters yönde giderdi çünkü tüm yığını çevirmek onları ters sıraya koyardı. Püristler, plaklara böyle düşme izni verilmesi fikrine gücenirlerdi, ancak kayıtlarının biraz daha hızlı aşınmasına tahammül edebilen insanlar için karşı konulmaz bir kolaylıktı.
133
Why isn't the market dropping like a stone with all the bad news?
Tüm bu kötü haberlerle piyasa neden taş gibi düşmüyor?
Market reactions to information are not always timely, proportional, or rational. We don't know the full impact of our current situation; we're feeling it out. * Some people (bulls), believe that the initial dip was an over-reaction, that the government response will prevent further decline, and/or that things will go back to normal pretty quickly, so they are buying the dip. * On the other side you have people (bears) that believe the initial reaction was just a start but not enough to price-in the full impact, that the government can't prop up the economy, and/or that this will drag on for a long while, so they are betting on further decline. The problem with this idea of information being priced-in is that we all know there's a global pandemic, but there are very different opinions about how much that should affect the market. Consider unemployment levels: We have projections about unemployment rate potentially hitting a peak over 30%. Meanwhile, the current unemployment rate is 4.4% and projected to hit double digits in April. The only way all of that information could be appropriately priced in is if everyone agreed about the reasonableness of the projections and had the economic prowess to understand the actual impact of those figures. Instead, what happens is that some people will see the actual April unemployment numbers as surprising new information to react to, while others will see it as old information in line with their expectations. Add in thousands of other pieces of information about which people have conflicting opinions, and it becomes pretty much impossible to know in advance if that information was all priced in appropriately. The most recent comparable event is the subprime mortgage crash. Many people thought bottom was hit around November 2008 and there was a brief counter-trend rally before actual bottom was hit around March 2009. We don't know at this time if the market has bottomed out yet or not; nor do we know how long recovery could take.
Piyasaların bilgiye tepkileri her zaman zamanında, orantılı veya rasyonel olmayabilir. Mevcut durumumuzun tam etkisini bilmiyoruz; bunu hissediyoruz. * Bazı insanlar (boğalar), ilk düşüşün aşırı bir tepki olduğuna, hükümetin tepkisinin daha fazla düşüşü önleyeceğine ve/veya işlerin oldukça hızlı bir şekilde normale döneceğine inanıyor, bu yüzden düşüşü satın alıyorlar. * Öte yandan, ilk tepkinin sadece bir başlangıç olduğuna ancak tam etkiyi fiyatlandırmak için yeterli olmadığına, hükümetin ekonomiyi destekleyemeyeceğine ve/veya bunun uzun bir süre devam edeceğine inanan insanlar (ayılar) var, bu yüzden daha fazla düşüşe bahis oynuyorlar. Bilginin fiyatlandırıldığı fikrindeki sorun, hepimizin küresel bir salgın olduğunu bilmemiz ancak bunun piyasayı ne kadar etkilemesi gerektiği konusunda çok farklı görüşlerin olmasıdır. İşsizlik oranlarını düşünün: İşsizlik oranının potansiyel olarak %30'un üzerine çıkacağına dair tahminlerimiz var. Bu arada, mevcut işsizlik oranı %4,4 ve Nisan ayında iki haneye ulaşması bekleniyor. Tüm bu bilgilerin uygun şekilde fiyatlandırılmasının tek yolu, herkesin tahminlerin makul olması konusunda hemfikir olması ve bu rakamların gerçek etkisini anlamak için ekonomik güce sahip olmasıdır. Bunun yerine, bazı insanlar Nisan ayındaki gerçek işsizlik rakamlarını tepki verilecek şaşırtıcı yeni bilgiler olarak görürken, diğerleri bunu beklentileriyle uyumlu eski bilgiler olarak görecek. İnsanların çelişkili görüşlere sahip olduğu binlerce başka bilgi parçasını ekleyin ve bu bilgilerin uygun şekilde fiyatlandırılıp fiyatlandırılmadığını önceden bilmek neredeyse imkansız hale gelir. En son karşılaştırılabilir olay subprime ipotek kriziydi. Birçok kişi dip noktanın 2008 Kasım civarında geldiğini ve gerçek dip noktanın 2009 Mart civarında gelmesinden önce kısa bir karşıt trend rallisi yaşandığını düşündü. Şu anda piyasanın henüz dip yapıp yapmadığını bilmiyoruz; iyileşmenin ne kadar süreceğini de bilmiyoruz.
134
What are Null Pointer Exceptions (```java.lang.NullPointerException```) and what causes them? What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely?
Null Pointer İstisnaları (```java.lang.NullPointerException```) nedir ve bunlara ne sebep olur? İstisnanın programın erken sonlanmasına neden olmasını durdurmak için nedenini belirlemek için hangi yöntemler/araçlar kullanılabilir?
There are two overarching types of variables in Java: 1. Primitives: variables that contain data. If you want to manipulate the data in a primitive variable you can manipulate that variable directly. By convention primitive types start with a lowercase letter. For example variables of type `int` or `char` are primitives. 2. References: variables that contain the memory address of an `Object` i.e. variables that refer to an `Object`. If you want to manipulate the `Object` that a reference variable refers to you must dereference it. Dereferencing usually entails using `.` to access a method or field, or using `[` to index an array. By convention reference types are usually denoted with a type that starts in uppercase. For example variables of type `Object` are references. Consider the following code where you declare a variable of primitive type `int` and don't initialize it: ``` int x; int y = x + x; ``` These two lines will crash the program because no value is specified for `x` and we are trying to use `x`'s value to specify `y`. All primitives have to be initialized to a usable value before they are manipulated. Now here is where things get interesting. Reference variables can be set to `null` which means "I am referencing nothing". You can get a `null` value in a reference variable if you explicitly set it that way, or a reference variable is uninitialized and the compiler does not catch it (Java will automatically set the variable to `null`). If a reference variable is set to null either explicitly by you or through Java automatically, and you attempt to dereference it you get a `NullPointerException`. The `NullPointerException` (NPE) typically occurs when you declare a variable but did not create an object and assign it to the variable before trying to use the contents of the variable. So you have a reference to something that does not actually exist. Take the following code: ``` Integer num; num = new Integer(10); ``` The first line declares a variable named `num`, but it does not actually contain a reference value yet. Since you have not yet said what to point to, Java sets it to `null`. In the second line, the `new` keyword is used to instantiate (or create) an object of type `Integer`, and the `reference` variable `num` is assigned to that `Integer` object. If you attempt to dereference `num` before creating the object you get a `NullPointerException`. In the most trivial cases, the compiler will catch the problem and let you know that "`num may not have been initialized`," but sometimes you may write code that does not directly create the object. For instance, you may have a method as follows: ``` public void doSomething(SomeObject obj) { // Do something to obj, assumes obj is not null obj.myMethod(); } ``` In which case, you are not creating the object `obj`, but rather assuming that it was created before the `doSomething()` method was called. Note, it is possible to call the method like this: ``` doSomething(null); ``` In which case, `obj` is `null`, and the statement `obj.myMethod()` will throw a `NullPointerException`. If the method is intended to do something to the passed-in object as the above method does, it is appropriate to throw the `NullPointerException` because it's a programmer error and the programmer will need that information for debugging purposes. In addition to `NullPointerException`'s thrown as a result of the method's logic, you can also check the method arguments for `null` values and throw NPEs explicitly by adding something like the following near the beginning of a method: ``` // Throws an NPE with a custom error message if obj is null Objects.requireNonNull(obj, "obj must not be null"); ``` Note that it's helpful to say in your error message clearly which object cannot be `null`. The advantage of validating this is that 1) you can return your own clearer error messages and 2) for the rest of the method you know that unless `obj` is reassigned, it is not null and can be dereferenced safely. Alternatively, there may be cases where the purpose of the method is not solely to operate on the passed in object, and therefore a null parameter may be acceptable. In this case, you would need to check for a null parameter and behave differently. You should also explain this in the documentation. For example, `doSomething()` could be written as: ``` /** * @param obj An optional foo for ____. May be null, in which case * the result will be ____. */ public void doSomething(SomeObject obj) { if(obj == null) { // Do something } else { // Do something else } } ``` Finally, how to pinpoint the exception & cause using Stack Trace: > What methods/tools can be used to determine the cause so that you stop the exception from causing the program to terminate prematurely? Sonar with find bugs can detect NPE. Can sonar catch null pointer exceptions caused by JVM Dynamically Now Java 14 has added a new language feature to show the root cause of NullPointerException. This language feature has been part of SAP commercial JVM since 2006. In Java 14, the following is a sample NullPointerException Exception message: > in thread "main" java.lang.NullPointerException: Cannot invoke "java.util.List.size()" because "list" is null
Java'da iki genel değişken türü vardır: 1. İlkel Değişkenler: Veri içeren değişkenler. Bir ilkel değişkendeki verileri işlemek istiyorsanız, bu değişkeni doğrudan işleyebilirsiniz. Geleneksel olarak ilkel türler küçük harfle başlar. Örneğin `int` veya `char` türündeki değişkenler ilkeldir. 2. Referanslar: Bir `Nesne`nin bellek adresini içeren değişkenler, yani bir `Nesne`ye atıfta bulunan değişkenler. Bir referans değişkeninin atıfta bulunduğu `Nesne`yi işlemek istiyorsanız, referansını kaldırmanız gerekir. Referansını kaldırmak genellikle bir yönteme veya alana erişmek için `.` kullanmayı veya bir diziyi indekslemek için `[` kullanmayı gerektirir. Geleneksel olarak referans türleri genellikle büyük harfle başlayan bir türle gösterilir. Örneğin `Nesne` türündeki değişkenler referanstır. `int` ilkel türünde bir değişken bildirdiğiniz ve başlatmadığınız aşağıdaki kodu düşünün: ``` int x; int y = x + x; ``` Bu iki satır programı çökertir çünkü `x` için bir değer belirtilmemiştir ve `y`'yi belirtmek için `x`'in değerini kullanmaya çalışıyoruz. Tüm ilkel değişkenler, işlenmeden önce kullanılabilir bir değere başlatılmalıdır. Şimdi işlerin ilginçleştiği yer burası. Referans değişkenleri "Hiçbir şeye atıfta bulunmuyorum" anlamına gelen `null` olarak ayarlanabilir. Bir referans değişkeninde, açıkça bu şekilde ayarlarsanız veya bir referans değişkeni başlatılmamışsa ve derleyici bunu yakalamazsa (`Java` değişkeni otomatik olarak `null` olarak ayarlar) `null` değeri alabilirsiniz. Bir referans değişkeni sizin tarafınızdan açıkça veya `Java` tarafından otomatik olarak `null` olarak ayarlanmışsa ve referansını kaldırmaya çalışırsanız `NullPointerException` alırsınız. `NullPointerException` (NPE) genellikle bir değişken bildirdiğinizde ancak değişkenin içeriğini kullanmaya çalışmadan önce bir nesne oluşturmadığınızda ve değişkene atamadığınızda oluşur. Yani aslında var olmayan bir şeye referansınız var. Aşağıdaki kodu ele alalım: ``` Integer num; num = new Integer(10); ``` İlk satır `num` adında bir değişken bildirir, ancak henüz bir referans değeri içermez. Henüz neyi işaret edeceğinizi söylemediğiniz için `Java` onu `null` olarak ayarlar. İkinci satırda, `Integer` türünde bir nesne örneklemek (veya oluşturmak) için `new` anahtar sözcüğü kullanılır ve `referans` değişkeni `num` bu `Integer` nesnesine atanır. Nesneyi oluşturmadan önce `num`'un referansını kaldırmaya çalışırsanız `NullPointerException` alırsınız. En önemsiz durumlarda, derleyici sorunu yakalar ve "`num başlatılmamış olabilir`" bilgisini verir, ancak bazen doğrudan nesne oluşturmayan kod yazabilirsiniz. Örneğin, aşağıdaki gibi bir yönteminiz olabilir: ``` public void doSomething(SomeObject obj) { // obj'ye bir şeyler yapın, obj'nin null olmadığını varsayar obj.myMethod(); } ``` Bu durumda, `obj` nesnesini oluşturmuyorsunuz, bunun yerine `doSomething()` yöntemi çağrılmadan önce oluşturulduğunu varsayıyorsunuz. Bu yöntemi şu şekilde çağırmanın mümkün olduğunu unutmayın: ``` doSomething(null); ``` Bu durumda, `obj` `null`'dır ve `obj.myMethod()` ifadesi `NullPointerException` fırlatır. Yöntemin yukarıdaki yöntemin yaptığı gibi iletilen nesneye bir şeyler yapması amaçlanıyorsa, `NullPointerException`'ı fırlatmak uygundur çünkü bu bir programcı hatasıdır ve programcının hata ayıklama amacıyla bu bilgiye ihtiyacı olacaktır. Yöntemin mantığının bir sonucu olarak fırlatılan `NullPointerException`'lara ek olarak, yöntem argümanlarını `null` değerler açısından da kontrol edebilir ve bir yöntemin başına aşağıdakine benzer bir şey ekleyerek NPE'leri açıkça fırlatabilirsiniz: ``` // obj null ise özel bir hata mesajıyla NPE fırlatır Objects.requireNonNull(obj, "obj null olmamalıdır"); ``` Hata mesajınızda hangi nesnenin `null` olamayacağını açıkça belirtmenin yararlı olduğunu unutmayın. Bunu doğrulamanın avantajı, 1) kendi daha net hata mesajlarınızı döndürebilmeniz ve 2) yöntemin geri kalanı için `obj` yeniden atanmadığı sürece `null` olmadığını ve güvenli bir şekilde referansının kaldırılabileceğini bilmenizdir. Alternatif olarak, yöntemin amacının yalnızca iletilen nesne üzerinde çalışmak olmadığı ve bu nedenle null bir parametrenin kabul edilebilir olduğu durumlar olabilir. Bu durumda, null bir parametreyi kontrol etmeniz ve farklı davranmanız gerekir. Bunu belgelerde de açıklamalısınız. Örneğin, `doSomething()` şu şekilde yazılabilir: ``` /** * @param obj ____ için isteğe bağlı bir foo. Null olabilir, bu durumda * sonuç ____ olacaktır. */ public void doSomething(SomeObject obj) { if(obj == null) { // Bir şeyler yap } else { // Başka bir şey yap } } ``` Son olarak, Yığın İzi kullanarak istisnayı ve nedenini nasıl belirleyeceğiniz: > İstisnanın programın erken sonlanmasına neden olmasını durdurmak için nedeni belirlemek için hangi yöntemler/araçlar kullanılabilir? Hata bulan Sonar, NPE'yi tespit edebilir. Sonar, JVM Dinamik tarafından neden olan null işaretçi istisnalarını yakalayabilir mi? Artık Java 14, NullPointerException'ın temel nedenini göstermek için yeni bir dil özelliği ekledi. Bu dil özelliği, 2006'dan beri SAP ticari JVM'nin bir parçası olmuştur. Java 14'te, aşağıdaki NullPointerException İstisna mesajı örneğidir: > "main" iş parçacığında java.lang.NullPointerException: "liste" null olduğu için "java.util.List.size()" çağrılamaz
135
In Raiders of the Lost Ark, at the Ark opening ceremony the Nazi troops brings the Ark of the Covenant to the top of the mountain as Belloq said something before opening the Ark. Then they took the sand from the Ark and suddenly spirits coming out from the Ark and they're all killed (except Indy and Marion) by the freed-spirits which came from the Ark. Meanwhile, Indy asks Marion to keep her eyes shut. They didn't see the Ark when it was opened, so they're survived. In that scene what I don't understand is how did Indy know not to look into the Ark when it was opened?
Kayıp Ark Avcıları'nda, Sandığın açılış töreninde Nazi birlikleri Sandığı dağın tepesine getirirken Belloq Sandığı açmadan önce bir şeyler söyledi. Sonra Sandıktan kum aldılar ve aniden Sandıktan ruhlar çıkmaya başladı ve Sandıktan çıkan serbest ruhlar tarafından hepsi öldürüldü (Indy ve Marion hariç). Bu sırada Indy, Marion'a gözlerini kapalı tutmasını söyler. Sandık açıldığında Sandığı görmezler, bu yüzden hayatta kalırlar. O sahnede anlamadığım şey, Indy'nin Sandık açıldığında içine bakmaması gerektiğini nasıl bildiğidir?
There was a deleted scene that explained it: A plot element involving the Ark of the Covenant was cut from the film and is only hinted at during the finale when the Ark is opened. Basically, there were 2 rules about the Ark not mentioned in the final cut of the film: * If you touch the Ark, you die * If you look at the Ark when it is opened, you die This is first explained in additional dialogue for the scene when Indy and Sallah visit Imam. Before translating the writings on the headpiece that give the height of the Staff of Ra, Imam warns Indy not to touch the Ark or look at it when it is opened. [Source] The next scene involving this Ark subplot is when Sallah and Indy remove the Ark from the Well of the Souls. When Sallah first sees it he reaches out to touch it. Indy stops him before he does and reminds him of Imam's warning. Then they insert long poles through each side of the Ark to lift it out of its crypt. [Source] Notice that nobody ever touches the Ark throughout the rest of the film until the finale. And from the Bible (King James Version): 1 Samuel 6:19: And he smote the men of Bethshemesh, because they had looked into the ark of the Lord, even he smote of the people fifty thousand and threescore and ten men... 2 Samuel 6:6-7 And when they came to Nachon's threshingfloor, Uzzah put forth his hand to the ark of God, and took hold of it; for the oxen shook it. And the anger of the Lord was kindled against Uzzah; and God smote him there for his error; and there he died by the ark of God.
Bunu açıklayan silinmiş bir sahne vardı: Ahit Sandığı'nı içeren bir olay örgüsü filmden çıkarıldı ve sadece finalde Sandık açıldığında ima edildi. Temel olarak, filmin son halinde bahsedilmeyen Sandık hakkında 2 kural vardı: * Sandığa dokunursan ölürsün * Sandık açıldığında ona bakarsan ölürsün Bu ilk olarak Indy ve Sallah'ın İmam'ı ziyaret ettiği sahne için eklenen diyalogda açıklandı. Ra Asası'nın yüksekliğini veren başlığın üzerindeki yazıları tercüme etmeden önce İmam, Indy'yi Sandığa dokunmaması veya açıldığında ona bakmaması konusunda uyarır. [Kaynak] Bu Sandık alt konusunu içeren bir sonraki sahne, Sallah ve Indy'nin Sandığı Ruhlar Kuyusu'ndan çıkardığı zamandır. Sallah onu ilk gördüğünde dokunmak için uzanır. Indy onu yapmadan önce durdurur ve İmam'ın uyarısını hatırlatır. Sonra Sandığı mezarından çıkarmak için her iki yanından uzun direkler sokarlar. [Kaynak] Filmin geri kalanında finaline kadar kimsenin Sandığa dokunmadığına dikkat edin. Ve İncil'den (King James Versiyonu): 1 Samuel 6:19: Ve Bethshemesh adamlarını vurdu, çünkü Rab'bin sandığına bakmışlardı, halktan elli bin altmış on adamı vurdu... 2 Samuel 6:6-7 Ve Nachon'un harman yerine geldiklerinde, Uzzah Tanrı'nın sandığına elini uzattı ve onu tuttu; çünkü öküzler onu salladı. Ve Rab'bin öfkesi Uzzah'a yandı; ve Tanrı onu orada hatası yüzünden vurdu; ve orada Tanrı'nın sandığının yanında öldü.
136
What is likely to happen when you plug two ends of a network cable to a single switch/router? Will this create problems on the network, or just be ignored?
Bir ağ kablosunun iki ucunu tek bir anahtar/yönlendiriciye taktığınızda ne olması muhtemeldir? Bu ağda sorunlara neden olur mu yoksa sadece göz ardı mı edilir?
It depends on the router/switch. If it's "Managed" - Like decent Netgear, Cisco or HP Procurve, or has STP (Spanning Tree Protocol) or one of its variants enabled, there's a few seconds of absolute insanity, then the switch realises that there's a loop in the network topology, and blocks one of the ports. (I've only described the STP re-convergence as "absolute insanity" because if you're using old-style, slow, STP then re-convergence can take 30s or more, depending on network complexity. Vendor specific STP extensions such as BackboneFast and so on will decrease this, but you might still end up with a short period of a slightly unstable network. Rapid STP is a lot quicker to converge, due to a different algorithm) If it's "Unmanaged"- Like pretty much all SOHO grade gear, and a fair proportion of small 4-8 port switches, then all hell breaks loose, as you've just created a loop in a network, and all the traffic tends to just bounce about inside the loop. The reason this happens is because switches rely on a process of MAC address learning to map MAC addresses to physical ports. In a non-looped network, one MAC address will only be visible to the switch on a given physical port. If you have a loop, then the switch will see multiple paths to the same MAC address, and possibly multiple MAC addresses on multiple ports, so instead of the traffic being switched efficiently, it will be broadcast to wherever it sees the MACs. This is known as a "Broadcast Storm". This can quickly use up all of a switch's CPU power, fill the transmit and receive buffers, as well as polluting the MAC address table. Basically, if you create a loop in the network, you'll know about it, either through monitoring (detecting a change in the STP topology [you do have monitoring, right?]), or in everything falling over dramatically. If you look at a switch that has a broadcast storm on it, you tend to find that all of the port activity lights are blinking all at the same time.
Bu yönlendirici/anahtara bağlıdır. "Yönetilen" ise - Netgear, Cisco veya HP Procurve gibi iyi bir cihazsa veya STP (Spanning Tree Protocol) veya varyantlarından biri etkinleştirilmişse, birkaç saniyelik tam bir çılgınlık olur, ardından anahtar ağ topolojisinde bir döngü olduğunu fark eder ve bağlantı noktalarından birini engeller. (STP yeniden birleşmesini "tam bir çılgınlık" olarak tanımladım çünkü eski tip, yavaş STP kullanıyorsanız, ağ karmaşıklığına bağlı olarak yeniden birleşme 30 saniye veya daha fazla sürebilir. BackboneFast gibi satıcıya özel STP uzantıları bunu azaltacaktır, ancak yine de kısa bir süreliğine biraz dengesiz bir ağla karşılaşabilirsiniz. Hızlı STP, farklı bir algoritma nedeniyle birleşmek için çok daha hızlıdır) "Yönetilmeyen" ise - hemen hemen tüm SOHO sınıfı donanımlar ve 4-8 bağlantı noktalı küçük anahtarların adil bir kısmı gibi, ağda bir döngü oluşturduğunuz için tüm cehennem boşalır ve tüm trafik döngünün içinde sıçrar. Bunun gerçekleşmesinin nedeni, anahtarların MAC adreslerini fiziksel bağlantı noktalarına eşlemek için MAC adresi öğrenme sürecine güvenmesidir. Döngü olmayan bir ağda, bir MAC adresi yalnızca belirli bir fiziksel bağlantı noktasındaki anahtar tarafından görülebilir. Bir döngünüz varsa, anahtar aynı MAC adresine birden fazla yol ve muhtemelen birden fazla bağlantı noktasında birden fazla MAC adresi görecektir, bu nedenle trafik verimli bir şekilde değiştirilmek yerine MAC'leri gördüğü her yere yayınlanacaktır. Buna "Yayın Fırtınası" denir. Bu, bir anahtarın tüm CPU gücünü hızla tüketebilir, aktarım ve alma arabelleklerini doldurabilir ve MAC adresi tablosunu kirletebilir. Temel olarak, ağda bir döngü oluşturursanız, bunu ya izleme yoluyla (STP topolojisinde bir değişiklik tespit ederek [izleme yapıyorsunuz, değil mi?]) ya da her şeyin dramatik bir şekilde çökmesiyle anlayacaksınız. Yayın fırtınası olan bir anahtara bakarsanız, tüm bağlantı noktası etkinlik ışıklarının aynı anda yanıp söndüğünü görürsünüz.
137
What command do I use to find the size of all the files (recursively) in a Linux or Mac OS X directory?
Linux veya Mac OS X dizinindeki tüm dosyaların boyutunu (yinelemeli olarak) bulmak için hangi komutu kullanırım?
The BSD version of ```du``` used in OS X reports size with 512-byte blocks -- the sizes are essentially rounded up to the next 512-byte value. This tells you the space on disk, which is larger than the amount of data. If you have a lot of small files, the difference can be large. Here's an example. This is the value with regular ```du```. It's in 512-byte blocks: ```$ du -s 248 . ``` The ```-h``` flag results in a more readable number, in kilobytes. As expected, it's half the number of 512-byte blocks: ```$ du -hs 124K . ``` Finally, you can use ```find``` and ```awk``` to give you the sum of actual bytes in the files. This is kind of slow, but it works: ```$ find . -type f -exec ls -l {} \; | awk '{sum += $5} END {print sum}' 60527 ``` This value matches exactly the number reported by Finder's Get Info window. (There are no weird forks or xattrs in this set of files.) It's significantly smaller than the value reported by ```du```. Here's how it works: it gets a list of all the files, and passes them to ```ls -l```; then ```awk``` is used to count up the bytes. The ```-type f``` flag is there so that only files (and not directories) get sent to ```ls```. Without that flag, it'll also send directory names to ```ls```, and each file will be listed twice : once as an individual file, and once as an item in the directory. The GNU version of ```du``` can give values in actual bytes instead of blocks. It's unfortunate that the BSD version of ```du``` is not as flexible.
OS X'te kullanılan ```du```'nun BSD sürümü boyutu 512 baytlık bloklarla bildirir -- boyutlar esasen bir sonraki 512 baytlık değere yuvarlanır. Bu size diskteki alanı söyler, bu da veri miktarından daha büyüktür. Çok sayıda küçük dosyanız varsa, fark büyük olabilir. İşte bir örnek. Bu, normal ```du``` ile elde edilen değerdir. 512 baytlık bloklar halindedir: ```$ du -s 248 . ``` ```-h``` bayrağı, kilobayt cinsinden daha okunaklı bir sayı ile sonuçlanır. Beklendiği gibi, 512 baytlık blokların sayısının yarısıdır: ```$ du -hs 124K . ``` Son olarak, dosyalardaki gerçek baytların toplamını size vermek için ```find``` ve ```awk``` kullanabilirsiniz. Bu biraz yavaştır, ancak işe yarar: ```$ find . -type f -exec ls -l {} \; | awk '{sum += $5} END {print sum}' 60527 ``` Bu değer, Finder'ın Bilgi Al penceresinin bildirdiği sayıyla tam olarak eşleşir. (Bu dosya kümesinde garip çatallar veya xattr'ler yoktur.) ```du``` tarafından bildirilen değerden önemli ölçüde daha küçüktür. İşte nasıl çalıştığı: tüm dosyaların bir listesini alır ve bunları ```ls -l```'ye iletir; ardından ```awk``` baytları saymak için kullanılır. ```-type f``` bayrağı, yalnızca dosyaların (dizinlerin değil) ```ls```'ye gönderilmesi için oradadır. Bu bayrak olmadan, dizin adlarını da ```ls```'ye gönderecek ve her dosya iki kez listelenecektir: bir kez tek bir dosya olarak ve bir kez de dizindeki bir öğe olarak. ```du```'nun GNU sürümü, bloklar yerine gerçek bayt cinsinden değerler verebilir. ```du```'nun BSD sürümünün bu kadar esnek olmaması talihsizdir.
138
I've been writing C and C++ code for almost twenty years, but there's one aspect of these languages that I've never really understood. I've obviously used regular casts i.e. ```MyClass *m = (MyClass *)ptr; ``` all over the place, but there seem to be two other types of casts, and I don't know the difference. What's the difference between the following lines of code? ```MyClass *m = (MyClass *)ptr; MyClass *m = static_cast(ptr); MyClass *m = dynamic_cast(ptr); ```
Yaklaşık yirmi yıldır C ve C++ kodu yazıyorum, ancak bu dillerin hiç anlamadığım bir yönü var. Açıkçası her yerde normal dönüşümleri kullandım, yani ```MyClass *m = (MyClass *)ptr; ``` Ancak iki tür dönüşüm daha varmış gibi görünüyor ve farkını bilmiyorum. Aşağıdaki kod satırları arasındaki fark nedir? ```MyClass *m = (MyClass *)ptr; MyClass *m = static_cast(ptr); MyClass *m = dynamic_cast(ptr); ```
## static_cast `static_cast` is used for cases where you basically want to reverse an implicit conversion, with a few restrictions and additions. `static_cast` performs no runtime checks. This should be used if you know that you refer to an object of a specific type, and thus a check would be unnecessary. Here is an example: ``` void func(void *data) { // Conversion from MyClass* -> void* is implicit MyClass *c = static_cast<MyClass*>(data); ... } int main() { MyClass c; start_thread(&func, &c) // func(&c) will be called .join(); } ``` In this example, you know that you passed a `MyClass` object, and thus there isn't any need for a runtime check to ensure this. ## dynamic_cast `dynamic_cast` is useful when you don't know what the dynamic type of the object is. It returns a null pointer if the object referred to doesn't contain the type casted to as a base class (when you cast to a reference, a `bad_cast` exception is thrown in that case). ``` if (JumpStm *j = dynamic_cast<JumpStm*>(&stm)) { ... } else if (ExprStm *e = dynamic_cast<ExprStm*>(&stm)) { ... } ``` An "up-cast" (cast to the base class) is always valid with both `static_cast` and `dynamic_cast`, and also without any cast, as an "up-cast" is an implicit conversion (assuming the base class is accessible, i.e. it's a `public` inheritance). ## Regular Cast These casts are also called C-style cast. A C-style cast is basically identical to trying out a range of sequences of C++ casts, and taking the first C++ cast that works, without ever considering `dynamic_cast`. Needless to say, this is much more powerful as it combines all of `const_cast`, `static_cast` and `reinterpret_cast`, but it's also unsafe, because it does not use `dynamic_cast`. In addition, C-style casts not only allow you to do this, but they also allow you to safely cast to a private base-class, while the "equivalent" `static_cast` sequence would give you a compile-time error for that. Some people prefer C-style casts because of their brevity. I use them for numeric casts only, and use the appropriate C++ casts when user defined types are involved, as they provide stricter checking.
## static_cast `static_cast` birkaç kısıtlama ve eklemeyle örtük dönüşümü tersine çevirmek istediğiniz durumlarda kullanılır. `static_cast` çalışma zamanı denetimi yapmaz. Bu, belirli bir türdeki bir nesneye başvurduğunuzu bildiğinizde ve bu nedenle bir denetimin gereksiz olacağı durumlarda kullanılmalıdır. İşte bir örnek: ``` void func(void *data) { // MyClass* -> void* dönüşümü örtüktür MyClass *c = static_cast<MyClass*>(data); ... } int main() { MyClass c; start_thread(&func, &c) // func(&c) çağrılacak .join(); } ``` Bu örnekte, bir `MyClass` nesnesi geçirdiğinizi biliyorsunuz ve bu nedenle bunu sağlamak için bir çalışma zamanı denetimine gerek yok. ## dynamic_cast `dynamic_cast`, nesnenin dinamik türünün ne olduğunu bilmediğinizde kullanışlıdır. Başvurulan nesne, temel sınıf olarak dönüştürülen türü içermiyorsa null bir işaretçi döndürür (bir referansa dönüştürdüğünüzde, bu durumda bir `bad_cast` istisnası atılır). ``` if (JumpStm *j = dynamic_cast<JumpStm*>(&stm)) { ... } else if (ExprStm *e = dynamic_cast<ExprStm*>(&stm)) { ... } ``` Bir "yukarı dönüştürme" (temel sınıfa dönüştürme), hem `static_cast` hem de `dynamic_cast` ile ve ayrıca herhangi bir dönüştürme olmadan her zaman geçerlidir, çünkü "yukarı dönüştürme" örtük bir dönüşümdür (temel sınıfın erişilebilir olduğunu varsayarak, yani bir `public` kalıtım). ## Normal Dönüştürme Bu dönüştürmelere C tarzı dönüştürme de denir. Bir C tarzı dönüştürme, temelde bir dizi C++ dönüştürme dizisini denemeye ve `dynamic_cast`'ı hiç dikkate almadan çalışan ilk C++ dönüştürmeyi almaya eşdeğerdir. Söylemeye gerek yok, bu, `const_cast`, `static_cast` ve `reinterpret_cast`'ın tümünü birleştirdiği için çok daha güçlüdür, ancak `dynamic_cast` kullanmadığı için güvenli değildir. Ayrıca, C tarzı dönüştürmeler yalnızca bunu yapmanıza izin vermekle kalmaz, aynı zamanda "eşdeğer" `static_cast` dizisi size derleme zamanı hatası verecekken, güvenli bir şekilde özel bir temel sınıfa dönüştürmenize de olanak tanır. Bazı insanlar, kısalığı nedeniyle C tarzı dönüştürmeleri tercih eder. Bunları yalnızca sayısal dönüştürmeler için kullanırım ve kullanıcı tanımlı türler söz konusu olduğunda daha katı denetim sağladıkları için uygun C++ dönüştürmelerini kullanırım.
139
Why don't toilets use saltwater?
Neden tuvaletler tuzlu su kullanmaz?
The main answer is logistical. Building a network of pipes to convey water to houses is a major effort, and most places where that's been done found it extremely expensive. Providing a second set of pipes to bring salt water to houses would probably cost about the same. Except that cities go to considerable lengths to put their water reservoirs above the city as far as possible so they don't have to use as much energy for pumping. The few cities with seawater above them pay a lot to pump water out. A minor secondary problem is that sewage treatment plants are fairly heavily biological. They grow things in the sewage to break it down. But most of those things won't grow in salt water. It's already a challenge keeping toxic chemicals out of the sewage. For this to work it might be necessary to add a second set of sewer pipes to carry the water away, and develop new methods of treating that salty sewage (the treated sewage couldn't be spread on farmland, for example). It would be far simpler, cheaper and more reliable to simply buy everyone a composting toilet to replace each toilet they currently have. As a halfway measure, mandating more economical toilets would help, as would education campaigns like the ones encouraging people not to flush at all when they urinate. Even with a sensible cistern that has a 2 litre &quot;half flush&quot;, that's two litres wasted every time someone pees. Additionally, salt is not good for pipes. A lot of pipes, even today, are clay or concrete, and salt water is bad for both of these. It's not impossible to get around that, just expensive.
Ana cevap lojistiktir. Evlere su taşımak için boru ağı kurmak büyük bir çabadır ve bunu yapan çoğu yer bunu son derece pahalı bulmuştur. Evlere tuzlu su getirmek için ikinci bir boru seti sağlamak muhtemelen aynı maliyete mal olacaktır. Şehirler, pompalama için çok fazla enerji kullanmak zorunda kalmamak için su rezervuarlarını mümkün olduğunca şehrin üzerine koymak için epeyce çaba sarf ediyor. Üzerinde deniz suyu bulunan birkaç şehir, suyu dışarı pompalamak için çok para ödüyor. Küçük bir ikincil sorun, atık su arıtma tesislerinin oldukça biyolojik olmasıdır. Bunlar, atık suyu parçalamak için içinde şeyler yetiştirirler. Ancak bu şeylerin çoğu tuzlu suda yetişmez. Zehirli kimyasalları atık sudan uzak tutmak zaten bir sorundur. Bunun işe yaraması için, suyu uzaklaştırmak için ikinci bir kanalizasyon borusu seti eklemek ve bu tuzlu atık suyu arıtmanın yeni yöntemlerini geliştirmek gerekebilir (örneğin, arıtılmış atık su tarım arazisine yayılamaz). Herkes için şu anda sahip oldukları her tuvaleti değiştirecek bir kompost tuvaleti satın almak çok daha basit, ucuz ve daha güvenilir olacaktır. Yarı yarıya bir önlem olarak, daha ekonomik tuvaletleri zorunlu kılmak yardımcı olacaktır, tıpkı insanları idrar yaptıklarında hiç sifonu çekmemeleri için teşvik edenler gibi eğitim kampanyaları da yardımcı olacaktır. 2 litrelik "yarım sifonu" olan mantıklı bir sarnıçla bile, biri her işediğinde iki litre israf ediliyor. Ek olarak, tuz borular için iyi değildir. Bugün bile birçok boru kilden veya betondan yapılmıştır ve tuzlu su bu ikisi için de kötüdür. Bunu aşmak imkansız değil, sadece pahalı.
140
How do I modify fields inside the new PostgreSQL JSON datatype?
Yeni PostgreSQL JSON veri türü içindeki alanları nasıl değiştiririm?
With Postgresql 9.5 it can be done by following- ```UPDATE test SET data = data - 'a' || '{"a":5}' WHERE data->>'b' = '2'; ``` OR ```UPDATE test SET data = jsonb_set(data, '{a}', '5'::jsonb); ``` Somebody asked how to update many fields in jsonb value at once. Suppose we create a table: ```CREATE TABLE testjsonb ( id SERIAL PRIMARY KEY, object JSONB ); ``` Then we INSERT a experimental row: ```INSERT INTO testjsonb VALUES (DEFAULT, '{"a":"one", "b":"two", "c":{"c1":"see1","c2":"see2","c3":"see3"}}'); ``` Then we UPDATE the row: ```UPDATE testjsonb SET object = object - 'b' || '{"a":1,"d":4}'; ``` Which does the following: * Updates the a field * Removes the b field * Add the d field Selecting the data: ```SELECT jsonb_pretty(object) FROM testjsonb; ``` Will result in: ``` jsonb_pretty ------------------------- { + "a": 1, + "c": { + "c1": "see1", + "c2": "see2", + "c3": "see3", + }, + "d": 4 + } (1 row) ``` To update field inside, Dont use the concat operator ```||```. Use jsonb_set instead. Which is not simple: ```UPDATE testjsonb SET object = jsonb_set(jsonb_set(object, '{c,c1}','"seeme"'),'{c,c2}','"seehim"'); ``` Using the concat operator for {c,c1} for example: ```UPDATE testjsonb SET object = object || '{"c":{"c1":"seedoctor"}}'; ``` Will remove {c,c2} and {c,c3}. For more power, seek power at postgresql json functions documentation. One might be interested in the ```#-``` operator, ```jsonb_set``` function and also ```jsonb_insert``` function.
Postgresql 9.5 ile aşağıdakileri uygulayarak yapılabilir- ```UPDATE test SET data = data - 'a' || '{"a":5}' WHERE data->>'b' = '2'; ``` VEYA ```UPDATE test SET data = jsonb_set(data, '{a}', '5'::jsonb); ``` Birisi jsonb değerindeki birçok alanı bir kerede nasıl güncelleyeceğini sordu. Bir tablo oluşturacağımızı varsayalım: ```CREATE TABLE testjsonb ( id SERIAL PRIMARY KEY, object JSONB ); ``` Ardından deneysel bir satır EKLERİZ: ```INSERT INTO testjsonb VALUES (DEFAULT, '{"a":"one", "b":"two", "c":{"c1":"see1","c2":"see2","c3":"see3"}}'); ``` Ardından satırı GÜNCELLEME: ```UPDATE testjsonb SET object = object - 'b' || '{"a":1,"d":4}'; ``` Bu aşağıdakileri yapar: * a alanını günceller * b alanını kaldırır * d alanını ekler Verileri seçme: ```SELECT jsonb_pretty(object) FROM testjsonb; ``` Sonuç şu şekilde olacaktır: ``` jsonb_pretty ------------------------- { + "a": 1, + "c": { + "c1": "see1", + "c2": "see2", + "c3": "see3", + }, + "d": 4 + } (1 row) ``` İçindeki alanı güncellemek için birleştirme operatörü ```||``` kullanmayın. Bunun yerine jsonb_set kullanın. Bu basit değildir: ```UPDATE testjsonb SET object = jsonb_set(jsonb_set(object, '{c,c1}','"seeme"'),'{c,c2}','"seehim"'); ``` Örneğin {c,c1} için birleştirme operatörünü kullanma: ```UPDATE testjsonb SET object = object || '{"c":{"c1":"seedoctor"}}'; ``` {c,c2} ve {c,c3} öğelerini kaldıracaktır. Daha fazla güç için postgresql json işlevleri belgelerinde güç arayın. Birisi ```#-``` operatörü, ```jsonb_set``` işlevi ve ayrıca ```jsonb_insert``` işleviyle ilgilenebilir.
141
I find that the survivability and general performance of my party increases massively from levels 1 to 2. At times, level 1 feels like a completely different game from level 2. However, I can't fathom how or why. I think that the availability of healing has something to do with it. From a mechanical perspective, is there any deep reason why level 1 and level 2 seem so radically different? Furthermore, why I do find no similar differences between later levels, such as 6 and 7?
Partimdeki hayatta kalma ve genel performansın 1. seviyeden 2. seviyeye kadar büyük ölçüde arttığını görüyorum. Bazen 1. seviye, 2. seviyeden tamamen farklı bir oyun gibi hissettiriyor. Ancak nasıl veya neden olduğunu anlayamıyorum. Bunun iyileştirme olanaklarıyla bir ilgisi olduğunu düşünüyorum. Mekanik bir bakış açısından, 1. seviye ve 2. seviyenin neden bu kadar kökten farklı göründüğüne dair derin bir neden var mı? Dahası, neden 6 ve 7 gibi sonraki seviyeler arasında benzer farklılıklar bulamıyorum?
Welcome to Rusty Dagger Shanktown! What you have noticed is very widely commented upon—1st level is often called “rusty dagger shanktown.” It’s hyper-lethal, rather than the kind of heroic fantasy Dungeons & Dragons pitches itself as. It is very, very difficult for 1st-level PCs to actually really adventure at all. Many, many groups avoid 1st for this reason (many skip 2nd too, even though it is already dramatically different). Personally, I’ll include 1st level often, but the PCs basically always level-up to 2nd almost entirely on roleplaying XP. Note that this isn’t unique to 3.5e; it goes back to the earliest days of D&D. Pathfinder, of course, inherited it from 3.5e (I don’t know about PF 2e). It’s also very much still true in 5e—after 4e actually managed to avoid it, which may mean that this is considered a “feature” by some, enough that Wizards of the Coast felt the need to restore it as part of 5e’s general “return to form” after the divisive fourth edition. Anyway, the primary causes of rusty dagger shanktown: Hit points Almost anyone can one-shot almost any 1st-level character. It’s very, very easy to have 6 hp in a world where a decent, but basic, weapon’s base damage averages 7. Even smaller weapons can easily deal that much damage, either through luck or skill. We expect 1st-level characters to often go down in one hit. A 2nd-level character can have nearly twice as much hp. Actually, could easily be twice as much, if they multiclass from a small-HD class to a large-HD class. That drastically changes the game, because suddenly you can feel reasonably confident that you aren’t going to just suddenly die before anyone can do anything. Healing actually becomes relevant, where at 1st it’s often too little, too late. Notably, this only has this effect because damage doesn’t grow at the same rate. The base damage of weapons is fixed, and ability scores start at double digits but grow very slowly from there. That’s the biggest chunk of early damage for most characters. Even beyond that, a lot of damage boosts—inspire courage, rage, sneak attack—come at 1st anyway. And monsters tend to kind of mirror these trends. So what ends up happening is that a 1st-level character can’t really take a chance in order to get something accomplished. A 2nd-level character can feel reasonably comfortable taking a chance at least once. That dramatically affects the style of play. At 2nd-level D&D literally feels like a different game. Really, it is a different game. Wealth Characters start with less than 200 gp worth of gear. That’s not enough for a masterwork weapon, not enough even for non-masterwork medium or heavy armors, definitely not enough for any kind of magic item beyond maybe an extremely basic consumable. No 1st-level character has even their complete basic kit yet. The expected wealth of a 2nd-level character is 900 gp. That can afford masterwork armor of anything short of full-plate, and for many armors leave enough left over for a masterwork weapon. Most importantly, that is enough money for a party of 4 to trivially afford a wand of cure light wounds. A wand of cure light wounds is a game-changer. It means you can easily start every fight at full hp. And with 2nd-level hp, that means you can actually take a few risks. 2nd-level features This varies considerably from one class to the next, but several classes get major class features at 2nd level. The paladin’s 2nd-level feature, divine grace, might be the single greatest class feature in the game (assuming we don’t count “spells” and the like as a singular feature). Rangers don’t get their combat style until 2nd. Bards get 1st-level spells at 2nd (though inspire courage from 1st level is probably more important). Outside of core, meldshapers don’t get any chakra binds until 2nd, which can leave them with zero offense at 1st. Swordsages don’t get Wis-to-AC until 2nd. But plenty of characters are fine from 1st, so this can vary a lot.
Rusty Dagger Shanktown'a hoş geldiniz! Fark ettiğiniz şey çok yaygın bir şekilde yorumlanıyor—1. seviye genellikle "rusty dagger shanktown" olarak adlandırılıyor. Kahramanca fantezi Dungeons & Dragons'un kendini sunduğu türden ziyade aşırı ölümcül. 1. seviye PC'lerin gerçekten maceraya atılması çok, çok zor. Birçok, birçok grup bu nedenle 1. seviyeyi atlıyor (hatta birçokları 2. seviyeyi de atlıyor, çok farklı olmasına rağmen). Ben şahsen 1. seviyeyi sıklıkla dahil ediyorum, ancak PC'ler temelde her zaman rol yapma XP'siyle 2. seviyeye yükseliyor. Bunun 3.5e'ye özgü olmadığını unutmayın; D&D'nin en eski günlerine kadar uzanıyor. Pathfinder elbette bunu 3.5e'den devraldı (PF 2e hakkında bir bilgim yok). 5e'de de hala çok geçerli—4e'nin bunu gerçekten başardıktan sonra, bunun bazıları tarafından bir "özellik" olarak kabul edildiği anlamına gelebilir, Wizards of the Coast'un bunu bölücü dördüncü baskıdan sonra 5e'nin genel "forma dönüşü"nün bir parçası olarak geri getirme ihtiyacı hissettiği kadar. Neyse, rusty dagger shanktown'un birincil nedenleri: Can puanları Neredeyse herkes neredeyse her 1. seviye karakteri tek atışta öldürebilir. Ortalama 7 olan iyi, ancak temel bir silahın temel hasarının olduğu bir dünyada 6 can puanına sahip olmak çok, çok kolay. Daha küçük silahlar bile şans veya beceri yoluyla kolayca bu kadar hasar verebilir. 1. seviye karakterlerin genellikle tek vuruşta yere düşmesini bekliyoruz. 2. seviye bir karakter neredeyse iki kat daha fazla can puanına sahip olabilir. Aslında, küçük bir HD sınıfından büyük bir HD sınıfına çoklu sınıf yaparlarsa kolayca iki katı kadar olabilir. Bu oyunu kökten değiştirir, çünkü aniden birdenbire kimse bir şey yapamadan ölmeyeceğinize dair makul bir güven duyabilirsiniz. İyileştirme aslında önemli hale gelir, 1. seviyede genellikle çok az ve çok geçtir. Özellikle, bu yalnızca hasar aynı oranda büyümediği için bu etkiye sahiptir. Silahların temel hasarı sabittir ve yetenek puanları iki haneli sayılardan başlar ancak oradan çok yavaş büyür. Bu, çoğu karakter için erken hasarın en büyük kısmıdır. Bunun ötesinde bile, birçok hasar artışı—cesaretlendirme, öfke, sinsice saldırı—her neyse 1. seviyede gelir. Ve canavarlar da bu eğilimleri yansıtma eğilimindedir. Yani sonuçta olan şey, bir 1. seviye karakterin bir şeyleri başarmak için gerçekten bir şans alamamasıdır. 2. seviye bir karakter en az bir kez şansını denemek konusunda makul bir şekilde rahat hissedebilir. Bu, oyun tarzını önemli ölçüde etkiler. 2. seviye D&D kelimenin tam anlamıyla farklı bir oyun gibi hissettirir. Gerçekten, bu farklı bir oyundur. Zenginlik Karakterler 200 gp'den az değerinde teçhizatla başlar. Bu, bir şaheser silah için yeterli değil, şaheser olmayan orta veya ağır zırhlar için bile yeterli değil, kesinlikle son derece temel bir sarf malzemesinin ötesinde herhangi bir sihirli eşya için yeterli değil. Hiçbir 1. seviye karakterin henüz tam temel kiti bile yok. 2. seviye bir karakterin beklenen serveti 900 gp'dir. Bu, tam plakadan daha kısa her şeyin şaheser zırhını karşılayabilir ve birçok zırh için bir şaheser silah için yeterince fazla kalır. En önemlisi, bu, 4 kişilik bir partinin önemsiz bir şekilde hafif yara iyileştirme değneği alabilmesi için yeterli paradır. Hafif yara iyileştirme değneği oyunun kurallarını değiştirir. Bu, her savaşa kolayca tam can puanıyla başlayabileceğiniz anlamına gelir. Ve 2. seviye can puanıyla, bu aslında birkaç risk alabileceğiniz anlamına gelir. 2. seviye özellikleri Bu, bir sınıftan diğerine önemli ölçüde değişir, ancak birkaç sınıf 2. seviyede önemli sınıf özelliklerine sahip olur. Paladin'in 2. seviye özelliği olan ilahi lütuf, oyundaki en büyük sınıf özelliği olabilir ("büyüler" ve benzerlerini tekil bir özellik olarak saymazsak). Korucular 2. seviyeye kadar dövüş stillerini alamazlar. Ozanlar 2. seviyede 1. seviye büyüler alırlar (yine de 1. seviyeden cesaretlendirme muhtemelen daha önemlidir). Çekirdeğin dışında, şekil değiştiriciler 2. seviyeye kadar herhangi bir çakra bağı alamazlar, bu da onları 1. seviyede sıfır saldırı gücüyle bırakabilir. Kılıç ustaları 2. seviyeye kadar Wis-to-AC alamazlar. Ancak birçok karakter 1. seviyeden itibaren iyidir, bu nedenle bu çok değişebilir.
142
In my table view I have to scroll to the top. But I cannot guarantee that the first object is going to be section 0, row 0. May be that my table view will start from section number 5. So I get an exception, when I call: ```[mainTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; ``` Is there another way to scroll to the top of table view?
Tablo görünümümde en üste kaydırmam gerekiyor. Ancak ilk nesnenin 0. bölüm, 0. satır olacağını garanti edemem. Belki de tablo görünümüm 5. bölüm numarasından başlayacaktır. Bu nedenle şu çağrıyı yaptığımda bir istisna alıyorum: ```[mainTableView scrollToRowAtIndexPath:[NSIndexPath indexPathForRow:0 inSection:0] atScrollPosition:UITableViewScrollPositionTop animated:NO]; ``` Tablo görünümünün en üstüne kaydırmanın başka bir yolu var mı?
Possible Actions: 1 ```func scrollToFirstRow() { let indexPath = NSIndexPath(forRow: 0, inSection: 0) self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: true) } ``` 2 ```func scrollToLastRow() { let indexPath = NSIndexPath(forRow: objects.count - 1, inSection: 0) self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Bottom, animated: true) } ``` 3 ```func scrollToSelectedRow() { let selectedRows = self.tableView.indexPathsForSelectedRows if let selectedRow = selectedRows?[0] as? NSIndexPath { self.tableView.scrollToRowAtIndexPath(selectedRow, atScrollPosition: .Middle, animated: true) } } ``` 4 ```func scrollToHeader() { self.tableView.scrollRectToVisible(CGRect(x: 0, y: 0, width: 1, height: 1), animated: true) } ``` 5 ```func scrollToTop(){ self.tableView.setContentOffset(CGPointMake(0, UIApplication.sharedApplication().statusBarFrame.height ), animated: true) } ``` Disable Scroll To Top: ```func disableScrollsToTopPropertyOnAllSubviewsOf(view: UIView) { for subview in view.subviews { if let scrollView = subview as? UIScrollView { (scrollView as UIScrollView).scrollsToTop = false } self.disableScrollsToTopPropertyOnAllSubviewsOf(subview as UIView) } } ``` Modify and use it as per requirement. Swift 4 ``` func scrollToFirstRow() { let indexPath = IndexPath(row: 0, section: 0) self.tableView.scrollToRow(at: indexPath, at: .top, animated: true) } ```
Olası Eylemler: 1 ```func scrollToFirstRow() { let indexPath = NSIndexPath(forRow: 0, inSection: 0) self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Top, animated: true) } ``` 2 ```func scrollToLastRow() { let indexPath = NSIndexPath(forRow: objects.count - 1, inSection: 0) self.tableView.scrollToRowAtIndexPath(indexPath, atScrollPosition: .Bottom, animated: true) } ``` 3 ```func scrollToSelectedRow() { let selectedRows = self.tableView.indexPathsForSelectedRows if let selectedRow = selectedRows?[0] as? NSIndexPath { self.tableView.scrollToRowAtIndexPath(selectedRow, atScrollPosition: .Middle, animated: true) } } ``` 4 ```func scrollToHeader() { self.tableView.scrollRectToVisible(CGRect(x: 0, y: 0, width: 1, height: 1), animated: true) } ``` 5 ```func scrollToTop(){ self.tableView.setContentOffset(CGPointMake(0, UIApplication.sharedApplication().statusBarFrame.height ), animated: true) } ``` En Üste Kaydırmayı Devre Dışı Bırak: ```func disableScrollsToTopPropertyOnAllSubviewsOf(view: UIView) { for subview in view.subviews { if let scrollView = subview as? UIScrollView { (scrollView as UIScrollView).scrollsToTop = false } self.disableScrollsToTopPropertyOnAllSubviewsOf(subview as UIView) } } ``` İhtiyaca göre değiştirin ve kullanın. Swift 4 ``` func scrollToFirstRow() { let indexPath = IndexPath(row: 0, section: 0) self.tableView.scrollToRow(at: indexPath, at: .top, animated: true) } ```
143
While in Phd I developed a lot of code that I want to turn into start-up. Can I do this?
Doktora yaparken başlangıç ​​aşamasına dönüştürmek istediğim birçok kod geliştirdim. Bunu yapabilir miyim?
I'm not aware of any blanket prohibition, anywhere, that say that you can't use code developed during a PhD for a commercial venture - but most Universities in the US will have some kind of intellectual property agreement in place to state what the process is for doing this. You will need to check with officials at your University to see what agreements you are subject to - but you should go a step farther than this. Specifically, you should see what departments might exist that can actually help you. In the US at least - and I'm sure many other institutions around the world - there are departments specializing in intellectual property, "knowledge transfer", corporate spin-offs, start-ups, entrepreneurship, etc. These can be a rich source of support and networking, if they are available to you, even if you have intellectual property agreements that assign various rights to the University. Universities want to earn money for these projects, as I'm sure you do as well, and 100% of $0 is $0. Universities often heavily facilitate the process of converting this work into money, and it is not abnormal for even a place that has heavily restricted intellectual rights assignments agreements to assign use rights and royalty agreements that have zero cost for the first $200,000+ US dollars in income. There are often even startup grants available, accelerators (even if they are not called that - places that provide space and equipment to help starting businesses), introductions to investors, showcases, and more. You won't know until you ask and look for them, as where they are located tends to vary heavily by institution. For the exact nature of the agreements that apply to you, we can't say; I've seen everything from "the student owns their own work" to "anyone funded assigns all rights and ownership to the University", and I'm sure there are agreements everywhere in between. You are right to check them out in advance of a major decision, but this is so specific that you'll need to talk with multiple people are your specific institution to see what applies to you. You may also need to speak with an outside legal professional (lawyer experienced in this area, etc) to verify, but your local administrators are your best first point of contact to see how things work.
Hiçbir yerde, doktora sırasında geliştirilen kodun ticari bir girişim için kullanılamayacağını söyleyen genel bir yasağın olduğunun farkında değilim - ancak ABD'deki çoğu üniversitede bunu yapmak için bir tür fikri mülkiyet anlaşması olacaktır. Hangi anlaşmalara tabi olduğunuzu görmek için üniversitenizdeki yetkililerle görüşmeniz gerekecektir - ancak bundan bir adım daha ileri gitmelisiniz. Özellikle, size gerçekten yardımcı olabilecek hangi bölümlerin var olabileceğine bakmalısınız. En azından ABD'de - ve dünyanın dört bir yanındaki diğer birçok kurumda - fikri mülkiyet, "bilgi aktarımı", kurumsal yan kuruluşlar, yeni kurulan şirketler, girişimcilik vb. konularda uzmanlaşmış bölümler vardır. Üniversiteye çeşitli haklar veren fikri mülkiyet anlaşmalarınız olsa bile, bunlar mevcutsa zengin bir destek ve ağ oluşturma kaynağı olabilir. Üniversiteler bu projelerden para kazanmak istiyor, eminim siz de öyledir ve 0 doların %100'ü 0 dolardır. Üniversiteler genellikle bu işi paraya dönüştürme sürecini büyük ölçüde kolaylaştırır ve fikri hakları ciddi şekilde kısıtlayan fikri haklar atama anlaşmalarına sahip bir yerin bile ilk 200.000 ABD Doları gelir için kullanım hakları ve telif hakkı anlaşmaları ataması alışılmadık bir durum değildir. Hatta genellikle başlangıç ​​hibeleri, hızlandırıcılar (bu şekilde adlandırılmasalar bile - yeni işletmelere yardımcı olmak için alan ve ekipman sağlayan yerler), yatırımcılara tanıtımlar, vitrinler ve daha fazlası mevcuttur. Nerede bulundukları kuruma göre büyük ölçüde değiştiği için sorup arayana kadar bilemezsiniz. Sizin için geçerli olan anlaşmaların tam niteliği hakkında bir şey söyleyemeyiz; "Öğrenci kendi işinin sahibi"nden "finanse edilen herkes tüm hakları ve mülkiyeti üniversiteye devreder"e kadar her şeyi gördüm ve eminim aralarında her yerde anlaşmalar vardır. Büyük bir karar vermeden önce bunları kontrol etmekte haklısınız, ancak bu o kadar spesifik ki size neyin uygulandığını görmek için belirli kurumunuzdaki birden fazla kişiyle konuşmanız gerekecek. Doğrulamak için dışarıdan bir hukuk uzmanıyla (bu alanda deneyimli bir avukat vb.) konuşmanız da gerekebilir, ancak işlerin nasıl yürüdüğünü görmek için yerel yöneticileriniz en iyi ilk iletişim noktanızdır.
144
I have heard multiple times in photography, the words Bokeh, and Gaussian Blur. To me, it seems that the words are used almost interchangeably, but in some instances, I have heard them contrasted. What's the difference, and what are the definitions of each of them?
Fotoğrafçılıkta Bokeh ve Gauss Bulanıklığı kelimelerini birçok kez duydum. Bana göre bu kelimeler neredeyse birbirinin yerine kullanılsa da bazı durumlarda zıt anlamlı olarak kullanıldıklarını duydum. Aralarındaki fark nedir ve her birinin tanımı nedir?
Bokeh is specifically the out-of-focus areas of an image. Gaussian blur is an algorithm to fog selected image areas, to hide details or make them look out of focus. The main differences: * bokeh is created optically, gaussian blur in post-production; * in bokeh, the amount of how wide an out-of-focus point will be smeared is determined by its relative distance from focal plane, whereas gaussian blur is applied to a two-dimensional image where no distance information is present, thus all points are smeared equally; * in bokeh, the smearing characteristics depend on configuration and aperture shape of the lens, whereas gaussian blur is always smooth; * a small light source will be rendered as an aperture-shaped figure with quite well-defined edges in bokeh; but gaussian blur renders it as a spot with fading edges; * in bokeh, noise is present at the same level as in in-focus parts of image with same luminance; gaussian blur kills noise, so there'll be less noise than in non-blurred parts of image; * in bokeh, light areas will dominate over dark ones, while gaussian blur gives preserves the ratio of dark-light areas. So, all in all, you can use one to fake another, but the result will be similar only for low-noise bokeh containing items on roughly a plane parallel to focal plane, not including any significantly lighter areas or light sources, and taken with a lens that has a smooth bokeh.
Bokeh, özellikle bir görüntünün odak dışı alanlarıdır. Gauss bulanıklığı, ayrıntıları gizlemek veya odak dışı görünmelerini sağlamak için seçili görüntü alanlarını buğulamak için kullanılan bir algoritmadır. Temel farklar: * bokeh optik olarak oluşturulur, Gauss bulanıklığı ise son yapımda; * bokeh'te, odak dışı bir noktanın ne kadar geniş bulaşacağının miktarı, odak düzlemine göre göreceli uzaklığıyla belirlenirken, Gauss bulanıklığı, mesafe bilgisinin bulunmadığı iki boyutlu bir görüntüye uygulanır, bu nedenle tüm noktalar eşit şekilde bulaşır; * bokeh'te, bulaşma özellikleri, lensin yapılandırmasına ve diyafram şekline bağlıyken, Gauss bulanıklığı her zaman düzgündür; * küçük bir ışık kaynağı, bokeh'te oldukça iyi tanımlanmış kenarlara sahip diyafram şeklindeki bir figür olarak işlenir; ancak Gauss bulanıklığı, onu solgun kenarlara sahip bir nokta olarak işler; * bokeh'te, gürültü, aynı aydınlatmaya sahip görüntünün odakta olan kısımlarındakiyle aynı seviyede bulunur; Gauss bulanıklığı gürültüyü yok eder, bu nedenle görüntünün bulanık olmayan kısımlarına göre daha az gürültü olur; * bokeh'te, açık alanlar koyu alanlara hakim olurken, Gauss bulanıklığı koyu-açık alanların oranını korur. Yani, genel olarak, birini diğerini taklit etmek için kullanabilirsiniz, ancak sonuç yalnızca odak düzlemine yaklaşık olarak paralel bir düzlemde öğeler içeren, önemli ölçüde daha açık alanlar veya ışık kaynakları içermeyen ve düzgün bir bokeh'e sahip bir lensle çekilen düşük gürültülü bokeh için benzer olacaktır.
145
In 1969, NASA not only went to the moon, but broadcast the whole thing live on TV. How did they achieve the TV broadcast? What technology did they need to use to send a video and audio signal from the moon to earth? Was there much of a lag?
1969'da NASA sadece aya gitmekle kalmadı, aynı zamanda tüm olayı canlı olarak televizyonda yayınladı. TV yayınını nasıl başardılar? Ay'dan Dünya'ya bir video ve ses sinyali göndermek için hangi teknolojiyi kullanmaları gerekiyordu? Çok fazla gecikme var mıydı?
Apollo 11 mission had two modules * Lunar module - which descent to moon carrying two astronauts * command / service module- CSM was designed to return astronauts from the lunar surface on a direct-descent mission to earth and splash down. Direct telecast from the Command service module is not possible but CSM stored the recording of conversation which is transmitted by LM (which occur once in a rotation because the LM is stationary while CSM is orbiting the moon) then CSM sents to earth. Regarding the actual camera used in Apollo > Originally, these slow-scan television (SSTV) cameras, running at 10 frames-per-second (fps), produced only black and white pictures and first flew on the Apollo 7 mission in October 1968. NASA states as > The equipment onboard the Apollo Command Module that was used to make the recordings was called the Data Storage Equipment (DSE). Its contents were transmitted to the ground periodically during the mission. Also, the Command Module DSE had the capability to record data live during certain periods from the Lunar Module as it flew separately in lunar orbit. The equipment used aboard the Lunar Module to make the recordings was called the Data Storage Electronics Assembly (DSEA). It made recordings onboard the Lunar Module, but the DSEA flown on the Eagle during Apollo 11 malfunctioned. As a result, many of its recordings are barely, if at all, audible, with a constant high-pitched background tone. In the attached database, the recordings that are virtually inaudible are highlighted, but they are available on the web to ensure a complete release of the recordings made during the mission. and > The portion of the broadcast spectrum traditionally used for video was sending vital ship data to Earth, and there was no room left for the standard black-and- white video format of the era: 525 scan lines of data at 30 frames per second, transmitted at 4.5 MHz. So Lebar helped devise a smaller "oddball format" – 320 scan lines at 10 fps, transmitted at a meager 500 kHz. Tracking stations back on Earth would take this so-called slow-scan footage, convert it for TV broadcast, and beam it to Mission Control, which would send it out for the world to see. Transmission stations > To ensure a direct transmission signal from the moon, NASA had to maintain stations in three continents – two in Australia (the Honeysuckle Creek Tracking Station near Canberra and the Parkes Radio Observatory surrounded by sheep paddocks west of Sydney); one at the Goldstone Deep Space Communications Complex in the Mojave Desert of California; and one at the Madrid Manned Flight Tracking Site in Spain........ the tracking stations with a direct line on the Apollo 's signal were the ones in Australia. The 200-foot-diameter radio dish at the Parkes facility manag to withstand freak 70 mph gusts of wind and successfully captured the footage, which was converted and relayed to Houston.
Apollo 11 görevinde iki modül vardı * Ay modülü - iki astronot taşıyan aya iniş * komuta/hizmet modülü - CSM, astronotları doğrudan iniş göreviyle ay yüzeyinden Dünya'ya döndürmek ve suya inmek üzere tasarlanmıştı. Komuta hizmet modülünden doğrudan yayın mümkün değildi ancak CSM, LM tarafından iletilen konuşmaların kaydını sakladı (LM sabitken CSM ayın yörüngesinde dönerken bir dönüşte bir kez gerçekleşir) ardından CSM Dünya'ya gönderdi. Apollo'da kullanılan gerçek kamera hakkında > Başlangıçta, saniyede 10 kare (fps) hızında çalışan bu yavaş tarama televizyonu (SSTV) kameraları yalnızca siyah beyaz görüntüler üretiyordu ve ilk olarak Ekim 1968'de Apollo 7 görevinde uçtu. NASA şöyle belirtiyor: > Kayıtları yapmak için Apollo Komuta Modülü'nde kullanılan ekipmana Veri Depolama Ekipmanı (DSE) adı verildi. İçeriği görev sırasında periyodik olarak yere iletildi. Ayrıca Komuta Modülü DSE, Ay Modülü ay yörüngesinde ayrı olarak uçarken belirli dönemlerde verileri canlı olarak kaydetme özelliğine sahipti. Kayıtları yapmak için Ay Modülü'nde kullanılan ekipmana Veri Depolama Elektronik Montajı (DSEA) adı verildi. Ay Modülü'nde kayıtlar yaptı ancak Apollo 11 sırasında Eagle'da uçan DSEA arızalandı. Sonuç olarak, kayıtlarının çoğu, sürekli yüksek perdeli bir arka plan tonuyla zar zor duyulabilir veya hiç duyulamaz. Ekli veritabanında, neredeyse duyulmayan kayıtlar vurgulanmıştır ancak görevin tamamı sırasında yapılan kayıtların eksiksiz bir şekilde yayınlanmasını sağlamak için web üzerinde mevcuttur. ve > Geleneksel olarak video için kullanılan yayın spektrumunun bir kısmı, Dünya'ya hayati gemi verileri gönderiyordu ve o dönemin standart siyah beyaz video formatı için yer kalmamıştı: saniyede 30 karede 525 tarama çizgisi, 4,5 MHz'de iletiliyordu. Bu nedenle Lebar, daha küçük bir "tuhaf format" geliştirmeye yardımcı oldu - saniyede 10 fps'de 320 tarama çizgisi, 500 kHz'de iletildi. Dünya'daki izleme istasyonları, yavaş tarama olarak adlandırılan bu görüntüleri alır, TV yayını için dönüştürür ve Misyon Kontrolüne iletirdi, Misyon Kontrolü de bunları dünyanın görmesi için gönderirdi. İletim istasyonları > Ay'dan doğrudan bir iletim sinyali sağlamak için NASA, üç kıtada istasyonlar bulundurmak zorundaydı - Avustralya'da iki (Canberra yakınlarındaki Honeysuckle Creek İzleme İstasyonu ve Sidney'in batısında koyun ağıllarıyla çevrili Parkes Radyo Gözlemevi); biri Kaliforniya'nın Mojave Çölü'ndeki Goldstone Derin Uzay İletişim Kompleksi'nde; ve biri İspanya'daki Madrid İnsanlı Uçuş İzleme Sahası'nda... Apollo'nun sinyalinde doğrudan bir hat bulunan izleme istasyonları Avustralya'dakilerdi. Parkes tesisindeki 200 fit çapındaki radyo anteni, saatte 70 mil hızla esen rüzgarlara dayanmayı başardı ve görüntüleri başarıyla yakaladı, dönüştürüldü ve Houston'a iletildi.
146
Why does "elite" rhyme with "beet" rather than "bite"?
"Elite" neden "bite" yerine "beet" ile kafiyelidir?
This has everything to do with the following: * The language of origin of the word and * The point at which the word entered the English language. The reason that the words &quot;light&quot; and &quot;might&quot; and &quot;site&quot; have a diphthong is because they were present in spoken English during the Great Vowel Shift, which started in the 1400s and continued for a few hundred years. So words that had already entered the English language underwent that change in pronunciation. Those words could be of Anglo-Saxon, Norman French, or Latin origin. We see it across the board. However, the word elite entered English towards the end of the period of the Great Vowel shift. The first attestation is in the mid 1700s (1738 in the OED). This is probably further complicated by the fact that French has long been the language of nobility, so there are certain pressures to maintain the pronunciation patterns of the origin language. &quot;Elite&quot; joined the party a little bit late, so its pronunciation remained rather stable. As Rjpond points out, elite is a modern borrowing. Words like crime, sublime, mime, etc. are older borrowings. To note: There are early occurrences of the word &quot;elite&quot; in around 1400, with the meaning of a &quot;bishop elect&quot;. This sense of the word died out and is now marked as archaic. So when &quot;elite&quot; was re-introduced (directly from French) in the 1700s, there was no existing pronunciation. Small addendum: Already existing in English is another word that already occupies the same lexical space that elite would occupy, if the pronunciation were analogized to bite: alight, which dates back to Old English. (It's a lovely word.) You might say that there is some linguistic pressure to avoid creating homophones: elite vs. alight.
Bunun aşağıdakilerle her şeyi var: * Kelimenin köken dili ve * Kelimenin İngilizceye girdiği nokta. "Light" ve "might" ve "site" kelimelerinin çift ünlü içermesinin nedeni, 1400'lerde başlayan ve birkaç yüz yıl süren Büyük Ünlü Kayması sırasında konuşulan İngilizcede bulunmalarıdır. Yani İngilizceye çoktan girmiş olan kelimeler telaffuzda bu değişime uğramıştır. Bu kelimeler Anglo-Sakson, Norman Fransızcası veya Latince kökenli olabilir. Bunu her yerde görüyoruz. Ancak, elit kelimesi Büyük Ünlü Kayması döneminin sonlarına doğru İngilizceye girmiştir. İlk kanıt 1700'lerin ortalarındadır (OED'de 1738). Bu muhtemelen Fransızcanın uzun süredir asaletin dili olması gerçeğiyle daha da karmaşıklaşmaktadır, bu nedenle orijinal dilin telaffuz kalıplarını korumak için bazı baskılar vardır. "Elit" partiye biraz geç katıldı, bu nedenle telaffuzu oldukça istikrarlı kaldı. Rjpond'un belirttiği gibi, elit modern bir ödünçlemedir. Suç, yüce, pandomim vb. kelimeler daha eski ödünçlemelerdir. Not etmek gerekir ki, "elit" kelimesinin yaklaşık 1400'de "seçilmiş piskopos" anlamıyla erken örnekleri vardır. Kelimenin bu anlamı ortadan kalktı ve şimdi arkaik olarak işaretlenmiştir. Bu nedenle "elit" 1700'lerde (doğrudan Fransızcadan) yeniden tanıtıldığında, mevcut bir telaffuz yoktu. Küçük ek: İngilizcede zaten var olan, elit'in telaffuzu ısırmaya benzetilseydi, elit'in kaplayacağı aynı sözcüksel alanı zaten kaplayan başka bir kelime vardır: Eski İngilizceye kadar uzanan alight. (Bu güzel bir kelimedir.) Homofonlar yaratmaktan kaçınmak için bazı dilsel baskıların olduğunu söyleyebilirsiniz: elit ve alight.
147
A lot of ShaderToy demos share the Ray Marching algorithm to render the scene, but they are often written with a very compact style and i can't find any straightforward examples or explanation. So what is Ray Marching? Some comments suggests that it is a variation of Sphere Tracing. What are the computational advantages of a such approach?
Birçok ShaderToy demosu sahneyi işlemek için Ray Marching algoritmasını paylaşır, ancak bunlar genellikle çok sıkıştırılmış bir tarzda yazılır ve herhangi bir anlaşılır örnek veya açıklama bulamadım. Peki Ray Marching nedir? Bazı yorumlar bunun Sphere Tracing'in bir varyasyonu olduğunu öne sürüyor. Böyle bir yaklaşımın hesaplama avantajları nelerdir?
## TL;DR They belong to the same family of solvers, where sphere tracing is one method of ray marching, which is the family name. ## Raymarching a definition Raymarching is a technique a bit like traditional raytracing where the surface function is not easy to solve (or impossible without numeric iterative methods). In raytracing you just look up the ray intersection, whereas in ray marching you march forward (or back and forth) until you find the intersection, have enough samples or whatever it is your trying to solve. Try to think of it like a newton-raphson method for surface finding, or summing for integrating a varying function. This can be useful if you: * Need to render volumetrics that arenot uniform * Rendering implicit functions, fractals * Rendering other kinds of parametric surfaces where intersection is not known ahead of time, like paralax mapping etc. ## Sphere tracing Sphere tracing is one possible Ray marching algorithm. Not all raymarching uses benefit form this method, as they can not be converted into this kind of scheme. Sphere tracing is used for rendering implicit surfaces. Implicit surfaces are formed at some level of a continuous function. In essence solving the equation ```F(X,Y,Z) = 0 ``` Because of how this function can be solved at each point, one can go ahead and estimate the biggest possible sphere that can fit the current march step (or if not exactly reasonably safely). You then know that next march distance is at least this big. This way you can have adaptive ray marching steps speeding up the process.
## TL;DR Aynı çözücü ailesine aittirler, burada küre izleme, aile adı olan ışın yürütmenin bir yöntemidir. ## Işın yürütme tanımı Işın yürütme, yüzey işlevinin çözülmesinin kolay olmadığı (veya sayısal yinelemeli yöntemler olmadan imkansız olduğu) geleneksel ışın izleme gibi bir tekniktir. Işın izlemede yalnızca ışın kesişim noktasına bakarsınız, oysa ışın yürütmede kesişim noktasını bulana, yeterli örneğe sahip olana veya çözmeye çalıştığınız her neyse onu bulana kadar ileri (veya ileri geri) yürürsünüz. Bunu yüzey bulma için bir newton-raphson yöntemi veya değişken bir işlevi entegre etmek için toplama gibi düşünmeye çalışın. Bu, aşağıdaki durumlarda faydalı olabilir: * Tekdüzen olmayan hacimleri işlemeniz gerekiyorsa * Kapalı işlevleri, fraktalları işlemek * Paralaks eşleme gibi kesişim noktasının önceden bilinmediği diğer parametrik yüzey türlerini işlemek vb. ## Küre izleme Küre izleme, olası bir Işın yürütme algoritmasıdır. Tüm ışın yürütme bu yöntemden faydalanmaz, çünkü bu tür bir şemaya dönüştürülemezler. Küre izleme, kapalı yüzeyleri işlemek için kullanılır. Kapalı yüzeyler, sürekli bir işlevin belirli bir düzeyinde oluşur. Özünde şu denklemi çözmek ```F(X,Y,Z) = 0 ``` Bu işlevin her noktada nasıl çözülebileceği nedeniyle, mevcut yürüyüş adımına (veya tam olarak değilse makul ölçüde güvenli bir şekilde) sığabilecek en büyük küreyi tahmin edebilirsiniz. Ardından bir sonraki yürüyüş mesafesinin en az bu kadar büyük olduğunu bilirsiniz. Bu şekilde, süreci hızlandıran uyarlanabilir ışın yürütme adımlarına sahip olabilirsiniz.
148
Is martial arts training 'inadequate' for the real world?
Dövüş sanatları eğitimi gerçek dünya için 'yetersiz' mi?
Yes, depending on your definitions of martial arts, inadequate, and real world. No, depending on your definitions of martial arts, inadequate, and real world. Surviving an attack (or combat) is all about stacking the deck in your favour: martial arts (arts of Mars, the God of War) do help, so do guns, team mates, artillery, the police, not being there, body armour, etc... There is no such thing as a typical real world violent attack. For example, urban warfare is not the same thing as a bar brawl and both require very different skill sets to survive. The no prior warning is utter rubbish. There are always signs that something is about to happen. Sure, one may not notice those and a skilled attacker will be trained in camouflaging those signs but they always are. Police officers, body guards, soldiers, etc... are all trained in recognise those signs. Making general sweeping statements about violence and how to survive it generally indicate either bad research or an agenda. For a good site about self defence, especially the section on martial arts, see MacYoung's no nonsense self defense. But this is about civilian self defence in a stable country. If you were in a civil war zone, the advise would be very different.
Evet, dövüş sanatları, yetersiz ve gerçek dünya tanımlarınıza bağlı olarak. Hayır, dövüş sanatları, yetersiz ve gerçek dünya tanımlarınıza bağlı olarak. Bir saldırıdan (veya çatışmadan) sağ çıkmak, desteyi sizin lehinize yığmakla ilgilidir: dövüş sanatları (Savaş Tanrısı Mars'ın sanatları) yardımcı olur, silahlar, takım arkadaşları, topçu, polis, orada olmamak, vücut zırhı vb. de yardımcı olur... Tipik bir gerçek dünya şiddet saldırısı diye bir şey yoktur. Örneğin, kentsel savaş bir bar kavgasıyla aynı şey değildir ve her ikisi de hayatta kalmak için çok farklı beceri setleri gerektirir. Önceden uyarı yapılmaması tamamen saçmalıktır. Her zaman bir şeyin olmak üzere olduğuna dair işaretler vardır. Elbette, kişi bunları fark etmeyebilir ve yetenekli bir saldırgan bu işaretleri kamufle etmek için eğitilmiş olacaktır ancak bunlar her zaman vardır. Polis memurları, korumalar, askerler vb. bu işaretleri tanımak için eğitilmiştir. Şiddet ve ondan nasıl sağ çıkılacağı hakkında genel kapsamlı açıklamalar yapmak genellikle kötü araştırmayı veya bir gündemi gösterir. Öz savunma hakkında iyi bir site için, özellikle dövüş sanatları bölümü için MacYoung'un saçma olmayan öz savunmasına bakın. Ancak bu, istikrarlı bir ülkede sivil öz savunmasıyla ilgilidir. Bir iç savaş bölgesindeyseniz, tavsiyeler çok farklı olacaktır.
149
Make a single page landscape in Google Documents
Google Dokümanlar'da tek sayfalık bir manzara yapın
Currently a single Google Document can only be either Landscape or Portrait not both. Changing page orientation is done by selecting File and then Page setup. It is currently recommended to separate the Landscape and Portrait pages into different documents. A good place to get more information that might help is at Google Products Forums. Note that an additional option might be to have three files in Google Docs. The Portrait, The Landscape, and Microsoft Word Doc which integrates the two layouts into the correct sequence (this document would be Read Only when viewed in Google Docs). A Microsoft Word document may allow multiple orientations of the Page Layout, but if it is converted to a Google Document the Page Layout for each page will revert to the first Orientation found in the document. Also, creating multiple Orientations in Word isn't as straight forward as one might want either. For those wanting to do this in Word: Use portrait and landscape orientation in the same document 1. Select the pages or paragraphs that you want to change to portrait or landscape orientation. NOTE: If you select some but not all of the text on a page to change to portrait or landscape orientation, Word places the selected text on its own page, and the surrounding text on separate pages. 2. On the Page Layout tab, in the Page Setup group, click Margins. 3. Click Custom Margins. (This is the important part) 4. On the Margins tab, click Portrait or Landscape. 5. In the Apply to list, click Selected text.. NOTE: Microsoft Word automatically inserts section breaks before and after the text that has the new page orientation. If your document is already divided into sections, you can click in a section (or select multiple sections), and then change the orientation for only the sections that you select.
Şu anda tek bir Google Dokümanı yalnızca Yatay veya Dikey olabilir, her ikisi birden olamaz. Sayfa yönünü değiştirmek için Dosya ve ardından Sayfa düzeni seçilir. Şu anda Yatay ve Dikey sayfaları farklı belgelere ayırmanız önerilir. Daha fazla bilgi alabileceğiniz iyi bir yer Google Ürün Forumları'dır. Ek bir seçenek olarak Google Dokümanlar'da üç dosya bulundurmak olabilir. Dikey, Yatay ve iki düzeni doğru sırayla birleştiren Microsoft Word Dokümanı (bu belge Google Dokümanlar'da görüntülendiğinde Salt Okunur olur). Bir Microsoft Word belgesi Sayfa Düzeni'nin birden fazla yönüne izin verebilir, ancak bir Google Dokümanı'na dönüştürülürse her sayfanın Sayfa Düzeni belgede bulunan ilk Yönelime geri döner. Ayrıca, Word'de birden fazla Yönelim oluşturmak da istendiği kadar kolay değildir. Bunu Word'de yapmak isteyenler için: Aynı belgede dikey ve yatay yönlendirme kullanma 1. Dikey veya yatay yönelime değiştirmek istediğiniz sayfaları veya paragrafları seçin. NOT: Bir sayfadaki metnin tamamını değil de bir kısmını dikey veya yatay yönelime değiştirmek için seçerseniz, Word seçilen metni kendi sayfasına, çevreleyen metni de ayrı sayfalara yerleştirir. 2. Sayfa Düzeni sekmesinde, Sayfa Kurulumu grubunda Kenar Boşlukları'na tıklayın. 3. Özel Kenar Boşlukları'na tıklayın. (Önemli kısım burasıdır) 4. Kenar Boşlukları sekmesinde Dikey veya Yatay'a tıklayın. 5. Uygula listesinde Seçili metin'e tıklayın. NOT: Microsoft Word, yeni sayfa yönüne sahip metnin önüne ve sonuna otomatik olarak bölüm sonları ekler. Belgeniz zaten bölümlere ayrılmışsa, bir bölüme tıklayabilir (veya birden fazla bölüm seçebilir) ve ardından yalnızca seçtiğiniz bölümlerin yönünü değiştirebilirsiniz.
150
PHP is writing this error in the logs: "Notice: Use of undefined constant". Error in logs: ```PHP Notice: Use of undefined constant department - assumed 'department' (line 5) PHP Notice: Use of undefined constant name - assumed 'name' (line 6) PHP Notice: Use of undefined constant email - assumed 'email' (line 7) PHP Notice: Use of undefined constant message - assumed 'message' (line 8) ``` Relevant lines of code: ```$department = mysql_real_escape_string($_POST[department]); $name = mysql_real_escape_string($_POST[name]); $email = mysql_real_escape_string($_POST[email]); $message = mysql_real_escape_string($_POST[message]); ``` What does it mean and why am I seeing it?
PHP günlüklerde şu hatayı yazıyor: "Uyarı: Tanımlanmamış sabitin kullanımı". Günlüklerdeki hata: ```PHP Uyarı: Tanımlanmamış sabitin kullanımı - 'department' varsayıldı (satır 5) PHP Uyarısı: Tanımlanmamış sabitin kullanımı - 'name' varsayıldı (satır 6) PHP Uyarısı: Tanımlanmamış sabitin kullanımı - 'email' varsayıldı (satır 7) PHP Uyarısı: Tanımlanmamış sabitin kullanımı - 'message' varsayıldı (satır 8) ``` İlgili kod satırları: ```$department = mysql_real_escape_string($_POST[department]); $name = mysql_real_escape_string($_POST[name]); $email = mysql_real_escape_string($_POST[email]); $message = mysql_real_escape_string($_POST[message]); ``` Bu ne anlama geliyor ve neden görüyorum?
The error message is due to the unfortunate fact that PHP will implicitly declare an unknown token as a constant string of the same name. That is, it's trying to interpret this (note the missing quote marks): ```$_POST[department] ``` The only valid way this would be valid syntax in PHP is if there was previously a constant ```department``` defined. So sadly, rather than dying with a Fatal error at this point, it issues this Notice and acts as though a constant had been defined with the same name and value: ```// Implicit declaration of constant called department with value 'department' define('department', 'department'); ``` There are various ways you can get this error message, but they all have the same root cause - a token that could be a constant. Strings missing quotes: ```$my_array[bad_key]``` This is what the problem is in your case, and it's because you've got string array keys that haven't been quoted. Fixing the string keys will fix the bug: Change: ```$department = mysql_real_escape_string($_POST[department]); ...(etc)... ``` To: ```$department = mysql_real_escape_string($_POST['department']); ...(etc)... ``` Variable missing dollar sign: ```var_without_dollar``` Another reason you might see this error message is if you leave off the ```$``` from a variable, or ```$this->``` from a member. Eg, either of the following would cause a similar error message: ```my_local; // should be $my_local my_member; // should be $this->my_member ``` Invalid character in variable name: ```$bad-variable-name``` A similar but more subtle issue can result if you try to use a disallowed character in a variable name - a hyphen (```-```) instead of an underscore ```_``` would be a common case. For example, this is OK, since underscores are allowed in variable names: ```if (123 === $my_var) { do_something(); } ``` But this isn't: ```if (123 === $my-var) { do_something(); } ``` It'll be interpreted the same as this: ```if (123 === $my - var) { // variable $my minus constant 'var' do_something(); } ``` Referring to a class constant without specifying the class scope In order to refer to a class constant you need to specify the class scope with ```::```, if you miss this off PHP will think you're talking about a global ```define()```. Eg: ```class MyClass { const MY_CONST = 123; public function my_method() { return self::MY_CONST; // This is fine } public function my_method() { return MyClass::MY_CONST; // This is fine } public function my_bad_method() { return MY_CONST; // BUG - need to specify class scope } } ``` Using a constant that's not defined in this version of PHP, or is defined in an extension that's not installed There are some system-defined constants that only exist in newer versions of PHP, for example the mode option constants for ```round()``` such as ```PHP_ROUND_HALF_DOWN``` only exist in PHP 5.3 or later. So if you tried to use this feature in PHP 5.2, say: ```$rounded = round($my_var, 0, PHP_ROUND_HALF_DOWN); ``` You'd get this error message: Use of undefined constant PHP_ROUND_HALF_DOWN - assumed 'PHP_ROUND_HALF_DOWN' Warning (2): Wrong parameter count for round()
Hata mesajı, PHP'nin bilinmeyen bir belirteci aynı adlı sabit bir dize olarak örtük olarak bildireceği talihsiz gerçeklikten kaynaklanmaktadır. Yani, bunu yorumlamaya çalışıyor (tırnak işaretlerinin eksik olduğuna dikkat edin): ```$_POST[department] ``` PHP'de bunun geçerli söz dizimi olmasının tek geçerli yolu, daha önce ```department``` sabitinin tanımlanmış olmasıdır. Bu yüzden ne yazık ki, bu noktada Ölümcül bir hata ile ölmek yerine, bu Bildiriyi yayınlar ve aynı ad ve değere sahip bir sabitin tanımlanmış gibi davranır: ```// 'department' değeriyle department adlı sabitin örtük bildirimi define('department', 'department'); ``` Bu hata mesajını almanın çeşitli yolları vardır, ancak hepsinin aynı temel nedeni vardır - sabit olabilecek bir belirteç. Tırnak işaretleri eksik olan dizeler: ```$my_array[bad_key]``` Sizin durumunuzda sorun budur ve bunun nedeni, tırnak içine alınmamış dize dizi anahtarlarına sahip olmanızdır. Dize anahtarlarını düzeltmek hatayı düzeltecektir: Şunu değiştirin: ```$department = mysql_real_escape_string($_POST[department]); ...(vb)... ``` Şu şekilde: ```$department = mysql_real_escape_string($_POST['department']); ...(vb)... ``` Dolar işareti eksik değişken: ```var_without_dollar``` Bu hata mesajını görmenizin bir başka nedeni de bir değişkenden ```$``` veya bir üyeden ```$this->``` bırakmanız olabilir. Örneğin, aşağıdakilerden herhangi biri benzer bir hata mesajına neden olur: ```my_local; // $my_local olmalı my_member; // $this->my_member olmalı ``` Değişken adında geçersiz karakter: ```$bad-variable-name``` Bir değişken adında izin verilmeyen bir karakter kullanmaya çalışırsanız benzer ancak daha incelikli bir sorun ortaya çıkabilir - bir alt çizgi ```_``` yerine bir tire (```-```) yaygın bir durum olur. Örneğin, değişken adlarında alt çizgiler kullanılmasına izin verildiğinden bu sorun yoktur: ```if (123 === $my_var) { do_something(); } ``` Ancak bu sorun vardır: ```if (123 === $my-var) { do_something(); } ``` Aynı bunun gibi yorumlanacaktır: ```if (123 === $my - var) { // $my değişkeni eksi 'var' sabiti do_something(); } ``` Sınıf kapsamını belirtmeden bir sınıf sabitine başvurmak Bir sınıf sabitine başvurmak için ```::``` ile sınıf kapsamını belirtmeniz gerekir, bunu kaçırırsanız PHP bunun bir genel ```define()``` hakkında konuştuğunuzu düşünür. Örneğin: ```class MyClass { const MY_CONST = 123; public function my_method() { return self::MY_CONST; // Bu sorun değil } public function my_method() { return MyClass::MY_CONST; // Bu sorun değil } public function my_bad_method() { return MY_CONST; // HATA - sınıf kapsamını belirtmeniz gerekir } } ``` PHP'nin bu sürümünde tanımlanmamış veya yüklü olmayan bir eklentide tanımlanmış bir sabit kullanmak Yalnızca PHP'nin daha yeni sürümlerinde bulunan bazı sistem tarafından tanımlanmış sabitler vardır, örneğin ```round()``` için ```PHP_ROUND_HALF_DOWN``` gibi mod seçeneği sabitleri yalnızca PHP 5.3 veya sonraki sürümlerde bulunur. Bu nedenle, bu özelliği PHP 5.2'de kullanmaya çalışırsanız, örneğin: ```$rounded = round($my_var, 0, PHP_ROUND_HALF_DOWN); ``` Bu hata mesajını alırsınız: Tanımlanmamış PHP_ROUND_HALF_DOWN sabitinin kullanımı - varsayılan 'PHP_ROUND_HALF_DOWN' Uyarı (2): round() için yanlış parametre sayısı
151
I'm from a very rural area and love to garden, however, for work I just moved into an apartment in the city. I miss being able to grow vegetables and so I attempted to start some leaf lettuce indoors, however, almost every plant died quickly. I'm just curious, does anyone have experience growing vegetables indoors? What are the best ones for this? What sort of planter do you use? Do they need to be directly next to a window? How often should they be watered? I'm not used to not having Mother Nature help me out with my plants Any tips that can be provided would be much appreciated, thanks!
Çok kırsal bir bölgeden geliyorum ve bahçecilik yapmayı çok seviyorum, ancak iş için şehre bir daireye taşındım. Sebze yetiştiremediğim için özlüyorum ve bu yüzden iç mekanda yaprak marul yetiştirmeye çalıştım, ancak hemen hemen her bitki hızla öldü. Sadece merak ediyorum, iç mekanda sebze yetiştirme konusunda deneyimi olan var mı? Bunun için en iyileri hangileri? Ne tür bir ekici kullanıyorsunuz? Doğrudan bir pencerenin yanında olmaları gerekir mi? Ne sıklıkla sulanmaları gerekir? Bitkilerime yardım etmesi için Doğa Ana'ya sahip olmamaya alışkın değilim. Sağlanabilecek her türlü ipucu çok takdir edilecektir, teşekkürler!
Indoor gardening is a bit more difficult then the regular outdoor gardening, there are several factors but in most cases it boils down to: Temperature, Humidity, Light, The air in your apartment. You didn't mention exactly where your dying plants are being placed. Do you have a fan within the apartment? Plants need air whether it is natural or even if it is coming from a fan. What type of lighting is inside the apartment? Are you only using natural light? These are important factors to aide the growth of the plant as well. How is the temperature within the apartment? If you notice a lot of temp ups / downs in the area you are gardening than it is probably worth moving the garden or choosing another spot. With apartments that becomes all the more difficult. Your plant also probably came from some nice greenhouse, an english gardens, a ray weigands, etc etc...They have plenty of light, they also have plenty of means of water and the temperature well most of this is all outside, so they have the advantage of using mother nature. Your plant needs to adjust to these conditions. You should try to begin to place your plants in a very lit area with as much natural wind / fan as possible, these plants need to breath. If your plants are not conditioned for this type of environment you run the risk that they give up and die. When potting the plant ensure the actual pot is cleaned up to remove any unnecessary plant diseases from prior plants. Look on the bottom of the actual pot, are you getting drainage? If not drill a hole in the bottom of the pot if you can, if not toss that pot out and get you a pot that has a good amount of drainage. Overwatering plants will destroy them, and without nature (wind, temperature, etc) the water sitting there takes all the longer to dry out. When it comes to veggies Tomatoes need a ton of sunlight and humidity is great for them as well. Herbs are probably the simpliest to get going but I'm not sure if this is what you are after. Cucumbers and squash don't need as much sunlight as tomatoes.
Kapalı alanda bahçe işleri, normal açık hava bahçeciliğinden biraz daha zordur, bunun birkaç nedeni vardır ancak çoğu durumda şunlara indirgenebilir: Sıcaklık, Nem, Işık, Dairenizdeki hava. Ölen bitkilerinizin tam olarak nereye yerleştirildiğinden bahsetmediniz. Dairenizde bir vantilatör var mı? Bitkilerin havaya ihtiyacı vardır, ister doğal isterse bir vantilatörden gelsin. Dairenin içinde ne tür aydınlatma var? Sadece doğal ışık mı kullanıyorsunuz? Bunlar bitkinin büyümesine yardımcı olmak için de önemli faktörlerdir. Dairenin içindeki sıcaklık nasıl? Bahçe yaptığınız alanda çok fazla sıcaklık artışı/azalışı fark ederseniz, muhtemelen bahçeyi taşımaya veya başka bir yer seçmeye değer. Dairelerde bu daha da zorlaşır. Bitkiniz muhtemelen güzel bir seradan, bir İngiliz bahçesinden, bir ray weigands'tan vb. gelmiştir... Bol ışık alırlar, ayrıca bol su kaynakları vardır ve sıcaklık çoğunlukla dışarıdadır, bu nedenle doğa anadan yararlanma avantajına sahiptirler. Bitkinizin bu koşullara uyum sağlaması gerekir. Bitkilerinizi mümkün olduğunca çok doğal rüzgar/vantilatör bulunan çok aydınlık bir alana yerleştirmeye başlamalısınız, bu bitkilerin nefes alması gerekir. Bitkileriniz bu tür bir ortama uygun değilse pes edip ölme riskiyle karşı karşıya kalırsınız. Bitkiyi saksıya koyarken, önceki bitkilerden kaynaklanan gereksiz bitki hastalıklarını gidermek için saksının temizlendiğinden emin olun. Saksının altına bakın, drenaj oluyor mu? Olmuyorsa, mümkünse saksının altına bir delik açın, değilse o saksıyı atın ve iyi miktarda drenajı olan bir saksı alın. Bitkileri aşırı sulamak onları yok edecektir ve doğa olmadan (rüzgar, sıcaklık vb.) orada duran suyun kuruması daha uzun sürer. Sebzelere gelince, domateslerin bir ton güneş ışığına ihtiyacı vardır ve nem de onlar için harikadır. Otlar muhtemelen başlaması en kolay olanlardır ancak bunun aradığınız şey olduğundan emin değilim. Salatalık ve kabakların domatesler kadar güneş ışığına ihtiyacı yoktur.
152
What are the advantages of studying words by their frequency?
Kelimeleri sıklıklarına göre çalışmanın avantajları nelerdir?
The main advantage is that by learning higher frequency words, you get a greater "bang for your buck" - that is, if you know the most frequent words of the language, you'll be able to understand more of the words you encounter, and therefore you gain the greatest benefit by studying those frequent words first. According to Nation & Waring (1997), text coverage in the Brown corpus is as follows: * Most frequent 1000 words: 72.0% * Most frequent 2000 words: 79.7% * Most frequent 3000 words: 84.0% * Most frequent 4000 words: 86.8%. So by learning the top 1000 words, you'll know 72% of the words in the average text you read. But after that, there are diminishing returns: the next 1000 words gives you another 7.7% of a typical text, and the next 1000 words allows you to understand just 4.3% more. After that, the returns on memorizing by frequency decrease even more, so learning from frequency lists becomes less useful. Note that text coverage (the percentage of words that you know in an average text) is important. We don't need to understand every single word in a text in order to understand the general meaning. Some research has investigated what percentage of words we do need to understand. Laufer and Sim (1985) suggested 65-70% should be understood as an absolute minimum for comprehension, but Laufer (1989) (as described in Hu and Nation (2000)) suggests 95% should be known for solid comprehension. Hu and Nation (2000) suggest that 98% of words should be known for unaided comprehension. Although learning high-frequency words is a good idea, especially when you first start learning a language, frequency is not the only consideration when choosing words to learn. Barker (2007) suggests that "cost" and "benefit" be the primary considerations when choosing words to learn; benefit is partially defined by frequency, but also on personal needs. So it's good to learn the "technical" vocabulary of your major or field, and it's also useful to learn words related to your interest. It's also beneficial to learn words with a lower "cost" - words that are familiar, that you've encountered a lot recently, or that just seem easy. Also, although memorizing words has benefits, it is best to combine this with real exposure to words, so that you learn them naturally in real contexts.
En büyük avantaj, daha yüksek frekanslı kelimeleri öğrenerek "paranızın karşılığını daha fazla almanızdır" - yani, dilin en sık kullanılan kelimelerini biliyorsanız, karşılaştığınız kelimelerin daha fazlasını anlayabileceksiniz ve bu nedenle öncelikle bu sık kullanılan kelimeleri çalışarak en büyük faydayı elde edersiniz. Nation ve Waring'e (1997) göre, Brown derlemesindeki metin kapsamı şu şekildedir: * En sık kullanılan 1000 kelime: %72,0 * En sık kullanılan 2000 kelime: %79,7 * En sık kullanılan 3000 kelime: %84,0 * En sık kullanılan 4000 kelime: %86,8. Yani en önemli 1000 kelimeyi öğrenerek, okuduğunuz ortalama metindeki kelimelerin %72'sini bilirsiniz. Ancak bundan sonra, azalan getiriler vardır: sonraki 1000 kelime size tipik bir metnin %7,7'sini daha verir ve sonraki 1000 kelime %4,3 daha anlamanıza olanak tanır. Bundan sonra, frekansla ezberlemenin getirileri daha da azalır, bu nedenle frekans listelerinden öğrenmek daha az faydalı hale gelir. Metin kapsamının (ortalama bir metinde bildiğiniz kelimelerin yüzdesi) önemli olduğunu unutmayın. Genel anlamı anlamak için bir metindeki her kelimeyi anlamamıza gerek yok. Bazı araştırmalar, anlamak için hangi kelime yüzdesine ihtiyacımız olduğunu araştırdı. Laufer ve Sim (1985), %65-70'in anlama için mutlak bir minimum olarak anlaşılması gerektiğini öne sürdü, ancak Laufer (1989) (Hu ve Nation'da (2000) açıklandığı gibi) sağlam bir anlama için %95'in bilinmesi gerektiğini öne sürüyor. Hu ve Nation (2000), kelimelerin %98'inin yardımsız anlama için bilinmesi gerektiğini öne sürüyor. Yüksek frekanslı kelimeleri öğrenmek iyi bir fikir olsa da, özellikle bir dili ilk öğrenmeye başladığınızda, kelimeleri öğrenirken frekans tek husus değildir. Barker (2007), kelimeleri öğrenirken birincil hususların "maliyet" ve "fayda" olması gerektiğini öne sürüyor; fayda kısmen frekansla tanımlanır, ancak aynı zamanda kişisel ihtiyaçlara da bağlıdır. Bu nedenle, ana dalınızın veya alanınızın "teknik" kelime dağarcığını öğrenmek iyidir ve ilgi alanlarınızla ilgili kelimeleri öğrenmek de faydalıdır. Daha düşük "maliyetli" kelimeleri öğrenmek de faydalıdır - aşina olduğunuz, son zamanlarda çok karşılaştığınız veya sadece kolay görünen kelimeler. Ayrıca, kelimeleri ezberlemenin faydaları olsa da, bunu kelimelerle gerçek bir şekilde birleştirmek en iyisidir, böylece onları gerçek bağlamlarda doğal olarak öğrenirsiniz.
153
I have heard many people saying, “Hah! I beat Stockfish,” and one saying, “I am the best chess player ever! I beat Stockfish.” So I wonder if it is possible, just to know whether I should try to beat it. I tried to play it once; I barely played 25 moves.
Birçok kişinin "Hah! Stockfish'i yendim" dediğini ve birinin de "Ben gelmiş geçmiş en iyi satranç oyuncusuyum! Stockfish'i yendim" dediğini duydum. Bu yüzden denemeye değer mi diye merak ediyorum. Bir kez oynamayı denedim; zar zor 25 hamle yaptım.
The answer is that they either played it on some very handicapped mode, they took back A LOT of moves, or they are probably lying. Stockfish 11 is currently rated about 3607, and that is in standard chess. Computer programs are typically even HARDER to beat for humans at even faster controls. There is a reason elite humans have not played matches against computers for a long time: even the Carlsens of the world cannot beat them any more. According to the ELO winning expectancy calculator, there is currently a 745 point difference between Stockfish 11 and Carlsen, and per the chart, that gives the computer a 99.5439696% chance of winning. Note: The ratings used above are from different rating pools, and thus, are not truly directly comparable, but used as a rough estimate of what would happen between the computer and Carlsen.
Cevap ya çok engelli bir modda oynadıkları, bir sürü hamle geri aldıkları ya da muhtemelen yalan söyledikleridir. Stockfish 11 şu anda yaklaşık 3607 puan aldı ve bu standart satrançta. Bilgisayar programlarının insanları daha hızlı kontrollerde bile yenmesi daha ZORDUR. Seçkin insanların uzun süredir bilgisayarlara karşı maç oynamamalarının bir nedeni var: dünyanın Carlsen'leri bile artık onları yenemez. ELO kazanma beklentisi hesaplayıcısına göre, şu anda Stockfish 11 ile Carlsen arasında 745 puan fark var ve tabloya göre bu, bilgisayara %99,5439696 kazanma şansı veriyor. Not: Yukarıda kullanılan puanlar farklı puan havuzlarından alınmıştır ve bu nedenle doğrudan karşılaştırılabilir değildir, ancak bilgisayar ile Carlsen arasında ne olacağına dair kaba bir tahmin olarak kullanılır.
154
How to decrypt Jenkins passwords from credentials.xml?
Jenkins şifreleri credentials.xml'den nasıl çözülür?
There is a `hudson.util.Secret.decrypt()` function which can be used for this, so: 1. In Jenkins, go to: `/script` page. 2. Run the following command: ```println(hudson.util.Secret.decrypt("{XXX=}")) ``` or ``` println(hudson.util.Secret.fromString("{XXX=}").getPlainText()) ``` where `{XXX=}` is your encrypted password. This will print the plain password. To do the opposite, you can run: ``` println(hudson.util.Secret.fromString("some_text").getEncryptedValue()) ``` Alternatively check the following scripts: `tweksteen/jenkins-decrypt`, `menski/jenkins-decrypt.py`.
Bunun için kullanılabilecek bir `hudson.util.Secret.decrypt()` fonksiyonu vardır, bu nedenle: 1. Jenkins'te şuraya gidin: `/script` sayfası. 2. Aşağıdaki komutu çalıştırın: ```println(hudson.util.Secret.decrypt("{XXX=}")) ``` veya ``` println(hudson.util.Secret.fromString("{XXX=}").getPlainText()) ``` burada `{XXX=}` şifrelenmiş parolanızdır. Bu, düz metin parolasını yazdıracaktır. Tersi işlemi yapmak için şunları çalıştırabilirsiniz: ``` println(hudson.util.Secret.fromString("some_text").getEncryptedValue()) ``` Alternatif olarak şu betikleri kontrol edin: `tweksteen/jenkins-decrypt`, `menski/jenkins-decrypt.py`.
155
I'm pretty disappointed with my horse. He wasn't cheap -- 1000g -- but he just doesn't seem that fast. To make things worse, he's a bit of a wolf magnet and every time I get attacked I have to tediously dismount, blast the wolf, and then remount. Is the speed of a horse actually significantly faster than normal running speed? If so, how much faster?
Atımdan oldukça hayal kırıklığına uğradım. Ucuz değildi -- 1000g -- ama o kadar da hızlı görünmüyor. İşleri daha da kötüleştirmek için, o biraz kurt mıknatısı ve her saldırıya uğradığımda sıkıcı bir şekilde inmek, kurdu patlatmak ve sonra tekrar binmek zorunda kalıyorum. Bir atın hızı gerçekten normal koşu hızından önemli ölçüde daha mı hızlı? Eğer öyleyse, ne kadar daha hızlı?
Don't forget that you can sprint with a horse. It might be that you know that you can sprint on your character, but not on your horse. Please note that your horse is also able to sprint using stamina. You can do this using the default Alt key. Horses are indeed faster, transportation was simplified. Since Oblivion, they took Acrobatics and Athletics skills away, thus you can't improve your speed in such way anymore that it would be faster than a horse. The speed improvements by not being Fatigued and not being overweight are not enough to be significant. All horses in Skyrim have the same speed and hardiness, they are all draft types that resemble a Clydesdale, and all cost 1000 septims. — Wikia - Elder Scrolls V: Skyrim - Horse All horses in Skyrim are the same, seems that they wanted to simplify the whole transportation idea. Restrictions apply on both your character and horse. Without mods, a horse can't be used inside a city. If you do a lot of role-playing within cities having a horse might not be useful. At the same time, characters are limited in Skyrim as Raven Dreamer noted; while you can get over some mountains by jumping left and right trying to get over a rock, a horse will be more superior in performing this task as it is less restricted by physics. You can however be smart enough to choose your path right, rather than trying to work against the physics...
Bir atla koşabileceğinizi unutmayın. Karakterinizle koşabileceğinizi biliyor olabilirsiniz ancak atınızla koşamayacağınızı düşünebilirsiniz. Lütfen atınızın da dayanıklılık kullanarak koşabileceğini unutmayın. Bunu varsayılan Alt tuşunu kullanarak yapabilirsiniz. Atlar gerçekten daha hızlıdır, ulaşım kolaylaştırılmıştır. Oblivion'dan beri Akrobasi ve Atletizm becerilerini kaldırdılar, bu nedenle hızınızı bir atın hızından daha fazla olacak şekilde geliştiremezsiniz. Yorgun olmamak ve fazla kilolu olmamakla gelen hız geliştirmeleri önemli olmak için yeterli değildir. Skyrim'deki tüm atların hızı ve dayanıklılığı aynıdır, hepsi Clydesdale'e benzeyen taslak türleridir ve hepsi 1000 septim'e mal olur. — Wikia - Elder Scrolls V: Skyrim - At Skyrim'deki tüm atlar aynıdır, tüm ulaşım fikrini basitleştirmek istemişler gibi görünüyor. Hem karakteriniz hem de atınız için kısıtlamalar geçerlidir. Modlar olmadan bir at şehir içinde kullanılamaz. Şehirlerde çok fazla rol yapıyorsanız bir ata sahip olmak faydalı olmayabilir. Aynı zamanda, Raven Dreamer'ın belirttiği gibi, Skyrim'de karakterler sınırlıdır; sola ve sağa zıplayarak bazı dağların üzerinden geçebilseniz de, bir at bu görevi yerine getirmede daha üstün olacaktır çünkü fizik tarafından daha az kısıtlanır. Ancak fiziğe karşı çalışmaya çalışmaktansa yolunuzu doğru seçmek için yeterince akıllı olabilirsiniz...
156
Other than rust, corrosion, and other reactions with air that would make the use of a metal unfavorable, how do different metals affect the performance? Let's give Yagi an example: Let's say I use 4 different metals for the directors , reflector, and driven element. One antenna made out of copper, one made out of aluminum, and one made out of a higher resistance conductor, let's say graphite (I know it would snap, I'm just talking theoretical), and iron Other then the metal variations, the antennas are identical. So, do different metals with different conductivity and permiability affect the performance of an antenna including gain, efficiency, impedance, elevation, or any other characteristic other then mechanical strength, and chemical reliability in open air.
Paslanma, korozyon ve havadaki diğer reaksiyonlar bir metalin kullanımını elverişsiz kılacak olsa da, farklı metaller performansı nasıl etkiler? Yagi'ye bir örnek verelim: Direktörler, reflektör ve tahrikli eleman için 4 farklı metal kullandığımı varsayalım. Bir anten bakırdan, biri alüminyumdan ve biri daha yüksek dirençli bir iletkenden, diyelim ki grafitten (kırılacağını biliyorum, sadece teorik olarak konuşuyorum) ve demirden yapılmış. Metal varyasyonları dışında antenler aynı. Yani, farklı iletkenlik ve geçirgenliğe sahip farklı metaller, mekanik mukavemet ve açık havada kimyasal güvenilirlik dışında kazanç, verimlilik, empedans, yükseklik veya başka herhangi bir özelliği içeren bir antenin performansını etkiler mi?
Considering just electrical properties, the most significant parameter for your selection of antenna conductor is resistance. You want to keep the resistance to a minimum, because when current flows through a resistance, the electrical power is converted to heat, according to Joule heating: $$ P = I^2 R $$ Any energy you use to make heat is energy you aren't using to make electromagnetic waves. So first, you should consider the resistivity ($\rho$) of various metals. A lower resistivity means you will need less of a metal to reduce the resistance to an acceptable target. Here's a selection, ordered from lowest to highest resistivity in nano-ohm-meters (nΩm), of some metals you might consider using in an antenna: * Silver: 15.9 * Copper: 16.8 * Gold: 24.4 * Aluminium: 26.2 * Zinc: 59.0 * Nickel: 69.9 * Iron: 100 * Tin: 109 I'm not going to list stainless steel because there are so many kinds, but generally stainless steels are not great conductors, being over 100 on this scale. A high resistivity isn't bad in itself, because you can compensate by making the conductor thicker, and end up with the same resistance. Thus, you might think copper is the best choice (ruling out silver due to high cost), but when you start making mechanical and cost considerations, you may find aluminium is better. This is because for a sample of copper and another of aluminium of equal resistance, the aluminium sample will be bigger, but stiffer, lighter, and cheaper. There's another effect to consider here: with increasing frequency, currents like to flow on the surfaces of conductors. This is called the skin effect. The current flowing only on the skin of a conductor effectively reduces the cross-sectional area, and thus the conductance. Since most of the RF current is only on the surface, it often makes sense to build antennas from tubing for antennas requiring rigid elements (a 440 MHz Yagi), or copper-clad steel for wire antennas requiring tensile strength (a 40 meter dipole). This saves weight and cost for a negligible increase in loss. Magnetic permeability is a factor in skin depth. With increasing permeability, the skin depth decreases, increasing loss. Of the metals listed above, only iron and nickel have significantly higher permeability. Iron by a factor of about 5000, and nickel by 100 to 600. You could compensate for the reduced skin depth by increasing the surface area of the conductor, but when you consider cost and mechanics, it usually makes more sense to simply avoid iron and nickel and alloys containing them.
Sadece elektriksel özellikleri göz önünde bulundurduğumuzda, anten iletkeni seçiminiz için en önemli parametre dirençtir. Direnci minimumda tutmak istersiniz çünkü akım bir dirençten geçtiğinde, Joule ısınmasına göre elektrik gücü ısıya dönüşür: $$ P = I^2 R $$ Isı yapmak için kullandığınız her enerji, elektromanyetik dalgalar yapmak için kullanmadığınız enerjidir. Bu nedenle öncelikle çeşitli metallerin özdirencini ($\rho$) göz önünde bulundurmalısınız. Daha düşük bir özdirenç, direnci kabul edilebilir bir hedefe düşürmek için daha az metale ihtiyacınız olacağı anlamına gelir. İşte bir anten içinde kullanmayı düşünebileceğiniz bazı metallerin nano-ohm-metre (nΩm) cinsinden en düşükten en yükseğe sıralanmış bir seçkisi: * Gümüş: 15,9 * Bakır: 16,8 * Altın: 24,4 * Alüminyum: 26,2 * Çinko: 59,0 * Nikel: 69,9 * Demir: 100 * Kalay: 109 Çok fazla çeşit olduğu için paslanmaz çeliği listelemeyeceğim ancak genel olarak paslanmaz çelikler bu ölçekte 100'ün üzerinde olduğu için iyi iletkenler değildir. Yüksek bir özdirenç kendi başına kötü değildir çünkü iletkeni daha kalın yaparak telafi edebilir ve aynı dirence sahip olabilirsiniz. Bu nedenle bakırın en iyi seçim olduğunu düşünebilirsiniz (yüksek maliyet nedeniyle gümüşü eleyerek) ancak mekanik ve maliyet hususlarını göz önünde bulundurmaya başladığınızda alüminyumun daha iyi olduğunu görebilirsiniz. Bunun nedeni, eşit dirence sahip bir bakır ve bir alüminyum örneği için alüminyum örneğinin daha büyük ancak daha sert, daha hafif ve daha ucuz olmasıdır. Burada dikkate alınması gereken başka bir etki daha var: artan frekansla akımlar iletkenlerin yüzeylerinde akmayı sever. Buna cilt etkisi denir. Sadece bir iletkenin yüzeyinde akan akım, etkili bir şekilde kesit alanını ve dolayısıyla iletkenliği azaltır. RF akımının çoğunun yalnızca yüzeyde olması nedeniyle, katı elemanlar gerektiren antenler (440 MHz Yagi) için tüplerden veya çekme dayanımı gerektiren tel antenler (40 metrelik dipol) için bakır kaplı çelikten antenler yapmak genellikle mantıklıdır. Bu, kayıplarda göz ardı edilebilir bir artış için ağırlıktan ve maliyetten tasarruf sağlar. Manyetik geçirgenlik, cilt derinliğinde bir faktördür. Artan geçirgenlikle cilt derinliği azalır ve kayıp artar. Yukarıda listelenen metallerden yalnızca demir ve nikelin önemli ölçüde daha yüksek geçirgenliği vardır. Demir yaklaşık 5000 faktörle ve nikel 100 ila 600 faktörle. İletkenin yüzey alanını artırarak azalan cilt derinliğini telafi edebilirsiniz ancak maliyet ve mekaniği düşündüğünüzde genellikle demir ve nikelden ve bunları içeren alaşımlardan kaçınmak daha mantıklıdır.
157
Windows in its earliest days was simply a shell that ran on top of MS-DOS, which means that Windows 3.1 itself was actually just a standard MS-DOS application like any other. Yet, MS-DOS is not a multitasking operating system, and at the same time, Windows applications were compiled native-code binaries that ran without any form of managed environment. So, how exactly was multitasking of Windows binaries achieved if Windows 3.1 was simply a regular old MS-DOS program itself? Are there any old technical documents still floating around that describe the early Windows architecture internally?
Windows'un ilk günlerinde, MS-DOS'un üzerinde çalışan basit bir kabuktu, yani Windows 3.1'in kendisi aslında diğerleri gibi standart bir MS-DOS uygulamasıydı. Yine de MS-DOS çoklu görev işletim sistemi değildir ve aynı zamanda Windows uygulamaları, yönetilen bir ortam olmadan çalışan yerel kod ikili dosyaları olarak derlenmiştir. Peki, Windows 3.1'in kendisi normal bir eski MS-DOS programıysa, Windows ikili dosyalarının çoklu görevi tam olarak nasıl sağlandı? Erken Windows mimarisini dahili olarak tanımlayan eski teknik belgeler var mı?
For Win16 programs, Windows implemented co-operative multitasking. Its implementation was based upon the &quot;message loop&quot; architecture of every Windows program. The duty of every program was to endlessly run in a loop in which a call to the ```GetMessage``` function was performed. This function call looks whether a message to this process is in the queue. If there is one, it is retrieved (```GetMessage```), optionally translated (```TranslateMessage```, done to convert keyboard shortcuts into menu actions) and finally, passed to the window procedure (```DispatchMessage```). If there is no message available in the queue, Windows suspends the current task and gives the CPU to another task. This task will try to retrieve a message from its queue as well, yielding the CPU to another task if no message is present and so on. If a program needed to perform background tasks while there were no pending messages in its queue, it would call ```PeekMessage``` instead of ```GetMessage```. This didn't make the task relinquish the CPU, as ```PeekMessage``` would immediately return to the caller task to inform it whether a message is available or not. This was used to time-multiplex message processing with another time-consuming task (think of a 3D program rendering but letting the user cancel that render by pressing a &quot;Cancel&quot; button). If this time-consuming task was actually very time-consuming, a well-behaved program should call the ```Yield``` function from time to time, to relinquish the CPU and let other tasks run. A badly-behaved program could easily hog the CPU by not retrieving messages too often or by spending too much time in a window procedure function. The situation was quite different for MS-DOS boxes. They ran using the V8086 mode of the 80386 (if Windows was running in enhanced mode). Windows-aware programs ran in the so-called System VM (Virtual Machine 1). DOS boxes ran from VM 2 upwards. DOS programs usually were badly-behaved programs, so Windows assigned each DOS box a different virtual machine. Virtual machines used pre-emptive multitasking in Windows 3.1, so each DOS box could run concurrently to others and to any Windows-aware program.
Win16 programları için Windows, işbirlikçi çoklu görevlendirme uyguladı. Uygulaması, her Windows programının "mesaj döngüsü" mimarisine dayanıyordu. Her programın görevi, ```GetMessage``` fonksiyonuna bir çağrı yapılan bir döngüde sonsuz bir şekilde çalışmasıydı. Bu fonksiyon çağrısı, bu işleme ait bir mesajın kuyrukta olup olmadığına bakar. Varsa, alınır (```GetMessage```), isteğe bağlı olarak çevrilir (```TranslateMessage```, klavye kısayollarını menü eylemlerine dönüştürmek için yapılır) ve son olarak pencere prosedürüne (```DispatchMessage```) geçirilir. Kuyrukta mevcut bir mesaj yoksa, Windows geçerli görevi askıya alır ve CPU'yu başka bir göreve verir. Bu görev de kendi kuyruğundan bir mesaj almaya çalışır ve mesaj yoksa CPU'yu başka bir göreve devreder ve bu böyle devam eder. Bir program, kuyruğunda bekleyen mesajlar yokken arka plan görevleri gerçekleştirmek istiyorsa, ```GetMessage``` yerine ```PeekMessage``` çağırırdı. Bu, ```PeekMessage``` mesajın mevcut olup olmadığını bildirmek için arayan göreve hemen döneceğinden, görevin CPU'yu bırakmasına neden olmazdı. Bu, mesaj işlemeyi başka bir zaman alıcı görevle zaman çoklama yapmak için kullanılırdı (bir 3D programın işlenmesini düşünün, ancak kullanıcının "İptal" düğmesine basarak bu işlemeyi iptal etmesine izin verin). Bu zaman alıcı görev gerçekten çok zaman alıyorsa, iyi davranan bir program, CPU'yu bırakmak ve diğer görevlerin çalışmasına izin vermek için zaman zaman ```Yield``` fonksiyonunu çağırmalıdır. Kötü davranan bir program, mesajları çok sık almamak veya bir pencere prosedürü fonksiyonunda çok fazla zaman geçirmek suretiyle CPU'yu kolayca tekeline alabilir. MS-DOS kutuları için durum oldukça farklıydı. 80386'nın V8086 modunu kullanarak çalıştılar (Windows gelişmiş modda çalışıyorsa). Windows uyumlu programlar, Sistem VM (Sanal Makine 1) olarak adlandırılan yerde çalıştı. DOS kutuları VM 2'den yukarıda çalıştı. DOS programları genellikle kötü davranan programlardı, bu nedenle Windows her DOS kutusuna farklı bir sanal makine atadı. Sanal makineler, Windows 3.1'de önleyici çoklu görevlendirme kullandı, böylece her DOS kutusu diğerleriyle ve herhangi bir Windows uyumlu programla eşzamanlı olarak çalışabilirdi.
158
I'm working on 2 different branches: release and development. I noticed I still need to integrate some changes that were committed to the release branch back into the development branch. The problem is I don't need all of the commit, only some hunks in certain files, so a simple ```git cherry-pick bc66559 ``` does not do the trick. When I do a ```git show bc66559 ``` I can see the diff but don't really know a good way of applying that partially to my current working tree.
2 farklı dal üzerinde çalışıyorum: sürüm ve geliştirme. Sürüm dalına eklenen bazı değişiklikleri geliştirme dalına geri entegre etmem gerektiğini fark ettim. Sorun şu ki tüm commit'lere değil, yalnızca belirli dosyalardaki bazı hunlara ihtiyacım var, bu nedenle basit bir ```git cherry-pick bc66559 ``` işe yaramaz. ```git show bc66559 ``` yaptığımda diff'i görebiliyorum ancak bunu kısmen geçerli çalışma ağacıma uygulamanın iyi bir yolunu bilmiyorum.
The core thing you're going to want here is ```git add -p``` (```-p``` is a synonym for ```--patch```). This provides an interactive way to add in content, letting you decide whether each hunk should go in or not, and even letting you manually edit the patch if necessary. To use it in combination with cherry-pick: ```git cherry-pick -n # get your patch, but don't commit (-n = --no-commit) git reset # unstage the changes from the cherry-picked commit git add -p # make all your choices (add the changes you do want) git commit # make the commit! ``` ``git-cherry-pick``` has a ```--no-commit``` option, and you need to do ```git reset```. If you only want to leave a few things out of the commit, you could use ```git reset ...``` to unstage just those files.) You can provide specific paths to ```add -p``` if necessary. If you're starting with a patch you could replace the ```cherry-pick``` with ```apply```. If you really want to ```git cherry-pick -p ``` (that option does not exist), you can use ```git checkout -p ``` That will diff the current commit against the commit you specify, and allow you to apply hunks from that diff individually. This option may be more useful if the commit you're pulling in has merge conflicts in part of the commit you're not interested in. (Note, however, that ```checkout``` differs from ```cherry-pick```: ```checkout``` tries to apply ``````'s contents entirely, while ```cherry-pick``` applies the diff of the specified commit from it's parent. This means that ```checkout``` can apply more than just that commit, which might be more than you want.)
Burada isteyeceğiniz temel şey ```git add -p```'dir (```-p```, ```--patch```'in eş anlamlısıdır). Bu, içeriği eklemek için etkileşimli bir yol sağlar, her bir parçanın girip girmeyeceğine karar vermenize ve gerekirse yamayı manuel olarak düzenlemenize olanak tanır. Cherry-pick ile birlikte kullanmak için: ```git cherry-pick -n # yamanızı alın, ancak taahhüt etmeyin (-n = --no-commit) git reset # cherry-pick edilen taahhütten değişiklikleri kaldırın git add -p # tüm seçimlerinizi yapın (istediğiniz değişiklikleri ekleyin) git commit # taahhüdü yapın! ``` ``git-cherry-pick```'in ```--no-commit``` seçeneği vardır ve ```git reset``` yapmanız gerekir. Taahhütten yalnızca birkaç şeyi dışarıda bırakmak istiyorsanız, yalnızca bu dosyaların kaldırılması için ```git reset ...``` kullanabilirsiniz.) Gerekirse ```add -p```'ye belirli yollar sağlayabilirsiniz. Bir yamayla başlıyorsanız, ```cherry-pick```'i ```apply``` ile değiştirebilirsiniz. Gerçekten ```git cherry-pick -p ``` istiyorsanız (bu seçenek mevcut değil), kullanabilirsiniz ```git checkout -p ``` Bu, geçerli taahhüdü belirttiğiniz taahhütle karşılaştıracak ve bu farktan parçaları tek tek uygulamanıza olanak tanıyacaktır. Bu seçenek, içeri aktardığınız taahhüdün, ilginizi çekmeyen taahhüdün bir kısmında birleştirme çakışmaları varsa daha faydalı olabilir. (Ancak, ```checkout```'un ```cherry-pick```'ten farklı olduğunu unutmayın: ```checkout```, ``````'in içeriğini tamamen uygulamaya çalışırken, ```cherry-pick``` belirtilen taahhüdün farkını ebeveyninden uygular. Bu, ```checkout```'un yalnızca bu taahhütten fazlasını uygulayabileceği anlamına gelir, bu da istediğinizden fazla olabilir.)
159
In Civilization V, you attain a cultural victory by accumulating enough culture to purchase at least 36 social policies, and then building a wonder. The catch is that the more cities you build, the more culture you need to generate before you hit the next "plateau" of culture. What is the ideal number of cities for a cultural victory? Does it change over time?
Civilization V'te, en az 36 sosyal politika satın alacak kadar kültür biriktirerek ve ardından bir harikayı inşa ederek kültürel bir zafere ulaşırsınız. İşin püf noktası, ne kadar çok şehir inşa ederseniz, bir sonraki kültür "platforma" ulaşmadan önce o kadar fazla kültür üretmeniz gerektiğidir. Kültürel bir zafer için ideal şehir sayısı nedir? Zamanla değişir mi?
The question you're really asking is &quot;When does the combined culture / turn of an additional city outstrip the increase in social policy cost incurred by founding that city?&quot; The short answer is... We know that adding another city increases the culture costs by approximately 30% of the base cost (that of 1 city). Therefore: If your maximum potential culture / turn won't increase by at least 30% due to the new city, you are hurting, not helping, the time till your next social policy. (This may be slightly hard to calculate, and if you take too long to reach your &quot;maximum potential culture / turn&quot; you're actually wasting turns.) The long answer is... It depends To begin with, we need to make some assumptions: * When you found a new city, you can get its culture / turn maximized within a single turn by buying the necessary building improvements (monument, etc). * Ignore city-states, leader specific abilities, +culture social policies, and wonders. These all help produce culture, and will shift the &quot;ideal city count&quot; down, but do so inconsistently. To produce an &quot;ideal&quot; city count, we limit ourselves by era and improvements alone. * This list of social policy costs is accurate for the given parameters: medium map and normal speed. And now, some math. The 1st social policy costs 25 points with a single city. In the ancient era, your cities can generate 2 culture / turn due to the monument. (Remember, we're ignoring the palace for now) This means that it will take 13 turns (Ceiling(25/2) to enact the policy, or 9 turns (ceiling (45/4) with two cities. We can continue this extrapolation -- 8 turns with 3 cities, 7 turns with 4 cities, 6 turns with 5 cities, and we finally reach diminishing returns at city 6 (also 6 turns). For the second social policy, the ramifications of the # of cities gets magnified due to a larger starting value: One city takes 23 turns, two cities take 15 turns, three cities take 13 turns, four cities take 12, five cities take 10, and again, we run into diminishing returns cap out at at six cities (10 turns). It is not until the 4th social policy that this trend is broken and diminishing returns end at the NINTH! city. Remember -- this assumes that each city has a monument the minute it is founded. Now let's say we've reached the classical age, and have temples in addition to monuments. Each city is now generating 5 culture. The first policy takes 5 turns with a single city, 4 turns with two, and 3 with three. What (hopefully) becomes clear is that we reached diminishing returns (4 cities as opposed to 6 cities) much faster when each individual city's contribution is higher. The more culture any one city is capable of producing, the more incentive there is to produce more cities. Even if you don't manage to build every +culture improvement immediately, you're still likely to come out ahead (as long as you're pre-diminishing returns). So while the optimal number of cities changes due to any number of factors, you can probably safely not shoot yourself in the foot if you stay between three and six cities, with six being on the high end.
Asıl sorduğun soru şu: "Ek bir şehrin getirdiği kültür/tur, o şehri kurmanın getirdiği sosyal politika maliyetindeki artışı ne zaman aşar?" Kısa cevap şu... Başka bir şehir eklemenin kültür maliyetlerini yaklaşık %30 oranında (1 şehrin maliyetinin) artırdığını biliyoruz. Bu nedenle: Yeni şehir nedeniyle maksimum potansiyel kültürün/turun en az %30 oranında artmayacağı durumda, bir sonraki sosyal politikanıza kadar geçen süreyi uzatıyor, kısaltmıyorsunuz. (Hesaplaması biraz zor olabilir ve "maksimum potansiyel kültür/tur"a ulaşmanız çok uzun sürerse aslında turlarınızı boşa harcıyorsunuz.) Uzun cevap şu... Duruma bağlı Başlangıç olarak bazı varsayımlarda bulunmamız gerekiyor: * Yeni bir şehir kurduğunuzda, gerekli bina iyileştirmelerini (anıt vb.) satın alarak kültürünü/turunu tek bir turda maksimize edebilirsiniz. * Şehir devletlerini, lidere özgü yetenekleri, +kültür sosyal politikalarını ve harikaları göz ardı edin. Bunların hepsi kültür üretmeye yardımcı olur ve "ideal şehir sayısını" aşağı çeker, ancak bunu tutarsız bir şekilde yapar. "İdeal" bir şehir sayısı üretmek için kendimizi yalnızca dönemler ve iyileştirmelerle sınırlarız. * Bu sosyal politika maliyetleri listesi verilen parametreler için doğrudur: orta harita ve normal hız. Ve şimdi biraz matematik. 1. sosyal politika, tek bir şehirle 25 puana mal olur. Antik çağda, şehirleriniz anıt sayesinde tur başına 2 kültür üretebilir. (Sarayı şimdilik göz ardı ettiğimizi unutmayın) Bu, politikanın yürürlüğe girmesi için 13 tur (Tavan(25/2) veya iki şehirle 9 tur (tavan (45/4) süreceği anlamına gelir. Bu ekstrapolasyonu sürdürebiliriz -- 3 şehirle 8 tur, 4 şehirle 7 tur, 5 şehirle 6 tur ve nihayet 6. şehirde (yine 6 tur) azalan getiriye ulaşırız. İkinci sosyal politika için, şehir sayısının sonuçları daha büyük bir başlangıç değeri nedeniyle büyür: Bir şehir 23 tur, iki şehir 15 tur, üç şehir 13 tur, dört şehir 12 tur, beş şehir 10 tur alır ve yine azalan getiriler altı şehirde (10 tur) zirveye ulaşır. Bu eğilimin kırıldığı ve azalan getirilerin DOKUZUNCU! şehirde sona erdiği 4. sosyal politikaya kadar sürmez. Unutmayın -- bu, her şehrin kurulduğu anda bir anıtı olduğu varsayımına dayanır. Şimdi klasik çağa ulaştığımızı ve anıtlara ek olarak tapınaklarımız olduğunu varsayalım. Her şehir artık 5 kültür üretiyor. İlk politika tek bir şehirle 5 tur, iki şehirle 4 tur ve üç şehirle 3 tur sürer. (Umarım) açıkça görülen şey, her bir şehrin katkısı daha yüksek olduğunda azalan getiriye (6 şehir yerine 4 şehir) çok daha hızlı ulaştığımızdır. Herhangi bir şehrin üretebileceği kültür ne kadar fazlaysa, daha fazla şehir üretmek için o kadar fazla teşvik vardır. Hemen her +kültür iyileştirmesini inşa etmeyi başaramasanız bile, yine de öne geçme olasılığınız yüksektir (azalan getiriler öncesinde olduğunuz sürece). Bu nedenle, optimum şehir sayısı birçok faktöre bağlı olarak değişse de, altı şehirle yüksek uçta kalarak üç ila altı şehir arasında kalırsanız muhtemelen kendinize zarar vermezsiniz.
160
How to find if a customer is logged in or not in Magento 2. If the customer is logged in then how to get customer data from a session?
Magento 2'de bir müşterinin giriş yapıp yapmadığını nasıl bulabilirim? Müşteri giriş yapmışsa, bir oturumdan müşteri verileri nasıl alınır?
It is possible via ```Magento\Framework\App\Http\Context``` or via ```Magento\Customer\Model\Session```. However, the result may be different: * HTTP context is initialized earlier than the customer session (but it does not matter since both are initialized in action controllers) * When the ```PageCache``` module is on (probably always on production), keep in mind that as soon as layout generation started, the customer session will be cleared by ```\Magento\PageCache\Model\Layout\DepersonalizePlugin::afterGenerateXml``` on all cacheable pages. It means that if you now check if the customer is logged in via the HTTP context, it will still say 'yes, but customer data will not be available in customer sessions anymore. So double-check is necessary before trying to access data in customer sessions. This can easily happen in the block, while is unlikely in action controller since you are not expected to generate layout manually there, it will be generated after-action controller returns an instance of ```ResultInterface``` To eliminate any risk of described inconsistencies when PageCache is on, consider using customer session if it is already initialized (true for action controllers). Else use the HTTP context.
```Magento\Framework\App\Http\Context``` veya ```Magento\Customer\Model\Session``` üzerinden mümkündür. Ancak sonuç farklı olabilir: * HTTP bağlamı, müşteri oturumundan daha önce başlatılır (ancak her ikisi de eylem denetleyicilerinde başlatıldığı için önemli değildir) * ```PageCache``` modülü açıkken (muhtemelen her zaman üretimde), düzen oluşturma işlemi başlar başlamaz, müşteri oturumu tüm önbelleğe alınabilir sayfalarda ```\Magento\PageCache\Model\Layout\DepersonalizePlugin::afterGenerateXml``` tarafından temizleneceğini unutmayın. Bu, HTTP bağlamı üzerinden müşterinin giriş yapıp yapmadığını kontrol ederseniz, yine de 'evet' diyeceğini ancak müşteri verilerinin artık müşteri oturumlarında mevcut olmayacağını gösterir. Bu nedenle, müşteri oturumlarındaki verilere erişmeye çalışmadan önce iki kez kontrol etmek gerekir. Bu, blokta kolayca gerçekleşebilirken, eylem denetleyicisinde olası değildir çünkü orada düzeni manuel olarak oluşturmanız beklenmez, ```ResultInterface``` örneği döndürdükten sonra düzen oluşturulacaktır. PageCache açıkken açıklanan tutarsızlık riskini ortadan kaldırmak için, zaten başlatılmışsa (eylem denetleyicileri için geçerlidir) müşteri oturumunu kullanmayı düşünün. Aksi takdirde HTTP bağlamını kullanın.
161
I have a 9 year old daughter that has expressed some interest in manga, but I'm having trouble locating series that are appropriate for her age. No one at our local bookstore could offer any advice. Is there a kid-friendly imprint or other resource I could use to help her find something appropriate? My preference is for physical books but I'm willing to explore digital options.
9 yaşında bir kızım var ve mangaya ilgi duyduğunu söyledi ancak yaşına uygun serileri bulmakta zorlanıyorum. Yerel kitapçımızda kimse bana tavsiyede bulunamadı. Çocuklara uygun bir baskı veya ona uygun bir şey bulmasına yardımcı olabilecek başka bir kaynak var mı? Fiziksel kitapları tercih ederim ancak dijital seçenekleri de araştırmaya hazırım.
The content deemed acceptable for Japanese children generally differs from the concept in other countries; manga contains all genres of stories, so one cannot responsibly presume that just because a title was marketed at Japanese kids, that you would likewise consider it appropriate for your kid of the same age. As one example: The popular girl's series Sailor Moon was published in the manga magazine Nakayoshi, which was marketed toward elementary school-age girls (1st through 6th grade). This series includes strong language, bullying, violence, death, war, genocide, refugees, lovers' suicide (more than once), non-consensual kisses (forced while awake, while asleep, while drunk), a father fondling his adult daughter while brainwashed, human/animal romance, demonic-style alien possession of human bodies, nudity, cross-dressing, a non-monogamous lesbian couple, and non-graphic sex resulting in teen pregnancy (the 90s anime version, also marketed toward children, also added wrist/ankle restraints for a rape-like, pain-inducing entering of victims). There are many manga reviews on the web, including those that specifically for parents and teen/preteen/kid readers on what sort of possibly objectionable content is included in the title (such as strong language, violence, nudity, gender-bending, innuendo, sexual content, etc.) and what sort of general content you can expect (for example: horror, potty humor, serious themes like depression/body image/sexual orientation/prostitution/parental abandonment/bullying/suicide) and let you as the parent or the reader use your own judgment about whether a title fits what you deem appropriate at what age. Browsing reviews also allows you to seek out titles that reinforce and contribute to your family's values (such as traits of selflessness, generosity, celebration of uniqueness, etc.). Some good starting places are: * A Parent's Guide to Anime * Good Manga for Kids at Manga Bookshelf * Good Comics for Kids at School Library Journal * Kids Manga at No Flying No Tights Since you have a daughter, she may be especially interested in shoujo manga, which was written with the target audience of Japanese girls. Within shoujo, nearly all genres of stories are included; some titles are very cheerful and innocuous and teach a moral-of-the-day, others are dark and heavy. Good starting places to get informed are: * What is Shoujo Manga?, What Shoujo Manga Are and Are Not, and Recommended Shoujo Manga by Matt Thorn, a professor in the Faculty of Manga at Kyoto Seika University (one of the world's experts on shoujo manga) * What is Shoujo? at Energetic Heartbeats Some shoujo manga review sites are: * The Classics at Shoujo Corner * Emily's Random Shoujo Manga Page (despite its unassuming name, contains many detailed reviews) * Heart of Manga * Shoujo Savvy * Shoujo Manga Recommendations * Romance Manga Reviews * Shoujo Manga Reviews * Shoujo Manga with Anime at Anime Manga Reviews More general review websites include MangaBlog and Kuriousity, and a Google search will find you many more.
Genellikle Japon çocukları için kabul edilebilir görülen içerik, diğer ülkelerdeki kavramdan farklılık gösterir; mangalar her türden hikaye içerir, bu nedenle bir başlığın Japon çocuklarına pazarlanmış olması, aynı yaştaki çocuğunuz için de uygun olduğunu sorumsuzca varsayamazsınız. Bir örnek olarak: Popüler kız serisi Sailor Moon, ilkokul çağındaki kızlara (1. ila 6. sınıf) pazarlanan Nakayoshi manga dergisinde yayınlandı. Bu seri sert dil, zorbalık, şiddet, ölüm, savaş, soykırım, mülteciler, sevgililerin intiharı (birden fazla kez), rızasız öpücükler (uyanıkken, uyurken, sarhoşken zorla), beyni yıkanmış bir babanın yetişkin kızını okşaması, insan/hayvan aşkı, insan bedenlerine şeytani tarzda uzaylıların musallat olması, çıplaklık, çapraz giyinme, tek eşli olmayan lezbiyen bir çift ve genç hamilelikle sonuçlanan grafik olmayan seks (ayrıca çocuklara pazarlanan 90'ların anime versiyonu, kurbanların tecavüz benzeri, acı verici bir şekilde girmesi için bilek/ayak bileği kısıtlamaları da ekledi). Web'de, özellikle ebeveynler ve genç/ergen/çocuk okuyucular için bir başlıkta hangi tür itiraz edilebilir içeriğin bulunduğu (sert dil, şiddet, çıplaklık, cinsiyet değiştirme, ima, cinsel içerik vb.) ve ne tür genel içerik bekleyebileceğiniz (örneğin: korku, tuvalet mizahı, depresyon/vücut imajı/cinsel yönelim/fuhuş/ebeveyn terk edilmesi/zorbalık/intihar gibi ciddi temalar) konusunda birçok manga incelemesi vardır ve ebeveyn veya okuyucu olarak bir başlığın hangi yaşta uygun gördüğünüz konusunda kendi kararınızı vermenize olanak tanır. İncelemelere göz atmak, aynı zamanda ailenizin değerlerini güçlendiren ve bunlara katkıda bulunan başlıkları (bencillik, cömertlik, benzersizliğin kutlanması vb. gibi özellikler) aramanıza da olanak tanır. Başlamak için bazı iyi yerler şunlardır: * Ebeveynler için Anime Rehberi * Manga Bookshelf'te Çocuklar İçin İyi Mangalar * School Library Journal'da Çocuklar İçin İyi Çizgi Romanlar * No Flying No Tights'ta Çocuk Mangaları Bir kızınız olduğu için, Japon kızlarını hedef kitle olarak yazılmış olan shoujo mangalarına özellikle ilgi duyabilir. Shoujo'nun içinde hemen hemen her türden hikaye yer alır; bazı başlıklar çok neşeli ve zararsızdır ve günün ahlakını öğretir, diğerleri ise karanlık ve ağırdır. Bilgi edinmek için iyi başlangıç noktaları şunlardır: * Shoujo Mangası Nedir?, Shoujo Mangaları Nelerdir ve Değildir ve Kyoto Seika Üniversitesi'nde Manga Fakültesi profesörü Matt Thorn'un (shoujo mangası konusunda dünyanın uzmanlarından biri) Önerdiği Shoujo Mangaları * Energetic Heartbeats'te Shoujo Nedir? Bazı shoujo manga inceleme siteleri şunlardır: * Shoujo Corner'da Klasikler * Emily's Random Shoujo Manga Page (mütevazı adına rağmen birçok ayrıntılı inceleme içerir) * Heart of Manga * Shoujo Savvy * Shoujo Manga Önerileri * Romantik Manga İncelemeleri * Shoujo Manga İncelemeleri * Anime Manga İncelemelerinde Animeli Shoujo Mangaları Daha genel inceleme web siteleri arasında MangaBlog ve Kuriousity bulunur ve bir Google araması size daha fazlasını bulacaktır.
162
I'm looking for a precise piece of information in a database which I have no knowledge about. The database is on a separate machine, but I can log into it, and launch a ```psql``` command line, with administrator rights. It's a third-party product, and they are slow to answer questions. I know the data is inside that database, so I want to do a little bit of reverse-engineering. Given a table name, is it possible to get a list of the names of the columns in that table? For example, in SQL Server, it's possible to dump a table into a reusable ```CREATE``` statement, which textually lists all the columns the table is composed of.
Hiçbir bilgim olmayan bir veritabanında kesin bir bilgi parçası arıyorum. Veritabanı ayrı bir makinede, ancak yönetici haklarıyla oturum açabilir ve bir ```psql``` komut satırı başlatabilirim. Bu üçüncü taraf bir ürün ve soruları cevaplamakta yavaşlar. Verilerin o veritabanının içinde olduğunu biliyorum, bu yüzden biraz tersine mühendislik yapmak istiyorum. Bir tablo adı verildiğinde, o tabloda bulunan sütunların adlarının bir listesini almak mümkün mü? Örneğin, SQL Server'da, tabloyu tabloda bulunan tüm sütunları metinsel olarak listeleyen yeniden kullanılabilir bir ```CREATE``` ifadesine dökmek mümkündür.
The information schema is the slow and sure way: it is standardized and largely portable to other databases that support it. And it will keep working across major versions. However, views in the information schema often join many tables from the system catalogs to meet a strictly standardized format - many of which are just dead freight most of the time. This makes them slow. The Postgres developers aren't making promises, but basics (like what is needed here) aren't going to change across major versions. More detailed assessment: * Query to output names and data types of a query, table or view ```psql``` (the native command-line interface) takes the fast lane, of course, and queries the source directly. If you start ```psql``` with the parameter ```-E```, the SQL behind backslash commands like ```\d``` is displayed. Or ```\set ECHO_HIDDEN on``` from the psql command line. Starting from there you can build an answer to your question. Given one table, is it possible to have a list of the names of the columns for this table. ```SELECT attrelid::regclass AS tbl , attname AS col , atttypid::regtype AS datatype -- more attributes? FROM pg_attribute WHERE attrelid = 'myschema.mytable'::regclass -- table name optionally schema-qualified AND attnum > 0 AND NOT attisdropped ORDER BY attnum; ``` Faster than querying ```information_schema.columns```. Try ```EXPLAIN ANALYZE``` to see for yourself. Still hardly matters for a one-time look-up. But might make a difference if used in a query / function that's repeated many times. There are also subtle differences in visibility. The following artical has detailed comparison: * How to check if a table exists in a given schema
Bilgi şeması yavaş ve emin bir yoldur: standartlaştırılmıştır ve büyük ölçüde bunu destekleyen diğer veritabanlarına taşınabilir. Ve büyük sürümler arasında çalışmaya devam edecektir. Ancak, bilgi şemasındaki görünümler genellikle kesinlikle standartlaştırılmış bir formatı karşılamak için sistem kataloglarından birçok tabloya katılır - bunların çoğu çoğu zaman sadece ölü yüktür. Bu onları yavaşlatır. Postgres geliştiricileri söz vermiyor, ancak temel bilgiler (burada ihtiyaç duyulanlar gibi) büyük sürümler arasında değişmeyecek. Daha ayrıntılı değerlendirme: * Bir sorgu, tablo veya görünümün adlarını ve veri türlerini çıkarmak için sorgu ```psql``` (yerel komut satırı arayüzü) elbette hızlı şeridi alır ve kaynağa doğrudan sorgu gönderir. ```psql```'i ```-E``` parametresiyle başlatırsanız, ```\d``` gibi ters eğik çizgi komutlarının ardındaki SQL görüntülenir. Veya psql komut satırından ```\set ECHO_HIDDEN on```. Oradan sorunuza bir cevap oluşturabilirsiniz. Bir tablo verildiğinde, bu tablo için sütun adlarının bir listesine sahip olmak mümkün müdür? ```SELECT attrelid::regclass AS tbl , attname AS col , atttypid::regtype AS datatype -- daha fazla öznitelik? FROM pg_attribute WHERE attrelid = 'myschema.mytable'::regclass -- tablo adı isteğe bağlı olarak şema nitelikli AND attnum > 0 AND NOT attisdropped ORDER BY attnum; ``` ```information_schema.columns``` sorgusundan daha hızlı. Kendiniz görmek için ```EXPLAIN ANALYZE```'i deneyin. Tek seferlik bir arama için yine de pek önemli değil. Ancak birçok kez tekrarlanan bir sorguda/işlevde kullanılırsa bir fark yaratabilir. Görünürlükte de ince farklılıklar vardır. Aşağıdaki makale ayrıntılı bir karşılaştırma içerir: * Belirli bir şemada bir tablonun var olup olmadığını kontrol etme
163
I am using Visual Studio Code and have a fairly common project structure: ```├── client/ │ ├── tsconfig.json ├── shared/ ├── server/ │ ├── tsconfig.json ├── project.json ``` The two tsconfig files have different settings (e.g. the one under ```client/``` targets ES5, the one under ```server/``` targets ES6). Note that there is no tsconfig in the root directory. The problem is that I want the shared directory to be included in both projects. I can't do this using tsconfig because the ```exclude``` option won't let me include a folder that is in a higher directory than the tsconfig.json, and using ```files``` I have to constantly keep the list of files up to date as it doesn't support globs. Note that I can compile fine by adding the shared folder into tsc, what I want is for the Visual Studio Code IDE to recognise the shared code for intellisense etc. Is the only option to wait for filesGlob?
Visual Studio Code kullanıyorum ve oldukça yaygın bir proje yapısına sahibim: ```├── client/ │ ├── tsconfig.json ├── shared/ ├── server/ │ ├── tsconfig.json ├── project.json ``` İki tsconfig dosyasının farklı ayarları var (örneğin ```client/``` altındaki ES5'i hedefler, ```server/``` altındaki ES6'yı hedefler). Kök dizinde tsconfig olmadığına dikkat edin. Sorun, shared dizininin her iki projeye de dahil edilmesini istemem. Bunu tsconfig kullanarak yapamam çünkü ```exclude``` seçeneği, tsconfig.json'dan daha yüksek bir dizinde olan bir klasörü dahil etmeme izin vermez ve ```files``` kullanarak, küresel ifadeleri desteklemediği için dosya listesini sürekli güncel tutmam gerekir. Shared klasörünü tsc'ye ekleyerek sorunsuz bir şekilde derleyebildiğimi unutmayın, istediğim şey Visual Studio Code IDE'nin shared kodunu akıllı tamamlama vb. için tanıması. Tek seçenek filesGlob'u beklemek mi?
These days it is much easier as vscode has better support for this. You can use this directory structure so all the code is independent: ```├── frontend/ │ ├── src/ │ │ ├── │ ├── package.json │ ├── tsconfig.json ├── shared/ │ ├── package.json ├── backend/ │ ├── src/ │ │ ├── │ ├── package.json │ ├── tsconfig.json ``` Then in both the backend and frontend ```tsconfig.json```: ```{ &quot;compilerOptions&quot;: { &quot;paths&quot;: { &quot;~shared/*&quot;: [&quot;../shared/*&quot;] }, &quot;rootDirs&quot;: [ &quot;./src&quot;, &quot;../shared&quot; ] } } ``` To allow access to the shared code e.g.: ```import { Foo } from '~shared/foo'; ```
Günümüzde vscode'nin bu konuda daha iyi desteği olduğu için çok daha kolay. Tüm kodun bağımsız olması için bu dizin yapısını kullanabilirsiniz: ```├── frontend/ │ ├── src/ │ │ ├── │ ├── package.json │ ├── tsconfig.json ├── shared/ │ ├── package.json ├── backend/ │ ├── src/ │ │ ├── │ ├── package.json │ ├── tsconfig.json ``` Ardından hem backend hem de frontend ```tsconfig.json```'da: ```{ &quot;compilerOptions&quot;: { &quot;paths&quot;: { &quot;~shared/*&quot;: [&quot;../shared/*&quot;] }, &quot;rootDirs&quot;: [ &quot;./src&quot;, &quot;../shared&quot; ] } } ``` Paylaşılan koda erişime izin vermek için örneğin: ```import { Foo } from '~shared/foo'; ```
164
I have the following method to save an Object to a file: ```// Save an object out to the disk public static void SerializeObject(this T toSerialize, String filename) { XmlSerializer xmlSerializer = new XmlSerializer(toSerialize.GetType()); TextWriter textWriter = new StreamWriter(filename); xmlSerializer.Serialize(textWriter, toSerialize); textWriter.Close(); } ``` I confess I did not write it (I only converted it to a extension method that took a type parameter). Now I need it to give the xml back to me as a string (rather than save it to a file).
Bir Nesneyi bir dosyaya kaydetmek için şu yönteme sahibim: ``` // Bir nesneyi diske kaydet public static void SerializeObject(this T toSerialize, String filename) { XmlSerializer xmlSerializer = new XmlSerializer(toSerialize.GetType()); TextWriter textWriter = new StreamWriter(filename); xmlSerializer.Serialize(textWriter, toSerialize); textWriter.Close(); } ``` Bunu yazmadığımı itiraf ediyorum (sadece bir tür parametresi alan bir uzantı yöntemine dönüştürdüm). Şimdi xml'i bana bir dosyaya kaydetmek yerine bir dize olarak geri vermesi gerekiyor.
Use a `StringWriter` instead of a `StreamWriter`: ``` public static string SerializeObject<T>(this T toSerialize) { XmlSerializer xmlSerializer = new XmlSerializer(toSerialize.GetType()); using(StringWriter textWriter = new StringWriter()) { xmlSerializer.Serialize(textWriter, toSerialize); return textWriter.ToString(); } } ``` Note, it is important to use `toSerialize.GetType()` instead of `typeof(T)` in XmlSerializer constructor: if you use the first one the code covers all possible subclasses of `T` (which are valid for the method), while using the latter one will fail when passing a type derived from `T`. There is some example code on Ideone that motivates this statement, with XmlSerializer throwing an `Exception` when `typeof(T)` is used, because you pass an instance of a derived type to a method that calls SerializeObject that is defined in the derived type's base class. Also, Ideone uses Mono to execute code; the actual `Exception` you would get using the Microsoft .NET runtime has a different `Message` than the one shown on Ideone, but it fails just the same.
`StreamWriter` yerine `StringWriter` kullanın: ``` public static string SerializeObject<T>(this T toSerialize) { XmlSerializer xmlSerializer = new XmlSerializer(toSerialize.GetType()); using(StringWriter textWriter = new StringWriter()) { xmlSerializer.Serialize(textWriter, toSerialize); return textWriter.ToString(); } } ``` XmlSerializer oluşturucusunda `typeof(T)` yerine `toSerialize.GetType()` kullanmanın önemli olduğunu unutmayın: ilkini kullanırsanız kod `T`'nin tüm olası alt sınıflarını kapsar (yöntem için geçerli olanlar), ikincisini kullanmak ise `T`'den türetilmiş bir türü geçirirken başarısız olur. Bu ifadeyi destekleyen Ideone'da bazı örnek kodlar vardır, XmlSerializer, `typeof(T)` kullanıldığında bir `Exception` fırlatır, çünkü türetilmiş bir türün bir örneğini, SerializeObject'i çağıran ve türetilmiş türün temel sınıfında tanımlanan bir yönteme geçirirsiniz. Ayrıca, Ideone kod çalıştırmak için Mono kullanır; Microsoft .NET çalışma zamanını kullanarak alacağınız gerçek `Exception`, Ideone'da gösterilenden farklı bir `Message`'a sahiptir, ancak yine de aynı şekilde başarısız olur.
165
I have a problem with the embedded bitcode term. What is embedded bitcode? When to enable, ```ENABLE_BITCODE``` in new Xcode? What happens to the binary when enabled, ```ENABLE_BITCODE``` in Xcode 7?
Gömülü bit kodu terimiyle ilgili bir sorunum var. Gömülü bit kodu nedir? Yeni Xcode'da ```ENABLE_BITCODE``` ne zaman etkinleştirilir? Xcode 7'de ```ENABLE_BITCODE``` etkinleştirildiğinde ikili dosyaya ne olur?
> What is embedded bitcode? According to docs: > Bitcode is an intermediate representation of a compiled program. Apps you upload to iTunes Connect that contain bitcode will be compiled and linked on the App Store. Including bitcode will allow Apple to re-optimize your app binary in the future without the need to submit a new version of your app to the store. This phrase in "New Features in Xcode 7" made me to think for a long time that Bitcode is needed for Slicing to reduce app size: When you archive for submission to the App Store, Xcode will compile your app into an intermediate representation. The App Store will then compile the bitcode down into the 64 or 32 bit executables as necessary. However that's not true, Bitcode and Slicing work independently: Slicing is about reducing app size and generating app bundle variants, and Bitcode is about certain binary optimizations. I've verified this by checking included architectures in executables of non-bitcode apps and founding that they only include necessary ones. Bitcode allows other App Thinning component called Slicing to generate app bundle variants with particular executables for particular architectures, e.g. iPhone 5S variant will include only arm64 executable, iPad Mini armv7 and so on. > When to enable ENABLE_BITCODE in new Xcode? For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS and tvOS apps, bitcode is required. > What happens to the binary when ENABLE_BITCODE is enabled in the new Xcode? From Xcode 7 reference: > Activating this setting indicates that the target or project should generate bitcode during compilation for platforms and architectures which support it. For Archive builds, bitcode will be generated in the linked binary for submission to the app store. For other builds, the compiler and linker will check whether the code complies with the requirements for bitcode generation, but will not generate actual bitcode.
> Gömülü bit kodu nedir? Belgelere göre: > Bit kodu, derlenmiş bir programın ara temsilidir. iTunes Connect'e yüklediğiniz ve bit kodu içeren uygulamalar, App Store'da derlenecek ve bağlanacaktır. Bit kodunu eklemek, Apple'ın uygulamanızın ikili dosyasını gelecekte, uygulamanızın yeni bir sürümünü mağazaya göndermenize gerek kalmadan yeniden optimize etmesine olanak tanır. "Xcode 7'deki Yeni Özellikler"deki bu ifade, Bit Kodunun uygulama boyutunu azaltmak için Kesme işlemi için gerekli olduğunu uzun süre düşünmeme neden oldu: > App Store'a göndermek için arşivlediğinizde, Xcode uygulamanızı ara bir temsile derler. App Store daha sonra bit kodunu gerektiği şekilde 64 veya 32 bit yürütülebilir dosyalara derler. Ancak bu doğru değil, Bit Kodu ve Kesme işlemi bağımsız olarak çalışır: Kesme işlemi uygulama boyutunu azaltmak ve uygulama paketi varyantları oluşturmakla ilgilidir ve Bit Kodu belirli ikili optimizasyonlarla ilgilidir. Bunu, bit kodu olmayan uygulamaların yürütülebilir dosyalarında bulunan mimarileri kontrol ederek ve yalnızca gerekli olanları içerdiklerini tespit ederek doğruladım. Bit Kodu, Kesme adlı başka bir Uygulama İnceltme bileşeninin belirli mimariler için belirli yürütülebilir dosyalarla uygulama paketi varyantları oluşturmasına olanak tanır, ör. iPhone 5S varyantı yalnızca arm64 yürütülebilir dosyasını, iPad Mini armv7'yi vb. içerir. > Yeni Xcode'da ENABLE_BITCODE ne zaman etkinleştirilir? > iOS uygulamaları için bit kodu varsayılan ancak isteğe bağlıdır. Bit kodu sağlarsanız, uygulama paketindeki tüm uygulamaların ve çerçevelerin bit kodu içermesi gerekir. watchOS ve tvOS uygulamaları için bit kodu gereklidir. > Yeni Xcode'da ENABLE_BITCODE etkinleştirildiğinde ikili dosyaya ne olur? Xcode 7 referansından: > Bu ayarı etkinleştirmek, hedefin veya projenin onu destekleyen platformlar ve mimariler için derleme sırasında bit kodu oluşturması gerektiğini gösterir. Arşiv yapıları için bit kodu, uygulama mağazasına gönderilmek üzere bağlantılı ikili dosyada oluşturulacaktır. Diğer yapılar için derleyici ve bağlayıcı, kodun bit kodu oluşturma gereksinimlerine uygunluğunu kontrol edecek ancak gerçek bit kodu oluşturmayacaktır.
166
In Dupire's local volatility model, the volatility is is a deterministic function of the underlying price and time, chosen to match observed European option prices. To be more specific, given a smooth surface $(K,T)\mapsto C(K,T)$ where K is the strike and T is time to maturity. Dupire equation implies that there exits an unique continuous function $\sigma_{loc}$ defined by $$\sigma_{loc}^{2}(K,T)=\frac{\partial_{T}C(K,T)+rK\partial_{K}C(K,T)}{\frac{1}{2}K^{2}\partial_{KK}C(K,T)}$$ for all $(K,T)\in(0,\infty)\times(0,\infty)$ such that the solution to the stochastic differential equation $dS_{t}/S_{t}=rdt+\sigma(t,S_{t})dW_{t}$ exactly generates the European call option prices. What do the dynamics of the local volatility mean? Are dynamics equivalent to the volatility surface? Why the dynamics of local volatility model is highly unrealistic?
Dupire'in yerel volatilite modelinde, volatilite, gözlemlenen Avrupa opsiyon fiyatlarına uyacak şekilde seçilen, altında yatan fiyatın ve zamanın deterministik bir fonksiyonudur. Daha spesifik olmak gerekirse, K'nın vade ve T'nin vadeye kadar geçen süre olduğu $(K,T)\mapsto C(K,T)$ düzgün bir yüzey verildiğinde. Dupire denklemi, tüm $(K,T)\in(0,\infty)\times(0,\infty)$ için $$\sigma_{loc}^{2}(K,T)=\frac{\partial_{T}C(K,T)+rK\partial_{K}C(K,T)}{\frac{1}{2}K^{2}\partial_{KK}C(K,T)}$$ ile tanımlanan benzersiz bir sürekli fonksiyon $\sigma_{loc}$'un var olduğunu gösterir, böylece $dS_{t}/S_{t}=rdt+\sigma(t,S_{t})dW_{t}$ stokastik diferansiyel denkleminin çözümü tam olarak Avrupa çağrı opsiyon fiyatlarını üretir. Yerel volatilitenin dinamikleri ne anlama geliyor? Dinamikler volatilite yüzeyine eşdeğer mi? Yerel volatilite modelinin dinamikleri neden son derece gerçekçi değil?
A general model (with continuous paths) can be written $$ \frac{dS_t}{S_t} = r_t dt + \sigma_t dW_t^S $$ where the short rate $r_t$ and spot volatility $\sigma_t$ are stochastic processes. In the Black-Scholes model both $r$ and $\sigma$ are deterministic functions of time (even constant in the original model). This produces a flat smile for any expiry $T$. And we have the closed form formula for option prices $$ C(t,S;T,K) = BS(S,T-t,K;\Sigma(T,K)) $$ where $BS$ is the BS formula and $\Sigma(T,K) = \sqrt{\frac{1}{T-t}\int_t^T \sigma(s)^2 ds}$. This is not consistent with the smile observed on the market. In order to match market prices, one needs to use a different volatility for each expiry and strike. This is the implied volatility surface $(T,K) \mapsto \Sigma(T,K)$. In the local volatility model, rates are deterministic, instant volatility is stochastic but there is only one source of randomness $$ \frac{dS_t}{S_t} = r(t) dt + \sigma_{Dup}(t,S_t) dW_t^S $$ this is a special case of the general model with $$ d\sigma_t = (\partial_t \sigma_{Dup}(t,S_t) + r(t)S_t\partial_S\sigma_{Dup}(t,S_t) + \frac{1}{2}S_t^2\partial_S^2\sigma_{Dup}(t,S_t)) dt + \frac{1}{2}S_t\partial_S\sigma_{Dup}(t,S_t)^2 dW_t^S $$ What is appealing with this model is that the function $\sigma_{Dup}$ can be perfectly calibrated to match all market vanilla prices (and quite easily too). The problem is that while correlated to the spot, statistical study show that the volatility also has its own source of randomness independent of that of the spot. Mathematically, this means the instant correlation between the spot and vol is not 1 contrary to what happens in the local volatility model. This can be seen in several ways: 1. The forward smile. Forward implied volatility is implied from prices of forward start options: ignoring interest rates, $$ C(t,S;T\to T+\theta,K) := E^Q[(\frac{S_{T+\theta}}{S_{T}}-K)_+] =: C_{BS}(S=1,\theta,K;\Sigma(t,S;T\to T+\theta,K)) $$ Alternatively, it is sometimes defined as the expectation of implied volatility at a forward date. In a LV model, as the maturity $T$ increases but $\theta$ is kept constant, the forward smile gets flatter and higher. This is not what we observe in the markets where the forward smile tends to be similar to the current smile. This is because the initial smile you calibrate the model too has decreasing skew: $$ \partial_K \Sigma(0,S;T,K) \xrightarrow[T\to +\infty]{} 0 $$ 2. Smile rolling. In a LV model, smile tends to move in the opposite direction of the spot and get higher independently of the direction of the spot. This is not consistent with what is observed on markets. See Hagan and al. Managing Smile Risk for the derivation. This means that $\partial_S \Sigma_{LV}(t,S;T,K)$ often has the wrong sign so your Delta will be wrong which can lead to a higher hedging error than using BS. 3. Barrier options. In FX markets, barrier options like Double No Touch are liquid but a LV model calibrated to vanilla prices does not reproduce these prices. This is a consequence of the previous point. The LV model is a static model. Its whole dynamic comes from the volatility surface at time 0. But the vol surface has a dynamic that is richer than that. There are alternatives using multiple factors like SV models, LSV models (parametric local vol like SABR or fully non parametric local vol), models of the joint dynamic of the spot and vol surface etc... but the LV model remains the default model in many cases due to its simplicity, its ability to calibrate the initial smile perfectly and its numerical efficiency.
Sürekli yollarla genel bir model şu şekilde yazılabilir: $$ \frac{dS_t}{S_t} = r_t dt + \sigma_t dW_t^S $$ burada kısa oran $r_t$ ve spot volatilitesi $\sigma_t$ stokastik süreçlerdir. Black-Scholes modelinde hem $r$ hem de $\sigma$ zamanın deterministik fonksiyonlarıdır (orijinal modelde sabit bile). Bu, herhangi bir son tarih $T$ için düz bir gülümseme üretir. Ve opsiyon fiyatları için kapalı formülümüz vardır $$ C(t,S;T,K) = BS(S,T-t,K;\Sigma(T,K)) $$ burada $BS$ BS formülüdür ve $\Sigma(T,K) = \sqrt{\frac{1}{T-t}\int_t^T \sigma(s)^2 ds}$. Bu, piyasada gözlemlenen gülümsemeyle tutarlı değildir. Piyasa fiyatlarına uymak için, her son tarih ve vuruş için farklı bir volatilite kullanmak gerekir. Bu, örtük volatilite yüzeyidir $(T,K) \mapsto \Sigma(T,K)$. Yerel volatilite modelinde oranlar deterministiktir, anlık volatilite stokastiktir ancak yalnızca bir rastgelelik kaynağı vardır $$ \frac{dS_t}{S_t} = r(t) dt + \sigma_{Dup}(t,S_t) dW_t^S $$ bu, şu genel modelin özel bir durumudur: $$ d\sigma_t = (\partial_t \sigma_{Dup}(t,S_t) + r(t)S_t\partial_S\sigma_{Dup}(t,S_t) + \frac{1}{2}S_t^2\partial_S^2\sigma_{Dup}(t,S_t)) dt + \frac{1}{2}S_t\partial_S\sigma_{Dup}(t,S_t)^2 dW_t^S $$ Bu modelin çekici yanı, $\sigma_{Dup}$ fonksiyonunun tüm piyasa vanilya fiyatlarına (ve oldukça kolay bir şekilde) mükemmel şekilde kalibre edilebilmesidir. Sorun, spot ile ilişkili olsa da, istatistiksel çalışmanın volatilitenin spotun bağımsız kendi rastgelelik kaynağına sahip olduğunu göstermesidir. Matematiksel olarak bu, spot ve vol arasındaki anlık korelasyonun, yerel volatilite modelinde olanın aksine 1 olmadığı anlamına gelir. Bu birkaç şekilde görülebilir: 1. Vadeli gülümseme. Vadeli örtük volatilite, vadeli başlangıç opsiyonlarının fiyatlarından çıkarılır: faiz oranlarını göz ardı ederek, $$ C(t,S;T\to T+\theta,K) := E^Q[(\frac{S_{T+\theta}}{S_{T}}-K)_+] =: C_{BS}(S=1,\theta,K;\Sigma(t,S;T\to T+\theta,K)) $$ Alternatif olarak, bazen vadeli bir tarihte örtük volatilitenin beklentisi olarak tanımlanır. Bir LV modelinde, vade tarihi $T$ arttıkça ancak $\theta$ sabit tutuldukça, vadeli gülümseme daha düz ve daha yüksek olur. Bu, vadeli gülümsemenin mevcut gülümsemeye benzer olma eğiliminde olduğu piyasalarda gözlemlediğimiz şey değildir. Bunun nedeni, modeli kalibre ettiğiniz ilk gülümsemenin azalan eğriliğe sahip olmasıdır: $$ \partial_K \Sigma(0,S;T,K) \xrightarrow[T\to +\infty]{} 0 $$ 2. Gülümseme yuvarlanması. Bir LV modelinde, gülümseme spotun ters yönünde hareket etme eğilimindedir ve spotun yönünden bağımsız olarak daha yüksek olur. Bu, piyasalarda gözlemlenenlerle tutarlı değildir. Türetimi için Hagan ve diğerlerine bakın. Bu, $\partial_S \Sigma_{LV}(t,S;T,K)$'nın genellikle yanlış işarete sahip olduğu ve bu nedenle Delta'nızın yanlış olacağı ve bu da BS kullanmaktan daha yüksek bir koruma hatasına yol açabileceği anlamına gelir. 3. Bariyer opsiyonları. FX piyasalarında, Double No Touch gibi bariyer opsiyonları likittir ancak vanilya fiyatlarına göre kalibre edilmiş bir LV modeli bu fiyatları yeniden üretmez. Bu, önceki noktanın bir sonucudur. LV modeli statik bir modeldir. Tüm dinamikleri, 0. zamandaki volatilite yüzeyinden gelir. Ancak vol yüzeyinin bundan daha zengin bir dinamiği vardır. SV modelleri, LSV modelleri (SABR gibi parametrik yerel vol veya tamamen parametrik olmayan yerel vol), spot ve vol yüzeyinin ortak dinamiğinin modelleri vb. gibi birden fazla faktör kullanan alternatifler vardır... ancak LV modeli, basitliği, ilk gülümsemeyi mükemmel bir şekilde kalibre etme yeteneği ve sayısal verimliliği nedeniyle birçok durumda varsayılan model olmaya devam etmektedir.
167
Can you explain why we need a large number of trees in random forest when the number of predictors is large? How can we determine the optimal number of trees?
Tahmin edicilerin sayısı fazla olduğunda neden rastgele ormanda çok sayıda ağaca ihtiyaç duyduğumuzu açıklayabilir misiniz? En uygun ağaç sayısını nasıl belirleyebiliriz?
Random forest uses bagging (picking a sample of observations rather than all of them) and random subspace method (picking a sample of features rather than all of them, in other words - attribute bagging) to grow a tree. If the number of observations is large, but the number of trees is too small, then some observations will be predicted only once or even not at all. If the number of predictors is large but the number of trees is too small, then some features can (theoretically) be missed in all subspaces used. Both cases results in the decrease of random forest predictive power. But the last is a rather extreme case, since the selection of subspace is performed at each node. During classification the subspace dimensionality is $\sqrt{p}$ (rather small, $p$ is the total number of predictors) by default, but a tree contains many nodes. During regression the subspace dimensionality is $p/3$ (large enough) by default, though a tree contains fewer nodes. So the optimal number of trees in a random forest depends on the number of predictors only in extreme cases. The official page of the algorithm states that random forest does not overfit, and you can use as much trees as you want. But Mark R. Segal (April 14 2004. "Machine Learning Benchmarks and Random Forest Regression." Center for Bioinformatics & Molecular Biostatistics) has found that it overfits for some noisy datasets. So to obtain optimal number you can try training random forest at a grid of ```ntree``` parameter (simple, but more CPU-consuming) or build one random forest with many trees with ```keep.inbag```, calculate out-of-bag (OOB) error rates for first $n$ trees (where $n$ changes from $1$ to ```ntree```) and plot OOB error rate vs. number of trees (more complex, but less CPU-consuming).
Rastgele orman, bir ağaç büyütmek için bagging (tüm gözlemler yerine bir gözlem örneği seçme) ve rastgele alt uzay yöntemi (tüm özellikler yerine bir özellik örneği seçme, başka bir deyişle - özellik bagging) kullanır. Gözlem sayısı fazla ancak ağaç sayısı çok azsa, bazı gözlemler yalnızca bir kez veya hiç tahmin edilmeyecektir. Tahmin edicilerin sayısı fazla ancak ağaç sayısı çok azsa, tüm alt uzaylarda bazı özellikler (teorik olarak) kaçırılabilir. Her iki durum da rastgele orman tahmin gücünün azalmasına neden olur. Ancak sonuncusu, alt uzay seçimi her düğümde gerçekleştirildiğinden oldukça uç bir durumdur. Sınıflandırma sırasında alt uzay boyutu varsayılan olarak $\sqrt{p}$'dir (oldukça küçük, $p$ tahmin edicilerin toplam sayısıdır), ancak bir ağaç birçok düğüm içerir. Regresyon sırasında alt uzay boyutu varsayılan olarak $p/3$'tür (yeterince büyük), ancak bir ağaç daha az düğüm içerir. Bu nedenle, rastgele bir ormandaki ağaçların optimum sayısı yalnızca uç durumlarda tahmin edicilerin sayısına bağlıdır. Algoritmanın resmi sayfası, rastgele ormanın aşırı uyum sağlamadığını ve istediğiniz kadar ağaç kullanabileceğinizi belirtir. Ancak Mark R. Segal (14 Nisan 2004. "Makine Öğrenimi Ölçütleri ve Rastgele Orman Regresyonu." Biyoinformatik ve Moleküler Biyoistatistik Merkezi) bunun bazı gürültülü veri kümeleri için aşırı uyum sağladığını bulmuştur. Bu nedenle, optimum sayıyı elde etmek için rastgele ormanı ```ntree``` parametresinin bir ızgarasında eğitmeyi deneyebilir (basit, ancak daha fazla CPU tüketir) veya ```keep.inbag``` ile birçok ağaca sahip bir rastgele orman oluşturabilir, ilk $n$ ağaç için çanta dışı (OOB) hata oranlarını hesaplayabilirsiniz (burada $n$, $1$'den ```ntree```'ye değişir) ve OOB hata oranını ağaç sayısına göre çizebilirsiniz (daha karmaşık, ancak daha az CPU tüketir).
168
I believe artificial intelligence (AI) term is overused nowadays. For example, people see that something is self-moving and they call it AI, even if it's on autopilot (like cars or planes) or there is some simple algorithm behind it. What are the minimum general requirements so that we can say something is AI?
Yapay zeka (YZ) teriminin günümüzde aşırı kullanıldığını düşünüyorum. Örneğin, insanlar bir şeyin kendi kendine hareket ettiğini görüyor ve otopilot (araba veya uçak gibi) olsa bile veya arkasında basit bir algoritma olsa bile buna YZ diyorlar. Bir şeyin YZ olduğunu söyleyebilmemiz için minimum genel gereksinimler nelerdir?
It's true that the term has become a buzzword, and is now widely used to a point of confusion - however if you look at the definition provided by Stuart Russell and Peter Norvig, they write it as follows: > We define AI as the study of agents that receive percepts from the environment and perform actions. Each such agent implements a function that maps percept sequences to actions, and we cover different ways to represent these functions, such as reactive agents, real-time planners, and decision-theoretic systems. We explain the role of learning as extending the reach of the designer into unknown environments, and we show how that role constrains agent design, favoring explicit knowledge representation and reasoning. Artificial Intelligence: A Modern Approach - Stuart Russell and Peter Norvig So the example you cite, "autopilot for cars/planes", is actually a (famous) form of AI as it has to use a form of knowledge representation to deal with unknown environments and circumstances. Ultimately, these systems also collect data so that the knowledge representation can be updated to deal with the new inputs that they have found. They do this with autopilot for cars all the time To answer your question, for something to be considered as "having AI", it needs to be able to deal with unknown environments/circumstances in order to achieve its objective/goal, and render knowledge in a manner that provides for new learning/information to be added easily. There are many different types of well defined knowledge representation methods, ranging from the popular neural net, through to probabilistic models like bayesian networks (belief networks) - but fundamentally actions by the system must be derived from whichever representation of knowledge you choose for it to be considered as AI.
Terimin bir moda sözcük haline geldiği ve artık kafa karışıklığına yol açacak kadar yaygın olarak kullanıldığı doğru - ancak Stuart Russell ve Peter Norvig'in sağladığı tanıma bakarsanız, bunu şu şekilde yazarlar: > AI'yı çevreden algılar alan ve eylemler gerçekleştiren ajanların çalışması olarak tanımlıyoruz. Bu tür her ajan, algı dizilerini eylemlere eşleyen bir işlev uygular ve reaktif ajanlar, gerçek zamanlı planlayıcılar ve karar teorik sistemler gibi bu işlevleri temsil etmenin farklı yollarını ele alırız. Öğrenmenin rolünü, tasarımcının erişimini bilinmeyen ortamlara genişletmek olarak açıklıyoruz ve bu rolün ajan tasarımını nasıl kısıtladığını, açık bilgi temsilini ve akıl yürütmeyi desteklediğini gösteriyoruz. Yapay Zeka: Modern Bir Yaklaşım - Stuart Russell ve Peter Norvig Bu nedenle, alıntıladığınız "araba/uçaklar için otopilot" örneği, aslında bilinmeyen ortamlarla ve koşullarla başa çıkmak için bir tür bilgi temsili kullanması gerektiğinden bir (ünlü) AI biçimidir. Sonuçta, bu sistemler aynı zamanda yeni buldukları girdilerle başa çıkmak için bilgi temsilinin güncellenebilmesi için veri toplarlar. Bunu arabalar için otopilotla sürekli yaparlar Sorunuzu cevaplamak için, bir şeyin "AI'ya sahip" olarak kabul edilmesi için, amacına/hedefine ulaşmak için bilinmeyen ortamlarla/koşullarla başa çıkabilmesi ve yeni öğrenme/bilgilerin kolayca eklenmesini sağlayan bir şekilde bilgi sunması gerekir. Popüler sinir ağından bayes ağları (inanç ağları) gibi olasılıklı modellere kadar değişen birçok farklı türde iyi tanımlanmış bilgi temsili yöntemi vardır - ancak temelde sistemin eylemleri, AI olarak kabul edilmesi için seçtiğiniz bilgi temsilinden türetilmelidir.
169
I have some questions regarding the usage and significance of the ```synchronized``` keyword. * What is the significance of the ```synchronized``` keyword? * When should methods be ```synchronized```? * What does it mean programmatically and logically?
```synchronized``` anahtar kelimesinin kullanımı ve önemi hakkında bazı sorularım var. * ```synchronized``` anahtar kelimesinin önemi nedir? * Hangi durumlarda metotlar ```synchronized``` olmalıdır? * Programatik ve mantıksal olarak ne anlama gelir?
The ```synchronized``` keyword is all about different threads reading and writing to the same variables, objects and resources. This is not a trivial topic in Java, but here is a quote from Sun: > ```synchronized``` methods enable a simple strategy for preventing thread interference and memory consistency errors: if an object is visible to more than one thread, all reads or writes to that object's variables are done through synchronized methods. In a very, very small nutshell: When you have two threads that are reading and writing to the same 'resource', say a variable named ```foo```, you need to ensure that these threads access the variable in an atomic way. Without the ```synchronized``` keyword, your thread 1 may not see the change thread 2 made to ```foo```, or worse, it may only be half changed. This would not be what you logically expect. Again, this is a non-trivial topic in Java. To learn more, explore topics about: * Concurrency * Java Memory Model Keep exploring these topics until the name "Brian Goetz" becomes permanently associated with the term "concurrency" in your brain.
```synchronized``` anahtar sözcüğü, farklı iş parçacıklarının aynı değişkenleri, nesneleri ve kaynakları okuması ve yazmasıyla ilgilidir. Bu, Java'da önemsiz bir konu değildir, ancak işte Sun'dan bir alıntı: > ```synchronized``` yöntemleri, iş parçacığı karışmasını ve bellek tutarlılığı hatalarını önlemek için basit bir strateji sağlar: Bir nesne birden fazla iş parçacığı tarafından görülebiliyorsa, bu nesnenin değişkenlerine yönelik tüm okumalar veya yazmalar eşzamanlı yöntemler aracılığıyla yapılır. Çok, çok küçük bir kabukta: ```foo``` adlı bir değişken gibi aynı 'kaynağı' okuyan ve yazan iki iş parçacığınız olduğunda, bu iş parçacıklarının değişkene atomik bir şekilde erişmesini sağlamanız gerekir. ```synchronized``` anahtar sözcüğü olmadan, 1. iş parçacığınız 2. iş parçacığının ```foo``` üzerinde yaptığı değişikliği göremeyebilir veya daha kötüsü, yalnızca yarı değiştirilmiş olabilir. Bu, mantıksal olarak beklediğiniz şey olmayacaktır. Yine, bu Java'da önemsiz bir konu değildir. Daha fazla bilgi edinmek için şu konuları inceleyin: * Eşzamanlılık * Java Bellek Modeli "Brian Goetz" adının beyninizde "eşzamanlılık" terimiyle kalıcı olarak ilişkilendirilene kadar bu konuları araştırmaya devam edin.
170
I am using the ```$http``` service of AngularJS to make an Ajax request. How can a spinner GIF (or another type of busy indicator) be shown while the Ajax request is executing?
Ajax isteği yaparken AngularJS'nin ```$http``` servisini kullanıyorum. Ajax isteği yürütülürken bir spinner GIF'i (veya başka bir tür meşgul göstergesi) nasıl gösterilebilir?
This really depends on your specific use case, but a simple way would follow a pattern like this: ``` .controller('MainCtrl', function ( $scope, myService ) { $scope.loading = true; myService.get().then( function ( response ) { $scope.items = response.data; }, function ( response ) { // TODO: handle the error somehow }).finally(function() { // called no matter success or failure $scope.loading = false; }); }); ``` And then react to it in your template: ``` <div class="spinner" ng-show="loading"></div> <div ng-repeat="item in items>{{item.name}}</div> ```
Bu gerçekten özel kullanım durumunuza bağlıdır, ancak basit bir yol şu kalıbı izler: ``` .controller('MainCtrl', function ( $scope, myService ) { $scope.loading = true; myService.get().then( function ( response ) { $scope.items = response.data; }, function ( response ) { // TODO: hatayı bir şekilde yönetin }).finally(function() { // başarı veya başarısızlık fark etmeksizin çağrılır $scope.loading = false; }); }); ``` Ve ardından şablonunuzda buna tepki verin: ``` <div class="spinner" ng-show="loading"></div> <div ng-repeat="item in items">{{item.name}}</div> ```
171
Let's say that we have a gaseous or liquidus compound (I don't know if elements or compounds make a difference, take this as a thought experiment), and we have a tungsten or steel block that's 5cm (or less, you choose) thick. Is there any physical method for that gas or liquid to pass through that thick heavy metal block (not by drilling etc.)?
Diyelim ki gaz halinde veya sıvı halde bir bileşiğimiz var (elementlerin veya bileşiklerin bir fark yaratıp yaratmadığını bilmiyorum, bunu bir düşünce deneyi olarak alın) ve 5 cm (veya daha az, siz seçin) kalınlığında bir tungsten veya çelik bloğumuz var. Bu gazın veya sıvının bu kalın ağır metal bloktan geçmesi için herhangi bir fiziksel yöntem var mı (delme vb. değil)?
Yes, some gases can diffuse into and through metal. It is the bane of the high-vacuum engineer's life. Hydrogen is the worst because it tends to dissociate into atoms at the surface and the nucleus, a single proton, can then leave its electron behind and wander through the metal lattice until it picks up another electron when it leaves. For example Mu-metal, favoured for some applications, typically has to be annealed in hydrogen at high temperature. Once that is over, it can take weeks or months for the residual hydrogen to diffuse out of the metal before a high enough vacuum can be achieved and the work proceed. A &quot;virtual leak&quot; occurs where a small bubble of gas is embedded in the material inside a vacuum chamber. The leak usually happens because a tiny hole exists for the gas to diffuse out through, but sometimes the &quot;hole&quot; is no more than an ultra-thin skin of metal (invisible to the frustrated technician) and the gas diffuses through it. These little horrors can keep going for months or even years and generally mean replacing suspected parts and pumping down over and over again until the dodgy one is finally stumbled on. Helium is both monatomic and the physically smallest atom. It can diffuse more easily than any other neutral atom or molecule, making certain metal foils unsuitable as say gas-tight liners for airships. As noted in another answer, in quantity it can also affect the bulk properties of the metal. On a more energetic scale, hydrogen and helium nuclei (protons and alpha particles) can pass through thin metal foils if fired with sufficient energy, and this has been used to establish the crystalline structures of some metals and alloys (where, for whatever reason, electrons were unsuitable). Other gases have much larger atoms (neon and other noble gases) or molecules (nitrogen and other diatomic molecules, water and other hydrides), but they can still diffuse extremely slowly through some metals. This can limit the lifetime of some microchips. A related phenomenon occurs where there is a defect in the lattice at the surface, such as a grain boundary, and a gas atom attaches to it. Defects are sometimes quite mobile and can migrate through the lattice; the gas atom will stabilise the defect and may be able to hitch a ride. Quantum processes such as tunnelling are not really relevant, as they work over distances smaller than the atomic wavelength, which in turn is typically far smaller than the thickness of any metal atom or foil. The probability of a gas atom tunnelling across is so infinitesimal as to be effectively zero.
Evet, bazı gazlar metalin içine ve içinden yayılabilir. Bu, yüksek vakum mühendisinin hayatının belasıdır. Hidrojen en kötüsüdür çünkü yüzeyde ve çekirdekte atomlara ayrılma eğilimindedir ve tek bir proton olan çekirdek daha sonra elektronunu geride bırakabilir ve başka bir elektronu alana kadar metal kafes içinde dolaşabilir. Örneğin, bazı uygulamalar için tercih edilen Mu-metal, tipik olarak yüksek sıcaklıkta hidrojende tavlanması gerekir. Bu bittikten sonra, yüksek bir vakum elde edilmeden ve çalışma devam etmeden önce artık hidrojenin metalden yayılması haftalar veya aylar alabilir. Bir vakum odasının içindeki malzemeye küçük bir gaz kabarcığı gömülü olduğu yerde bir "sanal sızıntı" meydana gelir. Sızıntı genellikle gazın yayılabileceği küçük bir delik olduğu için meydana gelir, ancak bazen "delik", metalin ultra ince bir kabuğundan (hayal kırıklığına uğramış teknisyen için görünmez) başka bir şey değildir ve gaz içinden yayılır. Bu küçük dehşetler aylarca hatta yıllarca devam edebilir ve genellikle şüpheli parçaların değiştirilmesi ve nihayetinde şüpheli olana rastlanana kadar tekrar tekrar pompalanması anlamına gelir. Helyum hem tek atomlu hem de fiziksel olarak en küçük atomdur. Herhangi bir diğer nötr atom veya molekülden daha kolay yayılabilir ve bu da belirli metal folyoları hava gemileri için gaz geçirmez astarlar olarak uygunsuz hale getirir. Başka bir cevapta belirtildiği gibi, miktar olarak metalin toplu özelliklerini de etkileyebilir. Daha enerjik bir ölçekte, hidrojen ve helyum çekirdekleri (protonlar ve alfa parçacıkları), yeterli enerjiyle ateşlenirse ince metal folyolardan geçebilir ve bu, bazı metallerin ve alaşımların kristal yapılarını oluşturmak için kullanılmıştır (elektronların uygun olmadığı nedenlerle). Diğer gazların çok daha büyük atomları (neon ve diğer soy gazlar) veya molekülleri (azot ve diğer iki atomlu moleküller, su ve diğer hidritler) vardır, ancak yine de bazı metallerden son derece yavaş yayılabilirler. Bu, bazı mikroçiplerin ömrünü sınırlayabilir. Yüzeyde, bir tane sınırı gibi, kafeste bir kusur olduğu ve bir gaz atomunun ona bağlandığı ilgili bir fenomen meydana gelir. Kusurlar bazen oldukça hareketlidir ve kafes içinde göç edebilir; gaz atomu kusuru stabilize edecek ve bir yolculuğa çıkabilecektir. Tünelleme gibi kuantum süreçleri gerçekten alakalı değildir, çünkü atomik dalga boyundan daha küçük mesafelerde çalışırlar, bu da tipik olarak herhangi bir metal atomu veya folyonun kalınlığından çok daha küçüktür. Bir gaz atomunun karşıdan karşıya tünel geçme olasılığı o kadar sonsuzdur ki etkili bir şekilde sıfırdır.
172
Once, I boarded a plane, went to my designated seat and tried to put my bag in the overhead bin. However, it was full, and other adjacent overhead bins were full too. Because I had a seat next to the emergency exit, which I paid for, I had to hand over my bag to someone else in order to take off. Do I have any rights over the overhead bin above my seat? Could I ask the flight attendant to remove some of the bags to make room for me? I cannot imagine that the bins were full because there was not enough space. I think this happened because some people were ignorant enough to bring more bags than is allowed inside the airplane instead of sending them to cargo. If this is the case why doesn't the airline enforce the bag limit inside the airplane?
Bir keresinde uçağa bindim, belirlenen koltuğuma gittim ve çantamı üstteki bölmeye koymaya çalıştım. Ancak doluydu ve diğer bitişik üst bölmeler de doluydu. Ücreti karşılığında aldığım acil çıkışın yanındaki bir koltukta oturduğum için, kalkış için çantamı başka birine vermek zorunda kaldım. Koltuğumun üzerindeki üst bölme üzerinde herhangi bir hakkım var mı? Kabin görevlisinden yer açmak için bazı çantaları çıkarmasını isteyebilir miyim? Yeterli alan olmadığı için bölmelerin dolu olduğunu hayal edemiyorum. Bunun, bazı insanların uçağın içine izin verilenden daha fazla çanta getirmek yerine kargoya göndermek için yeterince bilgisiz olmaları nedeniyle olduğunu düşünüyorum. Durum buysa, havayolu neden uçak içindeki çanta sınırını uygulamıyor?
You have no right to the bin above your seat. For those exit rows where you cannot put anything beneath the seat in front of you, flight attendants will generally try to help find some space somewhere for at least your small personal item, but any passenger may be required to check their bags rather than put them in the overhead bin. It is entirely possible that the airline didn't enforce the bag limit, but the overhead bins can easily fill up even when the limit is strictly enforced. If every passenger, or even most passengers, brings a regulation sized carry-on on a full flight, it is obvious that many of the bags will not fit in the bins and will have to be checked. In some cases, overhead bins may be marked as reserved for first class or premium economy passengers (or safety equipment, or pillows and blankets). Even in such cases, cabin crew may fill these bins with other bags in an attempt to accommodate as many passengers as possible, and a late-boarding passenger may be caught out with no space. It is hard to imagine that they are likely to remove and check someone's bag so you may have that space. Overhead bin space is typically first-come first served, and at some point, they will declare the bins full and start checking bags (sometimes even before the bins are actually full). Note that if your bag must be checked, you should ensure you remove any essential items (medication, passports, keys, etc...) and any valuables, along with any hazardous material that cannot be checked, namely spare (uninstalled) lithium batteries including external power packs. Boarding as early as possible (which, on some airlines, could require frequent flyer status or paying an extra fee) will help secure you overhead bin space.
Koltuğunuzun üzerindeki bölmeye eşya koyma hakkınız yoktur. Önünüzdeki koltuğun altına hiçbir şey koyamayacağınız çıkış sıralarında, uçuş görevlileri genellikle en azından küçük kişisel eşyalarınız için bir yer bulmanıza yardımcı olmaya çalışırlar ancak herhangi bir yolcunun eşyalarını baş üstü bölmeye koymak yerine teslim etmesi gerekebilir. Havayolunun bagaj sınırını uygulamaması tamamen mümkündür ancak baş üstü bölmeler sınırlama sıkı bir şekilde uygulandığında bile kolayca dolabilir. Her yolcu veya yolcuların çoğu tam bir uçuşta düzenlemeye uygun el bagajı getirirse, birçok çantanın bölmelere sığmayacağı ve teslim edilmesi gerekeceği açıktır. Bazı durumlarda, baş üstü bölmeler birinci sınıf veya premium ekonomi yolcuları (veya güvenlik ekipmanı veya yastıklar ve battaniyeler) için ayrılmış olarak işaretlenebilir. Bu gibi durumlarda bile, kabin ekibi mümkün olduğunca çok yolcuyu yerleştirmek için bu bölmeleri diğer çantalarla doldurabilir ve geç binen bir yolcu yer kalmadığı için sıkıntı yaşayabilir. Birinin çantasını çıkarıp teslim ederek o yeri size verme ihtimallerinin düşük olduğunu hayal etmek zor. Baş üstü bölme alanı genellikle ilk gelen ilk alır şeklindedir ve bir noktada bölmelerin dolu olduğunu ilan edip çantaları teslim almaya başlarlar (bazen bölmeler tamamen dolmadan bile). Çantanızın teslim edilmesi gerekiyorsa, ilaç, pasaport, anahtar vb. gibi temel eşyalarınızı ve teslim edilemeyen tehlikeli maddelerle birlikte değerli eşyalarınızı ve harici güç paketleri de dahil olmak üzere yedek (takılmamış) lityum pilleri çıkardığınızdan emin olmalısınız. Mümkün olduğunca erken binmek (bazı havayollarında bunun sık uçan yolcu statüsü veya ekstra ücret ödemeyi gerektirmesi mümkündür) baş üstü bölme alanınızı güvence altına almanıza yardımcı olacaktır.
173
The Canon EF 40mm f/2.8 has a designation of STM on the lens. What does this mean? What are the advantages of having it and does it replace an older technology?
Canon EF 40mm f/2.8 lensinde STM ifadesi yer alıyor. Bu ne anlama geliyor? Bu özelliğin avantajları nelerdir ve eski bir teknolojiyi değiştiriyor mu?
STM stands for Stepper Motor and is a applied to a new range of Canon lenses which feature a new design of focus motors which, along with a new iris mechanism are designed to eliminate (auditory) noise during video recording. Canon haven't revealed any information about how the new design works but it's probably the same type of motor used in mirrorless camera lenses. It's a more precise version of a regular DC motor but still has the same direct connection to the lens focus group, which means manual focus has to be implemented using a focus-by-wire arrangement whereby moving the focus ring by hand sends a signal to the motor to move the focus group. In comparison an ultrasonic motor (like Canon's USM) consists of a pair of concentric rings which vibrate at high frequency to rotate back and forth, an arrangement which permits the user to move the focus ring to directly move the lens element, achieving full time manual focus without damaging the motor. Stepper motors are better at producing smooth, precise incremental movements, such as those required by contrast detect AF, and AF during video. Ultrasonic motors are better at jumping to the right focus point as part of a phase detection system.
STM, Stepper Motor'un kısaltmasıdır ve video kaydı sırasında (işitsel) gürültüyü ortadan kaldırmak için tasarlanmış yeni bir iris mekanizmasıyla birlikte yeni bir odak motoru tasarımına sahip yeni bir Canon lens serisi için uygulanmıştır. Canon, yeni tasarımın nasıl çalıştığına dair herhangi bir bilgi açıklamadı ancak muhtemelen aynasız kamera lenslerinde kullanılan motorla aynı tiptir. Normal bir DC motorun daha hassas bir sürümüdür ancak yine de lens odak grubuna aynı doğrudan bağlantıya sahiptir, bu da manuel odaklamanın odak halkasını elle hareket ettirerek odak grubunu hareket ettirmesi için bir sinyal gönderen bir odaklama kablosu düzeneği kullanılarak uygulanması gerektiği anlamına gelir. Buna karşılık, bir ultrasonik motor (Canon'un USM'si gibi) ileri geri dönmek için yüksek frekansta titreşen bir çift eş merkezli halkadan oluşur, bu düzenleme kullanıcının odak halkasını hareket ettirerek lens elemanını doğrudan hareket ettirmesine izin verir ve motora zarar vermeden tam zamanlı manuel odaklama elde eder. Stepper motorlar, kontrast algılama AF ve video sırasında AF gibi gerekenler gibi düzgün, hassas artımlı hareketler üretmede daha iyidir. Ultrasonik motorlar, bir faz algılama sisteminin parçası olarak doğru odak noktasına atlamada daha iyidir.
174
I'm trying to set get id of all elements in an ```HTMLCollectionOf```. I wrote the following code: ```var list = document.getElementsByClassName("events"); console.log(list[0].id); for (key in list) { console.log(key.id); } ``` But I got the following output in console: ```event1 undefined ``` which is not what I expected. Why is the second console output ```undefined``` but the first console output is ```event1```?
```HTMLCollectionOf``` içindeki tüm elemanların id'sini almaya çalışıyorum. Aşağıdaki kodu yazdım: ```var list = document.getElementsByClassName("events"); console.log(list[0].id); for (key in list) { console.log(key.id); } ``` Ancak konsolda aşağıdaki çıktıyı aldım: ```event1 undefined ``` Bu beklediğim şey değil. Neden ikinci konsol çıktısı ```undefined``` ama ilk konsol çıktısı ```event1```?
You can't use ```for```/```in``` on ```NodeList```s or ```HTMLCollection```s. However, you can use some ```Array.prototype``` methods, as long as you ```.call()``` them and pass in the ```NodeList``` or ```HTMLCollection``` as ```this```. So consider the following as an alternative to jfriend00's ```for``` loop: ```var list= document.getElementsByClassName("events"); [].forEach.call(list, function(el) { console.log(el.id); }); ``` There's a good article on MDN that covers this technique. Note their warning about browser compatibility though: [...] passing a host object (like a ```NodeList```) as ```this``` to a native method (such as ```forEach```) is not guaranteed to work in all browsers and is known to fail in some. So while this approach is convenient, a ```for``` loop may be the most browser-compatible solution. Update (Aug 30, 2014): Eventually you'll be able to use ES6 ```for```/```of```! ```var list = document.getElementsByClassName("events"); for (const el of list) console.log(el.id); ``` It's already supported in recent versions of Chrome and Firefox.
```for```/```in```'i ```NodeList```'lerde veya ```HTMLCollection```'larda kullanamazsınız. Ancak, ```.call()```'u kullanıp ```NodeList``` veya ```HTMLCollection```'ı ```this``` olarak geçirdiğiniz sürece bazı ```Array.prototype``` yöntemlerini kullanabilirsiniz. Bu nedenle, jfriend00'un ```for``` döngüsüne alternatif olarak aşağıdakileri düşünün: ```var list= document.getElementsByClassName("events"); [].forEach.call(list, function(el) { console.log(el.id); }); ``` Bu tekniği ele alan MDN'de iyi bir makale var. Ancak tarayıcı uyumluluğu hakkındaki uyarılarına dikkat edin: [...] bir ana nesneyi (bir ```NodeList``` gibi) ```this``` olarak yerel bir yönteme (```forEach``` gibi) geçirmek tüm tarayıcılarda çalışmayabilir ve bazılarında başarısız olduğu bilinmektedir. Bu nedenle, bu yaklaşım uygun olsa da, bir ```for``` döngüsü en tarayıcı uyumlu çözüm olabilir. Güncelleme (30 Ağustos 2014): Sonunda ES6 ```for```/```of```'u kullanabileceksiniz! ```var list = document.getElementsByClassName("events"); for (const el of list) console.log(el.id); ``` Bu, Chrome ve Firefox'un son sürümlerinde zaten desteklenmektedir.
175
I am 21 years old and living in a large city in Germany where smalltalk in local markets is not a common thing. A new cashier joined my local food shop. She’s always at the checkout and never doing stuff like sorting products or cleaning the floor where I could actually ask her out. I am quite new to relationships, but the signs she gave me are promising. My question is how I can ask for her number, or ask her out for coffee while she is only sitting at the checkout? I mean there are always like 5 people before and after me, and I think it would be awkward if we are changing numbers while customers are waiting behind us. Or even worse if I read the signs wrong and she rejects me? Since the store is just 5 min away from my place I visit regularly and don't want to leave a bad impression there.
21 yaşındayım ve Almanya'nın yerel marketlerde küçük sohbetlerin yaygın olmadığı büyük bir şehrinde yaşıyorum. Yerel marketçime yeni bir kasiyer geldi. Her zaman kasada oluyor ve ürün ayırma veya yerleri temizleme gibi işleri yapmıyor, bu yüzden ona çıkma teklif edemiyorum. İlişkiler konusunda oldukça yeniyim ama bana verdiği işaretler umut verici. Sormak istediğim şey, sadece kasada otururken numarasını nasıl isteyebileceğim veya kahve içmeye nasıl davet edebileceğim. Yani önümde ve arkamda her zaman 5 kişi oluyor ve müşteriler arkamızda beklerken numara alışverişi yapmamız garip olur diye düşünüyorum. Ya da daha kötüsü, işaretleri yanlış yorumlarsam ve beni reddederse? Market evime sadece 5 dakika uzaklıkta olduğu için düzenli olarak gidiyorum ve orada kötü bir izlenim bırakmak istemiyorum.
Asking her out directly seems like a bad idea. Instead, in these situations, I've found something that works much better for both of you. During your conversation with her, mention some place you're planning to be in the future so she can find you there if she chooses. For example: &quot;I like to grab lunch here before going to [Public Event You Enjoy]&quot; This could be almost anything, but here are some examples: * A place your band plays * A public dance * A painting/pottery class * A wine tasting This should be something you actually enjoy, so be sure to let your excitement about your hobby be apparent when you mention it. Ex: &quot;I enjoy that they let you try lots of different wines from all around the world!&quot; If she expresses interest in the activity as well, tell her more about it so she can attend: &quot;Yeah, it's really fun. They do it every Tuesday and Thursday at 7pm - the admission fee is 5 Euro. You should check it out sometime!&quot; If she is interested in you and has time, she will probably arrange to come to the event some time and you will see her there. This is preferable because she is not under obligation to behave professionally for her work and you can spend some time chatting as equals. And if that goes well, then you have created a good opportunity to ask her on a real date. And if she doesn't come, well, you were planning to go there anyways so it's not a real loss on your part - you just spent an afternoon/evening doing something you already enjoy.
Ona doğrudan çıkma teklif etmek kötü bir fikir gibi görünüyor. Bunun yerine, bu gibi durumlarda, ikiniz için de çok daha iyi işe yarayan bir şey buldum. Onunla konuşurken, gelecekte bulunmayı planladığınız bir yerden bahsedin, böylece isterse sizi orada bulabilsin. Örneğin: "[Keyif Aldığınız Halka Açık Etkinlik]'e gitmeden önce burada öğle yemeği yemeyi seviyorum" Bu neredeyse her şey olabilir, ancak işte bazı örnekler: * Grubunuzun çaldığı bir yer * Halka açık bir dans * Bir resim/seramik dersi * Bir şarap tadımı Bu gerçekten keyif aldığınız bir şey olmalı, bu nedenle hobinizden bahsederken heyecanınızı belli ettiğinizden emin olun. Örn: "Dünyanın her yerinden birçok farklı şarabı denemenize izin vermelerinden keyif alıyorum!" Eğer o da etkinliğe ilgi gösterirse, katılabilmesi için ona daha fazla bilgi verin: "Evet, gerçekten eğlenceli. Her Salı ve Perşembe saat 19:00'da yapıyorlar - giriş ücreti 5 Euro. Bir ara uğramalısın!" Eğer sizinle ilgileniyorsa ve zamanı varsa, muhtemelen bir ara etkinliğe gelmeyi ayarlayacaktır ve onu orada göreceksiniz. Bu tercih edilir çünkü işi için profesyonel davranma zorunluluğu yoktur ve eşitler olarak sohbet etmek için biraz zaman geçirebilirsiniz. Ve eğer her şey yolunda giderse, ona gerçek bir randevu teklif etmek için iyi bir fırsat yaratmış olursunuz. Ve eğer gelmezse, zaten oraya gitmeyi planlıyordunuz, bu yüzden sizin için gerçek bir kayıp değil - sadece zaten keyif aldığınız bir şeyi yaparak bir öğleden sonra/akşam geçirdiniz.
176
You start with the number 1536. Your mission is to get to 1 in as few steps as possible. At each step, you may either multiply or divide the number you have, by either 2 or 3; but, only if the result is a whole number whose first digit is 1, 3, 4, or 9. That is all.
1536 sayısıyla başlıyorsunuz. Göreviniz olabildiğince az adımda 1'e ulaşmak. Her adımda, sahip olduğunuz sayıyı 2 veya 3 ile çarpabilir veya bölebilirsiniz; ancak, yalnızca sonuç ilk hanesi 1, 3, 4 veya 9 olan bir tam sayıysa. Hepsi bu.
As Jo has already shown, this can be accomplished in 28 steps. This is minimal, and it can be proven. To help visualize this problem, we can imagine: A two-dimensional grid/chart where each point is a number of the form $3^x2^y$, with $(x,y)$ as the relevant co-ordinates. We want to find a path from $(1,9)$ to $(0,0)$ while making only one step up/down/left/right at a time, and ensuring that the numbers we step on have their most significant digit in the set {1,3,4,9}. Here is what the chart looks like for the range $(0,0)$ to $(10,10)$. The dashes represent numbers that do not begin with {1,3,4,9}, and so are unusable in our path. ```1024 3072 9216 ---- ---- ---- ---- ---- ---- ---- ---- .``` ```---- 1536 4608 13824 41472 124416 373248 1119744 3359232 10077696 30233088 .``` ```---- ---- ---- ---- ---- ---- 186624 ---- 1679616 ---- 15116544 .``` ```128 384 1152 3456 10368 31104 93312 ---- ---- ---- ---- .``` ```---- 192 ---- 1728 ---- 15552 46656 139968 419904 1259712 3779136 .``` ```32 96 ---- ---- ---- ---- ---- ---- ---- ---- 1889568 .``` ```16 48 144 432 1296 3888 11664 34992 104976 314928 944784 .``` ```---- ---- ---- ---- ---- 1944 ---- 17496 ---- 157464 472392 .``` ```4 12 36 108 324 972 ---- ---- ---- ---- ---- .``` ```---- ---- 18 ---- 162 486 1458 4374 13122 39366 118098 .``` ```1 3 9 ---- ---- ---- ---- ---- ---- 19683 ---- .``` From here, we can see two different routes of 28 steps each: (1536->373248->93312->384->48->3888->972->36->9->1) and (1536->373248->46656->3779136->944784->3888->972->36->9->1). Proving minimality: Since a path of length 28 exists (we've found two), we can rule out anything that's too far away to be used in a shortest path. Moving from (1,9) to (0,0) must take at least ten steps on its own, so we can move at most nine steps completely out of the way (and nine steps back) in a shortest route. That limits us to only considering x-coordinates up to 10; any further would require making at least ten '*3' steps, eleven '÷3' steps, and at least nine '÷2' steps, putting the route definitely longer than 28. With our x-coordinate limited to [0,10], we now look at the bottlenecks. It should be clear that any shortest route must start by going from 1536 to 93312 in seven steps, and must end by going from 3888 to 1 in nine steps. These are both forced by unique bottlenecks; there is only one way to step from $(x,7)$ to $(x,6)$ and only one way to step from $(x,3)$ to $(x,2)$ in this range. This leaves at most twelve steps to go from 93312 to 3888. Either by observation or by pointing out that there are only two ways to go from $(x,6)$ to $(x,5)$, we can see that there are exactly two shortest routes from 93312 to 3888, and both require all twelve steps. Therefore, the shortest route is 28 steps, and there are exactly two ways to do so, both of which are described in Jo's solution and below the chart.
Jo'nun daha önce gösterdiği gibi, bu 28 adımda gerçekleştirilebilir. Bu minimumdur ve kanıtlanabilir. Bu problemi görselleştirmeye yardımcı olmak için şunları hayal edebiliriz: Her noktanın $3^x2^y$ biçiminde bir sayı olduğu iki boyutlu bir ızgara/tablo, $(x,y)$ ilgili koordinatlar olarak. $(1,9)$'dan $(0,0)$'a doğru sadece bir adım yukarı/aşağı/sola/sağa yaparak ve bastığımız sayıların en önemli basamağının {1,3,4,9} kümesinde olmasını sağlayarak bir yol bulmak istiyoruz. İşte $(0,0)$ ile $(10,10)$ aralığı için tablonun nasıl göründüğü. Tireler {1,3,4,9} ile başlamayan sayıları temsil eder ve bu nedenle yolumuzda kullanılamaz. ```1024 3072 9216 ---- ---- ---- ---- ---- ---- ---- ---- .``` ```---- 1536 4608 13824 41472 124416 373248 1119744 3359232 10077696 30233088 .``` ```---- ---- ---- ---- ---- ---- 186624 ---- 1679616 ---- 15116544 .``` ```128 384 1152 3456 10368 31104 93312 ---- ---- ---- ---- .``` ```---- 192 ---- 1728 ---- 15552 46656 139968 419904 1259712 3779136 .``` ```32 96 ---- ---- ---- ---- ---- ---- ---- ---- 1889568 .``` ```16 48 144 432 1296 3888 11664 34992 104976 314928 944784 .``` ```---- ---- ---- ---- ---- 1944 ---- 17496 ---- 157464 472392 .``` ```4 12 36 108 324 972 ---- ---- ---- ---- ---- .``` ```---- ---- 18 ---- 162 486 1458 4374 13122 39366 118098 .``` ```1 3 9 ---- ---- ---- ---- ---- ---- 19683 ---- .``` Buradan, her biri 28 adımdan oluşan iki farklı yol görebiliriz: (1536->373248->93312->384->48->3888->972->36->9->1) ve (1536->373248->46656->3779136->944784->3888->972->36->9->1). Minimumluğu kanıtlama: 28 uzunluğunda bir yol mevcut olduğundan (iki tane bulduk), en kısa yolda kullanılmak için çok uzak olan her şeyi eleyebiliriz. (1,9)'dan (0,0)'a hareket etmek kendi başına en az on adım atmayı gerektirir, bu nedenle en kısa yolda en fazla dokuz adım tamamen yoldan çıkabiliriz (ve dokuz adım geri dönebiliriz). Bu bizi yalnızca 10'a kadar x koordinatlarını dikkate almaya sınırlar; daha fazlası en az on '*3' adımı, on bir '÷3' adımı ve en az dokuz '÷2' adımı gerektirerek rotayı kesinlikle 28'den uzun hale getirir. X koordinatımız [0,10] ile sınırlıyken, şimdi darboğazlara bakıyoruz. Herhangi bir en kısa rotanın 1536'dan 93312'ye yedi adımda giderek başlaması ve 3888'den 1'e dokuz adımda giderek bitmesi gerektiği açık olmalıdır. Bunların ikisi de benzersiz darboğazlar tarafından zorlanır; bu aralıkta $(x,7)$'den $(x,6)$'ya ve $(x,3)$'ten $(x,2)$'ye gitmenin yalnızca bir yolu vardır. Bu, 93312'den 3888'e gitmek için en fazla on iki adım bırakır. Gözlem yoluyla veya $(x,6)$'dan $(x,5)$'e gitmenin yalnızca iki yolu olduğunu belirterek, 93312'den 3888'e tam olarak iki en kısa yol olduğunu ve her ikisinin de on iki adımı gerektirdiğini görebiliriz. Bu nedenle, en kısa yol 28 adımdır ve bunu yapmanın tam olarak iki yolu vardır, ikisi de Jo'nun çözümünde ve tablonun altında açıklanmıştır.
177
I want to create a simple bit of JS code that creates an image element in the background and doesn't display anything. The image element will call a tracking URL (such as Omniture) and needs to be simple and robust and work in IE 6 = ```var oImg = document.createElement("img"); oImg.setAttribute('src', 'http://www.testtrackinglink.com'); oImg.setAttribute('alt', 'na'); oImg.setAttribute('height', '1px'); oImg.setAttribute('width', '1px'); document.body.appendChild(oImg); ``` Is this the simplest but most robust (error free) way to do it?
Arka planda bir görüntü öğesi oluşturan ve hiçbir şey göstermeyen basit bir JS kodu parçası oluşturmak istiyorum. Görüntü öğesi bir izleme URL'sini (Omniture gibi) çağıracak ve basit, sağlam olmalı ve IE 6'da çalışmalıdır = ```var oImg = document.createElement("img"); oImg.setAttribute('src', 'http://www.testtrackinglink.com'); oImg.setAttribute('alt', 'na'); oImg.setAttribute('height', '1px'); oImg.setAttribute('width', '1px'); document.body.appendChild(oImg); ``` Bunu yapmanın en basit ama en sağlam (hatasız) yolu bu mu?
```oImg.setAttribute('width', '1px'); ``` ```px``` is for CSS only. Use either: ```oImg.width = '1'; ``` to set a width through HTML, or: ```oImg.style.width = '1px'; ``` to set it through CSS. Note that old versions of IE don't create a proper image with ```document.createElement()```, and old versions of KHTML don't create a proper DOM Node with ```new Image()```, so if you want to be fully backwards compatible use something like: ```// IEWIN boolean previously sniffed through eg. conditional comments function img_create(src, alt, title) { var img = IEWIN ? new Image() : document.createElement('img'); img.src = src; if ( alt != null ) img.alt = alt; if ( title != null ) img.title = title; return img; } ``` Also be slightly wary of ```document.body.appendChild``` if the script may execute as the page is in the middle of loading. You can end up with the image in an unexpected place, or a weird JavaScript error on IE. If you need to be able to add it at load-time (but after the `````` element has started), you could try inserting it at the start of the body using ```body.insertBefore(body.firstChild)```. To do this invisibly but still have the image actually load in all browsers, you could insert an absolutely-positioned-off-the-page `````` as the body's first child and put any tracking/preload images you don't want to be visible in there.
```oImg.setAttribute('width', '1px'); ``` ```px``` yalnızca CSS içindir. Aşağıdakilerden birini kullanın: ```oImg.width = '1'; ``` HTML üzerinden bir genişlik ayarlamak için veya: ```oImg.style.width = '1px'; ``` CSS üzerinden ayarlamak için. Eski IE sürümlerinin ```document.createElement()``` ile düzgün bir resim oluşturmadığını ve eski KHTML sürümlerinin ```new Image()``` ile düzgün bir DOM Düğümü oluşturmadığını unutmayın, bu nedenle tamamen geriye dönük uyumlu olmak istiyorsanız aşağıdakine benzer bir şey kullanın: ```// IEWIN boolean daha önce koşullu yorumlar gibi yöntemlerle koklanmıştır function img_create(src, alt, title) { var img = IEWIN ? new Image() : document.createElement('img'); img.src = src; if ( alt != null ) img.alt = alt; if ( title != null ) img.title = title; return img; } ``` Ayrıca, komut dosyası sayfa yüklenirken çalıştırılabilirse ```document.body.appendChild``` konusunda biraz dikkatli olun. Görüntüyü beklenmedik bir yerde veya IE'de garip bir JavaScript hatasıyla sonuçlanabilirsiniz. Yükleme zamanında ekleyebilmeniz gerekiyorsa (ancak `````` öğesi başladıktan sonra), ```body.insertBefore(body.firstChild)``` kullanarak gövdenin başına eklemeyi deneyebilirsiniz. Bunu görünmez bir şekilde yapmak ancak yine de görüntünün tüm tarayıcılarda yüklenmesini sağlamak için, gövdenin ilk çocuğu olarak kesinlikle konumlandırılmış bir `````` ekleyebilir ve görünür olmasını istemediğiniz izleme/ön yükleme görüntülerini oraya koyabilirsiniz.
178
Why is %s better than + for concatenation in python?
Python'da birleştirme için %s, + 'dan neden daha iyidir?
There are several benefits of using ```%s``` over ```+``` for string concatenation in Python: * Readability. The format string syntax is more readable, as it separates style from the data. Also, in Python, ```%s``` syntax will automatically coerce any non ```str``` types to ```str```; while concatenation only works with ```str```, and you can't concatenate ```str``` with ```int```. * Performance. In Python ```str``` is immutable, so the left and right string have to be copied into the new string for every pair of concatenation. If you concatenate four strings of length 10, you will be copying (10+10) + ((10+10)+10) + (((10+10)+10)+10) = 90 characters, instead of just 40 characters. And things gets quadratically worse as the number and size of the string increases. Java optimizes this case some of the times by transforming the series of concatenation to use ```StringBuilder```, but CPython doesn't. * For some use cases, the logging library provide an API that uses format string to create the log entry string lazily (```logging.info("blah: %s", 4)```). This is great for improved performance if the logging library decided that the current log entry will be discarded by a log filter, so it doesn't need to format the string.
Python'da dize birleştirme için ```+``` yerine ```%s``` kullanmanın birkaç faydası vardır: * Okunabilirlik. Biçim dizesi sözdizimi, stili verilerden ayırdığı için daha okunabilirdir. Ayrıca, Python'da ```%s``` sözdizimi, ```str``` olmayan tüm türleri otomatik olarak ```str```'ye dönüştürür; birleştirme yalnızca ```str``` ile çalışır ve ```str```'yi ```int``` ile birleştiremezsiniz. * Performans. Python'da ```str``` değişmezdir, bu nedenle sol ve sağ dize her birleştirme çifti için yeni dizeye kopyalanmalıdır. 10 uzunluğunda dört dizeyi birleştirirseniz, 40 karakter yerine (10+10) + ((10+10)+10) + (((10+10)+10)+10) = 90 karakter kopyalamış olursunuz. Ve dize sayısı ve boyutu arttıkça işler karesel olarak kötüleşir. Java, birleştirme serisini ```StringBuilder``` kullanacak şekilde dönüştürerek bu durumu bazen optimize eder, ancak CPython yapmaz. * Bazı kullanım durumları için, günlüğe kaydetme kitaplığı, günlük girişi dizesini tembelce oluşturmak için biçim dizesi kullanan bir API sağlar (```logging.info("blah: %s", 4)```). Günlük kaydetme kitaplığı, geçerli günlük girişinin bir günlük filtresi tarafından atılacağına karar verirse, bu, performansı artırmak için harika bir şeydir, bu nedenle dizeyi biçimlendirmesi gerekmez.
179
I had an interview with an employer working on a software-based vehicle solution. Before going further in the interview process, he gave me a task to find out if a potential customer (automotive OEMs) is interested. My question is, how can I approach a potential customer and arrange some time together to present to them the solution?. I'm intending to use Linkedin, but I'm not sure how to proceed. * Who to contact (I mean the person position in the company) * How to formulate the request?
Yazılım tabanlı bir araç çözümü üzerinde çalışan bir işverenle görüşme yaptım. Görüşme sürecine daha fazla ilerlemeden önce, potansiyel bir müşterinin (otomotiv OEM'leri) ilgilenip ilgilenmediğini öğrenmek için bana bir görev verdi. Sorunum şu ki, potansiyel bir müşteriye nasıl yaklaşabilirim ve onlara çözümü sunmak için birlikte biraz zaman ayarlayabilirim? Linkedin kullanmayı düşünüyorum ama nasıl ilerleyeceğimden emin değilim. * Kiminle iletişime geçmeliyim (şirketteki kişi pozisyonunu kastediyorum) * İsteği nasıl formüle etmeliyim?
Run (and run fast) - here are just a few points to consider: * That's a very unorthodox task for somebody still in the interviewing stage. * How you going to present a solution you aren't familiar with? * Since you aren't an employee of said company yet you have no grounds to represent them or even hustle their products. * You aren't on their payroll yet so why should you waste your time looking for customers? * There are a bunch of legal issues arising from such a 'task' (think NDA etc..). * How will your potential employer determine if your task has been carried out successfully? * Any CEO/CTO or even higher management of any automotive company will NOT engage in such a conversation with a random stranger. * Such an unprofessional approach is extremely disrespectful of the prospective customer's time. These are all major red flags and should lead any mentally sane person to the conclusion that the person asked for such tasks is unreasonable and has no clue about business in general. Additionally - what kind of impression do you think they will have of you or your potential, future employer considering the above mentioned points? Thank them for their time and continue applying elsewhere because this company is a nut-house.
Koşun (ve hızlı koşun) - işte dikkate alınması gereken birkaç nokta: * Bu, hala görüşme aşamasında olan biri için çok alışılmadık bir görev. * Bilmediğiniz bir çözümü nasıl sunacaksınız? * Henüz söz konusu şirketin bir çalışanı olmadığınız için onları temsil etmek veya ürünlerini satmak için hiçbir nedeniniz yok. * Henüz maaş bordrolarında değilsiniz, o halde neden müşteri aramak için zamanınızı boşa harcıyorsunuz? * Böyle bir "görevden" kaynaklanan bir sürü yasal sorun var (gizlilik sözleşmesi vb.). * Potansiyel işvereniniz, görevinizin başarıyla yerine getirilip getirilmediğini nasıl belirleyecek? * Herhangi bir otomotiv şirketinin CEO'su/CTO'su veya daha üst düzey yönetimi, rastgele bir yabancıyla böyle bir sohbete girmez. * Böyle profesyonelce olmayan bir yaklaşım, potansiyel müşterinin zamanına karşı son derece saygısızlıktır. Bunların hepsi büyük kırmızı bayraklardır ve aklı başında herhangi birini, kendisinden bu tür görevler istenen kişinin mantıksız olduğu ve genel olarak iş hakkında hiçbir fikri olmadığı sonucuna götürmelidir. Ek olarak - yukarıda belirtilen noktaları göz önünde bulundurarak, sizin veya potansiyel, gelecekteki işvereninizin sizin hakkınızda nasıl bir izlenim edineceğini düşünüyorsunuz? Zaman ayırdıkları için teşekkür edin ve başka yerlere başvurmaya devam edin çünkü bu şirket bir deliler evi.
180
When an expendable booster rocket stage nears the end of its burn, does the guidance computer shut the engine(s) off at a certain velocity/altitude for the mission, or does the stage completely exhaust its propellants?
Harcanabilir bir destek roketi aşaması yanmasının sonuna yaklaştığında, kılavuz bilgisayar görevin belirli bir hız/irtifasında motoru(motorları) kapatır mı yoksa aşama iticilerini tamamen tüketir mi?
First stages are generally run to depletion (though not complete depletion). First stage ascents often use a preprogrammed, open loop guidance system to get out of the atmosphere with a good chunk of downrange velocity. Because winds aloft and other factors may vary, first stage performance also varies somewhat. Upper stage guidance is almost always closed loop, targeting a specific position and velocity combination. As a result, upper stages of boosters are shut down when that target is reached, with some amount of reserve propellants left to cover dispersions during ascent and a disposal burn. Liquid fueled first stages are not run dry. Cutoff is triggered with some amount left in the tank. This is because the turbopumps operate at ridiculous velocities and need something to pump, at a specific inlet pressure. The heat source (gas generator, expander, or preburner) that drives the pump is downstream of the inlet in the flow path, so cutoff has to happen by cutting off the drive force to the pump before the inlet loses pressure or runs dry. If that pressure drops below minimum specifications or if the inlet goes dry, you will get cavitation and/or overspeed conditions, both of which would result in a violent reconfiguration of the hardware. Solid lower stages are much simpler in this regard. At some point, the thrust will tail off until the booster no longer supports its own weight. At that point, it is jettisoned.
İlk aşamalar genellikle tükenmeye kadar çalıştırılır (ancak tamamen tükenmez). İlk aşama yükselişleri genellikle atmosferden iyi bir miktar aşağı doğru hızla çıkmak için önceden programlanmış, açık döngü bir kılavuz sistem kullanır. Yukarıdaki rüzgarlar ve diğer faktörler değişebileceğinden, ilk aşama performansı da biraz değişir. Üst aşama kılavuzu neredeyse her zaman kapalı döngüdür ve belirli bir konum ve hız kombinasyonunu hedefler. Sonuç olarak, yükselticilerin üst aşamaları bu hedefe ulaşıldığında kapatılır ve yükseliş sırasında dağılımları ve bir atma yakması için bir miktar yedek itici bırakılır. Sıvı yakıtlı ilk aşamalar kuru çalıştırılmaz. Kesinti, tankta bir miktar yakıt kalacak şekilde tetiklenir. Bunun nedeni, türbopompaların saçma hızlarda çalışması ve belirli bir giriş basıncında pompalanacak bir şeye ihtiyaç duymasıdır. Pompayı çalıştıran ısı kaynağı (gaz jeneratörü, genleştirici veya ön brülör), akış yolunda girişin aşağısındadır, bu nedenle kesinti, giriş basıncı düşmeden veya kuru çalışmadan önce pompaya giden tahrik kuvvetinin kesilmesiyle gerçekleşmelidir. Bu basınç minimum özelliklerin altına düşerse veya giriş kurursa, her ikisi de donanımın şiddetli bir şekilde yeniden yapılandırılmasına neden olacak olan kavitasyon ve/veya aşırı hız koşulları elde edersiniz. Katı alt aşamalar bu açıdan çok daha basittir. Bir noktada, itki, yükseltici artık kendi ağırlığını destekleyemeyene kadar azalacaktır. O noktada, atılır.
181
Is &quot;ima&quot; an informal spelling of &quot;I must&quot;? MegaCharizardZord Replying to @nytimes about COVID-19 vaccine: i just hope when i take it don't die lol. i trust the government in Canada, but if I do get something ima sue the shit out of em lol. Source: Twitter
"ima" "I must" ifadesinin gayri resmi bir yazımı mı? MegaCharizardZord, @nytimes'a COVID-19 aşısı hakkında yanıt veriyor: Umarım aşıyı olduğumda ölmem lol. Kanada hükümetine güveniyorum ama bir şey olursa onları dava ederim lol. Kaynak: Twitter
Ima is an informal contraction of I'm going to when it's used in going-to future construction - not in sentences like I'm going to London etc. It's also written i'ma or imma in informal conversations. How did I'm going to come to be pronounced/spelt that way? In casual speech, we tend to drop consonants that require more effort to articulate, assimilate nearby consonants, drop weak vowels etc., for the ease of articulation. Grammatical words that don't have any meaning on their own (function words?) like have to, going to (not present continuous), has, is, was, will etc., are highly susceptible to these sound changes. For instance, have to is often pronounced hafta, trying to is pronounced tryna, want to is wanna etc etc. The same thing happened to the phrase I'm going to. There are a few processes involved in the reduction of I'm going to to ima. * I'm going to → I'm gonna: the consonant t is often dropped in many other clusters and grammatical constructions as well (as in tryna, wanna etc). Here it's dropped and the vowel of to—which is usually a schwa [ə]—is linked with the preceding word; going to → gonna: [ˈɡəʊɪ̃ŋtə] → [ˈgə̃nə] * Deletion of the /g/: plosives (/g t d k/ etc) require great effort to articulate (the air is completely blocked and then released), so people dropped the plosive /g/ to make its articulation easier: [aɪ̃m gə̃nə] → [aɪ̃m ə̃nə] (i'm ana) * linking I'm and gonna: In causal and connected speech, consonants and vowels are often linked by a process called liaison, so both I'm and gonna join together and become [aɪ̃mə̃nə] (i'mana). * Syncope of the vowel in the second syllable: Unstressed schwas are often lost through syncope (for example, 'chocolate' is choc.late for most speakers). If we removed the schwa from the second syllable, we'd get [aɪmnə] (i'mna). * Deletion of /n/: It's simple cluster reduction. In English, two nasals that are next to each other are often reduced to a single nasal (as in damn), so the /n/ is deleted, yielding in this case [aɪ̃mə] (i'ma). Or people dropped the /n/ for the sake of ease. Some people further reduce the diphthong [aɪ] it to something like [a], which results in [ãmə] (ama) That's why people spell it that way. It's highly informal and as TypeIA pointed out in a comment, it's mostly a verbal thing and is not usually found in written form. It's commonly found in chatspeak or lolspeak. You shouldn't write it in any kind of writing.
Ima, gelecek zaman yapısında kullanıldığında I'm going to'nun gayriresmi bir kısaltmasıdır - I'm going to London vb. cümlelerde değil. Gayriresmi konuşmalarda i'ma veya imma olarak da yazılır. I'm going to nasıl o şekilde telaffuz edilir/yazılır hale geldi? Rahat konuşmalarda, telaffuzu kolaylaştırmak için telaffuzu daha fazla çaba gerektiren ünsüzleri atma, yakındaki ünsüzleri asimile etme, zayıf ünlüleri atma vb. eğilimindeyiz. Kendi başlarına herhangi bir anlamı olmayan gramer kelimeleri (işlev kelimeleri?) gibi have to, going to (şimdiki zamanlı sürekli değil), has, is, was, will vb. bu ses değişikliklerine karşı oldukça hassastır. Örneğin, have to genellikle hafta olarak telaffuz edilir, trying to, tryna olarak telaffuz edilir, want to, wanna vb. olarak telaffuz edilir. Aynı şey I'm going to ifadesi için de oldu. I'm going to'nun ima'ya indirgenmesinde yer alan birkaç işlem vardır. * I'm going to → I'm gonna: t ünsüzü birçok başka kümede ve gramer yapısında da sıklıkla atılır (tryna, wanna vb.'de olduğu gibi). Burada atılır ve to'nun ünlüsü -ki genellikle bir şva [ə]'dır- önceki kelimeyle bağlantılıdır; going to → gonna: [ˈɡəʊɪ̃ŋtə] → [ˈgə̃nə] * /g/'nin silinmesi: patlamalı ünsüzler (/g t d k/ vb.) telaffuz etmek için büyük çaba gerektirir (hava tamamen bloke edilir ve sonra serbest bırakılır), bu nedenle insanlar telaffuzunu kolaylaştırmak için patlamalı ünsüz /g/'yi attılar: [aɪ̃m gə̃nə] → [aɪ̃m ə̃nə] (i'm ana) * I'm ve gonna'nın bağlanması: Nedensel ve bağlantılı konuşmada, ünsüzler ve ünlüler genellikle bağlantı adı verilen bir işlemle birbirine bağlanır, bu nedenle hem I'm hem de gonna bir araya gelir ve [aɪ̃mə̃nə] (i'mana) olur. * İkinci hecedeki ünlünün senkopu: Vurgusuz şvalar genellikle senkop yoluyla kaybolur (örneğin, 'chocolate' çoğu konuşmacı için choc.late'tir). İkinci heceden şvayı kaldırırsak [aɪmnə] (i'mna) elde ederiz. * /n/'nin silinmesi: Bu basit bir küme indirgemesidir. İngilizcede, yan yana gelen iki genizsel genellikle tek bir genizsele indirgenir (damn'de olduğu gibi), bu nedenle /n/ silinir ve bu durumda [aɪ̃mə] (i'ma) elde edilir. Veya insanlar kolaylık olsun diye /n/'yi attılar. Bazı insanlar [aɪ] ikili ünlüsünü [a] gibi bir şeye daha da indirger ve bu da [ãmə] (ama) ile sonuçlanır. İnsanların bu şekilde yazmasının nedeni budur. Son derece gayriresmi ve TypeIA'nın bir yorumda belirttiği gibi, çoğunlukla sözlü bir şeydir ve genellikle yazılı biçimde bulunmaz. Genellikle sohbet dilinde veya lolspeak'te bulunur. Herhangi bir yazı türünde yazmamalısınız.
182
How to prevent "Delhi Belly" from eating/drinking locally?
Yerel yemek/içecek tüketerek "Delhi Karnı"nın önüne nasıl geçilir?
Basically, you can't. The world is full of gastrointestinal (GI) diseases, even in developed, First World nations. There are some decent steps to trying to minimize your exposure: * Properly cooked foods. Everything heated to a proper internal temperature (depends on the dish, check the USDA's site for guidelines), no sampling the raw chicken dish, etc. * For fruits and veg, if you can't peel it, don't eat it. A tremendous number of GI outbreaks are due to fruit and veg, rather than meat. This includes things like salads - since you can't really peel lettuce, avoid it. * Check if the local water is safe. When in doubt, assume it isn't. You can stick to bottled water, though there's always the distinct chance its being bottled from a contaminated source. Coke/Pepsi etc., and beer are good alternatives. Little known fact, the Coca-Cola company is hugely involved in clean water programs worldwide, because they need it for their product. * Ice. Ice is bad. Its probably made using the local tap-water, and there are many beasties that can survive an encounter with an ice machine. But when it comes down to it, nearly every traveller makes some sort of safe-eating "mistake" fairly frequently, whether they realize it or not. At the end of the day, your best bet is to talk to your travel physician, and see if you can get a prescription for an antibiotic. Using that in combination with something like Imodium will probably keep your trip mostly on track - shutting down the problem long enough for the antibiotics to treat the source. Unless of course its viral - norovirus, rotavirus etc. In that event, best of luck. And if it does happen? Stay hydrated. You're losing salts and water, they need to be replaced.
Temel olarak, yapamazsınız. Dünya, gelişmiş, Birinci Dünya ülkelerinde bile gastrointestinal (GI) hastalıklarla doludur. Maruziyetinizi en aza indirmeye çalışmak için bazı iyi adımlar vardır: * Uygun şekilde pişmiş yiyecekler. Uygun bir iç sıcaklığa kadar ısıtılmış her şey (yemeğe bağlıdır, yönergeler için USDA'nın sitesini kontrol edin), çiğ tavuk yemeğini tatmak yok vb. * Meyve ve sebzeler için, soyamıyorsanız yemeyin. GI salgınlarının muazzam bir kısmı etten ziyade meyve ve sebzelerden kaynaklanır. Buna salatalar gibi şeyler de dahildir - marulu gerçekten soyamacağınız için ondan kaçının. * Yerel suyun güvenli olup olmadığını kontrol edin. Şüphe duyduğunuzda, olmadığını varsayın. Her zaman kirlenmiş bir kaynaktan şişelenme ihtimali olsa da şişe suya sadık kalabilirsiniz. Kola/Pepsi vb. ve bira iyi alternatiflerdir. Az bilinen bir gerçek, Coca-Cola şirketi dünya çapında temiz su programlarına büyük ölçüde dahildir, çünkü ürünlerine ihtiyaçları vardır. * Buz. Buz kötüdür. Muhtemelen yerel musluk suyu kullanılarak yapılır ve bir buz makinesiyle karşılaşmadan hayatta kalabilen birçok canavar vardır. Ancak işin aslına bakarsanız, neredeyse her gezgin, farkında olsun ya da olmasın, oldukça sık bir tür güvenli yeme "hatası" yapar. Günün sonunda, en iyi seçeneğiniz seyahat doktorunuzla konuşmak ve antibiyotik reçetesi alıp alamayacağınızı görmektir. Bunu Imodium gibi bir şeyle birlikte kullanmak muhtemelen yolculuğunuzu büyük ölçüde yolunda tutacaktır - antibiyotiklerin kaynağı tedavi etmesi için sorunu yeterince uzun süre durdurur. Tabii ki viral değilse - norovirüs, rotavirüs vb. Bu durumda, bol şans. Ve olursa ne olur? Susuz kalmayın. Tuz ve su kaybediyorsunuz, bunların yerine konması gerekiyor.
183
I'm working at my first programming job. My boss is a very smart software engineer, and I feel like I have very little to offer compared to him. Problem is, he is always busy, and needs someone to help him out. I feel like I'm not good enough, but I still want to succeed. I want to be a great programmer. What can I do to impress him? Thank you.
İlk programlama işimde çalışıyorum. Patronum çok zeki bir yazılım mühendisi ve ona kıyasla sunabileceğim çok az şeyim varmış gibi hissediyorum. Sorun şu ki, o her zaman meşgul ve kendisine yardım edecek birine ihtiyacı var. Yeterince iyi olmadığımı hissediyorum ama yine de başarılı olmak istiyorum. Harika bir programcı olmak istiyorum. Onu etkilemek için ne yapabilirim? Teşekkür ederim.
Remember the scene in Aladdin where Aladdin wants to impress Jasmine, and the genie tells him he'd do better to just focus on being himself? Same principle here. If the boss is that much better than you and you know it, he probably knows it too. He isn't expecting any great feats of programming rock-stardom out of you. Since this is your first job, he most likely hired you because he saw the potential to become a good coder in you. So if you really want to impress him, learn. Learn the language, learn the system you're working on, learn the ins and outs and dark corners. Focus on learning correct principles, learning them well and learning them quickly, in that order. And remember that part of learning is copying knowledge that other people already have. Don't be afraid to ask questions, either of your coworkers or on StackOverflow, or research things on Google. Whatever you do, don't pretend you know something when you really don't, in an effort to avoid seeming dumb. Any good developer will notice quickly, and that will make you look even stupider in their eyes. Humility tends to still be considered a virtue among engineers. Do a good job at that and it'll impress the boss.
Aladdin'de Aladdin'in Jasmine'i etkilemek istediği ve cinin ona sadece kendisi olmaya odaklanmasının daha iyi olacağını söylediği sahneyi hatırlayın. Burada da aynı prensip geçerli. Eğer patron sizden çok daha iyiyse ve siz de bunu biliyorsanız, o da muhtemelen bunu biliyordur. Sizden rock yıldızı programlama harikaları beklemiyor. Bu sizin ilk işiniz olduğu için, büyük ihtimalle sizde iyi bir kodlayıcı olma potansiyeli gördüğü için sizi işe almıştır. Yani onu gerçekten etkilemek istiyorsanız, öğrenin. Dili öğrenin, üzerinde çalıştığınız sistemi öğrenin, inceliklerini ve karanlık köşelerini öğrenin. Doğru prensipleri öğrenmeye, onları iyi öğrenmeye ve hızlı öğrenmeye odaklanın, bu sırayla. Ve öğrenmenin bir parçasının da başkalarının sahip olduğu bilgiyi kopyalamak olduğunu unutmayın. İş arkadaşlarınıza veya StackOverflow'da soru sormaktan veya Google'da şeyler araştırmaktan çekinmeyin. Ne yaparsanız yapın, aptal görünmemek için gerçekten bilmediğiniz bir şeyi biliyormuş gibi davranmayın. İyi bir geliştirici bunu hemen fark edecektir ve bu sizi onların gözünde daha da aptal gösterecektir. Mühendisler arasında alçakgönüllülük hala bir erdem olarak kabul edilir. Bunu iyi yapın ve patronu etkileyecektir.
184
Can I pass variables to a GNU Makefile as command line arguments? In other words, I want to pass some arguments which will eventually become variables in the Makefile.
Bir GNU Makefile'a komut satırı argümanları olarak değişkenler geçirebilir miyim? Başka bir deyişle, Makefile'da değişken haline gelecek bazı argümanlar geçirmek istiyorum.
You have several options to set up variables from outside your makefile: * From environment - each environment variable is transformed into a makefile variable with the same name and value. You may also want to set ```-e``` option (aka ```--environments-override```) on, and your environment variables will override assignments made into makefile (unless these assignments themselves use the ```override``` directive . However, it's not recommended, and it's much better and flexible to use ```?=``` assignment (the conditional variable assignment operator, it only has an effect if the variable is not yet defined): ```FOO?=default_value_if_not_set_in_environment ``` Note that certain variables are not inherited from environment: * ```MAKE``` is gotten from name of the script * ```SHELL``` is either set within a makefile, or defaults to ```/bin/sh``` (rationale: commands are specified within the makefile, and they're shell-specific). * From command line - ```make``` can take variable assignments as part of his command line, mingled with targets: ```make target FOO=bar ``` But then all assignments to ```FOO``` variable within the makefile will be ignored unless you use the ```override``` directive in assignment. (The effect is the same as with ```-e``` option for environment variables). * Exporting from the parent Make - if you call Make from a Makefile, you usually shouldn't explicitly write variable assignments like this: ```# Don't do this! target: $(MAKE) -C target CC=$(CC) CFLAGS=$(CFLAGS) ``` Instead, better solution might be to export these variables. Exporting a variable makes it into the environment of every shell invocation, and Make calls from these commands pick these environment variable as specified above. ```# Do like this CFLAGS=-g export CFLAGS target: $(MAKE) -C target ``` You can also export all variables by using ```export``` without arguments.
Make dosyanızın dışından değişkenler ayarlamak için çeşitli seçenekleriniz vardır: * Ortamdan - her ortam değişkeni, aynı ad ve değere sahip bir makefile değişkenine dönüştürülür. ```-e``` seçeneğini (diğer adıyla ```--environments-override```) de açmak isteyebilirsiniz ve ortam değişkenleriniz, makefile'a yapılan atamaları geçersiz kılacaktır (bu atamaların kendileri ```override``` yönergesini kullanmadığı sürece). Ancak bu önerilmez ve ```?=``` atamasını (koşullu değişken atama operatörü, yalnızca değişken henüz tanımlanmamışsa bir etkisi olur) kullanmak çok daha iyi ve esnektir: ```FOO?=default_value_if_not_set_in_environment ``` Belirli değişkenlerin ortamdan devralınmadığını unutmayın: * ```MAKE```, komut dosyasının adından alınır * ```SHELL``` ya bir makefile içinde ayarlanır ya da varsayılan olarak ```/bin/sh``` olur (gerekçe: komutlar makefile içinde belirtilir ve kabuk özelliğine sahiptir). * Komut satırından - ```make```, hedeflerle karıştırılmış olarak komut satırının bir parçası olarak değişken atamaları alabilir: ```make target FOO=bar ``` Ancak daha sonra makefile içindeki ```FOO``` değişkenine yapılan tüm atamalar, atama içinde ```override``` yönergesini kullanmadığınız sürece yoksayılacaktır. (Etkisi, ortam değişkenleri için ```-e``` seçeneğiyle aynıdır). * Üst Make'ten dışa aktarma - Make'i bir Makefile'tan çağırırsanız, genellikle şu şekilde değişken atamaları açıkça yazmamalısınız: ```# Bunu yapmayın! target: $(MAKE) -C target CC=$(CC) CFLAGS=$(CFLAGS) ``` Bunun yerine, bu değişkenleri dışa aktarmak daha iyi bir çözüm olabilir. Bir değişkeni dışa aktarmak, onu her kabuk çağrısının ortamına taşır ve Make, bu komutlardan çağrıldığında bu ortam değişkenini yukarıda belirtildiği gibi seçer. ```# Şöyle yapın CFLAGS=-g export CFLAGS target: $(MAKE) -C target ``` Ayrıca ```export```'u argüman kullanmadan kullanarak tüm değişkenleri dışa aktarabilirsiniz.
185
I have noticed that some games quote the requirement for "pixel shader 3.0 or better". What is a pixel shader and is it some software requirements or hardware requirements?
Bazı oyunların "pixel shader 3.0 veya daha iyisi" gereksinimini belirttiğini fark ettim. Pixel shader nedir ve bu bir yazılım gereksinimi mi yoksa donanım gereksinimi mi?
Simple answer Pixel shaders are tiny programs that can do operations on a single pixel on the screen, as opposed to geometry shaders and vertex shaders which work on the geometrical primitives (triangles) that make up everything you see on the screen. The most common use for pixel shaders is 'shading', approximation to real world lighting. Commonly used shading model is Phong. Pixel shaders are executed on your video card, so your video card needs to support them. Each new version provides more capabilities, so an older video card will not run newer shaders. A new version of the pixel shader specification (e.g. Pixel Shader 3.0) is usually released for each new version of DirectX (more accurately, Direct3D). Software Requirements You need to have the correct version of Direct3D (or OpenGL) installed in order to use the shaders. For example, Pixel Shader 4.0 requires at least Direct3D 10. Normally you don't have to worry about this, every game that uses Direct3D will install the correct version for you when you install the game. The only exceptions are Direct3D 10 and later, which will not run on Windows XP or earlier. You will need at least Windows Vista in order to play a game that uses Direct3D 10 or 11. Wikipedia provides a nice list of Pixel Shader versions, the version of Direct3D you need, and the types of graphics cards that work with them. Technical answer The 'standard' stages of a 3D rendering pipeline are as follows (somewhat simplified): * Transformation (Moving, rotating and scaling all the objects in the scene) * Lighting * Projection ('Squashing' the 3D world into a 2D plane) * Clipping (Removing anything outside the field of view) * Rasterising (Converting the vector graphics (triangles, etc) into raster graphics (pixels)) * Texturing * Display Pixel Shaders are used as an alternative to the standard texturing phase. During rasterisation, each triangle is converted into pixels. These pixels do not have their final colour yet, but the do have a bunch of parameters associated with them. These include base colour, texture coordinates, lighting information, etc. The Pixel Shader is a small program that takes these parameters and uses them to calculate the final colour as it is displayed on the screen. The Pixel Shader has access to all texture data, and can use them to do interesting things such as blending two textures (to create a 'dirty' look), using a texture as a bump map (to simulate a relief), or to simulate reflections. Hardware On the hardware side, Pixel Shaders are executed on 'Shader Units', small processors on your GPU. Each Shader Unit is basically a very simple CPU, but a modern video card may contain thousands of these things (an AMD Radeon HD6990 contains over 3000). Older GPUs had different Shader Units for different tasks: Pixel Shaders were executed on different parts of the system than Vertex Shaders. Modern GPUs have so called 'unified shader units' which can perform all of these operations.
Basit cevap Piksel gölgelendiricileri, ekranda gördüğünüz her şeyi oluşturan geometrik ilkel (üçgenler) üzerinde çalışan geometri gölgelendiricilerinin ve tepe noktası gölgelendiricilerinin aksine, ekrandaki tek bir piksel üzerinde işlemler yapabilen küçük programlardır. Piksel gölgelendiricilerinin en yaygın kullanımı, gerçek dünya aydınlatmasına yaklaşım olan "gölgelendirmedir". Yaygın olarak kullanılan gölgelendirme modeli Phong'dur. Piksel gölgelendiricileri video kartınızda çalıştırılır, bu nedenle video kartınızın bunları desteklemesi gerekir. Her yeni sürüm daha fazla yetenek sağlar, bu nedenle eski bir video kartı daha yeni gölgelendiricileri çalıştırmaz. Piksel gölgelendirici spesifikasyonunun yeni bir sürümü (ör. Piksel Gölgelendiricisi 3.0) genellikle DirectX'in her yeni sürümü için (daha doğrusu Direct3D) yayınlanır. Yazılım Gereksinimleri Gölgelendiricileri kullanmak için doğru Direct3D (veya OpenGL) sürümünün yüklü olması gerekir. Örneğin, Piksel Gölgelendiricisi 4.0 en az Direct3D 10 gerektirir. Normalde bununla ilgili endişelenmenize gerek yoktur, Direct3D kullanan her oyun, oyunu yüklediğinizde sizin için doğru sürümü yükler. Tek istisnalar, Windows XP veya daha önceki sürümlerde çalışmayan Direct3D 10 ve sonraki sürümleridir. Direct3D 10 veya 11 kullanan bir oyun oynamak için en az Windows Vista'ya ihtiyacınız olacaktır. Wikipedia, Piksel Gölgelendirici sürümlerinin, ihtiyacınız olan Direct3D sürümünün ve bunlarla çalışan grafik kartı türlerinin güzel bir listesini sunar. Teknik cevap 3B işleme hattının "standart" aşamaları şu şekildedir (bir şekilde basitleştirilmiştir): * Dönüşüm (Sahnedeki tüm nesneleri hareket ettirme, döndürme ve ölçekleme) * Aydınlatma * Projeksiyon (3B dünyayı 2B bir düzleme "sıkıştırma") * Kırpma (Görüş alanının dışındaki her şeyi kaldırma) * Rasterleştirme (Vektör grafiklerini (üçgenler vb.) raster grafiklerine (pikseller) dönüştürme) * Doku oluşturma * Görüntüleme Piksel Gölgelendiricileri, standart doku oluşturma aşamasına alternatif olarak kullanılır. Rasterleştirme sırasında her üçgen piksellere dönüştürülür. Bu pikseller henüz son renklerine sahip değildir, ancak bunlarla ilişkili bir dizi parametreye sahiptir. Bunlar temel renk, doku koordinatları, aydınlatma bilgileri vb. içerir. Piksel Gölgelendiricisi, bu parametreleri alan ve bunları ekranda görüntülendiği gibi son rengi hesaplamak için kullanan küçük bir programdır. Piksel Gölgelendiricisi tüm doku verilerine erişebilir ve bunları iki dokuyu harmanlamak (bir "kirli" görünüm oluşturmak), bir dokuyu kabartma haritası olarak kullanmak (bir kabartma simüle etmek) veya yansımaları simüle etmek gibi ilginç şeyler yapmak için kullanabilir. Donanım Donanım tarafında, Piksel Gölgelendiricileri GPU'nuzdaki küçük işlemciler olan "Gölgelendirici Birimleri" üzerinde çalıştırılır. Her Gölgelendirici Birimi temelde çok basit bir CPU'dur, ancak modern bir video kartı bunlardan binlerce tane içerebilir (bir AMD Radeon HD6990 3000'den fazla içerir). Eski GPU'ların farklı görevler için farklı Gölgelendirici Birimleri vardı: Piksel Gölgelendiricileri, sistemin Tepe Noktası Gölgelendiricilerinden farklı bölümlerinde çalıştırılıyordu. Modern GPU'lar, tüm bu işlemleri gerçekleştirebilen "birleşik gölgelendirici birimleri" olarak adlandırılır.
186
Red light facing forwards? It was nighttime in Manhattan. Isn't more always better when it comes to being seen?
Öne bakan kırmızı ışık? Manhattan'da gece vaktiydi. Görünür olmak söz konusu olduğunda daha fazlası her zaman daha iyi değil midir?
No. You should always ride with a white light facing forward and a red light facing backwards. If you want additional illumination, you can add multiple white/red lights in the appropriate direction. Amber/yellow lights can be used facing any direction for additional visibility. The first reason is that it's the law: (a) Every bicycle when in use during the period from one-half hour after sunset to one-half hour before sunrise shall be equipped with a lamp on the front which shall emit a white light visible during hours of darkness from a distance of at least five hundred feet to the front and with a red or amber light visible to the rear for three hundred feet. Effective July first, nineteen hundred seventy-six, at least one of these lights shall be visible for two hundred feet from each side. More importantly for your safety though, the color of a light conveys a certain meaning. Drivers, pedestrians, and other cyclists associate the color red with a taillight and the color white with a headlight. If you put the wrong color facing the wrong direction, people may think you are traveling the opposite direction. Imagine a car is pulling out of a driveway and sees a red bike light flashing to their left. They may assume that means a bike is moving away from them on the left. If they then pull out of the driveway and you're really moving towards them, you could get hit.
Hayır. Her zaman öne bakan beyaz bir ışık ve arkaya bakan kırmızı bir ışıkla sürmelisiniz. Ek aydınlatma istiyorsanız, uygun yöne birden fazla beyaz/kırmızı ışık ekleyebilirsiniz. Ek görünürlük için kehribar/sarı ışıklar herhangi bir yöne bakacak şekilde kullanılabilir. İlk neden bunun yasa olmasıdır: (a) Gün batımından yarım saat sonra ile gün doğumundan yarım saat öncesi arasında kullanılan her bisiklet, karanlık saatlerde en az beş yüz fit önden beyaz ışık yayan ve üç yüz fit arkada kırmızı veya kehribar ışık yayan bir lamba ile donatılmalıdır. 1 Temmuz 1976'dan itibaren bu ışıklardan en az biri her iki taraftan da iki yüz fit görünür olmalıdır. Bununla birlikte, sizin güvenliğiniz için daha da önemlisi, bir ışığın rengi belirli bir anlam ifade eder. Sürücüler, yayalar ve diğer bisikletçiler kırmızı rengi bir arka lambayla ve beyaz rengi bir farla ilişkilendirir. Yanlış rengi yanlış yöne bakacak şekilde koyarsanız, insanlar sizin ters yönde gittiğinizi düşünebilir. Bir arabanın bir araba yolundan çıktığını ve solunda kırmızı bir bisiklet ışığının yandığını hayal edin. Bu, bir bisikletin soldan uzaklaştığı anlamına gelebilir. Ardından araba yolundan çıkarsa ve siz gerçekten onlara doğru hareket ediyorsanız, çarpabilirsiniz.
187
If water is not a good conductor, why are we advised to avoid water near electricity (no wet hands near circuits etc.)?
Su iyi bir iletken değilse, neden elektrik yakınında sudan kaçınmamız öneriliyor (devrelerin yakınında ıslak eller vb.)?
&quot;Pure&quot; water is a very poor conductor (resistivity is actually used as a measure of purity). &quot;Real&quot; water is not pure - it contains electrolytes and is quite conductive. Also - when your skin is wet, its resistivity is significantly lower. For example - &quot;pure&quot; water has a resistivity of (about) 18.2 M$\Omega\cdot\rm{cm}$. With 10 ppm of dissolved NaCl (&quot;very good quality tap water&quot; would have less than 50 ppm), the resistivity drops to about $43~\rm{k\Omega\cdot cm}$ A lot of detail can be found in &quot;Conduction of Electrical Current to and Through the Human Body: A Review&quot; (Fish and Geddes, ePlasty 2009, 9, e44). > Why immersion in water can be fatal with very low voltages * Immersion wets the skin very effectively and great lowers skin resistance per unit area * Contact area is a large percentage of the entire body surface area * Electric current may also enter the body through mucous membranes, such as the mouth and throat * The human body is very sensitive to electricity. Very small amounts of current can cause loss of ability to swim, respiratory arrest and cardiac arrest
"Saf" su çok zayıf bir iletkendir (direnç aslında saflığın bir ölçüsü olarak kullanılır). "Gerçek" su saf değildir - elektrolitler içerir ve oldukça iletkendir. Ayrıca - cildiniz ıslak olduğunda, direnci önemli ölçüde düşüktür. Örneğin - "saf" suyun direnci (yaklaşık) 18,2 MΩ·cm'dir. 10 ppm çözünmüş NaCl ile ("çok iyi kalite musluk suyu" 50 ppm'den azına sahip olur), direnç yaklaşık 43 kΩ·cm'ye düşer. "İnsan Vücuduna ve İçinden Elektrik Akımının İletimi: Bir İnceleme" (Fish ve Geddes, ePlasty 2009, 9, e44) adlı eserde birçok ayrıntı bulunabilir. > Çok düşük voltajlarda suda boğulmanın neden ölümcül olabileceği * Daldırma cildi çok etkili bir şekilde ıslatır ve birim alan başına cilt direncini büyük ölçüde düşürür * Temas alanı, tüm vücut yüzey alanının büyük bir yüzdesidir * Elektrik akımı ayrıca ağız ve boğaz gibi mukoza zarlarından vücuda girebilir * İnsan vücudu elektriğe karşı çok hassastır. Çok az miktarda akım yüzme yeteneğinin kaybına, solunum durmasına ve kalp durmasına neden olabilir
188
What is the difference between cohesion and coupling? How can coupling and cohesion lead to either good or poor software design? What are some examples that outline the difference between the two, and their impact on overall code quality?
Kohezyon ve bağımlılık arasındaki fark nedir? Bağımlılık ve kohezyon nasıl iyi veya kötü yazılım tasarımına yol açabilir? İkisi arasındaki farkı ve genel kod kalitesi üzerindeki etkilerini özetleyen bazı örnekler nelerdir?
Cohesion refers to what the class (or module) can do. Low cohesion would mean that the class does a great variety of actions - it is broad, unfocused on what it should do. High cohesion means that the class is focused on what it should be doing, i.e. only methods relating to the intention of the class. Example of Low Cohesion: ```------------------- | Staff | ------------------- | checkEmail() | | sendEmail() | | emailValidate() | | PrintLetter() | ------------------- ``` Example of High Cohesion: ```---------------------------- | Staff | ---------------------------- | -salary | | -emailAddr | ---------------------------- | setSalary(newSalary) | | getSalary() | | setEmailAddr(newEmail) | | getEmailAddr() | ---------------------------- ``` As for coupling, it refers to how related or dependent two classes/modules are toward each other. For low coupled classes, changing something major in one class should not affect the other. High coupling would make it difficult to change and maintain your code; since classes are closely knit together, making a change could require an entire system revamp. Good software design has ***high cohesion*** and ***low coupling***.
Bağlantı, sınıfın (veya modülün) ne yapabileceğini ifade eder. Düşük bağlantı, sınıfın çok çeşitli eylemler yaptığı anlamına gelir - geniştir, ne yapması gerektiğine odaklanmamıştır. Yüksek bağlantı, sınıfın ne yapması gerektiğine odaklandığı anlamına gelir, yani yalnızca sınıfın amacıyla ilgili yöntemler. Düşük Bağlantı Örneği: ```------------------- | Personel | ------------------- | checkEmail() | | sendEmail() | | emailValidate() | | PrintLetter() | ------------------- ``` Yüksek Bağlantı Örneği: ```---------------------------- | Personel | ---------------------------- | -salary | | -emailAddr | ---------------------------- | setSalary(newSalary) | | getSalary() | | setEmailAddr(newEmail) | | getEmailAddr() | ---------------------------- ``` Bağlantıya gelince, iki sınıfın/modülün birbirine ne kadar ilişkili veya bağımlı olduğunu ifade eder. Düşük bağlantılı sınıflar için, bir sınıftaki önemli bir şeyi değiştirmek diğerini etkilememelidir. Yüksek bağlantı, kodunuzu değiştirmeyi ve sürdürmeyi zorlaştırır; sınıflar birbirine sıkı sıkıya bağlı olduğundan, bir değişiklik yapmak tüm sistemin yeniden düzenlenmesini gerektirebilir. İyi yazılım tasarımı ***yüksek bağlantı*** ve ***düşük bağlantı*** içerir.
189
Can Romex (NM-B) cable be run through conduit?
Romex (NM-B) kablosu borudan geçirilebilir mi?
Yes, NM (Romex) cable can be in conduit. In fact, National Electrical Code (NEC() calls for it to be in conduit, when protection from physical damage is required. But it really isn't worth it. ## It's a nightmare to pull NM (Romex) is already solid wire except in the large sizes, and now you have 3-4 wires bound together. You are trying to pull this around maybe 14" radius elbows, and if the NM gets twists in it (it always does), it really drags in those places. It's just a stiff, miserable pull - enough to "put you off conduit forever" - which is a shame, because conduit is wonderful when using easy-to-pull stranded wire. Pulling this stiff cable increases the risk of damaging the cable. What's more, "cable in conduit" is often a newbie who chooses cable simply because he is unaware that wire comes in any other forms. Which leads to more risk of damage still. ## It requires ridiculously large conduit You still have to calculate and respect conduit fill rules, and those are very punishing toward cable. Most cable is oblong, and the rules say you use the largest dimension and treat it as a circular wire of that dimension. * For a single "wire", you are allowed 53% conduit fill. That means the conduit ID must be at least 137% of the large cross-section of the cable. That's not so bad, but... * For two "wires", you're only allowed 31% fill. That's to protect the wires from binding. That means the conduit ID must be at least 2.54 times the cable large dimension. * For three "wires", you're allowed 40% fill. That means the conduit must be at least 2.74 times the cable width (at 3 wires), larger for more wires. For instance, someone wanted to squeeze three #6 cables through a 1" conduit. Now this is "easy peasy" with 6 individual #6 THHN wires and 3 bare #10 grounds. However, with three #6 UF cables, the conduit size needed to be 3" instead of 1". Whoa. You are certainly allowed to do it, but you will be using rather enormous conduit, and you will have a hard time pulling.
Evet, NM (Romex) kablosu boru içinde olabilir. Aslında, Ulusal Elektrik Kodu (NEC), fiziksel hasara karşı koruma gerektiğinde boru içinde olmasını gerektirir. Ancak buna gerçekten değmez. ## Çekmesi bir kabustur NM (Romex) zaten büyük boyutlar hariç katı bir teldir ve şimdi birbirine bağlı 3-4 teliniz var. Bunu yaklaşık 14" yarıçaplı dirseklerin etrafından çekmeye çalışıyorsunuz ve NM içinde bükülmeler olursa (her zaman olur), bu yerlerde gerçekten sürüklenir. Bu sadece sert, sefil bir çekiştir - "sizi sonsuza dek borudan uzaklaştırmaya" yetecek kadar - ki bu bir utançtır, çünkü boru, çekilmesi kolay telli tel kullanıldığında harikadır. Bu sert kabloyu çekmek, kabloya zarar verme riskini artırır. Dahası, "borudaki kablo" genellikle kabloyu seçen, telin başka biçimlerde geldiğinin farkında olmayan bir acemidir. Bu da daha fazla hasar riskiyle sonuçlanır. ## Gülünç derecede büyük bir boru gerektirir Yine de boru doldurma kurallarını hesaplamalı ve bunlara uymalısınız ve bunlar kablo için çok cezalandırıcıdır. Çoğu kablo dikdörtgendir ve kurallar en büyük boyutu kullanmanızı ve onu o boyutta dairesel bir tel olarak ele almanızı söyler. * Tek bir "tel" için %53 boru dolumu yapmanıza izin verilir. Bu, boru kimliğinin kablonun büyük kesitinin en az %137'si olması gerektiği anlamına gelir. Bu o kadar da kötü değil ama... * İki "tel" için yalnızca %31 dolum yapmanıza izin verilir. Bu, tellerin bağlanmasını önlemek içindir. Bu, boru kimliğinin kablonun büyük boyutunun en az 2,54 katı olması gerektiği anlamına gelir. * Üç "tel" için %40 dolum yapmanıza izin verilir. Bu, borunun kablonun genişliğinin (3 telde) en az 2,74 katı, daha fazla tel için daha büyük olması gerektiği anlamına gelir. Örneğin, birisi üç #6 kabloyu 1" borudan sıkıştırmak istedi. Şimdi bu, 6 ayrı #6 THHN teli ve 3 çıplak #10 toprakla "kolay peynirli". Ancak üç #6 UF kablosuyla boru boyutunun 1" yerine 3" olması gerekiyordu. Vay canına. Bunu yapmanıza kesinlikle izin verilir, ancak oldukça büyük bir boru kullanacaksınız ve çekmekte zorlanacaksınız.
190
Let's say I have a function which takes an ```std::function```: ```void callFunction(std::function x) { x(); } ``` Should I pass ```x``` by const-reference instead?: ```void callFunction(const std::function& x) { x(); } ``` Does the answer to this question change depending on what the function does with it? For example if it is a class member function or constructor which stores or initializes the ```std::function``` into a member variable.
Bir ```std::function``` alan bir fonksiyonum olduğunu varsayalım: ```void callFunction(std::function x) { x(); } ``` ```x```'i bunun yerine sabit referansla geçirmeli miyim?: ```void callFunction(const std::function& x) { x(); } ``` Bu sorunun cevabı, fonksiyonun onunla ne yaptığına bağlı olarak değişir mi? Örneğin, ```std::function```'ı bir üye değişkeninde saklayan veya başlatan bir sınıf üye fonksiyonu veya kurucuysa.
If you want performance, pass by value if you are storing it. Suppose you have a function called "run this in the UI thread". ```std::future run_in_ui_thread( std::function ) ``` which runs some code in the "ui" thread, then signals the ```future``` when done. (Useful in UI frameworks where the UI thread is where you are supposed to mess with UI elements) We have two signatures we are considering: ```std::future run_in_ui_thread( std::function ) // (A) std::future run_in_ui_thread( std::function const& ) // (B) ``` Now, we are likely to use these as follows: ```run_in_ui_thread( [=]{ // code goes here } ).wait(); ``` which will create an anonymous closure (a lambda), construct a ```std::function``` out of it, pass it to the ```run_in_ui_thread``` function, then wait for it to finish running in the main thread. In case (A), the ```std::function``` is directly constructed from our lambda, which is then used within the ```run_in_ui_thread```. The lambda is ```move```d into the ```std::function```, so any movable state is efficiently carried into it. In the second case, a temporary ```std::function``` is created, the lambda is ```move```d into it, then that temporary ```std::function``` is used by reference within the ```run_in_ui_thread```. So far, so good -- the two of them perform identically. Except the ```run_in_ui_thread``` is going to make a copy of its function argument to send to the ui thread to execute! (it will return before it is done with it, so it cannot just use a reference to it). For case (A), we simply ```move``` the ```std::function``` into its long-term storage. In case (B), we are forced to copy the ```std::function```. That store makes passing by value more optimal. If there is any possibility you are storing a copy of the ```std::function```, pass by value. Otherwise, either way is roughly equivalent: the only downside to by-value is if you are taking the same bulky ```std::function``` and having one sub method after another use it. Barring that, a ```move``` will be as efficient as a ```const&```. Now, there are some other differences between the two that mostly kick in if we have persistent state within the ```std::function```. Assume that the ```std::function``` stores some object with a ```operator() const```, but it also has some ```mutable``` data members which it modifies (how rude!). In the ```std::function const&``` case, the ```mutable``` data members modified will propagate out of the function call. In the ```std::function``` case, they won't. This is a relatively strange corner case. You want to treat ```std::function``` like you would any other possibly heavy-weight, cheaply movable type. Moving is cheap, copying can be expensive.
Performans istiyorsanız, saklıyorsanız değer olarak geçirin. "Bunu UI iş parçacığında çalıştır" adında bir fonksiyonunuz olduğunu varsayalım. ```std::future run_in_ui_thread( std::function ) ``` Bu, "UI" iş parçacığında bazı kodları çalıştırır ve bittiğinde ```future```'ı işaret eder. (UI öğeleriyle uğraşmanız gereken UI çerçevelerinde faydalıdır) Düşündüğümüz iki imza var: ```std::future run_in_ui_thread( std::function ) // (A) std::future run_in_ui_thread( std::function const& ) // (B) ``` Şimdi, bunları şu şekilde kullanma ihtimalimiz var: ```run_in_ui_thread( [=]{ // kod buraya gelir } ).wait(); ``` Bu, anonim bir kapanış (bir lambda) oluşturacak, ondan bir ```std::function``` oluşturacak, ```run_in_ui_thread``` fonksiyonuna geçirecek ve ardından ana iş parçacığında çalışmasını bekleyecektir. (A) durumunda, ```std::function``` doğrudan lambdamızdan oluşturulur ve ardından ```run_in_ui_thread``` içinde kullanılır. Lambda, ```std::function``` içine ```move``` edilir, böylece taşınabilir herhangi bir durum verimli bir şekilde içine taşınır. İkinci durumda, geçici bir ```std::function``` oluşturulur, lambda içine ```move``` edilir, ardından bu geçici ```std::function```, ```run_in_ui_thread``` içinde referansla kullanılır. Şimdiye kadar, çok iyi - ikisi de aynı şekilde çalışıyor. ```run_in_ui_thread```'in, yürütmek için UI iş parçacığına göndermek üzere fonksiyon argümanının bir kopyasını oluşturacağı hariç! (bitmeden geri dönecektir, bu nedenle ona yalnızca bir referans kullanamaz). (A) durumu için, ```std::function```'ı uzun süreli deposuna ```move``` ederiz. (B) durumunda, ```std::function```'ı kopyalamaya zorlanırız. Bu depo, değer olarak geçirmeyi daha uygun hale getirir. ```std::function```'ın bir kopyasını saklama olasılığınız varsa, değer olarak geçirin. Aksi takdirde, her iki yol da aşağı yukarı eşdeğerdir: değer olarak geçirmenin tek dezavantajı, aynı hantal ```std::function```'ı alıp bir alt yöntemin ardından diğerinin onu kullanmasıdır. Bunu engellemek için, bir ```move```, ```const&``` kadar verimli olacaktır. Şimdi, ikisi arasında, çoğunlukla ```std::function``` içinde kalıcı bir durumumuz varsa devreye giren bazı başka farklılıklar var. ```std::function```'ın ```operator() const``` ile bir nesne sakladığını, ancak aynı zamanda değiştirdiği bazı ```mutable``` veri üyelerine sahip olduğunu varsayalım (ne kadar kaba!). ```std::function const&``` durumunda, değiştirilen ```mutable``` veri üyeleri fonksiyon çağrısının dışına yayılacaktır. ```std::function``` durumunda, yayılmazlar. Bu, nispeten garip bir köşe vakasıdır. ```std::function```'ı, ağır olabilecek, ucuza taşınabilir başka bir tür gibi ele almak istersiniz. Taşıma ucuzdur, kopyalama pahalı olabilir.
191
I have an Eloquent model which has a related model: ```public function option() { return $this->hasOne('RepairOption', 'repair_item_id'); } public function setOptionArrayAttribute($values) { $this->option->update($values); } ``` When I create the model, it does not necessarily have a related model. When I update it, I might add an option, or not. So I need to check if the related model exists, to either update it, or create it, respectively: ```$model = RepairItem::find($id); if (Input::has('option')) { if () { $option = new RepairOption(Input::get('option')); $option->repairItem()->associate($model); $option->save(); $model->fill(Input::except('option'); } else { $model->update(Input::all()); } }; ``` Where `````` is the code I am looking for.
İlişkili bir modeli olan bir Eloquent modelim var: ```public function option() { return $this->hasOne('RepairOption', 'repair_item_id'); } public function setOptionArrayAttribute($values) { $this->option->update($values); } ``` Modeli oluşturduğumda, mutlaka ilişkili bir modeli olmayabilir. Güncellediğimde, bir seçenek ekleyebilirim veya eklemeyebilirim. Bu nedenle, ilişkili modelin var olup olmadığını kontrol etmem, sırasıyla güncellemem veya oluşturmam gerekir: ```$model = RepairItem::find($id); if (Input::has('option')) { if () { $option = new RepairOption(Input::get('option')); $option->repairItem()->associate($model); $option->save(); $model->fill(Input::except('option'); } else { $model->update(Input::all()); } }; ``` ````` aradığım kodun olduğu yerdir.
A Relation object passes unknown method calls through to an Eloquent query Builder, which is set up to only select the related objects. That Builder in turn passes unknown method calls through to its underlying query Builder. This means you can use the ```exists()``` or ```count()``` methods directly from a relation object: ```$model->relation()->exists(); // bool: true if there is at least one row $model->relation()->count(); // int: number of related rows ``` Note the parentheses after ```relation```: ```->relation()``` is a function call (getting the relation object), as opposed to ```->relation``` which a magic property getter set up for you by Laravel (getting the related object/objects). Using the ```count``` method on the relation object (that is, using the parentheses) will be much faster than doing ```$model->relation->count()``` or ```count($model->relation)``` (unless the relation has already been eager-loaded) since it runs a count query rather than pulling all of the data for any related objects from the database, just to count them. Likewise, using ```exists``` doesn't need to pull model data either. Both ```exists()``` and ```count()``` work on all relation types I've tried, so at least ```belongsTo```, ```hasOne```, ```hasMany```, and ```belongsToMany```.
Bir Relation nesnesi bilinmeyen metot çağrılarını, yalnızca ilgili nesneleri seçmek üzere ayarlanmış bir Eloquent sorgu Oluşturucusuna iletir. Bu Oluşturucu da bilinmeyen metot çağrılarını kendi altındaki sorgu Oluşturucusuna iletir. Bu, ```exists()``` veya ```count()``` metotlarını doğrudan bir relation nesnesinden kullanabileceğiniz anlamına gelir: ```$model->relation()->exists(); // bool: en az bir satır varsa true $model->relation()->count(); // int: ilgili satırların sayısı ``` ```relation``` sonrasındaki parantezlere dikkat edin: ```->relation()``` bir fonksiyon çağrısıdır (relation nesnesini almak), ```->relation``` ise Laravel tarafından sizin için ayarlanmış sihirli bir özellik alıcısıdır (ilgili nesne/nesneleri almak). Relation nesnesinde ```count``` metodunu kullanmak (yani parantezleri kullanmak), ```$model->relation->count()``` veya ```count($model->relation)``` yapmaktan çok daha hızlı olacaktır (relation önceden istekli yüklenmemişse), çünkü ilgili nesnelerin tüm verilerini veritabanından çekmek yerine, yalnızca onları saymak için bir sayım sorgusu çalıştırır. Aynı şekilde, ```exists``` kullanmak da model verilerini çekmek zorunda kalmaz. Hem ```exists()``` hem de ```count()```, denediğim tüm relation türlerinde çalışır, yani en azından ```belongsTo```, ```hasOne```, ```hasMany``` ve ```belongsToMany```.
192
NASA is hiring a new 'planetary protection officer' to defend Earth from alien matter, and the pay is a six-figure salary: as much as $187,000 a year. When we are not sure whether aliens exist, why are we still hiring staff for protecting Earth? I do understand we have to take precautions. But when we don't have any proof why spend $187,000 a year? Source: Nasa [sic] hiring new 'planetary protection officer' to defend Earth from alien matter - Times of India, Aug 3, 2017
NASA, Dünya'yı uzaylı maddelerden korumak için yeni bir 'gezegen koruma görevlisi' işe alıyor ve maaşı altı haneli: yılda 187.000 dolar kadar. Uzaylıların varlığından emin olmadığımız halde, neden hâlâ Dünya'yı korumak için personel işe alıyoruz? Önlem almamız gerektiğini anlıyorum. Ancak hiçbir kanıtımız yokken neden yılda 187.000 dolar harcıyoruz? Kaynak: Nasa [sic] Dünya'yı uzaylı maddelerden korumak için yeni 'gezegen koruma görevlisi' işe alıyor - Times of India, 3 Ağustos 2017
You're observing shamefully bad journalism. The &quot;protect Earth from aliens&quot; bullet point in the &quot;Highlights&quot; section of the article was put there by an editor who either ignorantly or willfully distorted the actual role of the Planetary Protection Officer. The first paragraph of the story gets a little closer: The full-time role of &quot;planetary protection officer&quot; will involve ensuring that humans in space do not contaminate planets and moons, as well as ensuring that alien matter does not infect Earth. &quot;Planetary Protection Officer&quot; isn't a new position; the current one is retiring. The primary focus of the planetary protection office is sterilizing probes that are going to other planets and moons. This is done both to preserve any existing life elsewhere in the solar system from Terran competition, and so that if and when we find life on other bodies, we will know we didn't bring it ourselves. Preventing microbes from other worlds reaching Earth is also a concern, for similar reasons. Developing and implementing the policies of the planetary protection office is a complex job requiring a broad array of both technical and human skills, and so a $187K salary is not remarkable for it: Candidates will be required to travel frequently — but like any job, there will be a significant amount of emails, proposals and other reading. Candidates must have at least one year's experience as a top-level civilian government employee, and an advanced degree in physical science, engineering or mathematics. They must also have &quot;advanced knowledge&quot; of planetary protection. The position also requires &quot;demonstrated skills in diplomacy that resulted in win-win solutions during extremely difficult and complex multilateral discussions&quot;. The new hire will also receive &quot;secret&quot; security clearance. Only US citizens and US nationals can apply.
Utanç verici derecede kötü gazetecilik örneği görüyorsunuz. Makalenin "Önemli Noktalar" bölümündeki "Dünyayı uzaylılardan koru" madde işareti, Gezegensel Koruma Görevlisinin gerçek rolünü bilmeyerek veya kasıtlı olarak çarpıtan bir editör tarafından eklenmiştir. Hikayenin ilk paragrafı biraz daha yaklaşıyor: "Gezegensel koruma görevlisi"nin tam zamanlı rolü, uzaydaki insanların gezegenleri ve uyduları kirletmemesini sağlamanın yanı sıra uzaylı maddelerin Dünya'yı enfekte etmemesini sağlamayı da içerecektir. "Gezegensel Koruma Görevlisi" yeni bir pozisyon değil; şu anki görevli emekli oluyor. Gezegensel koruma ofisinin birincil odak noktası, diğer gezegenlere ve uydulara giden sondaları sterilize etmektir. Bu, hem güneş sistemindeki başka yerlerdeki mevcut yaşamı Terran rekabetinden korumak hem de başka gök cisimlerinde yaşam bulduğumuzda veya bulduğumuzda onu kendimiz getirmediğimizi bilmek için yapılır. Benzer nedenlerden dolayı, diğer dünyalardan gelen mikropların Dünya'ya ulaşmasını önlemek de bir endişe kaynağıdır. Gezegensel koruma ofisinin politikalarını geliştirmek ve uygulamak, hem teknik hem de insani beceriler gerektiren karmaşık bir iştir ve bu nedenle 187.000 $'lık bir maaş bunun için dikkate değer değildir: Adayların sık sık seyahat etmesi gerekecek - ancak herhangi bir işte olduğu gibi, önemli miktarda e-posta, teklif ve diğer okumalar olacaktır. Adayların en üst düzey sivil devlet görevlisi olarak en az bir yıllık deneyime ve fizik bilimi, mühendislik veya matematik alanında yüksek lisans derecesine sahip olmaları gerekir. Ayrıca gezegensel koruma konusunda "ileri düzey bilgiye" sahip olmaları gerekir. Pozisyon ayrıca "son derece zor ve karmaşık çok taraflı tartışmalar sırasında kazan-kazan çözümleriyle sonuçlanan kanıtlanmış diplomasi becerileri" gerektirmektedir. Yeni işe alınan kişi ayrıca "gizli" güvenlik izni alacaktır. Sadece ABD vatandaşları ve ABD uyruklular başvurabilir.
193
Traditional advice for making megadungeons in older versions of D&D is in addition to any rooms with Monsters, Treasure, Traps, or "Tricks", there should also be at least 50 to 60 percent "Empty" rooms, which contain nothing overtly threatening or valuable. Now, there's several arguments for including these empty rooms that I buy, so I'm not going to accept any answer which primarily says, "Don't include empty rooms". The main issue I run into with empty rooms, however, is that they're boring in the way that I've been including them. They don't do their job of increasing tension, and the set dressing included around them hasn't been sufficiently interesting to my players either. My question is this: How can I make empty rooms interesting, by increasing tension or simply being interesting in and of themselves?
D&D'nin eski sürümlerinde megadanjonlar yapmaya yönelik geleneksel tavsiye, Canavarlar, Hazine, Tuzaklar veya "Hileler" içeren odalara ek olarak, açıkça tehditkar veya değerli hiçbir şey içermeyen en az %50 ila %60 oranında "Boş" oda olması gerektiğidir. Şimdi, bu boş odaları dahil etmenin kabul ettiğim birkaç argümanı var, bu yüzden öncelikle "Boş odalar eklemeyin" diyen hiçbir cevabı kabul etmeyeceğim. Ancak boş odalarla ilgili karşılaştığım ana sorun, onları dahil ettiğim şekilde sıkıcı olmalarıdır. Gerilimi artırma işlevlerini yerine getirmiyorlar ve etraflarına dahil edilen set dekoru da oyuncularım için yeterince ilgi çekici olmadı. Sorunum şu: Gerilimi artırarak veya kendi başlarına ilginç olarak boş odaları nasıl ilginç hale getirebilirim?
By definition, nothing's going to happen in an empty room (though see below). There are no hidden doors to find, no puzzles to solve, no enemies to fight. So what's their purpose? ## Bringing the dungeon to life While all the orcs may sit around in a guard room waiting for PCs to show up, where do they sleep, what do they eat, what happens to their trash? Think of a dungeon not just as a place to have fights in, but as an actual place that serves a purpose. Once you do, the dungeon will start making sense. &quot;Empty&quot; rooms will increase immersion for the players, and force you to consider things you may not have otherwise. Should there be a pet otyugh that eats the trash? Are the orcs demanding cows from the local farmers for &quot;protection&quot;? Do they keep a famed halfling cook enslaved, to make them rare steaks? ## Foreshadowing Once the dungeon makes sense, you can use that to place clues for things that dwell deeper within. Has a horde of zombies marched through to guard the necromancer's abode within, and left a few rotten body parts here and there? Has a malevolent force been summoned and spoiled all the meat and milk in the dungeon? Is there a golem maintenance station, with oil to grease them, rags to polish them, and a mad goblin mechanic? These may be vital clues PCs need to prepare for a tough fight, or they can simply let them form theories and feel smart about being right once they do come upon a golem or three. #Currently empty These rooms are empty now, but they don't have to stay that way. PCs may choose to fortify a room and bring the enemy to them - such tactical choices could be an important part of dungeoncrawling. Orcs may chase PCs through the dungeon, or randomly come across them in a kitchen because they were feeling peckish. Note that some of these ideas would introduce creatures or things into rooms that PCs may choose to interact with, which would make them non-empty. In a way that's fine: you started with an empty room but found something interesting to put inside after all. If that's not your intention, well, don't put goblins or halflings or otyughs in. Stick to body parts and greasy pots and shadowy portraits and bloodstains and scent of brimstone and fresh flowers and broken mirrors and... Tell a story with your empty rooms, or offer tactical choices. Preferably both.
Tanımı gereği, boş bir odada hiçbir şey olmayacaktır (aşağıya bakın). Bulunacak gizli kapılar, çözülecek bulmacalar, savaşacak düşmanlar yoktur. Peki amaçları nedir? ## Zindanı hayata geçirmek Tüm orklar bir muhafız odasında oturup oyuncuların gelmesini beklerken, nerede uyurlar, ne yerler, çöplerine ne olur? Zindanı sadece dövüşülecek bir yer olarak değil, bir amaca hizmet eden gerçek bir yer olarak düşünün. Bunu yaptığınızda, zindan mantıklı gelmeye başlayacaktır. "Boş" odalar oyuncular için sürükleyiciliği artıracak ve sizi normalde düşünmeyeceğiniz şeyleri düşünmeye zorlayacaktır. Çöpleri yiyen bir otyugh evcil hayvanı olmalı mı? Orklar yerel çiftçilerden "koruma" için inek mi istiyorlar? Nadir biftekler yapmak için ünlü bir hobbit aşçıyı köle olarak mı tutuyorlar? ## Haber verme Zindan mantıklı hale geldiğinde, bunu içinde daha derinde yaşayan şeyler için ipuçları yerleştirmek için kullanabilirsiniz. Bir zombi ordusu nekromanserin meskenini korumak için yürümüş ve oraya buraya birkaç çürümüş vücut parçası bırakmış mı? Kötü niyetli bir güç çağrılmış ve zindandaki tüm et ve sütü bozmuş mu? Yağlamak için yağ, parlatmak için bezler ve çılgın bir goblin tamircisi olan bir golem bakım istasyonu var mı? Bunlar oyuncuların zorlu bir kavgaya hazırlanmak için ihtiyaç duyabileceği hayati ipuçları olabilir veya sadece teoriler oluşturmalarına ve bir veya üç golemi bulduklarında haklı olduklarını hissetmelerine izin verebilirler. #Şu anda boş Bu odalar şu anda boş, ancak bu şekilde kalmak zorunda değiller. Oyuncular bir odayı güçlendirmeyi ve düşmanı kendilerine getirmeyi seçebilirler - bu tür taktiksel seçimler zindan taramanın önemli bir parçası olabilir. Orklar oyuncuları zindanda kovalayabilir veya aç hissettikleri için mutfakta rastgele onlarla karşılaşabilirler. Bu fikirlerden bazılarının, oyuncuların etkileşime girmeyi seçebileceği odalara yaratıklar veya şeyler getireceğini ve onları boş olmaktan çıkaracağını unutmayın. Bir bakıma bu iyi: Boş bir odadan başladınız ama sonuçta içine koyacak ilginç bir şey buldunuz. Eğer niyetiniz bu değilse, goblinler, hobbitler veya otyughlar koymayın. Vücut parçalarına, yağlı tencerelere, gölgeli portrelere, kan lekelerine, kükürt kokusuna, taze çiçeklere, kırık aynalara ve... Boş odalarınızla bir hikaye anlatın veya taktiksel seçimler sunun. Tercihen her ikisi de.
194
Laravel - Eloquent "Has", "With", "WhereHas" - What do they mean? explain in the context of an example
Laravel - Eloquent "Has", "With", "WhereHas" - Ne Anlama Geliyorlar? Bir örnek bağlamında açıklayın
With ```with()``` is for eager loading. That basically means, along the main model, Laravel will preload the relationship(s) you specify. This is especially helpful if you have a collection of models and you want to load a relation for all of them. Because with eager loading you run only one additional DB query instead of one for every model in the collection. Example: ```User > hasMany > Post``` ```$users = User::with('posts')->get(); foreach($users as $user){ $users->posts; // posts is already loaded and no additional DB query is run } ``` Has ```has()``` is to filter the selecting model based on a relationship. So it acts very similarly to a normal WHERE condition. If you just use ```has('relation')``` that means you only want to get the models that have at least one related model in this relation. Example: ```User > hasMany > Post``` ```$users = User::has('posts')->get(); // only users that have at least one post are contained in the collection ``` WhereHas ```whereHas()``` works basically the same as ```has()``` but allows you to specify additional filters for the related model to check. Example: ```User > hasMany > Post``` ```$users = User::whereHas('posts', function($q){ $q->where('created_at', '>=', '2015-01-01 00:00:00'); })->get(); // only users that have posts from 2015 on forward are returned ```
With ```with()``` istekli yükleme içindir. Bu temelde, ana model boyunca Laravel'in belirttiğiniz ilişki(leri) önceden yükleyeceği anlamına gelir. Bu, özellikle bir model koleksiyonunuz varsa ve hepsi için bir ilişki yüklemek istiyorsanız faydalıdır. Çünkü istekli yüklemeyle koleksiyondaki her model için bir tane yerine yalnızca bir ek DB sorgusu çalıştırırsınız. Örnek: ```User > hasMany > Post``` ```$users = User::with('posts')->get(); foreach($users as $user){ $users->posts; // gönderiler zaten yüklendi ve ek bir DB sorgusu çalıştırılmadı } ``` Has ```has()```, seçilen modeli bir ilişkiye göre filtrelemek içindir. Bu nedenle normal bir WHERE koşuluna çok benzer şekilde davranır. Sadece ```has('relation')``` kullanırsanız, yalnızca bu ilişkide en az bir ilgili modeli olan modelleri almak istediğiniz anlamına gelir. Örnek: ```User > hasMany > Post``` ```$users = User::has('posts')->get(); // koleksiyonda yalnızca en az bir gönderisi olan kullanıcılar bulunur ``` WhereHas ```whereHas()``` temelde ```has()``` ile aynı şekilde çalışır ancak kontrol edilecek ilgili model için ek filtreler belirtmenize olanak tanır. Örnek: ```User > hasMany > Post``` ```$users = User::whereHas('posts', function($q){ $q->where('created_at', '>=', '2015-01-01 00:00:00'); })->get(); // yalnızca 2015'ten itibaren gönderileri olan kullanıcılar döndürülür ```
195
What are some of the advantages of using one over the other?
Birini diğerine tercih etmenin bazı avantajları nelerdir?
ASP.NET Web Forms and MVC are two web frameworks developed by Microsoft - they are both good choices. Neither of the web frameworks are to be replaced by the other nor are there plans to have them 'merged' into a single framework. Continued support and development are done in parallel by Microsoft and neither will be 'going away'. Each of these web frameworks offers advantages/disadvantages - some of which need to be considered when developing a web application. A web application can be developed using either technology - it might make development for a particular application easier selecting one technology versus the other and vice versa. ASP.NET Web Forms: * Development supports state • Gives the illusion that a web application is aware of what the user has been doing, similar to Windows applications. I.e. Makes 'wizard' functionality a little bit easier to implement. Web forms does a great job at hiding a lot of that complexity from the developer. * Rapid Application Development (RAD) • The ability to just 'jump in' and start delivering web forms. This is disputed by some of the MVC community, but pushed by Microsoft. In the end, it comes down to the level of expertise of the developer and what they are comfortable with. The web forms model probably has less of a learning curve to less experienced developers. * Larger control toolbox • ASP.NET Web Forms offers a much greater and more robust toolbox (web controls) whereas MVC offers a more primitive control set relying more on rich client-side controls via jQuery (Javascript). * Mature • It's been around since 2002 and there is an abundance of information with regards to questions, problems, etc. Offers more third-party control - need to consider your existing toolkits. ASP.NET MVC: * Separation of concerns (SoC) • From a technical standpoint, the organization of code within MVC is very clean, organized and granular, making it easier (hopefully) for a web application to scale in terms of functionality. Promotes great design from a development standpoint. * Easier integration with client side tools (rich user interface tools) • More than ever, web applications are increasingly becoming as rich as the applications you see on your desktops. With MVC, it gives you the ability to integrate with such toolkits (such as jQuery) with greater ease and more seamless than in Web Forms. * Search Engine Optimization (SEO) Friendly / Stateless • URL's are more friendly to search engines (i.e. mywebapplication.com/users/ 1 - retrieve user with an ID of 1 vs mywebapplication/users/getuser.aspx (id passed in session)). Similarly, since MVC is stateless, this removes the headache of users who spawn multiple web browsers from the same window (session collisions). Along those same lines, MVC adheres to the stateless web protocol rather than 'battling' against it. * Works well with developers who need high degree of control • Many controls in ASP.NET web forms automatically generate much of the raw HTML you see when an page is rendered. This can cause headaches for developers. With MVC, it lends itself better towards having complete control with what is rendered and there are no surprises. Even more important, is that the HTML forms typically are much smaller than the Web forms which can equate to a performance boost - something to seriously consider. * Test Driven Development (TDD) • With MVC, you can more easily create tests for the web side of things. An additional layer of testing will provide yet another layer of defense against unexpected behavior. Authentication, authorization, configuration, compilation and deployment are all features that are shared between the two web frameworks.
ASP.NET Web Forms ve MVC, Microsoft tarafından geliştirilen iki web çerçevesidir; ikisi de iyi seçimlerdir. Web çerçevelerinden hiçbiri diğerinin yerini almayacak veya tek bir çerçevede "birleştirilmesi" planlanmamaktadır. Microsoft tarafından paralel olarak sürekli destek ve geliştirme yapılmakta ve hiçbirinin "ortadan kalkması" söz konusu değildir. Bu web çerçevelerinin her biri avantajlar/dezavantajlar sunar; bunlardan bazıları bir web uygulaması geliştirirken dikkate alınmalıdır. Bir web uygulaması her iki teknoloji kullanılarak da geliştirilebilir; belirli bir uygulama için geliştirmeyi kolaylaştırmak için bir teknolojiyi diğerine göre seçmek mümkündür ve bunun tersi de geçerlidir. ASP.NET Web Forms: * Geliştirme durumu destekler • Web uygulamasının, Windows uygulamalarına benzer şekilde kullanıcının ne yaptığının farkında olduğu yanılsamasını verir. Yani "sihirbaz" işlevselliğini uygulamayı biraz daha kolaylaştırır. Web formları, bu karmaşıklığın çoğunu geliştiriciden gizleme konusunda harika bir iş çıkarır. * Hızlı Uygulama Geliştirme (RAD) • Sadece "atlayıp" web formları sunma yeteneği. Bu, MVC topluluğunun bazıları tarafından tartışılır ancak Microsoft tarafından desteklenir. Sonuçta, geliştiricinin uzmanlık düzeyine ve rahat ettiği şeye bağlıdır. Web formları modeli, muhtemelen daha az deneyimli geliştiriciler için daha az öğrenme eğrisine sahiptir. * Daha büyük denetim kutusu • ASP.NET Web Forms, çok daha büyük ve daha sağlam bir araç kutusu (web denetimleri) sunarken, MVC, jQuery (Javascript) aracılığıyla zengin istemci tarafı denetimlerine daha fazla güvenerek daha ilkel bir denetim seti sunar. * Olgun • 2002'den beri var ve sorular, sorunlar vb. ile ilgili çok fazla bilgi var. Daha fazla üçüncü taraf denetimi sunar; mevcut araç takımlarınızı göz önünde bulundurmanız gerekir. ASP.NET MVC: * Endişelerin ayrılması (SoC) • Teknik bir bakış açısından, MVC içindeki kodun organizasyonu çok temiz, düzenli ve ayrıntılıdır ve bu da bir web uygulamasının işlevsellik açısından ölçeklenmesini (umarım) kolaylaştırır. Geliştirme açısından harika bir tasarım teşvik eder. * İstemci tarafı araçlarla (zengin kullanıcı arayüzü araçları) daha kolay entegrasyon • Web uygulamaları, masaüstünüzde gördüğünüz uygulamalar kadar zengin hale geliyor. MVC ile, bu tür araç takımlarıyla (jQuery gibi) Web Forms'a göre daha kolay ve daha sorunsuz bir şekilde bütünleşme yeteneği sağlar. * Arama Motoru Optimizasyonu (SEO) Dostu / Durumsuz • URL'ler arama motorları için daha dosttur (yani mywebapplication.com/users/1 - 1 kimlikli kullanıcıyı alır, mywebapplication/users/getuser.aspx'e (oturumda geçirilen kimlik) karşı). Benzer şekilde, MVC durumsuz olduğundan, aynı pencereden birden fazla web tarayıcısı oluşturan kullanıcıların baş ağrısını (oturum çakışmaları) ortadan kaldırır. Aynı doğrultuda, MVC, ona "karşı savaşmaktansa" durumsuz web protokolüne uyar. * Yüksek derecede kontrole ihtiyaç duyan geliştiricilerle iyi çalışır • ASP.NET web formlarındaki birçok denetim, bir sayfa işlendiğinde gördüğünüz ham HTML'nin çoğunu otomatik olarak oluşturur. Bu, geliştiriciler için baş ağrılarına neden olabilir. MVC ile, işlenen şey üzerinde tam kontrole sahip olmaya daha iyi uygundur ve sürprizler yoktur. Daha da önemlisi, HTML formları genellikle Web formlarından çok daha küçüktür ve bu da ciddi şekilde dikkate alınması gereken bir performans artışına eşit olabilir. * Test Odaklı Geliştirme (TDD) • MVC ile, işlerin web tarafı için daha kolay testler oluşturabilirsiniz. Ek bir test katmanı, beklenmedik davranışlara karşı başka bir savunma katmanı sağlayacaktır. Kimlik doğrulama, yetkilendirme, yapılandırma, derleme ve dağıtım, iki web çerçevesi arasında paylaşılan özelliklerdir.
196
What factors determine the maximum altitude for a plane? Is it limited by wing design, engine thrust, and so on? Is there a formula by which one can calculate the maximum altitude a plane can reach?
Bir uçak için maksimum irtifayı belirleyen faktörler nelerdir? Kanat tasarımı, motor gücü vb. ile sınırlı mıdır? Bir uçağın ulaşabileceği maksimum irtifayı hesaplamak için bir formül var mı?
The higher you get, the lower the density of the air becomes. This lower density results in a lower lift being generated for the same airspeed and angle of attack. Effectively, the higher you fly the higher your minimum speed becomes. So while climbing, your speed needs to increase to compensate for the lower air density. As long a you can fly faster, the lower density at altitude can be compensated for. Basically there are two things that limit your maximum speed: thrust and speed of sound and with that your maximum altitude. First is thrust; the higher you get, the lower the thrust your engines deliver. You might note that drag goes down with the air density as well but since you are flying faster and faster during the climb the drag doesn't decrease at all. If your maximum altitude is limited by thrust then at some point during the climb the thrust and drag are getting close to equal and that is where the climb stops. When you can no longer climb with more than 100ft per minute (for propeller aircraft) or 500ft per minute (for jet / turbofan aircraft) you have reached your service ceiling. If the aircraft maximum altitude is determined by thrust, the absolute ceiling will take very long to reach. At high altitudes air breathing engines will get difficulties eventually. Due to the lower air density the mass flow through the engine is reduced up to a point where it causes a flame out. The other limitation is the speed of sound, at least for subsonic aircraft. In the process of generating lift, air flowing over the top of the wing is accelerated. At one point, when the aircraft is still flying below the speed of sound, shock waves will start to form over the wing. This results in increase of drag and reduces the lift. So provided you have enough engine power at your disposal you can climb to an altitude where your minimum speed is also your maximum speed. This is called the coffin corner. In the coffin corner: * if you fly any faster, you will exceed the maximum Mach number ($M_{mo}$) of your aircraft, resulting in high speed buffet, vibrations and possible loss of control. * if you fly any slower, the maximum lift that the wing can provide will be insufficient to maintain altitude. Descent or the aircraft will stall. * if you fly any higher and you will be too fast and too slow at the same time. * if you turn, you increase the wing loading, thereby increasing the minimum speed needed to create the required lift. Also the outer wing will easily exceed the maximum speed while at the same time the inner wing is below stall speed. This can quickly develop into a spin. Since accurate knowledge of engine performance, drag and wing characteristics of the aircraft is needed, there is not a simple formula to derive the maximum altitude for an aircraft. Apart from the aircraft performance related limitations above there is a certified maximum operating altitude for the pressurized cabin. This takes into account the structural properties of the hull (pressure difference between inside and outside) and the achievable emergency descent rate in case of a depressurization event.
Yükseldikçe havanın yoğunluğu azalır. Bu düşük yoğunluk, aynı hava hızı ve hücum açısı için daha düşük bir kaldırma kuvveti üretilmesiyle sonuçlanır. Etkili bir şekilde, ne kadar yükselirseniz minimum hızınız o kadar artar. Bu nedenle tırmanırken, daha düşük hava yoğunluğunu telafi etmek için hızınızın artması gerekir. Daha hızlı uçabildiğiniz sürece, irtifadaki daha düşük yoğunluk telafi edilebilir. Temel olarak, maksimum hızınızı sınırlayan iki şey vardır: itki ve ses hızı ve bununla birlikte maksimum irtifanız. Birincisi itkidir; yükseldikçe motorlarınızın sağladığı itki azalır. Sürtünmenin de hava yoğunluğu ile birlikte azaldığını fark edebilirsiniz, ancak tırmanış sırasında daha hızlı ve daha hızlı uçtuğunuz için sürtünme hiç azalmaz. Maksimum irtifanız itki ile sınırlıysa, tırmanış sırasında bir noktada itki ve sürtünme birbirine yaklaşır ve tırmanışın durduğu yer burasıdır. Dakikada 100 fitten (pervaneli uçaklar için) veya dakikada 500 fitten (jet / turbofan uçaklar için) daha fazla tırmanamaz hale geldiğinizde, servis tavanınıza ulaşmışsınız demektir. Uçağın maksimum irtifası itki ile belirlenirse, mutlak tavana ulaşmak çok uzun sürecektir. Yüksek irtifalarda hava soluyan motorlar sonunda zorluk yaşayacaktır. Daha düşük hava yoğunluğu nedeniyle motordan geçen kütle akışı, alev almasına neden olan bir noktaya kadar azalır. Diğer sınırlama, en azından ses altı uçaklar için ses hızıdır. Kaldırma kuvveti oluşturma sürecinde, kanadın üzerinden akan hava hızlanır. Bir noktada, uçak hala ses hızının altında uçarken, kanat üzerinde şok dalgaları oluşmaya başlar. Bu, sürtünmenin artmasına ve kaldırma kuvvetinin azalmasına neden olur. Bu nedenle, emrinizde yeterli motor gücüne sahip olduğunuz sürece, minimum hızınızın aynı zamanda maksimum hızınız olduğu bir irtifaya tırmanabilirsiniz. Buna tabut köşesi denir. Tabut köşesinde: * Daha hızlı uçarsanız, uçağınızın maksimum Mach sayısını ($M_{mo}$) aşarsınız ve bu da yüksek hızlı türbülansa, titreşimlere ve olası kontrol kaybına neden olur. * Daha yavaş uçarsanız, kanadın sağlayabileceği maksimum kaldırma kuvveti irtifayı korumak için yetersiz kalır. Uçak alçalır veya durur. * Daha yükseğe uçarsanız aynı anda hem çok hızlı hem de çok yavaş olursunuz. * Dönerseniz, kanat yükünü artırırsınız ve böylece gerekli kaldırma kuvvetini oluşturmak için gereken minimum hızı artırırsınız. Ayrıca dış kanat maksimum hızı kolayca aşarken, iç kanat aynı anda durma hızının altındadır. Bu, hızla bir dönüşe dönüşebilir. Uçağın motor performansı, sürtünme ve kanat özellikleri hakkında doğru bilgiye ihtiyaç duyulduğundan, bir uçak için maksimum irtifayı türetmek için basit bir formül yoktur. Yukarıda belirtilen uçak performansıyla ilgili sınırlamaların dışında, basınçlı kabin için sertifikalı bir maksimum çalışma irtifası vardır. Bu, gövdenin yapısal özelliklerini (iç ve dış arasındaki basınç farkı) ve basınçsızlaşma olayı durumunda elde edilebilir acil iniş hızını dikkate alır.
197
Why did the Typescript folks create the ```infer``` keyword? According to the documents, this is an example of how you would use it: ```type ReturnType = T extends (...args: any[]) => infer R ? R : any; ``` I don't understand why this is needed. Why can't it just be: ```type ReturnType = T extends (...args: any[]) => R ? R : any; ``` Why doesn't this work? Why is the ```infer``` keyword necessary ?
Typescript geliştiricileri neden ```infer``` anahtar kelimesini oluşturdu? Belgelere göre, bu anahtar kelimenin nasıl kullanılacağına dair bir örnek şu şekildedir: ```type ReturnType = T extends (...args: any[]) => infer R ? R : any; ``` Bunun neden gerekli olduğunu anlamıyorum. Neden şu şekilde olamaz: ```type ReturnType = T extends (...args: any[]) => R ? R : any; ``` Bu neden çalışmıyor? ```infer``` anahtar kelimesi neden gerekli?
With ```infer```, the compiler ensures that you have declared all type variables explicitly: ```type MyType = T extends infer R ? R : never; type T1 = MyType // T1 is { b: string; } ``` Here we declare a new type variable ```R``` in ```MyType```, which gets inferred from ```T```. (Note, that ```infer``` is always used within the ```extends``` clause of a conditional type.) Usage of undeclared type parameters now can result in a compile error: ```type MyType2 = T extends R2 ? R2 : never; // error, R2 undeclared ``` Without ```infer```, the compiler wouldn't know, if you wanted to introduce an additional type variable ```R2``` that is to be inferred (see first case), or if ```R2``` is just an accidental typing error/typo. ```infer``` exists to remove this ambiguity. More precisely the compiler checks, if ```T``` is assignable to ```R``` , when ```infer``` is omitted: ```type R = { a: number } type MyType3 = T extends R ? R : never; // compare T with type R type T3 = MyType3 // T3 is never ``` Note, that ```infer R``` shadows type references of an equally-named type declaration ```R```: ```type R = { a: number } type MyType4 = T extends infer R ? R : never; type T4 = MyType4 // { b: string; } ```
```infer``` ile derleyici, tüm tür değişkenlerini açıkça bildirdiğinizden emin olur: ```type MyType = T extends infer R ? R : never; type T1 = MyType // T1 { b: string; }'dir ``` Burada ```MyType``` içinde ```T```'den çıkarılan yeni bir tür değişkeni ```R``` bildiriyoruz. (```infer```'in her zaman koşullu bir türün ```extends``` ifadesi içinde kullanıldığını unutmayın.) Bildirilmemiş tür parametrelerinin kullanımı artık derleme hatasına neden olabilir: ```type MyType2 = T extends R2 ? R2 : never; // hata, R2 bildirilmemiş ``` ```infer``` olmadan derleyici, çıkarılacak ek bir tür değişkeni ```R2``` tanıtmak isteyip istemediğinizi (ilk duruma bakın) veya ```R2```'nin sadece yanlış bir yazım hatası/yazım yanlışı olup olmadığını bilemez. ```infer``` bu belirsizliği gidermek için vardır. Daha kesin olarak derleyici, ```infer``` atlanırsa ```T```'nin ```R```'ye atanabilir olup olmadığını kontrol eder: ```type R = { a: number } type MyType3 = T extends R ? R : never; // T'yi R türüyle karşılaştırın type T3 = MyType3 // T3 asla değildir ``` ```infer R```'nin aynı adlı bir tür bildiriminin tür referanslarını gölgelediğini unutmayın: ```type R = { a: number } type MyType4 = T extends infer R ? R : never; type T4 = MyType4 // { b: string; } ```
198
Which is more widely supported: ```window.onload``` or ```document.onload```?
Hangisi daha yaygın olarak desteklenir: ```window.onload``` veya ```document.onload```?
When do they fire? ```window.onload``` * By default, it is fired when the entire page loads, including its content (images, CSS, scripts, etc.). In some browsers it now takes over the role of ```document.onload``` and fires when the DOM is ready as well. ```document.onload``` * It is called when the DOM is ready which can be prior to images and other external content is loaded. How well are they supported? ```window.onload``` appears to be the most widely supported. In fact, some of the most modern browsers have in a sense replaced ```document.onload``` with ```window.onload```. Browser support issues are most likely the reason why many people are starting to use libraries such as jQuery to handle the checking for the document being ready, like so: ```$(document).ready(function() { /* code here */ }); $(function() { /* code here */ }); ``` For the purpose of history. ```window.onload``` vs ```body.onload```: A similar question was asked on codingforums a while back regarding the usage of ```window.onload``` over ```body.onload```. The result seemed to be that you should use ```window.onload``` because it is good to separate your structure from the action.
Ne zaman tetiklenirler? ```window.onload``` * Varsayılan olarak, içeriği (resimler, CSS, komut dosyaları vb.) dahil olmak üzere tüm sayfa yüklendiğinde tetiklenir. Bazı tarayıcılarda artık ```document.onload``` rolünü üstlenir ve DOM hazır olduğunda da tetiklenir. ```document.onload``` * DOM hazır olduğunda çağrılır, bu da resimler ve diğer harici içerikler yüklenmeden önce olabilir. Ne kadar iyi destekleniyorlar? ```window.onload``` en yaygın şekilde desteklenen gibi görünüyor. Aslında, en modern tarayıcılardan bazıları bir anlamda ```document.onload```'ı ```window.onload``` ile değiştirdi. Tarayıcı desteği sorunları, muhtemelen birçok kişinin belgenin hazır olup olmadığını kontrol etmek için jQuery gibi kitaplıkları kullanmaya başlamasının nedenidir: ```$(document).ready(function() { /* code here */ }); $(function() { /* code here */ }); ``` Tarihçe amacıyla. ```window.onload``` ve ```body.onload```: Benzer bir soru bir süre önce ```window.onload```'ın ```body.onload``` üzerinde kullanımıyla ilgili olarak codingforums'ta sorulmuştu. Sonuç, ```window.onload```'ı kullanmanız gerektiği gibi görünüyordu çünkü yapınızı eylemden ayırmak iyidir.
199
I was surprised to learn that Puerto Ricans, despite living in a US territory, were not entitled to vote in the presidential elections. I was even more surprised to learn that US citizens are allowed to vote for president from anywhere in the world - EXCEPT if they happen to live in Puerto Rico. What is the legal/political rationale behind this? What is it about Puerto Rico that magically removes one's right to vote? Has anyone ever challenged this?
Puerto Ricalıların, bir ABD bölgesinde yaşamalarına rağmen başkanlık seçimlerinde oy kullanma hakkına sahip olmadıklarını öğrenince şaşırdım. ABD vatandaşlarının dünyanın herhangi bir yerinden başkan için oy kullanmalarına izin verildiğini öğrenince daha da şaşırdım - Puerto Rico'da yaşamaları HARİÇ. Bunun arkasındaki yasal/siyasi gerekçe nedir? Puerto Rico'da bir kişinin oy kullanma hakkını sihirli bir şekilde ortadan kaldıran nedir? Hiç kimse buna itiraz etti mi?
This is a peculiarity as a result of the federal nature of the USA and the exceptional position of Puerto Rico as a territory but not a state. Within the States and Territories of the USA, your voting rights depend on residence. If you leave the States and Territories your voting rights depend on former residence or inheritance. In general most citizens of the USA are also citizens of a state of the USA. Since states don't issue their own passports, your citizenship of a state is determined by residence. If a New Yorker moves to Florida, they become Floridians, and so can vote in state elections in Florida, but can't now vote in elections in New York. Now if our New Yorker moves to Timbuktu, this is treated slightly differently. They remain a US citizen and a citizen of New York, and so retain the right to vote in New York elections. Their children could also claim New York citizenship. But Puerto Rico is both part of the USA but not a State or part of a State of the USA. When our New Yorker moves to Puerto Rico, they can vote in Puerto Rican elections but not elections in New York. Now the nature of elections in the US is that there are no national elections There are statewide elections of Senators, Governors and Presidential electors. There are district elections of Representatives and there are local elections of many kinds. Our New Yorker has lost the right to vote in New York elections (just as they would have done if they had moved to Florida) but not gained the right to vote in Puerto Rican elections for Presidential electors (because there are none). This is odd, but something similar is true if the New Yorker moves to DC. They cease to have the right to vote in elections to the Senate.
Bu, ABD'nin federal yapısının ve Porto Riko'nun bir eyalet değil, bir bölge olarak istisnai konumunun bir sonucu olarak ortaya çıkan bir tuhaflıktır. ABD'nin eyaletleri ve bölgelerinde oy kullanma hakkınız ikametgâha bağlıdır. Eyaletleri ve bölgeleri terk ederseniz oy kullanma hakkınız eski ikametgâha veya mirasa bağlıdır. Genel olarak ABD vatandaşlarının çoğu aynı zamanda bir ABD eyaletinin vatandaşıdır. Eyaletler kendi pasaportlarını vermediğinden, bir eyaletin vatandaşlığınız ikametgâha göre belirlenir. Bir New York'lu Florida'ya taşınırsa Floridalı olur ve bu nedenle Florida'daki eyalet seçimlerinde oy kullanabilir, ancak artık New York'taki seçimlerde oy kullanamaz. Şimdi New York'lumuz Timbuktu'ya taşınırsa, bu biraz farklı ele alınır. ABD vatandaşı ve New York vatandaşı olmaya devam ederler ve bu nedenle New York seçimlerinde oy kullanma hakkını korurlar. Çocukları da New York vatandaşlığı talep edebilir. Ancak Porto Riko hem ABD'nin bir parçasıdır hem de bir eyalet veya ABD'nin bir eyaletinin bir parçası değildir. New York'lumuz Porto Riko'ya taşındığında Porto Riko seçimlerinde oy kullanabilir ancak New York'taki seçimlerde oy kullanamaz. Şimdi ABD'deki seçimlerin doğası gereği ulusal seçimler yoktur. Senatörler, valiler ve başkanlık seçmenlerinin eyalet çapında seçimleri vardır. Temsilcilerin bölge seçimleri ve birçok türde yerel seçimler vardır. New York'lumuz New York seçimlerinde oy kullanma hakkını kaybetti (tıpkı Florida'ya taşınmış olsalardı yaptıkları gibi) ancak Porto Riko'da başkanlık seçmenleri için oy kullanma hakkını kazanmadı (çünkü hiçbiri yok). Bu tuhaf, ancak New York'lu DC'ye taşınırsa benzer bir şey geçerlidir. Senato seçimlerine oy verme hakkını kaybederler.