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
0
Can brain cells move? By movement I mean long distance migration (preferably within the brain only).
Beyin hücreleri hareket edebilir mi? Hareketten kastım uzun mesafeli göç (tercihen sadece beyin içinde).
The question is relatively broad and one should take into account that the brain not only consists of neurons, but also glial cells (supportive cells) and pre-mitotic neuronal stem cells. Furthermore, as critical fellow-scientists have indicated, developmental stage is very important, as the developing embryonic brain is very different from the adult brain. However, after sifting through various publications, the answer to the question is actually remarkably simple: Yes, brain cells migrate. In the adult brain glial cells migrate in the brain (Klämbt, 2009). Glial cells are involved in a myriad of functions, but a notable example of migrating glial cells are the oligodendrocytes that migrate relative long distances to find their target axons onto which they wrap themselves to form the insulating myelin sheath (Tsai and Miller, 2002). Neuronal stem cells migrate over long distances in response to injury (Imitola et al., 2004) and they migrate from specific stem-cell locations (e.g., hippocampus and subventricular zone) to other regions (Clarke, 2003). Post-mitotic, but non-differentiated neurons have been shown to migrate in the adult brain in fish (Scott et al., 2012), and in mammals and non-human primates as well (Sawada et al., 2011). Not surprisingly, glial cells, stem cells and neurons also migrate during embryonic development. Most notably, post-mitotic neurons destined to fulfill peripheral functions have to migrate over relatively long distances from the neural crest to their target locations (Neuroscience, 2nd ed, Neuronal Migration).
Soru nispeten geniş ve beynin sadece nöronlardan değil, aynı zamanda glia hücrelerinden (destekleyici hücreler) ve mitoz öncesi nöronal kök hücrelerden oluştuğu dikkate alınmalıdır. Ayrıca, eleştirel meslektaş bilim insanlarının belirttiği gibi, gelişmekte olan embriyonik beyin yetişkin beyinden çok farklı olduğu için gelişimsel aşama çok önemlidir. Ancak, çeşitli yayınlar incelendikten sonra, sorunun cevabı aslında oldukça basittir: Evet, beyin hücreleri göç eder. Yetişkin beyinde glia hücreleri beyinde göç eder (Klämbt, 2009). Glia hücreleri çok sayıda işlevde yer alır, ancak göç eden glia hücrelerinin dikkate değer bir örneği, kendilerini yalıtım miyelin kılıfını oluşturmak için sardıkları hedef aksonlarını bulmak için nispeten uzun mesafeler göç eden oligodendrositlerdir (Tsai ve Miller, 2002). Nöronal kök hücreler, yaralanmaya yanıt olarak uzun mesafeler göç eder (Imitola ve ark., 2004) ve belirli kök hücre konumlarından (örn., hipokampus ve subventriküler bölge) diğer bölgelere göç eder (Clarke, 2003). Mitoz sonrası ancak farklılaşmamış nöronların balıkta (Scott ve ark., 2012) ve memelilerde ve insan olmayan primatlarda da (Sawada ve ark., 2011) yetişkin beyinde göç ettiği gösterilmiştir. Şaşırtıcı olmayan bir şekilde, glia hücreleri, kök hücreler ve nöronlar da embriyonik gelişim sırasında göç eder. En önemlisi, periferik işlevleri yerine getirmeye yönelik mitoz sonrası nöronların nöral kretten hedef konumlarına nispeten uzun mesafeler göç etmesi gerekir (Nörobilim, 2. baskı, Nöronal Göç).
1
In our computer systems lecture we were introduced to the MIPS processor. It was (re)developed over the course of the term and has in fact been quite easy to understand. It uses a RISC design, that is its elementary commands are regularly encoded and there are only few of them in order to keep the wires simple. It was mentioned that CISC follows a different philosophy. I looked briefly at the x86 instruction set and was shocked. I can not image how anyone would want to build a processor that uses so complex a command set! So I figure there have to be good arguments why large portions of the processor market use CISC architectures. What are they?
Bilgisayar sistemleri dersimizde MIPS işlemcisine giriş yaptık. Dönem boyunca (yeniden) geliştirildi ve aslında anlaşılması oldukça kolaydı. Basit komutlarının düzenli olarak kodlandığı ve kabloları basit tutmak için yalnızca birkaç tane olan bir RISC tasarımı kullanır. CISC'in farklı bir felsefe izlediği belirtildi. x86 komut setine kısaca baktım ve şok oldum. Bu kadar karmaşık bir komut seti kullanan bir işlemciyi kimin inşa etmek istediğini hayal edemiyorum! Bu nedenle, işlemci pazarının büyük bir kısmının neden CISC mimarilerini kullandığına dair iyi argümanlar olması gerektiğini düşünüyorum. Bunlar nelerdir?
There is a general historical trend. In the olden days, memories were small, and so programs were perforce small. Also, compilers were not very smart, and many programs were written in assembler, so it was considered a good thing to be able to write a program using few instructions. Instruction pipelines were simple, and processors grabbed one instruction at a time to execute it. The machinery inside the processor was quite complex anyway; decoding instructions was not felt to be much of a burden. In the 1970s, CPU and compiler designers realized that having such complex instructions was not so helpful after all. It was difficult to design processors in which those instructions were really efficient, and it was difficult to design compilers that really took advantage of these instructions. Chip area and compiler complexity was better spent on more generic pursuits such as more general-purpose registers. The Wikipedia article on RISC explains this in more detail. MIPS is the ultimate RISC architecture, which is why it's taught so often. The x86 family is a bit different. It was originally a CISC architecture meant for systems with very small memory (no room for large instructions), and has undergone many successive versions. Today's x86 instruction set is not only complicated because it's CISC, but because it's really a 8088 with a 80386 with a Pentium possibly with an x86_64 processor. In today's world, RISC and CISC are no longer the black-and-white distinction they might have been once. Most CPU architectures have evolved to different shades of grey. On the RISC side, some modern MIPS variants have added multiplication and division instructions, with a non-uniform encoding. ARM processors have become more complex: many of them have a 16-bit instruction set called Thumb in addition to the “original” 32-bit instructions, not to mention Jazelle to execute JVM instructions on the CPU. Modern ARM processors also have SIMD instructions for multimedia applications: some complex instructions do pay after all. On the CISC side, all recent processors are to some extent RISC inside. They have microcode to define all these complex macro instructions. The sheer complexity of the processor makes the design of each model take several years, even with a RISC design, what with the large number of components, with pipelining and predictive execution and whatnot. So why do the fastest processors remain CISC outside? Part of it, in the case of the x86 (32-bit and 64-bit) family, is historical compatibility. But that's not the whole of it. In the early 2000s, Intel tried pushing the Itanium architecture. Itanium is an extreme case of complex instructions (not really CISC, though: its design has been dubbed EPIC). It even does away with the old-fashioned idea of executing instructions in sequence: all instructions are executed in parallel until the next barrier. One of the reasons Itanium didn't take is that nobody, whether at Intel or elsewhere, could write a decent compiler for it. Now a good old mostly-sequential processor like x86_64, that's something we understand.
Genel bir tarihsel eğilim vardır. Eskiden bellekler küçüktü ve bu nedenle programlar da küçük olmak zorundaydı. Ayrıca derleyiciler çok akıllı değildi ve birçok program derleyici dilinde yazılmıştı, bu nedenle birkaç komut kullanarak bir program yazabilmek iyi bir şey olarak kabul ediliyordu. Komut hatları basitti ve işlemciler bir seferde bir komutu alıp yürütüyordu. İşlemcinin içindeki makineler zaten oldukça karmaşıktı; komutların kodunu çözmek çok da büyük bir yük olarak görülmüyordu. 1970'lerde CPU ve derleyici tasarımcıları bu kadar karmaşık komutların o kadar da faydalı olmadığını fark ettiler. Bu komutların gerçekten verimli olduğu işlemcileri tasarlamak zordu ve bu komutlardan gerçekten yararlanan derleyicileri tasarlamak zordu. Çip alanı ve derleyici karmaşıklığı, daha genel amaçlı kayıtlar gibi daha genel amaçlı arayışlara daha iyi harcanıyordu. RISC hakkındaki Wikipedia makalesi bunu daha ayrıntılı bir şekilde açıklıyor. MIPS, çok sık öğretilmesinin nedeni olan nihai RISC mimarisidir. x86 ailesi biraz farklıdır. Başlangıçta çok küçük belleğe sahip sistemler için tasarlanmış bir CISC mimarisiydi (büyük komutlar için yer yoktu) ve birçok ardışık sürümden geçti. Günümüzün x86 komut seti yalnızca CISC olduğu için değil, aynı zamanda bir x86_64 işlemciyle muhtemelen bir Pentium ile bir 80386 ile bir 8088 olduğu için de karmaşıktır. Günümüz dünyasında RISC ve CISC artık bir zamanlar olabilecekleri siyah beyaz ayrım değildir. Çoğu CPU mimarisi farklı gri tonlarına dönüştü. RISC tarafında, bazı modern MIPS varyantları, tekdüze olmayan bir kodlama ile çarpma ve bölme komutları ekledi. ARM işlemcileri daha karmaşık hale geldi: Birçoğunun "orijinal" 32 bitlik komutlara ek olarak Thumb adında 16 bitlik bir komut seti var, CPU'da JVM komutlarını yürütmek için Jazelle'den bahsetmiyorum bile. Modern ARM işlemcilerinde ayrıca multimedya uygulamaları için SIMD komutları vardır: Sonuçta bazı karmaşık komutlar işe yarar. CISC tarafında, tüm yeni işlemciler bir dereceye kadar içeride RISC'tir. Tüm bu karmaşık makro komutları tanımlamak için mikro kodları vardır. İşlemcinin karmaşıklığı, RISC tasarımıyla bile, çok sayıda bileşen, boru hattı ve tahmine dayalı yürütme ve benzeri şeylerle her modelin tasarımının birkaç yıl sürmesine neden olur. Peki en hızlı işlemciler neden dışarıda CISC olmaya devam ediyor? Bunun bir kısmı, x86 (32 bit ve 64 bit) ailesi durumunda, tarihsel uyumluluktur. Ama hepsi bu değil. 2000'lerin başında Intel, Itanium mimarisini zorlamaya çalıştı. Itanium, karmaşık komutların aşırı bir örneğidir (gerçekten CISC değil: tasarımı EPIC olarak adlandırılmıştır). Hatta komutları sırayla yürütme konusundaki eski moda fikrini ortadan kaldırır: tüm komutlar bir sonraki engele kadar paralel olarak yürütülür. Itanium'un tutmamasının nedenlerinden biri, Intel'de veya başka bir yerde hiç kimsenin bunun için düzgün bir derleyici yazamamış olmasıdır. Şimdi x86_64 gibi iyi eski, çoğunlukla sıralı bir işlemci, anladığımız bir şey.
2
View tabular file such as CSV from command line, having horizontal and vertical scrolling would be great.
CSV gibi tablolu dosyaları komut satırından görüntülemek, yatay ve dikey kaydırma özelliği harika olurdu.
Sure, please take a look at csvkit. It provides a set of tools that adhere to the UNIX philosophy (meaning they are small, simple, single-purposed and can be combined). Here is an example that extracts the ten most populated cities in Germany from the free Maxmind World Cities database and displays the result in a console-readable format: ```$ csvgrep -e iso-8859-1 -c 1 -m "de" worldcitiespop | csvgrep -c 5 -r "\d+" | csvsort -r -c 5 -l | csvcut -c 1,2,4,6 | head -n 11 | csvlook ----------------------------------------------------- | line_number | Country | AccentCity | Population | ----------------------------------------------------- | 1 | de | Berlin | 3398362 | | 2 | de | Hamburg | 1733846 | | 3 | de | Munich | 1246133 | | 4 | de | Cologne | 968823 | | 5 | de | Frankfurt | 648034 | | 6 | de | Dortmund | 594255 | | 7 | de | Stuttgart | 591688 | | 8 | de | Düsseldorf | 577139 | | 9 | de | Essen | 576914 | | 10 | de | Bremen | 546429 | ----------------------------------------------------- ``` Csvkit is platform independent because it is written in Python.
Elbette, lütfen csvkit'e göz atın. UNIX felsefesine uyan bir dizi araç sağlar (yani küçük, basit, tek amaçlıdır ve birleştirilebilirler). İşte Almanya'daki en kalabalık on şehri ücretsiz Maxmind Dünya Şehirleri veritabanından çıkaran ve sonucu konsolda okunabilir bir biçimde görüntüleyen bir örnek: ```$ csvgrep -e iso-8859-1 -c 1 -m "de" worldcitiespop | csvgrep -c 5 -r "\d+" | csvsort -r -c 5 -l | csvcut -c 1,2,4,6 | head -n 11 | csvlook ----------------------------------------------------- | satır_numarası | Ülke | AccentCity | Nüfus | ----------------------------------------------------- | 1 | de | Berlin | 3398362 | | 2 | de | Hamburg | 1733846 | | 3 | de | Munich | 1246133 | | 4 | de | Cologne | 968823 | | 5 | de | Frankfurt | 648034 | | 6 | de | Dortmund | 594255 | | 7 | de | Stuttgart | 591688 | | 8 | de | Düsseldorf | 577139 | | 9 | de | Essen | 576914 | | 10 | de | Bremen | 546429 | ----------------------------------------------------- ``` Csvkit, Python ile yazıldığı için platformdan bağımsızdır.
3
Slater type orbitals (STO) are considered to be more accurate than gaussian type orbitals (GTO) for atomic and molecular QM calculations because - among other reasons - they decay with $e^{-\alpha r}$ as $r \to \infty$. But GTOs are more popular because they are easier to calculate with. GTOs decay with $e^{-\alpha r^2}$, so its adequate to sometimes add diffuse functions to the GTO basis set to compensate for gaussian decay behaviour. Also, exact hydrogen wavefunctions decay exponentially, so the motivation for STOs. I understand that the only boundary requirement for solving the Schrödinger equation for atoms and molecules in free space is that the wavefunction goes zero as $r \to \infty$, but there are no a priori requirements for the way it decays as it does so. My question is: do we have theoretical (ab initio) and/or experimental reasons to believe that all atomic and molecular wavefunctions decay like $e^{-\alpha r}$ as $r \to \infty$.
Slater tipi orbitallerinin (STO), atomik ve moleküler QM hesaplamaları için Gauss tipi orbitallerden (GTO) daha doğru olduğu düşünülür çünkü -diğer nedenlerin yanı sıra- $r \to \infty$ iken $e^{-\alpha r}$ ile azalırlar. Ancak GTO'lar hesaplanması daha kolay olduğu için daha popülerdir. GTO'lar $e^{-\alpha r^2}$ ile azalır, bu nedenle Gauss azalma davranışını telafi etmek için GTO baz setine bazen dağınık fonksiyonlar eklemek yeterlidir. Ayrıca, kesin hidrojen dalga fonksiyonları üstel olarak azalır, bu nedenle STO'lar için motivasyon. Serbest uzaydaki atomlar ve moleküller için Schrödinger denklemini çözmek için tek sınır koşulunun dalga fonksiyonunun $r \to \infty$ iken sıfıra gitmesi olduğunu anlıyorum, ancak bu şekilde azalması için önceden belirlenmiş bir koşul yoktur. Soru şu: Tüm atomik ve moleküler dalga fonksiyonlarının $r \to \infty$ iken $e^{-\alpha r}$ gibi azaldığına inanmak için teorik (ab initio) ve/veya deneysel nedenlerimiz var mı?
I'll answer this question from the theoretical side. The exponential behavior follows simply from the Schrödinger equation. Consider the one-electron Schrödinger equation: $$ (-\frac{1}{2}\nabla^2 + V(\mathbf{r}))\psi(\mathbf{r}) = \epsilon\psi(\mathbf{r}), \epsilon < 0 $$ At spatial points that are very far away from the nucleus, $V(\mathbf{r})\approx 0$, so that the asymptotic solution is given by $$ -\frac{1}{2}\nabla^2\psi(\mathbf{r}) = \epsilon\psi(\mathbf{r}), \epsilon < 0 $$ This differential equation has basic solutions of the form $$ \psi(\mathbf{r}) = Ce^{-\sqrt{-2\epsilon}\mathbf{k}\cdot\mathbf{r}} $$ for some unit vector $\mathbf{k}$. The real asymptotic behavior of $\psi(\mathbf{r})$ is thus a linear combination of these basic solutions. The linear combination may bring a polynomial prefactor to the exponential, but will never alter the exponent. Thus we have not only proved the exponential behavior, but also derived the correct exponent $\alpha = \sqrt{-2\epsilon}$. For a multi-electronic, non-interacting system, the overall decay rate is governed by the slowest decaying orbital, i.e. the HOMO. Of course, the real wavefunction can only be described by a multi-electron Schrödinger equation. But we can work on the equivalent Kohn-Sham system and show that the Kohn-Sham wavefunction decays at a rate given by the Kohn-Sham HOMO energy. By Janak's theorem, the Kohn-Sham HOMO energy is just the negative of the ionization potential of the exact system. To see this, consider a huge ensemble of $N$ identical, non-interacting molecules. If we remove one electron from the ensemble and let the hole delocalize evenly between all the molecules, then as $N\to +\infty$, the electron removal has a negligible impact on the electron density of any molecule (and therefore the Kohn-Sham potential of each molecule). Therefore under the Kohn-Sham framework we see that removing such an electron costs an energy of $-\epsilon_{\mathrm{HOMO}}$ (it does not matter whether the HOMO refers to that of the ensemble or that of a molecule, since their orbital energies are equal), since the electron is taken from an energy level whose energy is $\epsilon_{\mathrm{HOMO}}$ and the Hamiltonian is not changed in this process. On the other hand, from the perspective of the real system it is clear that the energy cost is equal to the first ionization energy of one of the molecules, $I$. Therefore we have $\epsilon_{\mathrm{HOMO}} = -I$, which means that the Kohn-Sham wavefunction decays like (again up to a possible polynomial prefactor; the precise determination of this polynomial prefactor is a much more difficult question) $$ \psi(\mathbf{r}) = Ce^{-\sqrt{2I}\mathbf{k}\cdot\mathbf{r}} $$ Although the Kohn-Sham wavefunction is fictional, its density is equal to the true multielectronic density, and in order for the true density to have the same asymptotic behavior as the Kohn-Sham density, the true wavefunction must have the same asymptotic behavior as the Kohn-Sham wavefunction. Q.E.D.
Bu soruyu teorik açıdan cevaplayacağım. Üstel davranış Schrödinger denkleminin basit bir sonucudur. Tek elektronlu Schrödinger denklemini ele alalım: $$ (-\frac{1}{2}\nabla^2 + V(\mathbf{r}))\psi(\mathbf{r}) = \epsilon\psi(\mathbf{r}), \epsilon < 0 $$ Çekirdekten çok uzaktaki uzaysal noktalarda, $V(\mathbf{r})\approx 0$ olur, böylece asimptotik çözüm şu şekilde verilir: $$ -\frac{1}{2}\nabla^2\psi(\mathbf{r}) = \epsilon\psi(\mathbf{r}), \epsilon < 0 $$ Bu diferansiyel denklemin şu formda temel çözümleri vardır: $$ \psi(\mathbf{r}) = Ce^{-\sqrt{-2\epsilon}\mathbf{k}\cdot\mathbf{r}} $$ Burada $\mathbf{k}$ birim vektördür. $\psi(\mathbf{r})$'nin gerçek asimptotik davranışı bu temel çözümlerin doğrusal birleşimidir. Doğrusal birleşim üstele polinom ön ek getirebilir ancak üste hiçbir zaman etki etmez. Bu nedenle sadece üstel davranışı kanıtlamakla kalmadık, aynı zamanda doğru üs $\alpha = \sqrt{-2\epsilon}$'yi de türettik. Çok elektronlu, etkileşimsiz bir sistem için genel bozunma hızı en yavaş bozunan orbital, yani HOMO tarafından yönetilir. Elbette gerçek dalga fonksiyonu yalnızca çok elektronlu bir Schrödinger denklemiyle tanımlanabilir. Ancak eşdeğer Kohn-Sham sistemi üzerinde çalışabilir ve Kohn-Sham dalga fonksiyonunun Kohn-Sham HOMO enerjisiyle verilen bir oranda bozunduğunu gösterebiliriz. Janak'ın teoremine göre, Kohn-Sham HOMO enerjisi tam sistemin iyonlaşma potansiyelinin negatifidir. Bunu görmek için $N$ özdeş, etkileşimsiz molekülün büyük bir topluluğunu ele alalım. Topluluktan bir elektronu çıkarırsak ve deliğin tüm moleküller arasında eşit şekilde dağılmasına izin verirsek, $N\to +\infty$ olduğunda, elektronun çıkarılması herhangi bir molekülün elektron yoğunluğu üzerinde ihmal edilebilir bir etkiye sahiptir (ve bu nedenle her molekülün Kohn-Sham potansiyeli). Bu nedenle Kohn-Sham çerçevesi altında, böyle bir elektronun çıkarılmasının $-\epsilon_{\mathrm{HOMO}}$ enerjisine mal olduğunu görürüz (HOMO'nun topluluğun HOMO'suna mı yoksa bir molekülün HOMO'suna mı atıfta bulunduğu önemli değildir, çünkü yörünge enerjileri eşittir), çünkü elektron, enerjisi $\epsilon_{\mathrm{HOMO}}$ olan bir enerji seviyesinden alınır ve Hamiltonyen bu işlemde değiştirilmez. Öte yandan, gerçek sistemin perspektifinden, enerji maliyetinin moleküllerden birinin ilk iyonlaşma enerjisine, $I$ eşit olduğu açıktır. Bu nedenle $\epsilon_{\mathrm{HOMO}} = -I$ olur, bu da Kohn-Sham dalga fonksiyonunun şu şekilde bozunduğu anlamına gelir (yine olası bir polinom ön ekine kadar; bu polinom ön ekinin kesin olarak belirlenmesi çok daha zor bir sorudur): $$ \psi(\mathbf{r}) = Ce^{-\sqrt{2I}\mathbf{k}\cdot\mathbf{r}} $$ Kohn-Sham dalga fonksiyonu kurgusal olsa da, yoğunluğu gerçek çok elektronlu yoğunluğa eşittir ve gerçek yoğunluğun Kohn-Sham yoğunluğu ile aynı asimptotik davranışa sahip olması için gerçek dalga fonksiyonunun Kohn-Sham dalga fonksiyonu ile aynı asimptotik davranışa sahip olması gerekir. Q.E.D.
4
Explain what "git reset" does. I come from a SVN background and Git is a whole new paradigm. I got mercurial easily, but Git is much more technical. I think ```git reset``` is close to ```hg revert```, but it seems there are differences. Please include detailed explanations about: * the options ```--hard```, ```--soft``` and ```--merge```; * the strange notation you use with ```HEAD``` such as ```HEAD^``` and ```HEAD~1```; * concrete use cases and work flows; * consequences on the working copy, the ```HEAD``` and your global stress level.
"git reset"in ne yaptığını açıklayın. SVN geçmişinden geliyorum ve Git tamamen yeni bir paradigmadır. Mercurial'ı kolayca anladım ancak Git çok daha teknik. ```git reset```in ```hg revert```e yakın olduğunu düşünüyorum ancak aralarında farklar varmış gibi görünüyor. Lütfen aşağıdakiler hakkında ayrıntılı açıklamalar ekleyin: * ```--hard```, ```--soft``` ve ```--merge``` seçenekleri; * ```HEAD^``` ve ```HEAD~1``` gibi ```HEAD``` ile kullandığınız garip gösterim; * somut kullanım durumları ve iş akışları; * çalışma kopyası, ```HEAD``` ve genel stres seviyeniz üzerindeki sonuçlar.
Remember that in ```git``` you have: * the ```HEAD``` pointer, which tells you what commit you're working on * the working tree, which represents the state of the files on your system * the staging area (also called the index), which "stages" changes so that they can later be committed together > Please include detailed explanations about: ```--hard```, ```--soft``` and ```--merge```; In increasing order of dangerous-ness: * ```--soft``` moves ```HEAD``` but doesn't touch the staging area or the working tree. * ```--mixed``` moves ```HEAD``` and updates the staging area, but not the working tree. * ```--merge``` moves ```HEAD```, resets the staging area, and tries to move all the changes in your working tree into the new working tree. * ```--hard``` moves ```HEAD``` and adjusts your staging area and working tree to the new ```HEAD```, throwing away everything. > concrete use cases and workflows; * Use ```--soft``` when you want to move to another commit and patch things up without "losing your place". It's pretty rare that you need this. ``` # git reset --soft example touch foo // Add a file, make some changes. git add foo // git commit -m "bad commit message" // Commit... D'oh, that was a mistake! git reset --soft HEAD^ // Go back one commit and fix things. git commit -m "good commit" // There, now it's right. ``` -- * Use ```--mixed``` (which is the default) when you want to see what things look like at another commit, but you don't want to lose any changes you already have. * Use ```--merge``` when you want to move to a new spot but incorporate the changes you already have into that the working tree. * Use ```--hard``` to wipe everything out and start a fresh slate at the new commit.
```git```'te şunlara sahip olduğunuzu unutmayın: * Hangi komit üzerinde çalıştığınızı söyleyen ```HEAD``` işaretçisi * Sisteminizdeki dosyaların durumunu temsil eden çalışma ağacı * Değişiklikleri daha sonra birlikte komitlenebilmeleri için "hazırlayan" hazırlama alanı (aynı zamanda dizin olarak da adlandırılır) > Lütfen ```--hard```, ```--soft``` ve ```--merge``` hakkında ayrıntılı açıklamalar ekleyin; Tehlikelilik sırasına göre artan şekilde: * ```--soft``` ```HEAD```'i hareket ettirir ancak hazırlama alanına veya çalışma ağacına dokunmaz. * ```--mixed``` ```HEAD```'i hareket ettirir ve hazırlama alanını günceller, ancak çalışma ağacını güncellemez. * ```--merge``` ```HEAD```'i hareket ettirir, hazırlama alanını sıfırlar ve çalışma ağacınızdaki tüm değişiklikleri yeni çalışma ağacına taşımaya çalışır. * ```--hard``` ```HEAD```'i hareket ettirir ve hazırlama alanınızı ve çalışma ağacınızı yeni ```HEAD```'e göre ayarlar ve her şeyi atar. > Somut kullanım durumları ve iş akışları; * "Yerini kaybetmeden" başka bir komite geçmek ve şeyleri düzeltmek istediğinizde ```--soft``` kullanın. Buna ihtiyacınız olması oldukça nadirdir. ``` # git reset --soft example touch foo // Bir dosya ekleyin, bazı değişiklikler yapın. git add foo // git commit -m "bad commit message" // Komit edin... D'oh, bu bir hataydı! git reset --soft HEAD^ // Bir komit geri dönün ve şeyleri düzeltin. git commit -m "good commit" // İşte, şimdi doğru. ``` -- * Başka bir komitteki şeylerin nasıl göründüğünü görmek istediğinizde ancak halihazırda yaptığınız değişiklikleri kaybetmek istemediğinizde ```--mixed```'i (varsayılan olan) kullanın. * Yeni bir noktaya geçmek ancak halihazırda yaptığınız değişiklikleri çalışma ağacına dahil etmek istediğinizde ```--merge```'i kullanın. * Her şeyi silmek ve yeni komitte yeni bir sayfa açmak için ```--hard```'ı kullanın.
5
I am looking to use Java to get the MD5 checksum of a file. How is it done?
Bir dosyanın MD5 kontrol toplamını almak için Java kullanmak istiyorum. Bu nasıl yapılır?
The com.google.common.hash API offers: * A unified user-friendly API for all hash functions * Seedable 32- and 128-bit implementations of murmur3 * md5(), sha1(), sha256(), sha512() adapters, change only one line of code to switch between these, and murmur. * goodFastHash(int bits), for when you don't care what algorithm you use * General utilities for HashCode instances, like combineOrdered / combineUnordered Read the User Guide (IO Explained, Hashing Explained). For your use-case ```Files.hash()``` computes and returns the digest value for a file. For example a sha-1 digest calculation (change SHA-1 to MD5 to get MD5 digest) ```HashCode hc = Files.asByteSource(file).hash(Hashing.sha1()); "SHA-1: " + hc.toString(); ``` Note that crc32 is much faster than md5, so use crc32 if you do not need a cryptographically secure checksum. Note also that md5 should not be used to store passwords and the like since it is to easy to brute force, for passwords use bcrypt, scrypt or sha-256 instead. For long term protection with hashes a Merkle signature scheme adds to the security and The Post Quantum Cryptography Study Group sponsored by the European Commission has recommended use of this cryptography for long term protection against quantum computers (ref). Note that crc32 has a higher collision rate than the others. What part of Files.hash as stated above does not cover Files.hash ?
com.google.common.hash API'si şunları sunar: * Tüm karma işlevleri için birleştirilmiş kullanıcı dostu bir API * murmur3'ün 32 ve 128 bitlik ekilebilir uygulamaları * md5(), sha1(), sha256(), sha512() bağdaştırıcıları, bunlar arasında geçiş yapmak için yalnızca bir kod satırını değiştirin ve murmur. * hangi algoritmayı kullandığınızı önemsemediğiniz zamanlar için goodFastHash(int bit) * combineOrdered / combineUnordered gibi HashCode örnekleri için genel yardımcı programlar Kullanım Kılavuzunu (IO Açıklaması, Karma Açıklaması) okuyun. Kullanım durumunuz için ```Files.hash()``` bir dosyanın özet değerini hesaplar ve döndürür. Örneğin bir sha-1 özet hesaplaması (MD5 özeti almak için SHA-1'i MD5 olarak değiştirin) ```HashCode hc = Files.asByteSource(file).hash(Hashing.sha1()); "SHA-1: " + hc.toString(); ``` crc32'nin md5'ten çok daha hızlı olduğunu unutmayın, bu nedenle kriptografik olarak güvenli bir toplam kontrolüne ihtiyacınız yoksa crc32'yi kullanın. Ayrıca md5'in kaba kuvvet uygulamasının kolay olması nedeniyle parola ve benzerlerini depolamak için kullanılmaması gerektiğini, bunun yerine parolalar için bcrypt, scrypt veya sha-256 kullanılması gerektiğini unutmayın. Uzun vadeli koruma için karma işlevlerle bir Merkle imza şeması güvenliği artırır ve Avrupa Komisyonu tarafından desteklenen Post Kuantum Kriptografi Çalışma Grubu, kuantum bilgisayarlara karşı uzun vadeli koruma için bu kriptografinin kullanılmasını önermiştir (ref). crc32'nin diğerlerine göre daha yüksek bir çakışma oranına sahip olduğunu unutmayın. Yukarıda belirtildiği gibi Files.hash'in hangi kısmı Files.hash'i kapsamaz?
6
What are the primary objections Democrats have to a border wall?
Demokratların sınır duvarına yönelik temel itirazları nelerdir?
It's not clear to me that Democrats are opposed to border-wall construction (your one source suggests they are fine with border walls/fences where necessary), so much as they opposed to some of the plans for full-border walls that have been put forth so far. Recently, in response to reports that the spending bill would include funding for a border wall, 5 Democratic senators released a letter voicing concerns over the cost, the effectiveness, and the legal issues of constructing it. We are also concerned with reports that there may be an effort to include funding for a very expensive new wall along the southern border with Mexico and a “deportation force.” According to non-partisan experts, the proposed new border wall could cost as much as $25 million per mile and raises considerable issues that have not been resolved by the Congress or the Department of Homeland Security. First, many experts believe that such a border wall will not work. Second, there is real concern that the Administration, put simply, has no plan to build the border wall. For example, the Administration has not detailed how to 1) use eminent domain and other procedures to acquire land from private landowners and Native American tribes, 2) design the wall, 3) locate the wall, 4) construct the wall, and 5) require Mexico to pay for the wall given the President’s clear and repeated promises that he would force Mexico to do so. Finally, there are objections to the construction of a wall from Democratic and Republican members of Congress that represent border states. Given these and other concerns, we believe it would be inappropriate to insist on the inclusion of such funding in a must-pass appropriations bill that is needed for the Republican majority in control of the Congress to avert a government shutdown so early in President Trump’s Administration. [...] Senator Charles Schumer Senator Richard Durbin Senator Patty Murray Senator Debbie Stabenow Senator Patrick Leahy Based on this letter, it appears their main objections to a full border wall are currently the cost-benefit ratio and the legal issues of taking land from Americans to build it on; objections that may not be unique to Democrats.
Demokratların sınır duvarı inşasına karşı oldukları bana açık değil (tek kaynağınız, gerektiğinde sınır duvarları/çitleri konusunda sorunları olmadığını öne sürüyor), şimdiye kadar ortaya atılan tam sınır duvarı planlarından bazılarını karşı çıkıyorlar. Yakın zamanda, harcama tasarısının bir sınır duvarı için finansman içereceğine dair haberlere yanıt olarak, 5 Demokrat senatör, maliyet, etkinlik ve inşaatının yasal sorunları konusunda endişelerini dile getiren bir mektup yayınladı. Ayrıca, Meksika ile güney sınırına çok pahalı yeni bir duvar ve bir "sınır dışı etme gücü" için finansman sağlama çabası olabileceğine dair haberlerden de endişe duyuyoruz. Tarafsız uzmanlara göre, önerilen yeni sınır duvarı mil başına 25 milyon dolara mal olabilir ve Kongre veya İç Güvenlik Bakanlığı tarafından çözülmemiş önemli sorunları gündeme getiriyor. Birincisi, birçok uzman böyle bir sınır duvarının işe yaramayacağına inanıyor. İkincisi, İdare'nin basitçe sınır duvarını inşa etmek için bir planı olmadığı konusunda gerçek bir endişe var. Örneğin, İdare, 1) özel toprak sahiplerinden ve Kızılderili kabilelerinden arazi edinmek için eminent domain ve diğer prosedürleri nasıl kullanacağını, 2) duvarı nasıl tasarlayacağını, 3) duvarı nasıl konumlandıracağını, 4) duvarı nasıl inşa edeceğini ve 5) Meksika'yı Başkan'ın Meksika'yı bunu yapmaya zorlayacağına dair açık ve tekrarlanan vaatleri göz önüne alındığında duvarın bedelini ödemeye nasıl zorlayacağını detaylandırmadı. Son olarak, sınır eyaletlerini temsil eden Demokrat ve Cumhuriyetçi Kongre üyelerinin duvarın inşasına itirazları var. Bu ve diğer endişeler göz önüne alındığında, Başkan Trump'ın İdaresi'nin başlarında bir hükümet kapanmasını önlemek için Kongre'nin kontrolündeki Cumhuriyetçi çoğunluğun ihtiyaç duyduğu, mutlaka kabul edilmesi gereken bir ödenek tasarısına böyle bir finansmanın dahil edilmesinde ısrar etmenin uygunsuz olacağına inanıyoruz. [...] Senatör Charles Schumer Senatör Richard Durbin Senatör Patty Murray Senatör Debbie Stabenow Senatör Patrick Leahy Bu mektuba dayanarak, tam bir sınır duvarına yönelik temel itirazlarının şu anda maliyet-fayda oranı ve onu inşa etmek için Amerikalılardan arazi alma konusundaki yasal sorunlar olduğu anlaşılıyor; bu itirazlar Demokratlara özgü olmayabilir.
7
I'm converting a video to GIF file with ```ffmpeg```: ```ffmpeg \ -i input.flv \ -ss 00:00:00.000 \ -pix_fmt rgb24 \ -r 10 \ -s 320x240 \ -t 00:00:10.000 \ output.gif ``` It works great, but output gif file has a very low quality. Any ideas how can I improve quality of converted gif?
Bir videoyu ```ffmpeg``` ile GIF dosyasına dönüştürüyorum: ```ffmpeg \ -i input.flv \ -ss 00:00:00.000 \ -pix_fmt rgb24 \ -r 10 \ -s 320x240 \ -t 00:00:10.000 \ output.gif ``` Harika çalışıyor, ancak çıktı gif dosyasının kalitesi çok düşük. Dönüştürülen gif'in kalitesini nasıl iyileştirebileceğime dair herhangi bir fikriniz var mı?
If you would prefer to avoid intermediate image files, the commands provided by LordNeckBeard can be piped between ```ffmpeg``` and ImageMagick's ```convert``` so that no intermediate files are required: ```ffmpeg -i input.flv -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 -loop 0 - output.gif ``` The ```-f image2pipe``` tells ffmpeg to split the video into images and make it suitable to be piped out, and ```-vcodec ppm``` specifies the output format to be ppm (for some reason if the format is png, either ```convert``` does not read all the images from the pipe, or ffmpeg does not output them all). The ```-``` for both commands specifies that a pipe will be used for output and input respectively. To optimize the result without saving a file, you can pipe the output from ```convert``` to a second ```convert``` command: ```ffmpeg -i input.flv -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 -loop 0 - gif:- | convert -layers Optimize - output.gif ``` The ```gif:-``` tells ```convert``` to pipe its output as gif formatted data and ```-layers Optimize``` tells the second ```convert``` to perform ```optimize-frame``` and ```optimize-transparancy``` methods (see the ImageMagick Introduction to Animation Optimization). Note that the output from the ```-layers Optimize``` may not always provide a smaller file size, so you may want to try converting to a gif without optimization first to be sure. Remember that during this whole process everything is in memory so you may need sufficient memory if the images are quite large.
Ara görüntü dosyalarından kaçınmayı tercih ederseniz, LordNeckBeard tarafından sağlanan komutlar, ara dosyalara gerek kalmayacak şekilde ```ffmpeg``` ve ImageMagick'in ```convert``` komutları arasında yönlendirilebilir: ```ffmpeg -i input.flv -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 -loop 0 - output.gif ``` ```-f image2pipe```, ffmpeg'e videoyu görüntülere bölmesini ve yönlendirilmeye uygun hale getirmesini söyler ve ```-vcodec ppm```, çıktı biçimini ppm olarak belirtir (nedense biçim png ise, ```convert``` ya borudaki tüm görüntüleri okumaz ya da ffmpeg hepsini çıktı olarak vermez). Her iki komut için de ```-```, sırasıyla çıktı ve girdi için bir boru kullanılacağını belirtir. Sonucu bir dosya kaydetmeden optimize etmek için, ```convert```'ten gelen çıktıyı ikinci bir ```convert``` komutuna yönlendirebilirsiniz: ```ffmpeg -i input.flv -vf scale=320:-1 -r 10 -f image2pipe -vcodec ppm - | convert -delay 10 -loop 0 - gif:- | convert -layers Optimize - output.gif ``` ```gif:-```, ```convert```'e çıktısını gif biçimli veri olarak yönlendirmesini söyler ve ```-layers Optimize```, ikinci ```convert```'e ```optimize-frame``` ve ```optimize-transparancy``` yöntemlerini gerçekleştirmesini söyler (ImageMagick Animasyon Optimizasyonuna Giriş bölümüne bakın). ```-layers Optimize```'dan gelen çıktının her zaman daha küçük bir dosya boyutu sağlamayabileceğini unutmayın, bu nedenle emin olmak için önce optimizasyon olmadan bir gif'e dönüştürmeyi denemek isteyebilirsiniz. Tüm bu süreç boyunca her şeyin bellekte olduğunu ve görüntüler oldukça büyükse yeterli belleğe ihtiyacınız olabileceğini unutmayın.
8
Tor can only handle TCP connections, but DNS is a UDP protocol. How does Tor route DNS requests over its TCP based network? Why can the same approach not be used to route all UDP traffic over Tor?
Tor yalnızca TCP bağlantılarını işleyebilir, ancak DNS bir UDP protokolüdür. Tor, DNS isteklerini TCP tabanlı ağı üzerinden nasıl yönlendirir? Aynı yaklaşım neden tüm UDP trafiğini Tor üzerinden yönlendirmek için kullanılamaz?
Tor clients do not, in general, directly do DNS requests. When you open a connection through the tor network you usually ask your client (on its socks ports) to connect you to a hostname and port, say www.example.com:80. Your tor client, once it has created a circuit, will send that hostname and port to the exit node in its RELAY_BEGIN cell. The exit node will then do a DNS resolve and open a TCP connection to the target. Once that's established it will tell your client that the connection is open, and for informational purposes will also tell your client what address that hostname resolved to. Tor, in addition to that, has some sort of "remote DNS resolve" protocol built in. This support allows clients to query for certain resource types, like IPv4 or IPv6 addresses. Here too, the exit node does the actual DNS packet sending and receiving and just relays the answer to the client. No UDP packets are actually ever routed from the client. There's also a proposal to add more full featured DNS support to Tor. So far it hasn't been implemented. Tor Protocol Specification references * 6.2. Opening streams and transferring data * 6.4. Remote hostname lookup * Proposal 219 - Support for full DNS and DNSSEC resolution in Tor
Tor istemcileri genel olarak doğrudan DNS istekleri yapmaz. Tor ağı üzerinden bir bağlantı açtığınızda genellikle istemcinizden (socks portlarında) sizi bir ana makine adına ve porta bağlamasını istersiniz, örneğin www.example.com:80. Tor istemciniz bir devre oluşturduktan sonra bu ana makine adını ve portu çıkış düğümüne RELAY_BEGIN hücresinde gönderir. Çıkış düğümü daha sonra bir DNS çözümlemesi yapar ve hedefe bir TCP bağlantısı açar. Bu bağlantı kurulduktan sonra istemcinize bağlantının açık olduğunu söyler ve bilgi amaçlı olarak istemcinize bu ana makine adının çözümlendiği adresi de söyler. Tor, buna ek olarak, dahili olarak bir tür "uzaktan DNS çözümleme" protokolüne sahiptir. Bu destek, istemcilerin IPv4 veya IPv6 adresleri gibi belirli kaynak türlerini sorgulamasına olanak tanır. Burada da çıkış düğümü gerçek DNS paketini gönderme ve alma işlemini yapar ve yalnızca yanıtı istemciye iletir. Hiçbir UDP paketi aslında istemciden yönlendirilmez. Tor'a daha fazla tam özellikli DNS desteği ekleme önerisi de var. Şimdiye kadar uygulanmadı. Tor Protokolü Spesifikasyonu referansları * 6.2. Akışları açma ve veri aktarma * 6.4. Uzak ana makine adı araması * Öneri 219 - Tor'da tam DNS ve DNSSEC çözümlemesi desteği
9
Why does this throw ```NullPointerException``` ```public static void main(String[] args) throws Exception { Boolean b = true ? returnsNull() : false; // NPE on this line. System.out.println(b); } public static Boolean returnsNull() { return null; } ``` while this doesn't ```public static void main(String[] args) throws Exception { Boolean b = true ? null : false; System.out.println(b); // null } ``` ? The solution is by the way to replace ```false``` by ```Boolean.FALSE``` to avoid ```null``` being unboxed to ```boolean``` --which isn't possible. But that isn't the question. The question is why? Are there any references in JLS which confirms this behaviour, especially of the 2nd case?
Bu neden ```NullPointerException``` fırlatıyor? ```public static void main(String[] args) throws Exception { Boolean b = true ? returnsNull() : false; // Bu satırda NPE. System.out.println(b); } public static Boolean returnsNull() { return null; } ``` bu yapmazken ```public static void main(String[] args) throws Exception { Boolean b = true ? null : false; System.out.println(b); // null } ``` ? Çözüm, ```null```'un ```boolean```'e dönüştürülmesini önlemek için ```false```'u ```Boolean.FALSE``` ile değiştirmektir --ki bu mümkün değildir. Ama soru bu değil. Soru neden? Bu davranışı, özellikle 2. durum için doğrulayan JLS'de herhangi bir referans var mı?
The difference is that the explicit type of the ```returnsNull()``` method affects the static typing of the expressions at compile time: ```E1: `true ? returnsNull() : false` - boolean (auto-unboxing 2nd operand to boolean) E2: `true ? null : false` - Boolean (autoboxing of 3rd operand to Boolean) ``` See Java Language Specification, section 15.25 Conditional Operator ? : * For E1, the types of the 2nd and 3rd operands are ```Boolean``` and ```boolean``` respectively, so this clause applies: If one of the second and third operands is of type boolean and the type of the other is of type Boolean, then the type of the conditional expression is boolean. Since the type of the expression is ```boolean```, the 2nd operand must be coerced to ```boolean```. The compiler inserts auto-unboxing code to the 2nd operand (return value of ```returnsNull()```) to make it type ```boolean```. This of course causes the NPE from the ```null``` returned at run-time. * For E2, types of the 2nd and 3rd operands are `````` (not ```Boolean``` as in E1!) and ```boolean``` respectively, so no specific typing clause applies (go read 'em!), so the final "otherwise" clause applies: Otherwise, the second and third operands are of types S1 and S2 respectively. Let T1 be the type that results from applying boxing conversion to S1, and let T2 be the type that results from applying boxing conversion to S2. The type of the conditional expression is the result of applying capture conversion (§5.1.10) to lub(T1, T2) (§15.12.2.7). * S1 == `````` (see §4.1) * S2 == ```boolean``` * T1 == box(S1) == `````` (see last item in list of boxing conversions in §5.1.7) * T2 == box(S2) == `Boolean * lub(T1, T2) == ```Boolean``` So the type of the conditional expression is ```Boolean``` and the 3rd operand must be coerced to ```Boolean```. The compiler inserts auto-boxing code for the 3rd operand (```false```). The 2nd operand doesn't need the auto-unboxing as in ```E1```, so no auto-unboxing NPE when ```null``` is returned. This question needs a similar type analysis: Java conditional operator ?: result type
Fark, ```returnsNull()``` yönteminin açık türünün derleme zamanında ifadelerin statik yazımını etkilemesidir: ```E1: `true ? returnsNull() : false` - boolean (2. işlenen otomatik olarak boolean'a dönüştürülür) E2: `true ? null : false` - Boolean (3. işlenen otomatik olarak Boolean'a dönüştürülür) ``` Java Dil Spesifikasyonuna, 15.25 Koşullu İşleç ? : bölümüne bakın: * E1 için 2. ve 3. işlenenlerin türleri sırasıyla ```Boolean``` ve ```boolean```'dır, bu nedenle şu madde uygulanır: İkinci ve üçüncü işlenenlerden biri boolean türündeyse ve diğerinin türü Boolean türündeyse, koşullu ifadenin türü boolean'dır. İfadenin türü ```boolean``` olduğundan, 2. işlenen ```boolean```'a dönüştürülmelidir. Derleyici, 2. işlenen (```returnsNull()```'un dönüş değeri) ```boolean``` türünde yapmak için otomatik dönüştürme kodu ekler. Bu elbette çalışma zamanında döndürülen ```null```'dan NPE'ye neden olur. * E2 için 2. ve 3. işlenenlerin türleri sırasıyla `````` (E1'deki gibi ```Boolean``` değil!) ve ```boolean```'dır, bu nedenle belirli bir yazım maddesi uygulanmaz (gidip okuyun!), bu nedenle son "aksi takdirde" maddesi uygulanır: Aksi takdirde, ikinci ve üçüncü işlenenler sırasıyla S1 ve S2 türündedir. T1, S1'e kutulama dönüşümü uygulanarak elde edilen tür olsun ve T2, S2'ye kutulama dönüşümü uygulanarak elde edilen tür olsun. Koşullu ifadenin türü, lub(T1, T2) (§15.12.2.7) üzerine yakalama dönüşümü (§5.1.10) uygulanarak elde edilen sonuçtur. * S1 == `````` (bkz. §4.1) * S2 == ```boolean``` * T1 == box(S1) == `````` (bkz. §5.1.7'deki kutulama dönüşümlerinin listesindeki son öğe) * T2 == box(S2) == `Boolean * lub(T1, T2) == ```Boolean``` Bu nedenle koşullu ifadenin türü ```Boolean```'dır ve 3. işlenen ```Boolean```'a dönüştürülmelidir. Derleyici, 3. işlenen (```false```) için otomatik kutulama kodu ekler. 2. işlenen, ```E1```'deki gibi otomatik dönüştürmeye ihtiyaç duymaz, bu nedenle ```null``` döndürüldüğünde otomatik dönüştürme NPE'si olmaz. Bu soru benzer bir tür analizi gerektirir: Java koşullu işleç ?: sonuç türü
10
How do DOS games like DOOM benefit from a PCI graphics card?
DOOM gibi DOS oyunları bir PCI grafik kartından nasıl faydalanır?
DOOM itself doesn’t do anything special to benefit from PCI graphics cards. It runs faster with PCI graphics cards (and VLB, AGP, and PCI Express cards) than with ISA graphics cards because the supporting bus is faster, so reads from and writes to video memory take less time. PCI goes to great lengths to preserve backwards compatibility with ISA-based VGA, providing support for “VGA compatible” adapters so that they can appear in memory at the same locations and use the same I/O ports as ISA VGA cards. So accesses to the VGA registers and to the VGA buffer (at 0xA0000) go directly to the main PCI VGA compatible adapter in the system, with no change required in the operating system or programs running on it. (This is the reason why there’s a specific “VGA compatible controller” device type in PCI. Such shenanigans are impossible for other device types in PCI, which is why PCI sound cards have so much trouble providing compatibility with programs written for ISA sound cards.) A faster bus and/or faster video memory immediately leads to higher performance in video-intensive programs because software doesn’t need to be careful about how it accesses video memory (except on CGA, and on all platforms with vertical blank synchronisation if it cares about tearing). So ```REP MOVSW``` or ```REP MOVSD``` with no waiting in software, once the program decides to write a frame, is perfectly fine, and will go faster and faster as the underlying hardware improves. On platforms where this can’t work in hardware (e.g. on an 8088 with a VGA card), the hardware takes care of specifics — for example on an 8088 the bus unit will split up 16-bit accesses. Your question is specific to DOOM but other DOS games are in a similar situation. Later games tended to rely on VBE (often using UniVBE) to access video modes beyond those provided by VGA, but they mostly didn’t use anything beyond video-mode setup and framebuffer configuration (see also Were any DOS games (or software) known to use VBE/AF?), so improved video speed came mostly from bus speed increases, faster video memory, and speed increases in the cards themselves (which was already a factor in the ISA era, compare most Trident cards to Tseng cards for example). For an excellent explanation of the intricacies of VGA programming and its memory layout, see Fabien Sanglard’s Game Engine Black Book series. The DOOM update loop is shown on page 185 of the DOOM book; it doesn’t use any assembly language (unlike the renderer, see pp. 290 and following), but it does have one perhaps surprising feature given the 32-bit nature of the code: VGA updates are done 16 bits at a time. Section 2.3 of the same book, pp. 59 and following, describes some of the improvements to VGA adapters around the time DOOM was released, in particular the switch to the VESA Local Bus on 486s. The benchmark table on page 287 shows the importance of the bus.
DOOM'un kendisi PCI grafik kartlarından faydalanmak için özel bir şey yapmaz. ISA grafik kartlarına göre PCI grafik kartlarıyla (ve VLB, AGP ve PCI Express kartlarıyla) daha hızlı çalışır çünkü destekleyen veri yolu daha hızlıdır, bu nedenle video belleğinden okuma ve yazma işlemleri daha az zaman alır. PCI, ISA tabanlı VGA ile geriye dönük uyumluluğu korumak için büyük çaba sarf eder ve "VGA uyumlu" bağdaştırıcılar için destek sağlayarak, bunların bellekte aynı konumlarda görünmelerini ve ISA VGA kartlarıyla aynı G/Ç bağlantı noktalarını kullanmalarını sağlar. Bu nedenle VGA kayıtlarına ve VGA arabelleğine (0xA0000'de) erişimler, işletim sisteminde veya üzerinde çalışan programlarda herhangi bir değişiklik gerektirmeden doğrudan sistemdeki ana PCI VGA uyumlu bağdaştırıcısına gider. (PCI'da belirli bir "VGA uyumlu denetleyici" aygıt türünün olmasının nedeni budur. Bu tür oyunlar PCI'daki diğer aygıt türleri için imkansızdır, bu nedenle PCI ses kartlarının ISA ses kartları için yazılmış programlarla uyumluluk sağlamada çok fazla sorunu vardır.) Daha hızlı bir veri yolu ve/veya daha hızlı video belleği, yazılımın video belleğine nasıl eriştiği konusunda dikkatli olması gerekmediği için (CGA hariç ve yırtılmayı önemsiyorsa dikey boş senkronizasyonu olan tüm platformlarda) video yoğun programlarda hemen daha yüksek performansa yol açar. Bu nedenle, program bir kare yazmaya karar verdiğinde, yazılımda beklemeden ```REP MOVSW``` veya ```REP MOVSD``` mükemmeldir ve temel donanım geliştikçe daha da hızlanacaktır. Bunun donanımda çalışamadığı platformlarda (örneğin VGA kartlı bir 8088'de), donanım ayrıntılarla ilgilenir; örneğin 8088'de veri yolu birimi 16 bitlik erişimleri böler. Sorunuz DOOM'a özeldir ancak diğer DOS oyunları da benzer bir durumdadır. Daha sonraki oyunlar, VGA'nın sağladıklarının ötesindeki video modlarına erişmek için VBE'ye (genellikle UniVBE kullanarak) güvenme eğilimindeydi, ancak çoğunlukla video modu kurulumu ve çerçeve arabelleği yapılandırmasının ötesinde bir şey kullanmadılar (ayrıca VBE/AF kullandığı bilinen herhangi bir DOS oyunu (veya yazılımı) var mıydı?), bu nedenle gelişmiş video hızı çoğunlukla veri yolu hızındaki artışlardan, daha hızlı video belleğinden ve kartların kendilerindeki hız artışlarından kaynaklandı (bu, ISA döneminde zaten bir faktördü, örneğin çoğu Trident kartını Tseng kartlarıyla karşılaştırın). VGA programlamasının incelikleri ve bellek düzeni hakkında mükemmel bir açıklama için Fabien Sanglard'ın Game Engine Black Book serisine bakın. DOOM güncelleme döngüsü, DOOM kitabının 185. sayfasında gösterilmiştir; kodun 32 bit doğasına rağmen herhangi bir derleme dili kullanmaz (işleyici gibi, bkz. s. 290 ve sonrası), ancak belki de şaşırtıcı bir özelliğe sahiptir: VGA güncellemeleri bir seferde 16 bit yapılır. Aynı kitabın 2.3 bölümü, s. 59 ve sonrası, DOOM'un piyasaya sürüldüğü sırada VGA bağdaştırıcılarındaki bazı gelişmeleri, özellikle 486'larda VESA Yerel Veri Yoluna geçişi açıklar. 287. sayfadaki kıyaslama tablosu, veri yolunun önemini göstermektedir.
11
I need to be able to open a document using its default application in Windows and Mac OS. Basically, I want to do the same thing that happens when you double-click on the document icon in Explorer or Finder. What is the best way to do this in Python?
Windows ve Mac OS'ta varsayılan uygulamasını kullanarak bir belgeyi açabilmem gerekiyor. Temel olarak, Explorer veya Finder'da belge simgesine çift tıkladığınızda olan şeyi yapmak istiyorum. Bunu Python'da yapmanın en iyi yolu nedir?
```open``` and ```start``` are command-interpreter things for Mac OS/X and Windows respectively, to do this. To call them from Python, you can either use ```subprocess``` module or ```os.system()```. Here are considerations on which package to use: * You can call them via ```os.system```, which works, but... Escaping: ```os.system``` only works with filenames that don't have any spaces or other shell metacharacters in the pathname (e.g. ```A:\abc\def\a.txt```), or else these need to be escaped. There is ```shlex.quote``` for Unix-like systems, but nothing really standard for Windows. Maybe see also python, windows : parsing command lines with shlex * MacOS/X: ```os.system("open " + shlex.quote(filename))``` * Windows: ```os.system("start " + filename)``` where properly speaking ```filename``` should be escaped, too. * You can also call them via ```subprocess``` module, but... For Python 2.7 and newer, simply use ```subprocess.check_call(['open', filename]) ``` In Python 3.5+ you can equivalently use the slightly more complex but also somewhat more versatile ```subprocess.run(['open', filename], check=True) ``` If you need to be compatible all the way back to Python 2.4, you can use ```subprocess.call()``` and implement your own error checking: ```try: retcode = subprocess.call("open " + filename, shell=True) if retcode < 0: print >>sys.stderr, "Child was terminated by signal", -retcode else: print >>sys.stderr, "Child returned", retcode except OSError, e: print >>sys.stderr, "Execution failed:", e ``` Now, what are the advantages of using ```subprocess```? * Security: In theory, this is more secure, but in fact we're needing to execute a command line one way or the other; in either environment, we need the environment and services to interpret, get paths, and so forth. In neither case are we executing arbitrary text, so it doesn't have an inherent "but you can type ```'filename ; rm -rf /'```" problem, and if the file name can be corrupted, using ```subprocess.call``` gives us little additional protection. * Error handling: It doesn't actually give us any more error detection, we're still depending on the ```retcode``` in either case; but the behavior to explicitly raise an exception in the case of an error will certainly help you notice if there is a failure (though in some scenarios, a traceback might not at all be more helpful than simply ignoring the error). * Spawns a (non-blocking) subprocess: We don't need to wait for the child process, since we're by problem statement starting a separate process. To the objection "But ```subprocess``` is preferred." However, ```os.system()``` is not deprecated, and it's in some sense the simplest tool for this particular job. Conclusion: using ```os.system()``` is therefore also a correct answer. A marked disadvantage is that the Windows ```start``` command requires you to pass in ```shell=True``` which negates most of the benefits of using ```subprocess```.
```open``` ve ```start``` sırasıyla Mac OS/X ve Windows için komut yorumlayıcı öğeleridir. Bunları Python'dan çağırmak için ```subprocess``` modülünü veya ```os.system()``` kullanabilirsiniz. Hangi paketi kullanacağınıza dair hususlar şunlardır: * ```os.system``` ile çağırabilirsiniz, bu işe yarar ancak... Kaçış: ```os.system``` yalnızca yol adında boşluk veya başka kabuk metakarakterleri olmayan dosya adlarıyla çalışır (ör. ```A:\abc\def\a.txt```) veya bunların kaçırılması gerekir. Unix benzeri sistemler için ```shlex.quote``` vardır ancak Windows için gerçekten standart bir şey yoktur. Ayrıca bkz. python, windows: shlex ile komut satırlarını ayrıştırma * MacOS/X: ```os.system("open " + shlex.quote(filename))``` * Windows: ```os.system("start " + filename)``` burada ```filename``` de kaçırılmalıdır. * ```subprocess``` modülüyle de çağırabilirsiniz ancak... Python 2.7 ve daha yenisi için basitçe kullanın ```subprocess.check_call(['open', filename]) ``` Python 3.5+'ta eşdeğer olarak biraz daha karmaşık ancak biraz daha çok yönlü olanı kullanabilirsiniz ```subprocess.run(['open', filename], check=True) ``` Python 2.4'e kadar uyumlu olmanız gerekiyorsa ```subprocess.call()``` kullanabilir ve kendi hata denetiminizi uygulayabilirsiniz: ```try: retcode = subprocess.call("open " + filename, shell=True) if retcode < 0: print >>sys.stderr, "Child was terminated by signal", -retcode else: print >>sys.stderr, "Child returned", retcode except OSError, e: print >>sys.stderr, "Execution failed:", e ``` Peki, ```subprocess``` kullanmanın avantajları nelerdir? * Güvenlik: Teoride bu daha güvenlidir ancak aslında bir komut satırını bir şekilde yürütmemiz gerekir; her iki ortamda da yorumlamak, yolları almak vb. için ortama ve servislere ihtiyacımız vardır. Her iki durumda da keyfi metin yürütmüyoruz, bu nedenle doğal olarak "ancak ```'filename ; rm -rf /'``` yazabilirsiniz" sorunu yoktur ve dosya adı bozulabiliyorsa ```subprocess.call``` kullanmak bize çok az ek koruma sağlar. * Hata işleme: Aslında bize daha fazla hata algılama sağlamaz, her iki durumda da ```retcode```'a bağımlıyız; ancak bir hata durumunda açıkça bir istisna oluşturma davranışı, bir hata olup olmadığını fark etmenize kesinlikle yardımcı olacaktır (ancak bazı senaryolarda bir geri izleme hatayı görmezden gelmekten daha faydalı olmayabilir). * (Engellemeyen) bir alt işlem oluşturur: Ayrı bir işlem başlattığımız için alt işlem için beklememize gerek yoktur. "Ancak ```subprocess``` tercih edilir" itirazına. Ancak, ```os.system()``` kullanım dışı bırakılmamıştır ve bir anlamda bu özel iş için en basit araçtır. Sonuç: ```os.system()``` kullanmak da doğru bir cevaptır. Windows ```start``` komutunun ```subprocess``` kullanmanın faydalarının çoğunu ortadan kaldıran ```shell=True```'yu geçirmenizi gerektirmesi belirgin bir dezavantajdır.
12
Why does PRC devalue its currency on purpose, but Turkey is worried about the devaluation of its currency?
Çin neden kasten para birimini devalüe ediyor ama Türkiye para biriminin devalüasyonundan endişe ediyor?
Trade surplus/deficit Devaluing one's currency means mostly one thing: It becomes more expensive to import products from abroad, while one's own products become comparably cheaper to buy on the world market. That means a country which exports lots of goods wants to devalue their currency while a country which imports lots of goods does not. In 2016, Turkey imported goods worth US $186 billion and exported goods worth US $156 billion. That means they had a trade deficit of 19%. However, China only imported goods worth US $1.23 trillion and exported goods worth US $2.27 trillion in 2016. That means they had a trade surplus of 84%. Which is why China wants to devalue their currency while Turkey does not. Debt management Another reason to devalue one's currency is that it reduces any debts denoted in that currency. If a country has a problem of too much public and private debt, then an easy way to get rid of it is to cause a hyperinflation. China happens to have a debt-to-gdp ratio of 47.6% while Turkey only has one of 28.3%. When you look at the private debt (debt of private citizens and companies in the country), you see the same picture. Private debit in Turkey was 170% of GDP, while China's is rumored to be over 300%. Which is why reducing debt through causing inflation seems more attractive to China than to Turkey. Foreign investor relations So why don't all countries get rid of their debt by adding a few zeroes to their bank notes? Because inflating your currency is a surefire way to drive away any foreign investors. Nobody will invest money into your country when that money might be worth nothing in a few years. Investors want stable currencies. Again, we observe the same difference in motivation between Turkey and China here. Turkey is actively inviting foreign investors, but China is quite reluctant to allow foreign economic influence in their country.
Ticaret fazlası/açığı Bir ülkenin para birimini devalüe etmesi genellikle tek bir anlama gelir: Yurtdışından ürün ithal etmek daha pahalı hale gelirken, kendi ürünlerinin dünya pazarında satın alınması nispeten daha ucuz hale gelir. Bu, çok fazla mal ihraç eden bir ülkenin para birimini devalüe etmek isterken, çok fazla mal ithal eden bir ülkenin bunu istemediği anlamına gelir. Türkiye 2016 yılında 186 milyar ABD Doları değerinde mal ithal etmiş ve 156 milyar ABD Doları değerinde mal ihraç etmiştir. Bu, %19'luk bir ticaret açığı olduğu anlamına gelir. Ancak Çin, 2016 yılında yalnızca 1,23 trilyon ABD Doları değerinde mal ithal etmiş ve 2,27 trilyon ABD Doları değerinde mal ihraç etmiştir. Bu, %84'lük bir ticaret fazlası olduğu anlamına gelir. Çin'in para birimini devalüe etmek istemesinin, Türkiye'nin ise istememesinin nedeni budur. Borç yönetimi Bir ülkenin para birimini devalüe etmesinin bir başka nedeni de, bu para birimiyle ifade edilen borçları azaltmasıdır. Bir ülkenin çok fazla kamu ve özel borcu varsa, bundan kurtulmanın kolay bir yolu hiperenflasyona neden olmaktır. Çin'in GSYİH'ye oranı %47,6 iken Türkiye'nin yalnızca %28,3'tür. Ülkedeki özel borca (ülkedeki özel vatandaşların ve şirketlerin borcu) baktığınızda aynı tabloyu görürsünüz. Türkiye'de özel borç GSYİH'nın %170'iyken, Çin'in %300'ün üzerinde olduğu söyleniyor. Bu nedenle enflasyona neden olarak borcu azaltmak, Çin'e Türkiye'den daha çekici geliyor. Yabancı yatırımcı ilişkileri Peki neden tüm ülkeler banknotlarına birkaç sıfır ekleyerek borçlarından kurtulmuyor? Çünkü para biriminizi enflasyon etmek, yabancı yatırımcıları uzaklaştırmanın kesin bir yoludur. Hiç kimse, birkaç yıl içinde değersiz hale gelebilecek bir ülkeye para yatırmaz. Yatırımcılar istikrarlı para birimleri ister. Yine burada Türkiye ve Çin arasında aynı motivasyon farkını gözlemliyoruz. Türkiye aktif olarak yabancı yatırımcıları davet ediyor ancak Çin, ülkesine yabancı ekonomik etki girmesine oldukça isteksiz.
13
Is it worth patenting an algorithm if I don't have the money to defend against infringements?
İhlallere karşı savunmak için param yoksa bir algoritmayı patent almaya değer mi?
This is a great question, with no one right answer. The strength of a patent comes from the ability to enforce it. If the patent owner cannot enforce it for whatever reason (such as a lack of funding), the patent is effectively toothless. But your competitors will likely not know that. They may therefore be dissuaded from infringing simply by the existence of a patent and the assumption that you would sue. Such a chilling effect on competition may be valuable to you. In addition, if there is infringement, you may be able to get a licensing agreement without the need for litigation. This can be a very lucrative business model, and so may justify the cost of patenting. And if litigation seems likely, there is a nascent field of litigation funding. While your funders will take quite a great deal of the damages, you may at least get something out of the end of it. Finally, even if you can't sue, someone else could. You might therefore get quite some value from selling it off at some point. There are a number of tech businesses where most of their value comes from their IP portfolio. On the whole therefore it depends how you see yourself proceeding. If you're unsure, it may pay to err on the side of patenting: once you disclose or use your invention publicly, you're generally barred from patenting it later (but for a short grace period in some countries), whereas it's easy to abandon a patent (or application) later down the track if you wish.
Bu harika bir soru ve tek bir doğru cevabı yok. Bir patentin gücü, onu uygulama yeteneğinden gelir. Patent sahibi, ne sebeple olursa olsun (örneğin fon eksikliği gibi) patenti uygulayamıyorsa, patent fiilen etkisizdir. Ancak rakipleriniz muhtemelen bunu bilmeyecektir. Bu nedenle, yalnızca bir patent varlığı ve dava açacağınız varsayımıyla ihlal etmekten caydırılabilirler. Rekabet üzerindeki böyle bir caydırıcı etki sizin için değerli olabilir. Ayrıca, ihlal varsa, dava açmaya gerek kalmadan bir lisans anlaşması yapabilirsiniz. Bu çok kazançlı bir iş modeli olabilir ve bu nedenle patent alma maliyetini haklı çıkarabilir. Ve dava açma olasılığı varsa, yeni bir dava fonlama alanı vardır. Finansörleriniz tazminatın büyük bir kısmını alırken, siz de en azından bunun sonundan bir şeyler elde edebilirsiniz. Son olarak, dava açamasanız bile, başkası açabilir. Bu nedenle, onu bir noktada satarak oldukça fazla değer elde edebilirsiniz. Değerlerinin çoğu IP portföylerinden gelen bir dizi teknoloji işi vardır. Bu nedenle, genel olarak nasıl ilerleyeceğinizi görmenize bağlıdır. Emin değilseniz, patent almaktan yana hata yapmak faydalı olabilir: İcadınızı açıkladıktan veya kamuya açık bir şekilde kullandıktan sonra, genellikle daha sonra patent almaktan men edilirsiniz (ancak bazı ülkelerde kısa bir süre için), oysa daha sonra bir patenti (veya başvuruyu) terk etmek isterseniz kolaydır.
14
"I have a ```String[]``` with values like so: ```public static final String[] VALUES = new String[] {""AB"",""BC"",""CD"",""AE""}; ``` Given ```String s```, is there a good way of testing whether ```VALUES``` contains ```s```?" How do I determine whether an array contains a particular value in Java?
"Şu şekilde değerleri olan bir ```String[]```'im var: ```public static final String[] VALUES = new String[] {""AB"",""BC"",""CD"",""AE""}; ``` Verilen ```String s``` için, ```VALUES```'in ```s```'yi içerip içermediğini test etmenin iyi bir yolu var mı?" Java'da bir dizinin belirli bir değeri içerip içermediğini nasıl belirlerim?
Four Different Ways to Check If an Array Contains a Value: * Using ```List```: ```public static boolean useList(String[] arr, String targetValue) { return Arrays.asList(arr).contains(targetValue); } ``` * Using ```Set```: ```public static boolean useSet(String[] arr, String targetValue) { Set set = new HashSet(Arrays.asList(arr)); return set.contains(targetValue); } ``` * Using a simple loop: ```public static boolean useLoop(String[] arr, String targetValue) { for (String s: arr) { if (s.equals(targetValue)) return true; } return false; } ``` * Using ```Arrays.binarySearch()```: The code below is wrong, it is listed here for completeness. ```binarySearch()``` can ONLY be used on sorted arrays. You will find the result is weird below. This is the best option when array is sorted. ```public static boolean binarySearch(String[] arr, String targetValue) { return Arrays.binarySearch(arr, targetValue) >= 0; } ``` Quick Example: ```String testValue="test"; String newValueNotInList="newValue"; String[] valueArray = { "this", "is", "java" , "test" }; Arrays.asList(valueArray).contains(testValue); // returns true Arrays.asList(valueArray).contains(newValueNotInList); // returns false ```
Bir Dizinin Bir Değer İçerip İçermediğini Kontrol Etmenin Dört Farklı Yolu: * ```List``` Kullanarak: ```public static boolean useList(String[] arr, String targetValue) { return Arrays.asList(arr).contains(targetValue); } ``` * ```Set``` Kullanarak: ```public static boolean useSet(String[] arr, String targetValue) { Set set = new HashSet(Arrays.asList(arr)); return set.contains(targetValue); } ``` * Basit bir döngü kullanarak: ```public static boolean useLoop(String[] arr, String targetValue) { for (String s: arr) { if (s.equals(targetValue)) return true; } return false; } ``` * ```Arrays.binarySearch()``` Kullanarak: Aşağıdaki kod yanlıştır, bütünlük için burada listelenmiştir. ```binarySearch()``` YALNIZCA sıralanmış dizilerde kullanılabilir. Aşağıda sonucun garip olduğunu göreceksiniz. Dizi sıralandığında bu en iyi seçenektir. ```public static boolean binarySearch(String[] arr, String targetValue) { return Arrays.binarySearch(arr, targetValue) >= 0; } ``` Hızlı Örnek: ```String testValue="test"; String newValueNotInList="newValue"; String[] valueArray = { "this", "is", "java" , "test" }; Arrays.asList(valueArray).contains(testValue); // true döner Arrays.asList(valueArray).contains(newValueNotInList); // false döner ```
15
Does Java casting introduce overhead? Or the compiler just resolves everything and there is no cost at run time? Is this a general things, or there are different cases?
Java dökümü ek yük getirir mi? Yoksa derleyici her şeyi çözer ve çalışma zamanında maliyet olmaz mı? Bu genel bir şey mi, yoksa farklı durumlar mı var?
There are 2 types of casting in Java: Implicit casting, when you cast from a type to a wider type, which is done automatically and there is no overhead: ```String s = "Cast"; Object o = s; // implicit casting ``` Explicit casting, when you go from a wider type to a more narrow one. For this case, you must explicitly use casting like that: ```Object o = someObject; String s = (String) o; // explicit casting ``` In this second case, there is overhead in runtime, because the two types must be checked and in case that casting is not feasible, JVM must throw a ClassCastException. Taken from JavaWorld: The cost of casting > Casting is used to convert between types -- between reference types in particular, for the type of casting operation in which we're interested here. Upcast operations (also called widening conversions in the Java Language Specification) convert a subclass reference to an ancestor class reference. This casting operation is normally automatic, since it's always safe and can be implemented directly by the compiler. Downcast operations (also called narrowing conversions in the Java Language Specification) convert an ancestor class reference to a subclass reference. This casting operation creates execution overhead, since Java requires that the cast be checked at runtime to make sure that it's valid. If the referenced object is not an instance of either the target type for the cast or a subclass of that type, the attempted cast is not permitted and must throw a java.lang.ClassCastException.
Java'da 2 tür döküm vardır: Türden daha geniş bir türe döküm yaptığınızda otomatik olarak yapılan ve ek yükü olmayan örtük döküm: ```String s = "Cast"; Object o = s; // örtük döküm ``` Daha geniş bir türden daha dar bir türe geçtiğinizde açık döküm. Bu durumda, dökümü şu şekilde açıkça kullanmanız gerekir: ```Object o = someObject; String s = (String) o; // açık döküm ``` Bu ikinci durumda, çalışma zamanında ek yük vardır, çünkü iki tür kontrol edilmelidir ve dökümün mümkün olmaması durumunda JVM bir ClassCastException fırlatmalıdır. JavaWorld'den alınmıştır: Dökümün maliyeti > Döküm, türler arasında dönüştürmek için kullanılır -- özellikle de burada ilgilendiğimiz döküm işlemi türü için referans türleri arasında. Yukarı döküm işlemleri (Java Dil Belirtiminde genişletme dönüşümleri olarak da adlandırılır) bir alt sınıf referansını bir üst sınıf referansına dönüştürür. Bu döküm işlemi normalde otomatiktir, çünkü her zaman güvenlidir ve doğrudan derleyici tarafından uygulanabilir. Aşağı döküm işlemleri (Java Dil Belirtiminde daraltma dönüşümleri olarak da adlandırılır) bir üst sınıf referansını bir alt sınıf referansına dönüştürür. Bu döküm işlemi, yürütme ek yükü oluşturur, çünkü Java, geçerli olduğundan emin olmak için dökümün çalışma zamanında kontrol edilmesini gerektirir. Referans verilen nesne, döküm için hedef türün veya bu türün bir alt sınıfının bir örneği değilse, denenen döküm izin verilmez ve bir java.lang.ClassCastException fırlatmalıdır.
16
How can I copy a string (e.g "hello") to the System Clipboard in C#, so next time I press CTRL+V I'll get "hello"?
C# dilinde bir dizeyi (örneğin "merhaba") Sistem Panosuna nasıl kopyalayabilirim, böylece bir sonraki CTRL+V tuşuna bastığımda "merhaba"yı alabilirim?
There are two classes that lives in different assemblies and different namespaces. * WinForms: use following namespace declaration, make sure ```Main``` is marked with ```[STAThread]``` attribute: ```using System.Windows.Forms; ``` * WPF: use following namespace declaration ```using System.Windows; ``` * console: add reference to ```System.Windows.Forms```, use following namespace declaration, make sure ```Main``` is marked with ```[STAThread]``` attribute. Step-by-step guide in another answer ```using System.Windows.Forms; ``` To copy an exact string (literal in this case): ```Clipboard.SetText("Hello, clipboard"); ``` To copy the contents of a textbox either use TextBox.Copy() or get text first and then set clipboard value: ```Clipboard.SetText(txtClipboard.Text); ``` See here for an example. Or... Official MSDN documentation or Here for WPF. Remarks: * Clipboard is desktop UI concept, trying to set it in server side code like ASP.Net will only set value on the server and has no impact on what user can see in they browser. While linked answer lets one to run Clipboard access code server side with ```SetApartmentState``` it is unlikely what you want to achieve. * If after following information in this question code still gets an exception see &quot;Current thread must be set to single thread apartment (STA)&quot; error in copy string to clipboard * This question/answer covers regular .NET, for .NET Core see - .Net Core - copy to clipboard?
Farklı derlemelerde ve farklı ad alanlarında yaşayan iki sınıf vardır. * WinForms: aşağıdaki ad alanı bildirimini kullanın, ```Main```'in ```[STAThread]``` özniteliğiyle işaretlendiğinden emin olun: ```using System.Windows.Forms; ``` * WPF: aşağıdaki ad alanı bildirimini kullanın ```using System.Windows; ``` * konsol: ```System.Windows.Forms```'a başvuru ekleyin, aşağıdaki ad alanı bildirimini kullanın, ```Main```'in ```[STAThread]``` özniteliğiyle işaretlendiğinden emin olun. Başka bir yanıtta adım adım kılavuz ```using System.Windows.Forms; ``` Tam bir dizeyi (bu durumda değişmez) kopyalamak için: ```Clipboard.SetText("Merhaba, pano"); ``` Bir metin kutusunun içeriğini kopyalamak için TextBox.Copy()'yi kullanın veya önce metni alın ve ardından pano değerini ayarlayın: ```Clipboard.SetText(txtClipboard.Text); ``` Bir örnek için buraya bakın. Veya... Resmi MSDN belgeleri veya WPF için buraya. Açıklamalar: * Pano, masaüstü kullanıcı arayüzü kavramıdır, ASP.Net gibi sunucu tarafı kodunda ayarlamayı denemek yalnızca sunucudaki değeri ayarlar ve kullanıcının tarayıcısında görebilecekleri üzerinde hiçbir etkisi yoktur. Bağlantılı yanıt, birinin ```SetApartmentState``` ile pano erişim kodunu sunucu tarafında çalıştırmasına izin verse de, elde etmek istediğiniz şey bu değildir. * Bu sorudaki bilgileri takip ettikten sonra kod hala bir istisna alıyorsa, panoya dize kopyalama işleminde "Geçerli iş parçacığı tek iş parçacığı dairesine (STA) ayarlanmalıdır" hatası görün. * Bu soru/yanıt normal .NET'i kapsar, .NET Core için bkz. - .Net Core - panoya kopyalama?
17
I want to put a draft watermark using the below script but the problem is that the watermark don't come over the images and I want it to come over it. ```\usepackage{draftwatermark} \SetWatermarkText{DRAFT} \SetWatermarkScale{1} ```
Aşağıdaki betiği kullanarak bir taslak filigranı koymak istiyorum ancak sorun şu ki filigran görüntülerin üzerine gelmiyor ve üzerine gelmesini istiyorum. ```\usepackage{draftwatermark} \SetWatermarkText{DRAFT} \SetWatermarkScale{1} ```
The problem is that the ```draftwatermark``` places the material in the background, so other elements (for example, figures and listings) might cover the included material; to prevent this, instead of using the ```draftwatermark``` package, you can use the ```xwatermark``` package; the starred variant of ```\newwatermark``` places the material in the foreground which seems to be what you need. A little example: First, with the unstarred variant (material on the background, so a figure will be placed on top of it): ```\documentclass{article} \usepackage[printwatermark]{xwatermark} \usepackage{xcolor} \usepackage{graphicx} \usepackage{lipsum} \newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT} \begin{document} \lipsum[1-2] \begin{figure}[!ht] \centering \includegraphics[width=3cm]{example-image-a} \end{figure} \lipsum[1-2] \end{document} ``` And now, with the starred variant (material on the foreground, so it will appear on top of figures): ```\documentclass{article} \usepackage[printwatermark]{xwatermark} \usepackage{xcolor} \usepackage{graphicx} \usepackage{lipsum} \newwatermark*[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT} \begin{document} \lipsum[1-2] \begin{figure}[!ht] \centering \includegraphics[width=3cm]{example-image-a} \end{figure} \lipsum[1-2] \end{document} ```
Sorun, ```draftwatermark```'ın materyali arka plana yerleştirmesi, bu nedenle diğer öğeler (örneğin, şekiller ve listeler) eklenen materyali kapatabilir; bunu önlemek için ```draftwatermark``` paketini kullanmak yerine ```xwatermark``` paketini kullanabilirsiniz; ```\newwatermark```'ın yıldızlı değişkeni materyali ön plana yerleştirir, bu da ihtiyacınız olan şey gibi görünüyor. Küçük bir örnek: İlk olarak, yıldızsız değişkenle (arka plandaki materyal, bu nedenle bir şekil onun üzerine yerleştirilecektir): ```\documentclass{article} \usepackage[printwatermark]{xwatermark} \usepackage{xcolor} \usepackage{graphicx} \usepackage{lipsum} \newwatermark[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT} \begin{document} \lipsum[1-2] \begin{figure}[!ht] \centering \includegraphics[width=3cm]{example-image-a} \end{figure} \lipsum[1-2] \end{document} ``` Ve şimdi, yıldızlı değişkenle (ön plandaki materyal, bu nedenle şekillerin üzerinde görünecektir): ```\documentclass{article} \usepackage[printwatermark]{xwatermark} \usepackage{xcolor} \usepackage{graphicx} \usepackage{lipsum} \newwatermark*[allpages,color=red!50,angle=45,scale=3,xpos=0,ypos=0]{DRAFT} \begin{document} \lipsum[1-2] \begin{figure}[!ht] \centering \includegraphics[width=3cm]{example-image-a} \end{figure} \lipsum[1-2] \end{document} ```
18
Understanding the Rails Authenticity Token
Rails Orijinallik Jetonunu Anlamak
What is CSRF? The Authenticity Token is a countermeasure to Cross-Site Request Forgery (CSRF). What is CSRF, you ask? It's a way that an attacker can potentially hijack sessions without even knowing session tokens. Scenario: * Visit your bank's site, log in. * Then visit the attacker's site (e.g. sponsored ad from an untrusted organization). * Attacker's page includes form with same fields as the bank's "Transfer Funds" form. * Attacker knows your account info, and has pre-filled form fields to transfer money from your account to attacker's account. * Attacker's page includes Javascript that submits form to your bank. * When form gets submitted, browser includes your cookies for the bank site, including the session token. * Bank transfers money to attacker's account. * The form can be in an iframe that is invisible, so you never know the attack occurred. * This is called Cross-Site Request Forgery (CSRF). CSRF solution: * Server can mark forms that came from the server itself * Every form must contain an additional authentication token as a hidden field. * Token must be unpredictable (attacker can't guess it). * Server provides valid token in forms in its pages. * Server checks token when form posted, rejects forms without proper token. * Example token: session identifier encrypted with server secret key. * Rails automatically generates such tokens: see the authenticity_token input field in every form.
CSRF Nedir? Orijinallik Belirteci, Siteler Arası İstek Sahteciliği'ne (CSRF) karşı bir önlemdir. CSRF nedir diye sorabilirsiniz? Bir saldırganın oturum belirteçlerini bilmeden bile oturumları ele geçirebileceği bir yoldur. Senaryo: * Bankanızın sitesini ziyaret edin, oturum açın. * Ardından saldırganın sitesini ziyaret edin (ör. güvenilmeyen bir kuruluştan sponsorlu reklam). * Saldırganın sayfası, bankanın "Para Transferi" formu ile aynı alanlara sahip bir form içerir. * Saldırgan hesap bilgilerinizi bilir ve hesabınızdan saldırganın hesabına para transfer etmek için önceden doldurulmuş form alanlarına sahiptir. * Saldırganın sayfası, formu bankanıza gönderen Javascript içerir. * Form gönderildiğinde, tarayıcı oturum belirteci de dahil olmak üzere banka sitesi için çerezlerinizi içerir. * Banka, saldırganın hesabına para aktarır. * Form, görünmez bir iframe içinde olabilir, böylece saldırının gerçekleştiğini asla bilemezsiniz. * Buna Siteler Arası İstek Sahteciliği (CSRF) denir. CSRF çözümü: * Sunucu, sunucudan gelen formları işaretleyebilir * Her form, gizli bir alan olarak ek bir kimlik doğrulama belirteci içermelidir. * Belirteç tahmin edilemez olmalıdır (saldırgan tahmin edemez). * Sunucu, sayfalarındaki formlarda geçerli belirteç sağlar. * Sunucu, form gönderildiğinde belirteci kontrol eder, uygun belirteci olmayan formları reddeder. * Belirteç örneği: sunucu gizli anahtarıyla şifrelenmiş oturum tanımlayıcısı. * Rails otomatik olarak bu tür belirteçler oluşturur: her formda authenticity_token giriş alanına bakın.
19
Why is FIFA against adding instant replay to the game?
FIFA neden oyuna anında tekrar eklemeye karşı?
There are a few fundamental considerations: * Uncertainty is a part of the game. The referee and linesmen are the arbiters of the action. Instant replay would limit their authority. * Football is global. Many places do not have access to the technology necessary to implement instant replay. * Football is a fast-paced game with few opportunities for stoppage. Instant replay would unnecessarily slow the pace. In 2008, FiFA President Sepp Blatter said: "Let it be as it is and let's leave [football] with errors. The television companies will have the right to say [the referee] was right or wrong, but still the referee makes the decision – a man, not a machine." Blatter and others at FIFA have repeatedly argued against using instant replay. But lately, FIFA has begun to come around on the idea. At FIFA's Congress in São Paulo prior to the 2014 World Cup, Blatter proposed allowing managers 2 challenges per game, much like the NFL handles challenges today. Although it's not quite "instant replay," in 2012 FIFA approved two different goal-line technologies to improve referee accuracy: "Hawk-Eye" -- which uses visual triangulation to determine ball location -- and "GoalRef" -- which uses a microchip in the ball and magnetic sensors within goalposts. (Many say FIFA approved the technologies in response to Frank Lampard's snubbed "goal" against Germany in the 2010 World Cup.) In 2013, FIFA announced it would use GoalControl, a German competitor to Hawk-Eye, at the Confederations Cup, basically a rehearsal for the World Cup. After a successful run at that tournament, FIFA announced it would implement GoalControl at the 2014 World Cup. The Guardian provides a pretty helpful FAQ on the technology. FIFA may choose to implement further changes to approved goal-line technology and referee rules when it meets again after the World Cup.
Birkaç temel husus vardır: * Belirsizlik oyunun bir parçasıdır. Hakem ve çizgi hakemleri, eylemin hakemleridir. Anında tekrar oynatma yetkilerini sınırlayacaktır. * Futbol küreseldir. Birçok yerde anında tekrar oynatmayı uygulamak için gerekli teknolojiye erişim yoktur. * Futbol, durma fırsatlarının az olduğu hızlı tempolu bir oyundur. Anında tekrar oynatma gereksiz yere hızı yavaşlatacaktır. 2008'de FIFA Başkanı Sepp Blatter şöyle demiştir: "Olduğu gibi kalsın ve [futbolu] hatalarıyla bırakalım. Televizyon şirketleri [hakemin] haklı ya da haksız olduğunu söyleme hakkına sahip olacak, ancak yine de karar veren hakemdir - bir makine değil, bir adam." Blatter ve FIFA'daki diğerleri, anında tekrar oynatma kullanımına karşı defalarca tartıştılar. Ancak son zamanlarda FIFA fikre yaklaşmaya başladı. 2014 Dünya Kupası'ndan önce São Paulo'daki FIFA Kongresi'nde Blatter, menajerlerin oyunda 2 meydan okumaya izin verilmesini önerdi, tıpkı NFL'nin bugün meydan okumaları ele aldığı gibi. Tam olarak "anında tekrar oynatma" olmasa da 2012'de FIFA, hakem doğruluğunu artırmak için iki farklı gol çizgisi teknolojisini onayladı: Topun yerini belirlemek için görsel üçgenleme kullanan "Hawk-Eye" ve gol direkleri içinde bir mikroçip ve manyetik sensörler kullanan "GoalRef". (Birçoğu FIFA'nın teknolojileri, Frank Lampard'ın 2010 Dünya Kupası'nda Almanya'ya karşı atılan "golünün" reddedilmesine yanıt olarak onayladığını söylüyor.) 2013 yılında FIFA, Dünya Kupası için temelde bir prova olan Konfederasyonlar Kupası'nda Hawk-Eye'ın Alman rakibi GoalControl'ü kullanacağını duyurdu. Bu turnuvada başarılı bir koşunun ardından FIFA, 2014 Dünya Kupası'nda GoalControl'ü uygulayacağını duyurdu. The Guardian, teknoloji hakkında oldukça faydalı bir SSS sağlıyor. FIFA, Dünya Kupası'ndan sonra tekrar bir araya geldiğinde onaylanmış gol çizgisi teknolojisinde ve hakem kurallarında daha fazla değişiklik yapmayı seçebilir.
20
If we should encrypt the message rather than the method of transfer, why do we care about wifi security? Is this just security theatre?
Mesajı aktarım yönteminden ziyade şifrelersek, neden wifi güvenliğiyle ilgileniyoruz? Bu sadece güvenlik tiyatrosu mu?
Network encryption protects against different set of threats than application layer encryption like TLS. In particular, network encryption like Wifi encryption are primarily designed to protect from a local attacker from being able to watch network patterns (by recording who you're making connections with, and discovering what devices are on the local network), observing/tampering of low level messages like ARP/DNS, and protecting network broadcasts from devices that aren't supposed to be in the network, and from tampering or selective interference. TLS doesn't protect the low level TCP/IP packets, which leaks information like the IP address of the machine you're connecting with, and the TLS handshake also by design leaks a number of information about the connection like Server Name Indication (SNI) header. The side effect of needing to do all this is that Wifi hardware already need to have enough code and processing power to handle encryption, so it becomes easier to just encrypt all wifi packets rather than selectively figuring out what needs protection or not. This come also with the side benefit that unsecured HTTP connection will still be at least marginally protected, even if at least to protect users of the infrastructure from each other, but not from the infrastructure provider. Network encryption is designed to protect the network, not the service. Application encryption is designed to protect the connection to the service, but it doesn't protect the network. They complement each other, but neither completely makes the other unnecessary.
Ağ şifrelemesi, TLS gibi uygulama katmanı şifrelemesinden farklı bir tehdit kümesine karşı koruma sağlar. Özellikle Wifi şifrelemesi gibi ağ şifrelemesi, öncelikle yerel bir saldırganın ağ modellerini izlemesini (kiminle bağlantı kurduğunuzu kaydederek ve yerel ağdaki hangi cihazları keşfederek), ARP/DNS gibi düşük seviyeli mesajları gözlemlemesini/kurcalamasını ve ağda olmaması gereken cihazlardan gelen ağ yayınlarını korumasını ve kurcalama veya seçici parazitten korumak için tasarlanmıştır. TLS, bağlantı kurduğunuz makinenin IP adresi gibi bilgileri sızdıran düşük seviyeli TCP/IP paketlerini korumaz ve TLS el sıkışması da tasarım gereği Sunucu Adı Göstergesi (SNI) başlığı gibi bağlantı hakkında bir dizi bilgi sızdırır. Tüm bunları yapma ihtiyacının yan etkisi, Wifi donanımının şifrelemeyi işlemek için zaten yeterli koda ve işlem gücüne sahip olması gerektiğidir, bu nedenle neyin korunması gerektiğini veya gerekmediğini seçici olarak belirlemek yerine tüm wifi paketlerini şifrelemek daha kolay hale gelir. Bu, güvenli olmayan HTTP bağlantısının bile en azından altyapının kullanıcılarını birbirinden korumak için olsa bile yine de marjinal olarak korunacağı yan faydayla birlikte gelir, ancak altyapı sağlayıcısından değil. Ağ şifrelemesi, hizmeti değil, ağı korumak için tasarlanmıştır. Uygulama şifrelemesi, hizmete olan bağlantıyı korumak için tasarlanmıştır, ancak ağı korumaz. Birbirlerini tamamlarlar, ancak hiçbiri diğerini tamamen gereksiz kılmaz.
21
Applying filter in scipy.signal: Use lfilter or filtfilt?
Scipy.signal'de filtre uygulama: lfilter mı yoksa filtfilt mi kullanılmalı?
* ```filtfilt``` is zero-phase filtering, which doesn't shift the signal as it filters. Since the phase is zero at all frequencies, it is also linear-phase. Filtering backwards in time requires you to predict the future, so it can't be used in "online" real-life applications, only for offline processing of recordings of signals. * ```lfilter``` is causal forward-in-time filtering only, similar to a real-life electronic filter. It can't be zero-phase. It can be linear-phase (symmetrical FIR), but usually isn't. Usually it adds different amounts of delay at different frequencies. An example and image should make it obvious. Although the magnitude of the frequency response of the filters is identical (top left and top right), the zero-phase lowpass lines up with the original signal, just without high frequency content, while the minimum phase filtering delays the signal in a causal way: ```from __future__ import division, print_function import numpy as np from numpy.random import randn from numpy.fft import rfft from scipy import signal import matplotlib.pyplot as plt b, a = signal.butter(4, 0.03, analog=False) # Show that frequency response is the same impulse = np.zeros(1000) impulse[500] = 1 # Applies filter forward and backward in time imp_ff = signal.filtfilt(b, a, impulse) # Applies filter forward in time twice (for same frequency response) imp_lf = signal.lfilter(b, a, signal.lfilter(b, a, impulse)) plt.subplot(2, 2, 1) plt.semilogx(20*np.log10(np.abs(rfft(imp_lf)))) plt.ylim(-100, 20) plt.grid(True, which='both') plt.title('lfilter') plt.subplot(2, 2, 2) plt.semilogx(20*np.log10(np.abs(rfft(imp_ff)))) plt.ylim(-100, 20) plt.grid(True, which='both') plt.title('filtfilt') sig = np.cumsum(randn(800)) # Brownian noise sig_ff = signal.filtfilt(b, a, sig) sig_lf = signal.lfilter(b, a, signal.lfilter(b, a, sig)) plt.subplot(2, 1, 2) plt.plot(sig, color='silver', label='Original') plt.plot(sig_ff, color='#3465a4', label='filtfilt') plt.plot(sig_lf, color='#cc0000', label='lfilter') plt.grid(True, which='both') plt.legend(loc="best") ```
* ```filtfilt``` sıfır fazlı filtrelemedir, filtreleme sırasında sinyali kaydırmaz. Faz tüm frekanslarda sıfır olduğundan, aynı zamanda doğrusal fazlıdır. Zamanda geriye doğru filtreleme, geleceği tahmin etmenizi gerektirir, bu nedenle "çevrimiçi" gerçek yaşam uygulamalarında kullanılamaz, yalnızca sinyal kayıtlarının çevrimdışı işlenmesi için kullanılabilir. * ```lfilter``` yalnızca gerçek hayattaki bir elektronik filtreye benzer şekilde nedensel ileri zaman filtrelemesidir. Sıfır fazlı olamaz. Doğrusal fazlı (simetrik FIR) olabilir, ancak genellikle öyle değildir. Genellikle farklı frekanslarda farklı miktarlarda gecikme ekler. Bir örnek ve resim bunu açıkça göstermelidir. Filtrelerin frekans tepkisinin büyüklüğü aynı olsa da (sol üst ve sağ üst), sıfır fazlı düşük geçiş orijinal sinyalle hizalanır, sadece yüksek frekans içeriği olmadan, minimum faz filtrelemesi ise sinyali nedensel bir şekilde geciktirir: ```from __future__ import division, print_function import numpy as np from numpy.random import randn from numpy.fft import rfft from scipy import signal import matplotlib.pyplot as plt b, a = signal.butter(4, 0.03, analog=False) # Frekans tepkisinin aynı olduğunu göster impuls = np.zeros(1000) impuls[500] = 1 # Filtreyi zamanda ileri ve geri uygular imp_ff = signal.filtfilt(b, a, impuls) # Filtreyi zamanda iki kez ileri uygular (aynı frekans tepkisi için) imp_lf = signal.lfilter(b, a, signal.lfilter(b, a, impuls)) plt.subplot(2, 2, 1) plt.semilogx(20*np.log10(np.abs(rfft(imp_lf)))) plt.ylim(-100, 20) plt.grid(True, which='both') plt.title('lfilter') plt.subplot(2, 2, 2) plt.semilogx(20*np.log10(np.abs(rfft(imp_ff)))) plt.ylim(-100, 20) plt.grid(True, which='both') plt.title('filtfilt') sig = np.cumsum(randn(800)) # Brown gürültüsü sig_ff = signal.filtfilt(b, a, sig) sig_lf = signal.lfilter(b, a, signal.lfilter(b, a, sig)) plt.subplot(2, 1, 2) plt.plot(sig, color='silver', label='Orijinal') plt.plot(sig_ff, color='#3465a4', label='filtfilt') plt.plot(sig_lf, color='#cc0000', label='lfilter') plt.grid(True, which='both') plt.legend(loc="best") ```
22
What do different people in the department expect from a postdoc? By different people I mean the advisor, graduate students and PhD students. I know it mainly depends on the job description but there are few basic things that a postdoc must be expected to do. How aggressive (proactive) must one be? This question is important since a postdoc cannot just wait for the adviser to give him/her inputs. Rather the postdoc must take the project(s) as another PhD research of his own but be completely accountable to the adviser in terms of what he/she is doing and how is he/she doing that. The above are my thoughts. My question is divided into the following sub-parts: * What would you as a professor expect from your postdoc? * What preparation one must do to rise to the expected level? * Is the preparation merely restricted to having sound academic record and experience?
Bölümdeki farklı kişiler bir postdoktordan ne bekler? Farklı kişiler derken danışman, lisansüstü öğrenciler ve doktora öğrencilerini kastediyorum. Bunun esas olarak iş tanımına bağlı olduğunu biliyorum ancak bir postdoktorun yapması beklenen birkaç temel şey var. Ne kadar agresif (proaktif) olunmalı? Bu soru önemlidir çünkü bir postdoktor sadece danışmanın kendisine girdi vermesini bekleyemez. Aksine, postdoktor projeyi kendi doktora araştırması gibi ele almalı ancak ne yaptığını ve nasıl yaptığını konusunda danışmana karşı tamamen sorumlu olmalıdır. Yukarıdakiler benim düşüncelerim. Sorularım aşağıdaki alt bölümlere ayrılmıştır: * Bir profesör olarak postdoktorunuzdan ne beklersiniz? * Beklenen seviyeye yükselmek için ne gibi hazırlıklar yapılmalıdır? * Hazırlık sadece sağlam bir akademik geçmişe ve deneyime sahip olmakla mı sınırlıdır?
You'll very quickly learn that being an academic involves more than just writing research papers. Your time as a postdoc is when you can start learning about these other aspects, while building your own profile. A postdoc needs to do the following: * Build a publication record. This will involve both what you are paid to do and your own line of research. * Get involved with supervising students. Help with the PhDs in the lab, and get involved in supervising masters students. * Get involved with obtaining funding. This can either be by helping your employer or (ideally) obtaining your own funding. * Build an international reputation. * Start collaborating with external parties. * Gain some teaching experience. This is absolutely crucial if you want a faculty position. * Learn how to manage projects and a lab. This includes overseeing the progress of projects, allocating your time (and others), presenting results at meetings and writing deliverables. If you are in a lab setting, you will need to learn how to fix/calibrate/maintain critical equipment and software so that you can start your own lab some day, and you will need to become proficient in teaching more junior members on how to use that equipment. * Start to devise a strategic research plan. While it is fun to do opportunistic research, solving a problem that comes along or investigating any idea that pops into your head, a better long term strategy is to formulate an interesting long term research plan and follow it, building result upon result. Be as proactive as humanly possible, without being annoying. Talk to everyone in the department, especially people whose research interests are close to your. Go to conferences and sit down and work with interesting people (not necessarily the superstars).
Akademik olmanın sadece araştırma makaleleri yazmaktan daha fazlasını içerdiğini çok çabuk öğreneceksiniz. Doktora sonrası dönem, kendi profilinizi oluştururken bu diğer yönleri öğrenmeye başlayabileceğiniz zamandır. Bir doktora sonrası şunları yapmalıdır: * Bir yayın kaydı oluşturun. Bu, hem yapmak için para aldığınız şeyi hem de kendi araştırma alanınızı içerecektir. * Öğrencilerin denetlenmesine katılın. Laboratuvardaki doktora öğrencilerine yardım edin ve yüksek lisans öğrencilerinin denetlenmesine katılın. * Finansman sağlamaya katılın. Bu, ya işverenize yardım ederek ya da (ideal olarak) kendi finansmanınızı sağlayarak yapılabilir. * Uluslararası bir itibar oluşturun. * Dış taraflarla işbirliği yapmaya başlayın. * Biraz öğretim deneyimi kazanın. Bir fakülte pozisyonu istiyorsanız bu kesinlikle çok önemlidir. * Projeleri ve bir laboratuvarı nasıl yöneteceğinizi öğrenin. Bu, projelerin ilerlemesini denetlemek, zamanınızı (ve başkalarının zamanını) ayırmak, toplantılarda sonuçları sunmak ve teslim edilebilirleri yazmak gibi şeyleri içerir. Bir laboratuvar ortamındaysanız, bir gün kendi laboratuvarınızı kurabilmeniz için kritik ekipman ve yazılımları nasıl tamir edeceğinizi/kalibre edeceğinizi/bakımını yapacağınızı öğrenmeniz gerekecektir ve daha genç üyelere bu ekipmanı nasıl kullanacaklarını öğretmede yetkin olmanız gerekecektir. * Stratejik bir araştırma planı geliştirmeye başlayın. Fırsatçı araştırmalar yapmak, ortaya çıkan bir sorunu çözmek veya aklınıza gelen herhangi bir fikri araştırmak eğlenceli olsa da, daha iyi bir uzun vadeli strateji, ilginç bir uzun vadeli araştırma planı formüle etmek ve bunu takip etmek, sonuç üzerine sonuç oluşturmaktır. Can sıkıcı olmadan, insan olarak mümkün olduğunca proaktif olun. Bölümdeki herkesle konuşun, özellikle de araştırma ilgi alanları size yakın olan kişilerle. Konferanslara gidin ve ilginç insanlarla (mutlaka süperstarlar değil) oturup çalışın.
23
Can someone explain to me what the ```contentInset``` property in a ```UIScrollView``` instance is used for? And maybe provide an example?
Birisi bana ```UIScrollView``` örneğinde ```contentInset``` özelliğinin ne için kullanıldığını açıklayabilir mi? Ve belki bir örnek verebilir mi?
While jball's answer is an excellent description of content insets, it doesn't answer the question of when to use it. I'll borrow from his diagrams: ``` _|←_cW_→_|_↓_ | | --------------- |content| ↑ ↑ |content| contentInset.top cH |content| ↓ |content| contentInset.bottom |content| ↓ --------------- |content| -------------↑- ``` That's what you get when you do it, but the usefulness of it only shows when you scroll: ``` _|←_cW_→_|_↓_ |content| ← content is still visible --------------- |content| ↑ ↑ |content| contentInset.top cH |content| ↓ |content| contentInset.bottom |content| ↓ --------------- _|_______|___ ↑ ``` That top row of content will still be visible because it's still inside the frame of the scroll view. One way to think of the top offset is "how much to shift the content down the scroll view when we're scrolled all the way to the top" To see a place where this is actually used, look at the build-in Photos app on the iphone. The Navigation bar and status bar are transparent, and the contents of the scroll view are visible underneath. That's because the scroll view's frame extends out that far. But if it wasn't for the content inset, you would never be able to have the top of the content clear that transparent navigation bar when you go all the way to the top.
jball'un cevabı içerik girintileri hakkında mükemmel bir açıklama olsa da, ne zaman kullanılacağı sorusunu cevaplamıyor. Onun diyagramlarından ödünç alacağım: ``` _|←_cW_→_|_↓_ | | --------------- |içerik| ↑ ↑ |içerik| contentInset.top cH |içerik| ↓ |içerik| contentInset.bottom |içerik| ↓ --------------- |içerik| -------------↑- ``` Bunu yaptığınızda elde ettiğiniz şey budur, ancak bunun kullanışlılığı yalnızca kaydırdığınızda ortaya çıkar: ``` _|←_cW_→_|_↓_ |içerik| ← içerik hala görünür --------------- |içerik| ↑ ↑ |içerik| contentInset.top cH |içerik| ↓ |içerik| contentInset.bottom |içerik| ↓ --------------- _|_______|___ ↑ ``` İçeriğin en üst sırası hala görünür olacak çünkü hala kaydırma görünümünün çerçevesinin içinde. Üst ofseti düşünmenin bir yolu, "en üste kaydırıldığımızda içeriği kaydırma görünümünde ne kadar aşağı kaydıracağımız"dır. Bunun gerçekten kullanıldığı bir yeri görmek için, iPhone'daki yerleşik Fotoğraflar uygulamasına bakın. Gezinme çubuğu ve durum çubuğu şeffaftır ve kaydırma görünümünün içerikleri altında görünür. Bunun nedeni, kaydırma görünümünün çerçevesinin o kadar uzağa uzanmasıdır. Ancak içerik girintisi olmasaydı, en üste gittiğinizde içeriğin üst kısmının o şeffaf gezinme çubuğunu asla temizleyemezdiniz.
24
How is arc defined in TikZ?
TikZ'de yay nasıl tanımlanır?
```\draw (x,y) arc (start:stop:radius);``` draws an arc * with radius ```radius``` * starts from ```(x,y)``` * with center ```(x-r*cos(start), y-r*sin(start))``` and * ends at ```(x-r*cos(start)+r*cos(stop), y-r*sin(start)+r*sin(stop))```. For example, ``` \draw[red] (0,0) arc (30:60:3); ``` draws an arc * of radius ```3``` * starting from ```(0,0)``` * with center ```(0-3*cos(30),0-3*sin(30))``` and * ending at ```(0-3*cos(30)+3*cos(60),0-3*sin(30)+3*sin(60))```. ```\draw[blue] (0,0) -- ++(30+180:3) -- +(60:3); ``` draw a blue line to the arc to make a complete sector. Minimal Working Example ```\documentclass[tikz,border=12pt]{standalone} \begin{document} \foreach \start/\stop in {30/60,45/90,135/180,0/180,45/315} { \begin{tikzpicture} \draw[lightgray,ultra thin] (-6,-6) grid (6,6); \draw[red] (0,0) arc (\start:\stop:3); \draw[blue] (0,0) -- ++(\start+180:3) -- +(\stop:3); \node[anchor=north] at (0,6) {$(\start:\stop:3)$}; \end{tikzpicture} } \end{document} ```
```\draw (x,y) arc (start:stop:radius);``` bir yay çizer * ```radius``` yarıçapıyla * ```(x,y)``` noktasından başlar * ```(x-r*cos(start), y-r*sin(start))``` merkezlidir ve * ```(x-r*cos(start)+r*cos(stop), y-r*sin(start)+r*sin(stop))``` noktasında biter. Örneğin, ``` \draw[red] (0,0) arc (30:60:3); ``` bir yay çizer * ```3``` yarıçaplı * ```(0,0)``` noktasından başlar * ```(0-3*cos(30),0-3*sin(30))``` merkezlidir ve * ```(0-3*cos(30)+3*cos(60),0-3*sin(30)+3*sin(60))``` noktasında biter. ```\draw[blue] (0,0) -- ++(30+180:3) -- +(60:3); ``` tam bir sektör oluşturmak için yaydan mavi bir çizgi çizer. Minimum Çalışma Örneği ```\documentclass[tikz,border=12pt]{standalone} \begin{document} \foreach \start/\stop in {30/60,45/90,135/180,0/180,45/315} { \begin{tikzpicture} \draw[lightgray,ultra thin] (-6,-6) grid (6,6); \draw[red] (0,0) arc (\start:\stop:3); \draw[blue] (0,0) -- ++(\start+180:3) -- +(\stop:3); \node[anchor=north] at (0,6) {$(\start:\stop:3)$}; \end{tikzpicture} } \end{document} ```
25
How to connect mysql workbench to running mysql inside docker?
Mysql workbench'ü docker içinde çalışan mysql'e nasıl bağlayabilirim?
By default after deployment MySQL has following connection restrictions: ```mysql> select host, user from mysql.user; +-----------+---------------+ | host | user | +-----------+---------------+ | localhost | healthchecker | | localhost | mysql.session | | localhost | mysql.sys | | localhost | root | +-----------+---------------+ 4 rows in set (0.00 sec) ``` Apparently, for the security purposes you will not be able to connect to it outside of the docker image. If you need to change that to allow root to connect from any host (say, for development purposes), do: * Start your mysql image with all port mappings required: ```docker run -p 3306:3306 --name=mysql57 -d mysql/mysql-server:5.7``` or, if the complete port mapping is required: ```docker run -p 3306:3306 -p 33060:33060 --name=mysql57 -d mysql/mysql-server:5.7 ``` * If this is the fresh installation - grab the default password: ```docker logs mysql57 2>&1 | grep GENERATED``` * Connect using ```mysql``` client directly to the mysqld in docker: ```docker exec -it mysql57 mysql -uroot -p``` * If this is the fresh installation you will be asked to change the password using ```ALTER USER``` command. Do it. * Run SQL: ```update mysql.user set host = '%' where user='root';``` * Quit the ```mysql``` client. * Restart the container: ```docker restart mysql57``` Now you will be able to connect from MySQL Workbench to ```host: `0.0.0.0` port: `3306` ``` After all the changes the query will show: ```select host, user from mysql.user; +-----------+---------------+ | host | user | +-----------+---------------+ | % | root | | localhost | healthchecker | | localhost | mysql.session | | localhost | mysql.sys | +-----------+---------------+ ```
MySQL'in varsayılan olarak dağıtımdan sonra aşağıdaki bağlantı kısıtlamaları vardır: ```mysql> select host, user from mysql.user; +-----------+---------------+ | host | user | +-----------+---------------+ | localhost | healthchecker | | localhost | mysql.session | | localhost | mysql.sys | | localhost | root | +-----------+---------------+ 4 rows in set (0.00 sec) ``` Görünüşe göre, güvenlik amaçları doğrultusunda docker görüntüsünün dışından bağlantı kuramayacaksınız. Bunu, root'un herhangi bir host'tan bağlanmasına izin verecek şekilde değiştirmeniz gerekiyorsa (örneğin, geliştirme amaçları için), şunları yapın: * Gerekli tüm bağlantı eşlemeleriyle mysql görüntünüzü başlatın: ```docker run -p 3306:3306 --name=mysql57 -d mysql/mysql-server:5.7``` veya, tam bağlantı eşlemesi gerekiyorsa: ```docker run -p 3306:3306 -p 33060:33060 --name=mysql57 -d mysql/mysql-server:5.7 ``` * Bu yeni bir kurulumsa - varsayılan parolayı alın: ```docker logs mysql57 2>&1 | grep GENERATED``` * ```mysql``` istemcisini kullanarak doğrudan docker'daki mysqld'ye bağlanın: ```docker exec -it mysql57 mysql -uroot -p``` * Bu yeni bir kurulumsa, ```ALTER USER``` komutunu kullanarak parolayı değiştirmeniz istenecektir. Yapın. * SQL'i çalıştırın: ```update mysql.user set host = '%' where user='root';``` * ```mysql``` istemcisinden çıkın. * Konteyneri yeniden başlatın: ```docker restart mysql57``` Artık MySQL Workbench'ten şu şekilde bağlantı kurabileceksiniz: ```host: `0.0.0.0` port: `3306` ``` Tüm değişikliklerden sonra sorgu şu şekilde görünecektir: ```select host, user from mysql.user; +-----------+---------------+ | host | user | +-----------+---------------+ | % | root | | localhost | healthchecker | | localhost | mysql.session | | localhost | mysql.sys | +-----------+---------------+ ```
26
Can meat spoil outside the fridge if it's baked into bread as a filling?
Et, ekmeğin içine dolgu olarak konulursa buzdolabının dışında bozulur mu?
There are two differences between your buns and a tin can. First, your buns were heated to a core temperature of under 100°C. Yes, your oven was probably set way higher, but the water content in your filling prevents it from getting hotter than boiling water. Commercial canning is done in the vicinity of 120-130°C, which is possible because the cans are cooked under pressure. So unlike in a can, most pathogens were destroyed, but not necessarily all of them. For human consumption, that’s perfectly fine as long as the remaining ones don’t get the time-temperature combo to regrow. Second, a bread dough may be dense (although the aim is usually something different), but by no means airtight. Interestingly, wrapping meat in dense dough was used as preservation method in medieval times - the “ancestor” of today’s pork pies and pastries. But while the hard flour crust (not intended to be eaten originally) did form a protective layer and usually extended the shelf life more or less, it was by no means food safe judged by modern standards - although some pies were stored for months. But your fluffy buns are truly not a protective layer. Which means you should refrigerate your buns, but also that you get to enjoy the whole dish.
Çöreklerinizle bir teneke kutu arasında iki fark vardır. Birincisi, çörekleriniz 100°C'nin altındaki bir çekirdek sıcaklığına kadar ısıtıldı. Evet, fırınınız muhtemelen çok daha yükseğe ayarlanmıştı, ancak dolgunuzdaki su içeriği kaynar sudan daha sıcak olmasını engeller. Ticari konserveleme, kutuların basınç altında pişirilmesi mümkün olduğu için 120-130°C civarında yapılır. Yani bir kutunun aksine, çoğu patojen yok edildi, ancak hepsi değil. İnsan tüketimi için, kalanların yeniden büyümesi için zaman-sıcaklık kombinasyonunu elde etmedikleri sürece bu tamamen iyidir. İkincisi, bir ekmek hamuru yoğun olabilir (amaç genellikle farklı olsa da), ancak hiçbir şekilde hava geçirmez değildir. İlginç bir şekilde, eti yoğun hamura sarmak orta çağlarda bir koruma yöntemi olarak kullanılıyordu - günümüzün domuz böreklerinin ve hamur işlerinin "atası". Ancak sert un kabuğu (aslen yenmek için tasarlanmamıştır) koruyucu bir tabaka oluşturmuş ve genellikle raf ömrünü az çok uzatmış olsa da, modern standartlara göre hiçbir şekilde gıda güvenli değildi - bazı börekler aylarca saklansa da. Ancak kabarık çörekleriniz gerçekten koruyucu bir tabaka değildir. Bu, çöreklerinizi soğutmanız gerektiği, ancak aynı zamanda tüm yemeğin tadını çıkarmanız gerektiği anlamına gelir.
27
I'm wondering how the XML Schema specification handles these cases: ``` ``` No maxOccurs given -> Is this the cardinality [1..1]? ``` ``` I suppose this is simply invalid? ``` ``` Is this the cardinality [0..2] or [1..2]? Is there an "official" definition on how the XML Schema spec handles these cases?
XML Şeması spesifikasyonunun bu durumları nasıl işlediğini merak ediyorum: ``` ``` maxOccurs verilmemiş -> Bu [1..1] kardinalitesi midir? ``` ``` Sanırım bu sadece geçersiz? ``` ``` Bu [0..2] mi yoksa [1..2] kardinalitesi midir? XML Şeması spesifikasyonunun bu durumları nasıl işlediğine dair "resmi" bir tanım var mı?
New, expanded answer to an old, commonly asked question... Default Values * Occurrence constraints ```minOccurs``` and ```maxOccurs``` default to ```1```. Common Cases Explained ``` ``` means ```A``` is required and must appear exactly once. ``` ``` means ```A``` is optional and may appear at most once. ``` ``` means ```A``` is required and may repeat an unlimited number of times. ``` ``` means ```A``` is optional and may repeat an unlimited number of times. See Also * W3C XML Schema Part 0: Primer In general, an element is required to appear when the value of minOccurs is 1 or more. The maximum number of times an element may appear is determined by the value of a maxOccurs attribute in its declaration. This value may be a positive integer such as 41, or the term unbounded to indicate there is no maximum number of occurrences. The default value for both the minOccurs and the maxOccurs attributes is 1. Thus, when an element such as comment is declared without a maxOccurs attribute, the element may not occur more than once. Be sure that if you specify a value for only the minOccurs attribute, it is less than or equal to the default value of maxOccurs, i.e. it is 0 or 1. Similarly, if you specify a value for only the maxOccurs attribute, it must be greater than or equal to the default value of minOccurs, i.e. 1 or more. If both attributes are omitted, the element must appear exactly once. * W3C XML Schema Part 1: Structures Second Edition ```<element maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 > ```
Eski, sıkça sorulan bir soruya yeni, genişletilmiş cevap... Varsayılan Değerler * Oluşum kısıtlamaları ```minOccurs``` ve ```maxOccurs``` varsayılan olarak ```1```'dir. Ortak Durumlar Açıklandı ``` ``` ```A```'nın gerekli olduğu ve tam olarak bir kez görünmesi gerektiği anlamına gelir. ``` ``` ```A```'nın isteğe bağlı olduğu ve en fazla bir kez görünebileceği anlamına gelir. ``` ``` ```A```'nın gerekli olduğu ve sınırsız sayıda tekrarlanabileceği anlamına gelir. ``` ``` ```A```'nın isteğe bağlı olduğu ve sınırsız sayıda tekrarlanabileceği anlamına gelir. Ayrıca Bakınız * W3C XML Şeması Bölüm 0: Giriş Genel olarak, bir öğenin ```minOccurs``` değeri 1 veya daha fazla olduğunda görünmesi gerekir. Bir öğenin görünebileceği maksimum tekrar sayısı, bildirimindeki ```maxOccurs``` özniteliğinin değeriyle belirlenir. Bu değer, 41 gibi pozitif bir tam sayı veya maksimum oluşum sayısının olmadığını belirtmek için sınırsız terimi olabilir. Hem ```minOccurs``` hem de ```maxOccurs``` özniteliklerinin varsayılan değeri 1'dir. Bu nedenle, ```comment``` gibi bir öğe ```maxOccurs``` özniteliği olmadan bildirildiğinde, öğe bir kereden fazla görünemez. Yalnızca ```minOccurs``` özniteliği için bir değer belirtiyorsanız, bunun ```maxOccurs```'un varsayılan değerinden küçük veya ona eşit olduğundan emin olun, yani 0 veya 1'dir. Benzer şekilde, yalnızca ```maxOccurs``` özniteliği için bir değer belirtiyorsanız, bunun ```minOccurs```'un varsayılan değerinden büyük veya ona eşit olması gerekir, yani 1 veya daha fazla. Her iki öznitelik de atlanırsa, öğe tam olarak bir kez görünmelidir. * W3C XML Şeması Bölüm 1: Yapılar İkinci Baskı ```<element maxOccurs = (nonNegativeInteger | unbounded) : 1 minOccurs = nonNegativeInteger : 1 > ```
28
Were there any flying dinosaurs?
Uçan dinozorlar var mıydı?
Birds are both flying dinosaurs and flying reptiles. Yes, that's potentially confusing. To understand the apparent contradiction, you have to understand how modern classification of organisms works (phylogenetic systematics). Under the old (Linnean) classification system, Reptilia (reptiles) was an order and Aves (birds) was a separate order. Phylogenetic systematics, which has completely replaced the Linnean system, views all organisms as interrelated in a nested set of monophyletic groups (clades). It's like a set of venn diagrams, where all organisms fall into a giant circle and then successively smaller circles classify more and more specific groups. The clade Reptilia includes snakes, lizards, crocodiles, and lots of extinct groups, including dinosaurs. So all dinosaurs are reptiles. The clade Dinosauria includes all the extinct dinosaurs (Stegosaurus, Triceratops, sauropods, etc.), including theropod dinosaurs, which include well known dinosaurs like Tyrannosaurus and Allosaurus. Based on a mountain on anatomical evidence, including lots of transitional fossils, living birds are a sub-group of theropod dinosaurs. So all birds (Aves) are theropod dinosaurs (Dinosauria: Theropoda). All dinosaurs are reptiles. Therefore, birds are dinosaurs and reptiles. They are just more closely related to dinosaurs than to other reptiles. The tricky part is that most people have an intuitive idea of what "reptiles" and "dinosaurs" are. To a systematist, whose job it is to classify organisms, these terms don't mean the same thing as they do to most people. Systematists think about groups like Reptilia and Dinosauria and how those groups are related to one another. So they have no problem saying that birds are dinosaurs and reptiles, because birds are nested within both of those groups. A few words about pterosaurs Along with birds and bats, pterosaurs are the other clade of vertebrates capable of powered, flapping flight. Pterosaurs fall within Reptilia (and Diapsida and Archosauria) along with Dinosauria, which includes birds. There are a lot of other extinct lineages in the tree that are not shown, e.g., ornithodirans that are not dinosaurs and not pterosaurs. Pterosaurs and birds share anatomical features that all reptiles, diapsids, archosaurs, and ornithodirans have, which is how we know that they are more closely related to each other than to other groups, like crocodiles. But their flight structures evolved independently and are anatomically distinct fro one another. So pterosaurs are flying reptiles but not flying dinosaurs. These images might help you understand the above explanation.
Kuşlar hem uçan dinozorlar hem de uçan sürüngenlerdir. Evet, bu kafa karıştırıcı olabilir. Görünürdeki çelişkiyi anlamak için organizmaların modern sınıflandırmasının nasıl çalıştığını (filogenetik sistematik) anlamanız gerekir. Eski (Linne) sınıflandırma sisteminde, Reptilia (sürüngenler) bir takımdı ve Aves (kuşlar) ayrı bir takımdı. Linne sisteminin yerini tamamen alan filogenetik sistematik, tüm organizmaları monofiletik grupların (kladlar) iç içe geçmiş bir kümesinde birbirine bağlı olarak görür. Bu, tüm organizmaların dev bir daireye düştüğü ve daha sonra giderek daha küçük dairelerin daha spesifik grupları sınıflandırdığı bir Venn diyagramları kümesi gibidir. Reptilia kladı yılanları, kertenkeleleri, timsahları ve dinozorlar da dahil olmak üzere birçok soyu tükenmiş grubu içerir. Yani tüm dinozorlar sürüngendir. Dinosauria kladı, Tyrannosaurus ve Allosaurus gibi iyi bilinen dinozorları içeren teropod dinozorlar da dahil olmak üzere tüm soyu tükenmiş dinozorları (Stegosaurus, Triceratops, sauropodlar vb.) içerir. Çok sayıda geçiş fosili de dahil olmak üzere anatomik kanıtlara dayanan bir dağa göre, yaşayan kuşlar teropod dinozorların bir alt grubudur. Yani tüm kuşlar (Aves) teropod dinozorlardır (Dinosauria: Theropoda). Tüm dinozorlar sürüngendir. Bu nedenle kuşlar dinozor ve sürüngendir. Sadece diğer sürüngenlerden ziyade dinozorlarla daha yakından ilişkilidirler. İşin püf noktası, çoğu insanın "sürüngenler" ve "dinozorlar"ın ne olduğuna dair sezgisel bir fikre sahip olmasıdır. Görevi organizmaları sınıflandırmak olan bir sistematist için bu terimler çoğu insan için ifade ettikleri anlamı ifade etmez. Sistematistler Reptilia ve Dinosauria gibi grupları ve bu grupların birbirleriyle nasıl ilişkili olduğunu düşünürler. Bu nedenle kuşların dinozor ve sürüngen olduğunu söylemekte bir sorunları yoktur çünkü kuşlar bu grupların her ikisinin içinde yer alır. Pterozorlar hakkında birkaç söz Kuşlar ve yarasalarla birlikte pterozorlar, güçlü, çırpınan uçuş yeteneğine sahip diğer omurgalı kladıdır. Pterozorlar, kuşları içeren Dinosauria ile birlikte Reptilia'ya (ve Diapsida ve Archosauria'ya) girer. Ağaçta gösterilmeyen, örneğin dinozor olmayan ve pterozor olmayan ornitodinler gibi birçok başka soyu tükenmiş soy vardır. Pterozorlar ve kuşlar, tüm sürüngenlerin, diapsidlerin, arkozorların ve ornitodinlerin sahip olduğu anatomik özellikleri paylaşırlar; bu, timsahlar gibi diğer gruplara göre birbirleriyle daha yakından ilişkili olduklarını bilmemizi sağlar. Ancak uçuş yapıları bağımsız olarak evrimleşmiştir ve anatomik olarak birbirinden farklıdır. Yani pterozorlar uçan sürüngenlerdir ancak uçan dinozorlar değildir. Bu görseller yukarıdaki açıklamayı anlamanıza yardımcı olabilir.
29
Say, a table ```car``` has one-to-one relationship to tables ```electric_car```, ```gas_car```, and ```hybrid_car```. If a ```car``` is ```electric_car```, it can no longer appear in ```gas_car``` or a ```hybrid_car```, etc. Is it a bad practice to have several mutually exclusive one-to-one relationships in database design?
Diyelim ki ```car``` tablosu ```electric_car```, ```gas_car``` ve ```hybrid_car``` tablolarıyla bire bir ilişkiye sahip. Bir ```car``` ```electric_car``` ise, artık ```gas_car``` veya ```hybrid_car``` içinde görünemez, vb. Veritabanı tasarımında karşılıklı olarak birbirini dışlayan birden fazla bire bir ilişkiye sahip olmak kötü bir uygulama mıdır?
The different types of cars are an instance of a general problem that surfaces over and over again in data modeling. It is called "generalization/specialization" in ER modeling, and "superclass/subclass" in object modeling. An object modeler uses the inheritance features built into the object model to solve the problem quite easily. The subclasses simply extend the superclass. The relational modeler is faced with a problem. how to design the tables so as to emulate the benefits that one would get from inheritance? The simplest technique is called single table inheritance. Data about all types of cars are grouped into a single table for cars. There is a column, car_type, that groups together all the cars of a single type. No car can belong to more than one type. If a column is irrelevant to, say, electric cars, it will be left NULL in the rows that pertain to electric cars. This simple solution works well for the smaller and simpler cases. The presence of a lot of NULLs adds a tiny bit to storage overhead, and a little bit to retrieval overhead. The developer may have to learn SQL three-valued logic if boolean tests are done on nullable columns. This can be baffling at first, but one gets used to it. There is another technique, called class table inheritance. In this design, there are separate tables for gas_car, electric_car, and hybrid_car, in addition to a combined table, car, for all of them. When you want all of the data about a specific kind of car, you join the car table with the appropriate specialized table. There are fewer NULLs in this design, but you do more joining. This technique works better in the larger and more complex cases. There is a third technique called shared primary key. This technique is often used in conjunction with class table inheritance. The specialized tables for the subclasses have, as their primary key, a copy of the primary key of the corresponding entry in the car table. This id column can be declared to be both the primary key and a foreign key. This involves a little extra programming when new cars are to be added, but it makes the joins simple, easy, and fast. Superclasses and subclasses happen all the time in the real world. Don't be afraid. But do test your initial design for performance. If your first attempt is simple and sound, you'll be able to tweak it to speed it up.
Farklı araba türleri, veri modellemede tekrar tekrar ortaya çıkan genel bir sorunun bir örneğidir. ER modellemede "genelleme/uzmanlaşma" ve nesne modellemede "üst sınıf/alt sınıf" olarak adlandırılır. Bir nesne modelleyicisi, sorunu çözmek için nesne modeline yerleştirilmiş kalıtım özelliklerini oldukça kolay bir şekilde kullanır. Alt sınıflar üst sınıfı basitçe genişletir. İlişkisel modelleyici bir sorunla karşı karşıyadır. Kalıtımın sağlayacağı faydaları taklit etmek için tablolar nasıl tasarlanır? En basit teknik tek tablo kalıtımı olarak adlandırılır. Her türden araba hakkındaki veriler, arabalar için tek bir tabloda gruplandırılır. Tek bir türdeki tüm arabaları bir araya getiren bir car_type sütunu vardır. Hiçbir araba birden fazla türe ait olamaz. Bir sütun, örneğin elektrikli arabalar için alakasızsa, elektrikli arabalarla ilgili satırlarda NULL bırakılır. Bu basit çözüm, daha küçük ve daha basit durumlar için iyi çalışır. Çok sayıda NULL'un varlığı, depolama yüküne biraz ve alma yüküne biraz ekler. Geliştirici, boş bırakılabilir sütunlarda mantıksal testler yapılırsa SQL üç değerli mantığını öğrenmek zorunda kalabilir. Bu ilk başta şaşırtıcı olabilir, ancak alışılır. Sınıf tablo kalıtımı adı verilen başka bir teknik vardır. Bu tasarımda, tümü için birleşik bir tablo olan car'ın yanı sıra gas_car, electric_car ve hybrid_car için ayrı tablolar vardır. Belirli bir araba türüyle ilgili tüm verileri istediğinizde, araba tablosunu uygun uzmanlaşmış tabloyla birleştirirsiniz. Bu tasarımda daha az NULL vardır, ancak daha fazla birleştirme yaparsınız. Bu teknik, daha büyük ve daha karmaşık durumlarda daha iyi çalışır. Paylaşılan birincil anahtar adı verilen üçüncü bir teknik vardır. Bu teknik genellikle sınıf tablo kalıtımıyla birlikte kullanılır. Alt sınıflar için uzmanlaşmış tablolar, birincil anahtarları olarak araba tablosundaki karşılık gelen girdinin birincil anahtarının bir kopyasına sahiptir. Bu id sütunu hem birincil anahtar hem de yabancı anahtar olarak ilan edilebilir. Bu, yeni arabalar eklendiğinde biraz ekstra programlama içerir, ancak birleştirmeleri basit, kolay ve hızlı hale getirir. Üst sınıflar ve alt sınıflar gerçek dünyada her zaman olur. Korkmayın. Ancak ilk tasarımınızı performans açısından test edin. İlk denemeniz basit ve sağlamsa, hızlandırmak için ayarlayabilirsiniz.
30
I see a low use of Mathematica in Kaggle competitions. Why would one use the Wolfram Language versus R, Python, or Julia for machine learning? Besides prettier plots and the Manipulate function, do we have something that is useful for ML that other languages are lacking?
Kaggle yarışmalarında Mathematica'nın düşük kullanımını görüyorum. Makine öğrenimi için Wolfram Dili yerine R, Python veya Julia'yı kullanmanın nedeni ne olabilir? Daha güzel grafikler ve Manipulate fonksiyonunun yanı sıra, diğer dillerde olmayan ve ML için yararlı bir şeyimiz var mı?
Mathematica doesn't have the depth of algorithm support that is present in R or Python. Julia has much more limited algorithm support but does exhibit a good turn of speed. The few algorithms that Mathematica does support are not particularly well exposed for the type of tweaking needed to win Kaggle competitions. Mathematica, as of version 10, supports the following classifiers: "LogisticRegression", "Markov", "NaiveBayes", "NearestNeighbors", "NeuralNetwork", "RandomForest", "SupportVectorMachine". Whilst it does offer one ensemble method, RandomForest, it lacks both Bagging and any flavour of boosting, such as Adaboost. These latter general ensemble methods allow you to leverage the power of a base classifier, either built-in or, of greater utility when exploring performance improvements, of your own design. This limits significantly the potential for creating novel methods within the existing machine learning framework. Mathematica's strengths lay with it's expressive, compact, language, strong visualisation capabilities and easy parallelization. These make it very efficient to explore new strategies and combinations of ML algorithms you may already have implemented. A less often mentioned benefit is that use of Mathematica in a functional programming style tends to lead to fewer bugs in the final code.
Mathematica, R veya Python'da bulunan algoritma desteğinin derinliğine sahip değildir. Julia'nın algoritma desteği çok daha sınırlıdır ancak iyi bir hız sergiler. Mathematica'nın desteklediği birkaç algoritma, Kaggle yarışmalarını kazanmak için gereken ince ayar türü için özellikle iyi bir şekilde ortaya konmamıştır. Mathematica, sürüm 10 itibariyle şu sınıflandırıcıları destekler: "LogisticRegression", "Markov", "NaiveBayes", "NearestNeighbors", "NeuralNetwork", "RandomForest", "SupportVectorMachine". Bir topluluk yöntemi olan RandomForest'ı sunarken, hem Bagging'den hem de Adaboost gibi herhangi bir güçlendirme türünden yoksundur. Bu son genel topluluk yöntemleri, ister yerleşik ister performans iyileştirmelerini keşfederken daha büyük bir yardımcı program olan kendi tasarımınız olsun, bir temel sınıflandırıcı gücünden yararlanmanıza olanak tanır. Bu, mevcut makine öğrenimi çerçevesi içinde yeni yöntemler oluşturma potansiyelini önemli ölçüde sınırlar. Mathematica'nın güçlü yönleri, etkileyici, kompakt dili, güçlü görselleştirme yetenekleri ve kolay paralelliktir. Bunlar, halihazırda uygulamış olabileceğiniz yeni stratejileri ve ML algoritmalarının kombinasyonlarını keşfetmeyi çok verimli hale getirir. Daha az bahsedilen bir fayda, Mathematica'nın işlevsel bir programlama stiliyle kullanılmasının, nihai kodda daha az hataya yol açma eğiliminde olmasıdır.
31
I'm using wp_nav_menu and am trying to create custom output for the sub-level drop downs. I came across the "items_wrap" argument but there's really not much information as to what it is, how it works, and what kind of things can be done with it. What exactly is "%1$s" and "%2$s"? (Can anyone explain it in layman's terms?)
wp_nav_menu kullanıyorum ve alt seviye açılır menüler için özel çıktı oluşturmaya çalışıyorum. "items_wrap" argümanına rastladım ancak ne olduğu, nasıl çalıştığı ve onunla ne gibi şeyler yapılabileceği konusunda pek fazla bilgi yok. "%1$s" ve "%2$s" tam olarak nedir? (Bunu herkes basit bir şekilde açıklayabilir mi?)
The parameter ```'items_wrap'``` for ```wp_nav_menu()``` defaults to: ```'%3$s' ``` This a a template that is parsed with ```sprintf()```: ```$nav_menu .= sprintf( $args->items_wrap , esc_attr( $wrap_id ) // %1$s , esc_attr( $wrap_class ) // %2$s , $items // %3$s ); ``` The numbered placeholders – ```%1$s```, ```%2$s```, ```%3$s``` – refer to the arguments after the first argument in ```sprintf()```. The percent sign marks a placeholder, the number the position and the type ```s``` means it should be treated as a string. Do not change the type unless you really know what you do. :) * ```$wrap_id``` is the parameter ```'menu_id'``` if you have it set, else it is ```'menu-' . $menu->slug```. * ```$wrap_class``` is the parameter ```'menu_class'``` if you have it set, else it is empty. * ```$items``` is a string of the inner content of the menu. Let’s say you don’t need a ```class```. Just omit the second string: ```wp_nav_menu( array( 'items_wrap' => '%3$s' ) ); ``` If you don’t need the ```class``` and the ```id```, and you want another container (because you used a custom walker): ```wp_nav_menu( array( 'items_wrap' => '%3$s' ) ); ``` The main point is: You have to use the numbers for the replacements given in ```wp_nav_menu()```. ```%3$s``` is always the list of items.
```'wp_nav_menu()'``` için ```'items_wrap'``` parametresi varsayılan olarak şu şekildedir: ```'%3$s' ``` Bu, ```sprintf()``` ile ayrıştırılan bir şablondur: ```$nav_menu .= sprintf( $args->items_wrap , esc_attr( $wrap_id ) // %1$s , esc_attr( $wrap_class ) // %2$s , $items // %3$s ); ``` Numaralandırılmış yer tutucular – ```%1$s```, ```%2$s```, ```%3$s``` – ```sprintf()``` içindeki ilk argümandan sonraki argümanları ifade eder. Yüzde işareti bir yer tutucuyu, sayı konumu ve ```s``` türü bir dize olarak işlenmesi gerektiği anlamına gelir. Ne yaptığınızı gerçekten bilmiyorsanız türü değiştirmeyin. :) * ```$wrap_id```, ayarladıysanız ```'menu_id'``` parametresidir, aksi takdirde ```'menu-' . $menu->slug``` olur. * ```$wrap_class```, ayarladıysanız ```'menu_class'``` parametresidir, aksi takdirde boştur. * ```$items```, menünün iç içeriğinin bir dizesidir. Diyelim ki bir ```class```'a ihtiyacınız yok. İkinci dizeyi atlayın: ```wp_nav_menu( array( 'items_wrap' => '%3$s' ) ); ``` ```class```'a ve ```id```'ye ihtiyacınız yoksa ve başka bir kapsayıcı istiyorsanız (özel bir yürütücü kullandığınız için): ```wp_nav_menu( array( 'items_wrap' => '%3$s' ) ); ``` Ana nokta: ```wp_nav_menu()``` içinde verilen değiştirmeler için sayıları kullanmanız gerekir. ```%3$s``` her zaman öğelerin listesidir.
32
I've noticed that people on YouTube and even on TV would sometimes say things like "I used to take lots of coke a few years ago" or "I used to smoke weed daily until this and that" or "Yea, I smoke weed every once in a while," or "I used to pirate games a lot when I was a bit younger" or "I used pirated Windows and Photoshop until I got a job," etc., etc.. Basically they are confessing to a crime, on public record, couldn't anyone come after them? They've already confessed - technically all that would have to be done is a trial. How do people publicly admit to criminal activity and not typically get arrested?
YouTube'da ve hatta televizyonda insanların bazen "Birkaç yıl önce çok fazla kokain alıyordum" veya "Şu zamana kadar her gün ot içiyordum" veya "Evet, ara sıra ot içiyorum" veya "Biraz daha gençken çok fazla korsan oyun oynuyordum" veya "İş bulana kadar korsan Windows ve Photoshop kullandım" gibi şeyler söylediklerini fark ettim. Temel olarak, kamuya açık bir şekilde bir suçu itiraf ediyorlar, peşlerinden kimse gelemez mi? Zaten itiraf etmişler - teknik olarak yapılması gereken tek şey bir duruşma. İnsanlar nasıl kamuoyuna suç faaliyetlerini itiraf edebiliyor ve genellikle tutuklanmıyor?
Unless the Youtube Video shows them committing a crime, then no, they couldn't be arrested and tried for a crime. Them saying it, not under oath, is just hearsay that has no evidentiary value unless there is already other evidence they have committed a crime. In that case, its an admission. But there must be other, either circumstantial, or actual physical evidence of a crime. Past intoxication is not a crime, either. Possession of drugs, if caught with them is. But saying you got high is not. People have walked into police stations and confessed to murders. But with no evidence, no body, no name of a missing person, they can't even be held after the holding period for investigatory purposes expires. If the video shows them committing assault, or breaking and entering (there actually are idiots who post this stuff), the video is actual evidence of a crime and it is often used against them. The statements can be used to begin an investigation, but people don't usually confess to anything worth pursuing even an investigation. The fact that someone says they used to do something criminal is not enough. For all you ( meaning anyone ) knows, the statute of limitations has expired because they "pirated games" 10 years ago. Your comment is right on.
Youtube Videosu onları suç işlerken göstermiyorsa, hayır, tutuklanamaz ve suçtan yargılanamazlar. Yemin etmeden söyledikleri, zaten bir suç işlediklerine dair başka kanıtlar olmadığı sürece delil değeri olmayan sadece duyumdan ibarettir. Bu durumda, bir itiraftır. Ancak suçun başka dolaylı veya fiili fiziksel kanıtları olmalıdır. Geçmişte sarhoş olmak da suç değildir. Uyuşturucu bulundurmak, eğer üzerlerinde yakalanırsa suçtur. Ancak uyuşturucu kullandığınızı söylemek suç değildir. İnsanlar polis karakollarına girip cinayetleri itiraf ettiler. Ancak delil, ceset, kayıp bir kişinin adı olmadan, soruşturma amaçlı tutma süresi dolduktan sonra bile tutulamazlar. Video onları saldırı veya hırsızlık yaparken gösteriyorsa (gerçekten de bu tür şeyleri yayınlayan aptallar var), video suçun fiili kanıtıdır ve genellikle onlara karşı kullanılır. İfadeler bir soruşturma başlatmak için kullanılabilir, ancak insanlar genellikle bir soruşturmayı bile hak edecek bir şeyi itiraf etmezler. Birinin eskiden suç işlediğini söylemesi yeterli değildir. Siz (herkes anlamına gelir) bildiğiniz kadarıyla, 10 yıl önce "oyun korsanlığı" yaptıkları için zamanaşımı süresi dolmuştur. Yorumunuz çok doğru.
33
Did two dissenting Supreme Court justices agree that Trump was "absolutely immune" to the Manhattan DA's subpoena?
İki muhalif Yüksek Mahkeme yargıcı, Trump'ın Manhattan Bölge Savcısı'nın celbine "kesinlikle dokunulmaz" olduğu konusunda hemfikir miydi?
If you are interested in the gory details, please see the full decision in Trump v. Vance. The first half of the linked document contains the Court's majority opinion and the concurring opinion of Justices Kavanaugh and Gorsuch, followed by the separate dissenting opinions of Justices Thomas and Alito. Based on a quick read, it's apparent that Justice Thomas agrees with the general court's opinion that a sitting President &quot;is not entitled to absolute immunity from issuance of [a] subpoena&quot;. Thomas dissents on the grounds that the President &quot;may be entitled to relief against [a subpoena's] enforcement&quot; based on his special status as president. Thomas argues (agreeing with the president) that the case should be vacated and returned to the lower court, so that the President can argue that his duties to the nation take up all of his time and attention and he thus deserves relief from the subpoena. Justice Alito makes a stronger dissent. While he agrees that a sitting President is not absolutely immune from a state subpoena, he argues that such a subpoena should not be enforced unless it meets a stringent legal test, such that: * It does not interfere with the President's execution of his duties of office, and * It carries a weight of urgency — e.g., subpoenaing information related to suspected treason — as a guarantee it is not merely issued to harass. In the absence of those conditions, in Alito's opinion, the President is only subject to the constitutional process of impeachment and trial in Congress. So no, neither dissenting Justice suggests that the President is absolutely immune from this kind of subpoena. Instead, they are concerned that the issuance of such subpoenas might negatively impact on the President's ability to perform the duties of the office, and argue that the President might legitimately be granted varying degrees of relief from such legal actions at a court's discretion.
Kanlı ayrıntılarla ilgileniyorsanız lütfen Trump v. Vance'deki tam karara bakın. Bağlantılı belgenin ilk yarısı Mahkemenin çoğunluk görüşünü ve Yargıçlar Kavanaugh ve Gorsuch'un katılımcı görüşünü içerir, ardından Yargıçlar Thomas ve Alito'nun ayrı muhalif görüşleri gelir. Hızlı bir okumaya dayanarak, Yargıç Thomas'ın genel mahkemenin, görevdeki bir Başkanın "[bir] celbin çıkarılmasından mutlak dokunulmazlığa sahip olmadığı" yönündeki görüşüne katıldığı açıktır. Thomas, Başkanın başkan olarak özel statüsüne dayanarak "[bir celbin] uygulanmasına karşı koruma hakkına sahip olabileceği" gerekçesiyle muhalefet ediyor. Thomas, davanın bozulması ve alt mahkemeye geri gönderilmesi gerektiğini (başkanla aynı fikirde olarak) savunuyor, böylece Başkan görevlerinin tüm zamanını ve dikkatini aldığını ve bu nedenle celpten muaf tutulmayı hak ettiğini savunabilir. Yargıç Alito daha güçlü bir muhalefet sergiliyor. Görevdeki bir Başkanın bir eyalet celbinden mutlak surette muaf olmadığını kabul ederken, böyle bir celbin şu gibi sıkı bir yasal testi karşılamadığı sürece uygulanmaması gerektiğini savunuyor: * Başkanın görevlerini yerine getirmesine müdahale etmez ve * Acil bir ağırlık taşır - örneğin, şüpheli vatana ihanetle ilgili bilgilerin celbedilmesi - yalnızca taciz amacıyla çıkarılmadığının bir garantisi olarak. Alito'nun görüşüne göre, bu koşulların yokluğunda Başkan yalnızca Kongre'de anayasal azil ve yargılama sürecine tabidir. Yani hayır, muhalif Yargıçlardan hiçbiri Başkanın bu tür bir celpten mutlak surette muaf olduğunu öne sürmüyor. Bunun yerine, bu tür celplerin çıkarılmasının Başkanın görevlerini yerine getirme yeteneği üzerinde olumsuz bir etki yaratabileceğinden endişe duyuyorlar ve Başkanın bir mahkemenin takdirine bağlı olarak bu tür yasal işlemlerden meşru olarak çeşitli derecelerde muafiyet verilebileceğini savunuyorlar.
34
Just curious, given how heavily from Tolkien D&D drew, and the fact that games like Wizardry used Hobbits, is there a good design reason why Gygax and company used Halflings (a term that also appears in Tolkien) vice Hobbits as the term for our little friends?
Sadece meraktan, D&D'nin Tolkien'den ne kadar çok şey aldığını ve Wizardry gibi oyunların Hobbitleri kullandığını göz önünde bulundurarak, Gygax ve ekibinin küçük dostlarımız için Hobbitler yerine Yarımlar (Tolkien'de de geçen bir terim) terimini kullanmasının iyi bir tasarım nedeni var mı?
Halflings were originally called hobbits prior to a legal challenge. According to Gary Gygax himself, it was due to a legal claim on &quot;hobbit&quot; by a company who purchased the merchandising rights on Tolkien's works in 1976: TSR was served with papers threatening damages to the tune of half a mil by the Saul Zantes (sp?) division of Elan Merchandising on behalf of the tolkien Estate. The main objection was to the boardgame we were publishing, The Battle of Five Armies. The author of that game had given us a letter from his attorney claiming the work was grandfathered because it was published after the copyrights for JRRT's works had lapsed and before any renewals were made. The action also demanded we remove balrog, dragon, dwarf, elf, ent, goblin, hobbit, orc, and warg from the D&D game. Although only balrog and warg were unique names we agreed to hobbit as well, kept the rest, of course. The boardgame was dumped, and thus the suit was settled out of court at that. Halflings were originally called &quot;hobbits&quot; in the Dungeons & Dragons box set first released in 1974. Later printings changed this to &quot;halfling&quot;. According to The Acaeum, this change occurred between the fifth printing (Dec 1975 - Apr 1976) and sixth printing (1977), with the six printing being marked the Original Collector's Edition. However, Tim Kask has said that box sets were generally thrown together with whichever printings of the books were on hand, so the distinctions between printings are inexact. The Acaeum notes at least one box set shipped having the revised booklets but no Original Collector's Edition mark. Due to an oversight, a single reference to &quot;hobbit&quot; remained on page 6 of Men & Magic, which was fixed in the 2013 Deluxe reprint and PDF copies. According to Wikipedia, J.R.R. Tolkien sold the film, stage, and merchandising rights to The Hobbit and Lord of the Rings to United Artists in 1968, who sold them in turn to Saul Zaentz in 1976. Zaents would go on to produce the 1978 Lord of the Rings animated movie.
Hobbitler, yasal bir itirazdan önce başlangıçta hobbit olarak adlandırılıyordu. Gary Gygax'in kendisine göre, bunun nedeni 1976'da Tolkien'in eserlerinin ticari haklarını satın alan bir şirketin "hobbit" kelimesi üzerinde yasal hak iddia etmesiydi: TSR'ye, Elan Merchandising'in Saul Zantes (sp?) bölümü tarafından Tolkien Vakfı adına yarım milyon dolarlık tazminat davası açıldı. Ana itiraz, yayınladığımız masaüstü oyunu Beş Ordunun Savaşı'naydı. O oyunun yazarı bize, avukatından, JRRT'nin eserlerinin telif hakları sona erdikten ve yenilenmeden önce yayınlandığı için eserin büyükbabadan kalma olduğunu iddia eden bir mektup vermişti. Dava ayrıca balrog, ejderha, cüce, elf, ent, goblin, hobbit, ork ve warg'ı D&D oyunundan kaldırmamızı talep ediyordu. Sadece balrog ve warg benzersiz isimler olmasına rağmen hobbit'i de kabul ettik, geri kalanı elbette koruduk. Masaüstü oyunu çöpe atıldı ve böylece dava mahkeme dışında çözüldü. Hobbitler ilk olarak 1974'te piyasaya sürülen Dungeons & Dragons kutu setinde "hobbitler" olarak adlandırıldı. Daha sonraki baskılarda bu "yarı insan" olarak değiştirildi. The Acaeum'a göre, bu değişiklik beşinci baskı (Aralık 1975 - Nisan 1976) ile altıncı baskı (1977) arasında gerçekleşti ve altıncı baskı Orijinal Koleksiyoncu Sürümü olarak işaretlendi. Ancak Tim Kask, kutu setlerinin genellikle eldeki kitapların hangi baskılarıyla bir araya getirildiğini, bu nedenle baskılar arasındaki ayrımların kesin olmadığını söyledi. The Acaeum, en az bir kutu setinin gözden geçirilmiş kitapçıkları içermesine rağmen Orijinal Koleksiyoncu Sürümü işareti olmadığını belirtiyor. Bir gözden kaçırma nedeniyle, 2013 Deluxe yeniden baskısında ve PDF kopyalarında düzeltilen Men & Magic'in 6. sayfasında "hobbit" kelimesine tek bir referans kaldı. Wikipedia'ya göre, J.R.R. Tolkien, The Hobbit ve Yüzüklerin Efendisi'nin film, sahne ve ticari haklarını 1968'de United Artists'e sattı ve onlar da 1976'da Saul Zaentz'e sattı. Zaents, 1978 Yüzüklerin Efendisi animasyon filmini yapmaya devam edecekti.
35
My USB drive used to be originally 8GB when I bought it. I'm trying to reformatted in Windows 7 by right clicking on the drive and selecting ```Format...```. But the capacity only shows 250MB. Is there something I can do to get the original size back? Maybe it got partitioned in a weird way? The flash drive is a SanDisk Cruzer Micro 8GB.
USB sürücüm ilk aldığımda 8 GB idi. Windows 7'de sürücüye sağ tıklayıp ```Biçimlendir...``` seçeneğini seçerek yeniden biçimlendirmeye çalışıyorum. Ancak kapasite yalnızca 250 MB olarak görünüyor. Orijinal boyutu geri almak için yapabileceğim bir şey var mı? Belki de garip bir şekilde bölümlenmiştir? Flash sürücü bir SanDisk Cruzer Micro 8GB'dir.
The command line procedure is not simple, but it is the most likely thing to work. When re-formatting the "drive" you're actually only formatting a partition on the drive. You need to use the diskpart utility to remove the partitions and create 1 single partition covering the full volume. ```diskpart``` can be a bit dangerous, because if you pick the wrong disk or partition, you can remove data or partitions that are extremely, EXTREMELY important and lose all data on your machine. Proceed with extreme caution! Open up a command prompt as administrator (open the start menu, type ```cmd``` and press Enter.) Type ```diskpart``` and press Enter. You'll end up with a new prompt that looks like this: ```DISKPART> ``` Type ```list disk ``` and you'll get a listing of all drives on your machine. Type ```select disk # ``` to select a disk, where ```#``` is the number of the disk Windows screw-balled. Usually, the device is disk 1, but it's always best to make sure. Then type ```list partition ``` to get a listing of all partitions on the disk. If you're sure you have the right disk/partition, you can then repeat typing ```select partition # delete partition ``` until all partitions are removed from that drive (you may need to type ```delete partition override``` for protected partitions). Once the drive is empty, exit diskpart and remove the drive. Wait at least 5 minutes, then re-insert the drive. DO NOT CLICK FORMAT – this will most likely re-create the problem. Instead, enter diskpart again, and select the disk. Then type ```create partition primary ``` Once you have created the partition, exit ```diskpart``` and, in the command promt, type ```diskmgmt.msc ``` This will provide a reliable way to create a FAT32 partition. On the drive you would like to format (NEVER TOUCH DISK 0!), right click and select ```format```. The ```allocation unit size``` option should be default, and the ```File System``` option should be set to ```FAT32```. The format may take a while, depending on the disk size, be patient. This should fix partition troubles on any readable USB flash drive.
Komut satırı prosedürü basit değildir ancak işe yarama olasılığı en yüksek olanıdır. "Sürücüyü" yeniden biçimlendirirken aslında sürücüdeki yalnızca bir bölümü biçimlendirirsiniz. Bölümleri kaldırmak ve tüm birimi kapsayan tek bir bölüm oluşturmak için diskpart yardımcı programını kullanmanız gerekir. ```diskpart``` biraz tehlikeli olabilir çünkü yanlış disk veya bölümü seçerseniz son derece, SON DERECE önemli olan verileri veya bölümleri kaldırabilir ve makinenizdeki tüm verileri kaybedebilirsiniz. Son derece dikkatli ilerleyin! Yönetici olarak bir komut istemi açın (başlat menüsünü açın, ```cmd``` yazın ve Enter'a basın.) ```diskpart``` yazın ve Enter'a basın. Şuna benzer yeni bir istemle karşılaşırsınız: ```DISKPART> ``` Şunu yazın ```list disk ``` ve makinenizdeki tüm sürücülerin bir listesini alırsınız. Şunu yazın ```select disk # ``` bir disk seçmek için, burada ```#``` Windows'un bozduğu diskin numarasıdır. Genellikle cihaz disk 1'dir ancak emin olmak her zaman en iyisidir. Ardından şunu yazın ```list partition ``` diskteki tüm bölümlerin bir listesini almak için. Doğru disk/bölüme sahip olduğunuzdan eminseniz, tüm bölümler o sürücüden kaldırılıncaya kadar ```select partition # delete partition ``` yazmayı tekrarlayabilirsiniz (korumalı bölümler için ```delete partition override``` yazmanız gerekebilir). Sürücü boşaldığında diskpart'tan çıkın ve sürücüyü çıkarın. En az 5 dakika bekleyin, ardından sürücüyü yeniden takın. BİÇİMLENDİR'e TIKLAMAYIN – bu büyük olasılıkla sorunu yeniden oluşturacaktır. Bunun yerine diskpart'a tekrar girin ve diski seçin. Ardından şunu yazın ```create partition primary ``` Bölümü oluşturduktan sonra ```diskpart```'tan çıkın ve komut isteminde şunu yazın ```diskmgmt.msc ``` Bu, FAT32 bölümü oluşturmanın güvenilir bir yolunu sağlayacaktır. Biçimlendirmek istediğiniz sürücüde (ASLA DİSK 0'A DOKUNMAYIN!), sağ tıklayın ve ```format```'ı seçin. ```Tahsis birimi boyutu``` seçeneği varsayılan olmalı ve ```Dosya Sistemi``` seçeneği ```FAT32``` olarak ayarlanmalıdır. Biçimlendirme, disk boyutuna bağlı olarak biraz zaman alabilir, sabırlı olun. Bu, okunabilir herhangi bir USB flash sürücüdeki bölüm sorunlarını gidermelidir.
36
I am a Tor developer. I understand that the .onion address is a public key of sorts, but not much more than that (I can vaguely guess, though). When nobody knows the IP of the .onion address, how do requests reach it? Are they bounced between nodes in the P2P network till someone decrypts it with the corresponding private key?
Ben bir Tor geliştiricisiyim. .onion adresinin bir tür açık anahtar olduğunu anlıyorum, ancak bundan fazlasını değil (tahmin edebiliyorum). Kimse .onion adresinin IP'sini bilmiyorsa, istekler ona nasıl ulaşıyor? Karşılık gelen özel anahtarla biri şifresini çözene kadar P2P ağındaki düğümler arasında sıçrıyorlar mı?
Up to at least October 2013 the hidden services work like this: * A hidden service calculates its key pair (private and public key, asymmetric encryption). * Then the hidden service picks some relays as its introduction points. * It tells its public key to those introduction points over Tor circuits. * After that the hidden-service creates a hidden service descriptor, containing its public key and what its introduction points are. * The hidden service signs the hidden service descriptor with its private key. * It then uploads the hidden service descriptor to a distributed hash table (DHT). * Clients learn the .onion address from a hidden service out-of-band. (e.g. public website) (A $hash.onion is a 16 character name derived from the service's public key.) * After retrieving the .onion address the client connects to the DHT and asks for that $hash. * If it exists the client learns about the hidden service's public key and its introduction points. * The client picks a relay at random to build a circuit to it, to tell it a one-time secret. The picked relay acts as rendezvous point. * The client creates a introduce message, containing the address of the rendezvous point and the one-time secret, before encrypting the message with the hidden service's public key. * The client sends its message over a Tor circuit to one of the introduction points, demanding it to be forwarded to the hidden service. * The hidden service decrypts the introduce message with its private key to learn about the rendezvous point and the one-time secret. * The hidden service creates a rendezvous message, containing the one-time secret and sends it over a circuit to the rendezvous point. * The rendezvous point tells the client that a connection was established. * Client and hidden service talk to each other over this rendezvous point. All traffic is end-to-end encrypted and the rendezvous point just relays it back and forth. Note that each of them, client and hidden service, build a circuit to the rendezvous point; at three hops per circuit this makes six hops in total.
En azından Ekim 2013'e kadar gizli hizmetler şu şekilde çalıştı: * Gizli bir hizmet anahtar çiftini (özel ve genel anahtar, asimetrik şifreleme) hesaplar. * Ardından gizli hizmet, giriş noktaları olarak bazı röleleri seçer. * Genel anahtarını bu giriş noktalarına Tor devreleri üzerinden söyler. * Bundan sonra gizli hizmet, genel anahtarını ve giriş noktalarının ne olduğunu içeren bir gizli hizmet tanımlayıcısı oluşturur. * Gizli hizmet, gizli hizmet tanımlayıcısını özel anahtarıyla imzalar. * Ardından gizli hizmet tanımlayıcısını dağıtılmış bir karma tabloya (DHT) yükler. * İstemciler, .onion adresini gizli bir hizmetten bant dışı öğrenir. (ör. genel web sitesi) (Bir $hash.onion, hizmetin genel anahtarından türetilen 16 karakterlik bir addır.) * .onion adresini aldıktan sonra istemci DHT'ye bağlanır ve o $hash'i ister. * Varsa istemci, gizli hizmetin genel anahtarı ve giriş noktaları hakkında bilgi edinir. * İstemci, kendisine bir devre kurmak için rastgele bir röle seçer ve ona tek seferlik bir sır söyler. Seçilen röle buluşma noktası görevi görür. * İstemci, buluşma noktasının adresini ve tek seferlik sırrı içeren bir tanıtım mesajı oluşturur ve mesajı gizli hizmetin genel anahtarıyla şifreler. * İstemci, mesajını Tor devresi üzerinden giriş noktalarından birine gönderir ve gizli hizmete iletilmesini talep eder. * Gizli hizmet, buluşma noktası ve tek seferlik sır hakkında bilgi edinmek için tanıtım mesajını özel anahtarıyla şifresini çözer. * Gizli hizmet, tek seferlik sırrı içeren bir buluşma mesajı oluşturur ve bir devre üzerinden buluşma noktasına gönderir. * Buluşma noktası, istemciye bir bağlantı kurulduğunu söyler. * İstemci ve gizli hizmet, bu buluşma noktası üzerinden birbirleriyle konuşur. Tüm trafik uçtan uca şifrelenir ve buluşma noktası yalnızca onu ileri geri iletir. İstemci ve gizli hizmetin her birinin buluşma noktasına bir devre kurduğunu unutmayın; devre başına üç atlama ile bu toplamda altı atlama yapar.
37
I have been offered a PhD position by an inexperienced professor in a great institution in Europe. Despite the fact that the institution is very strong in my area, since the position was offered by this particular professor, I would have to commit myself to working with him for my thesis. This professor is young, and relatively inexperienced, but I enjoy the things he works on, and we seem to get along well. My question is, would having an inexperienced advisor hurt my growth as a scientist, or my career in general? Will I have the time during my PhD to also work on the side with other, more renowned professors in the department, or is one usually focused in a single research project?
Avrupa'da harika bir kurumda deneyimsiz bir profesör tarafından bana doktora pozisyonu teklif edildi. Kurumun benim alanımda çok güçlü olmasına rağmen, pozisyon bu profesör tarafından teklif edildiğinden, tezim için onunla çalışmaya kendimi adamam gerekecek. Bu profesör genç ve nispeten deneyimsiz, ancak üzerinde çalıştığı şeylerden hoşlanıyorum ve iyi anlaştığımız anlaşılıyor. Sormak istediğim şu: Deneyimsiz bir danışman olması, bir bilim insanı olarak gelişimime veya genel olarak kariyerime zarar verir mi? Doktora çalışmam sırasında bölümdeki diğer daha ünlü profesörlerle de yan yana çalışma zamanım olacak mı, yoksa genellikle tek bir araştırma projesine mi odaklanılıyor?
An inexperienced advisor can hurt your career by being relatively unknown. This means they may not have access to the same network and that their recommendation letters do not carry the same weight. Inexperience in supervision may, for example, lead to unrealistic expectations. Or an inexperienced advisor can be very good for your career, by quickly rising to fame with the awesome publications the two of you will write together and being fresh in everybody's memory when writing recommendation letters. They may spend plenty of time on working with you. An experienced advisor can hurt your career by being never there. They may already have made their name, have extremely high expectations from PhD students, to the level of cause them to be overly stressed and quit. Or they may be very good for your career, as dedicated as can be to PhD students, prioritising them above most other duties, having realistic expectations from PhD students, and having great influence when writing recommendation letters. Bottom line: an experienced advisor may be better for you than an inexperienced one, but that certainly does not have to be the case. And keep in mind: a very good/famous scientist is not always a very good PhD advisor.
Deneyimsiz bir danışman, nispeten bilinmediği için kariyerinize zarar verebilir. Bu, aynı ağa erişimlerinin olmayabileceği ve tavsiye mektuplarının aynı ağırlığı taşımayacağı anlamına gelir. Örneğin, denetim konusunda deneyimsizlik gerçekçi olmayan beklentilere yol açabilir. Ya da deneyimsiz bir danışman, ikinizin birlikte yazacağı harika yayınlarla hızla ün kazanarak ve tavsiye mektupları yazarken herkesin hafızasında taze olarak kalarak kariyeriniz için çok iyi olabilir. Sizinle çalışmaya bolca zaman ayırabilirler. Deneyimli bir danışman, hiç orada olmamakla kariyerinize zarar verebilir. Zaten bir isim yapmış olabilirler, doktora öğrencilerinden son derece yüksek beklentileri olabilir, onları aşırı strese sokacak ve bırakmalarına neden olacak düzeyde olabilir. Ya da doktora öğrencilerine olabildiğince adanmış, onları diğer görevlerin çoğundan önceliklendiren, doktora öğrencilerinden gerçekçi beklentileri olan ve tavsiye mektupları yazarken büyük etkiye sahip oldukları için kariyeriniz için çok iyi olabilirler. Sonuç olarak: Deneyimli bir danışman, deneyimsiz bir danışmandan sizin için daha iyi olabilir, ancak bu kesinlikle böyle olmak zorunda değildir. Ve unutmayın: Çok iyi/ünlü bir bilim insanı her zaman çok iyi bir doktora danışmanı değildir.
38
Is there a phrase that means "too important" and "attracting too much attention"?
"Çok önemli" ve "çok fazla dikkat çeken" anlamına gelen bir deyim var mı?
There is the term "overdominant": From Collins dictionary: >overdominant [adjective] excessively dominant To begin with, the design aspect is the most striking and arguably remains overdominant. [Times, Sunday Times (2010)] Here is an example: > [Steps must be taken to prevent any one] religious or ethnic group being overdominant. Otherwise, we will see a repeat of the unfortunate history of much of the 20th Century... Other possible terms that have similar meaning include "overpowered", "obtrusive" and "preponderant".
"Aşırı baskın" terimi vardır: Collins sözlüğünden: >aşırı baskın [sıfat] aşırı derecede baskın Başlangıçta, tasarım yönü en çarpıcı olanıdır ve tartışmasız bir şekilde aşırı baskın olmaya devam etmektedir. [Times, Sunday Times (2010)] İşte bir örnek: >[Herhangi bir] dini veya etnik grubun aşırı baskın olmasını önlemek için adımlar atılmalıdır. Aksi takdirde, 20. Yüzyılın büyük bir bölümünün talihsiz tarihinin bir tekrarını göreceğiz... Benzer anlama sahip diğer olası terimler arasında "güçlü", "müdahaleci" ve "ağırlıklı" sayılabilir.
39
This guy claims that Olympic powerlifters working in the 1-6 rep range can increase strength without increasing muscle size. > Trained Olympic lifters, for example, were shown over a two-year period to have significant strength increases with barely noticeable increases in muscle mass (Hakkinen et al, 1988). I had a similar experience when I used AST's Max-OT principals. My strength went up like crazy, but I gained very little size. Obviously, traditional strength training with low volume and low sets (1-6 reps, 3 or less sets) is not the best approach. Strength training does cause hypertrophy (Hakkinen et al, 1985), but it won't cause maximum hypertrophy. What is the scientific explanation for this? Is the inverse true? That is, can a buff guy (with lots of prominent muscle) actually be weak?
Bu adam, 1-6 tekrar aralığında çalışan Olimpik güç kaldırıcıların kas kütlesini artırmadan güçlerini artırabileceğini iddia ediyor. > Örneğin, eğitimli Olimpik haltercilerin iki yıllık bir süre boyunca kas kütlesinde neredeyse fark edilebilir artışlar olmaksızın önemli güç artışları gösterdiği gösterildi (Hakkinen ve ark., 1988). AST'nin Max-OT ilkelerini kullandığımda benzer bir deneyim yaşadım. Gücüm çılgınlar gibi arttı ama çok az boyut kazandım. Açıkçası, düşük hacimli ve düşük setli (1-6 tekrar, 3 veya daha az set) geleneksel güç antrenmanı en iyi yaklaşım değildir. Güç antrenmanı hipertrofiye neden olur (Hakkinen ve ark., 1985), ancak maksimum hipertrofiye neden olmaz. Bunun bilimsel açıklaması nedir? Tersi doğru mu? Yani, kaslı bir adam (çok belirgin kaslara sahip) aslında zayıf olabilir mi?
Certainly there is a correlation between muscle mass and strength, but there is more to the story. Two reasons why muscle mass and strength may not be completely congruous are: * Muscle fiber density * Muscle utilization Density: Your muscles are composed of four different types of fibers (slow-twitch, and three forms of fast-twitch). These fibers have different profiles in terms of force applied and recovery time. Slow twitch fibers, for example, recover quickly but have less force as there are fewer muscle fibers per bundle, compared with the fast-twitch fibers. Extra water in the form of glycogen can also cause muscles to take up more volume with the same amount of actual muscle. This glycogen can be a ready source of energy for the muscles, but isn't going to increase their maximum theoretical force for a single heavy lift (per Olympic competition) where endurance through a long set isn't at issue. Utilization: The average person is able to utilize 20-30% of their total theoretical muscle strength when trying their hardest. (Ref. Tsatsouline, Power To The People) Top lifters use perhaps 50% of their theoretical strength. Olympic and powerlifting-style training focuses on training the neural pathways to utilize a greater percentage of the available muscle mass. Since muscle fibers contract all internal cells (the all-or-nothing principal), this training is focused on convincing a greater proportion of fiber bundles to contract during a lift. Can a buff guy be weak? Well, it depends on your definition of buff. A cut guy can be weak (compared to a strength athlete), because muscle definition is more about having low body fat covering the muscle than it is about having large muscles. A bodybuilder with decent volume won't be able to lift as much as a comparable powerlifter because he/she doesn't train for strength per se. It seems worth noting that Olympic/power lifters also want to minimize their size (except for the heavyweights) because it affects their weight class in competition, so there is an added incentive to train for neural utilization over additional muscle mass.
Elbette kas kütlesi ve güç arasında bir korelasyon vardır, ancak hikaye bundan ibaret değildir. Kas kütlesi ve gücün tamamen örtüşmemesinin iki nedeni şunlardır: * Kas lifi yoğunluğu * Kas kullanımı Yoğunluk: Kaslarınız dört farklı lif türünden oluşur (yavaş kasılan ve üç hızlı kasılan form). Bu lifler, uygulanan kuvvet ve iyileşme süresi açısından farklı profillere sahiptir. Örneğin, yavaş kasılan lifler hızla iyileşir ancak hızlı kasılan liflerle karşılaştırıldığında demet başına daha az kas lifi olduğundan daha az kuvvete sahiptir. Glikojen formundaki ekstra su, kasların aynı miktarda gerçek kasla daha fazla hacim kaplamasına da neden olabilir. Bu glikojen, kaslar için hazır bir enerji kaynağı olabilir, ancak uzun bir set boyunca dayanıklılığın sorun olmadığı tek bir ağır kaldırma (Olimpiyat yarışması başına) için maksimum teorik kuvvetlerini artırmayacaktır. Kullanım: Ortalama bir kişi, elinden gelenin en iyisini yaparken toplam teorik kas gücünün %20-30'unu kullanabilir. (Ref. Tsatsouline, Power To The People) En iyi halterciler teorik güçlerinin belki de %50'sini kullanırlar. Olimpiyat ve güç kaldırma tarzı antrenman, mevcut kas kütlesinin daha büyük bir yüzdesini kullanmak için sinir yollarını eğitmeye odaklanır. Kas lifleri tüm iç hücreleri kasıldığından (ya hep ya hiç prensibi), bu eğitim, bir kaldırma sırasında daha fazla lif demetinin kasılmasını sağlamaya odaklanır. Kaslı bir adam zayıf olabilir mi? Bu, kaslı tanımınıza bağlıdır. Keskin bir adam zayıf olabilir (bir güç sporcusuna kıyasla), çünkü kas tanımlaması büyük kaslara sahip olmaktan çok kası kaplayan düşük vücut yağına sahip olmakla ilgilidir. İyi bir hacme sahip bir vücut geliştirmeci, güç için antrenman yapmadığı için karşılaştırılabilir bir güç kaldırıcı kadar kaldıramaz. Olimpiyat/güç kaldırıcıların da (ağır sikletler hariç) boyutlarını en aza indirmek istediklerini belirtmekte fayda var çünkü bu, yarışmadaki kilo sınıflarını etkiliyor, bu nedenle ek kas kütlesi yerine sinirsel kullanım için antrenman yapmanın ek bir teşviki var.
40
What are the major concerns about planting trees to create carbon offsets?
Karbon dengelemesi oluşturmak için ağaç dikmeyle ilgili temel endişeler nelerdir?
Here are some common concerns about using tree planting projects to create carbon offsets: * The scheme actually has a net positive effect, both in the short and long-term/ How effective a tree planting scheme is in capturing and storing carbon dioxide, is for a large part determined by what happens to the trees after they are planted. When trees mature and are harvested for wood that's used in construction, then the captured carbon dioxide is stored for a long time (until the wood decomposes or is burned). However, if no trees are replanted after harvesting this will have had a one-time effect only. Also when wood is burned (for energy or in a wild fire), or if trees die quickly and decompose, then their captured carbon is released again. Of course all trees die eventually even when they are not harvested, this is part of the natural cycle, but a mature forest can store a lot more carbon than a young, newly-planted forest so it's important to keep a forest intact as much as possible. * The wrong type(s) of trees are planted in the wrong location. In the past there were bad offsetting schemes that planted non-native trees, or planted trees in a location where they would change water flows and thus change local ecosystems in a negative way. Some offsetting schemes planted thousands of trees of the same species, resulting in a large monoculture. Such a monoculture hinders biodiversity, is susceptible to diseases and can even damage local communities. There have also been reports that planting trees above a certain latitude can have a net warming effect by changing the albedo and trapping heat. * Buying offsets reduces the incentive for people to reduce their emissions. Reducing emissions is much more effective than offsetting. Buying carbon offsets can lead to people thinking they are doing the right thing, whereas they had better spent their time and effort in reducing their emissions. Of course this point goes for all offsetting-schemes and is not specifically for planting trees. * There are more effective ways of reducing carbon emissions than planting trees. Nowadays many offsetting schemes invest in development of renewable energy sources (in developing countries) instead of planting trees, simply because it is a more effective and cheaper way to reduce emissions.
İşte ağaç dikme projelerini karbon dengelemesi oluşturmak için kullanma konusunda bazı yaygın endişeler: * Planın kısa ve uzun vadede net bir olumlu etkisi var. Bir ağaç dikme planının karbondioksiti yakalama ve depolamada ne kadar etkili olduğu, büyük ölçüde ağaçların dikildikten sonra ne olduğuna bağlıdır. Ağaçlar olgunlaştığında ve inşaatta kullanılan kereste için hasat edildiğinde, yakalanan karbondioksit uzun bir süre depolanır (ahşap çürüyene veya yanana kadar). Ancak hasattan sonra ağaçlar yeniden dikilmezse bunun yalnızca bir kerelik bir etkisi olacaktır. Ayrıca ahşap yakıldığında (enerji için veya orman yangınında) veya ağaçlar hızla ölür ve çürürse, yakaladıkları karbon tekrar salınır. Elbette tüm ağaçlar hasat edilmeseler bile sonunda ölür, bu doğal döngünün bir parçasıdır, ancak olgun bir orman, yeni dikilmiş genç bir ormandan çok daha fazla karbon depolayabilir, bu nedenle bir ormanı mümkün olduğunca sağlam tutmak önemlidir. * Yanlış türde ağaçlar yanlış yere dikiliyor. Geçmişte, yerel olmayan ağaçlar diken veya ağaçları su akışlarını değiştirecekleri ve böylece yerel ekosistemleri olumsuz yönde değiştirecekleri bir yere diken kötü dengeleme planları vardı. Bazı dengeleme planları, aynı türden binlerce ağaç dikerek büyük bir monokültürle sonuçlandı. Böyle bir monokültür biyolojik çeşitliliği engeller, hastalıklara karşı hassastır ve hatta yerel topluluklara zarar verebilir. Belirli bir enlemin üzerinde ağaç dikmenin albedo'yu değiştirerek ve ısıyı hapsederek net bir ısınma etkisine sahip olabileceğine dair raporlar da var. * Dengeleme satın almak, insanların emisyonlarını azaltma teşvikini azaltır. Emisyonları azaltmak, dengelemeden çok daha etkilidir. Karbon dengelemesi satın almak, insanların doğru şeyi yaptıklarını düşünmelerine neden olabilir, oysa zamanlarını ve çabalarını emisyonlarını azaltmaya harcamaları daha iyi olur. Elbette bu nokta tüm dengeleme planları için geçerlidir ve özellikle ağaç dikmek için değildir. * Karbon emisyonlarını azaltmanın ağaç dikmekten daha etkili yolları var. Günümüzde birçok dengeleme planı, emisyonları azaltmanın daha etkili ve ucuz bir yolu olduğu için ağaç dikmek yerine (gelişmekte olan ülkelerde) yenilenebilir enerji kaynaklarının geliştirilmesine yatırım yapıyor.
41
I am wondering how to generate uniformly distributed points on the surface of the 3-d unit sphere? Also after generating those points, what is the best way to visualize and check whether they are truly uniform on the surface $x^2+y^2+z^2=1$?
3 boyutlu birim kürenin yüzeyinde düzgün dağılmış noktaların nasıl oluşturulacağını merak ediyorum. Ayrıca bu noktaları oluşturduktan sonra, $x^2+y^2+z^2=1$ yüzeyinde gerçekten düzgün olup olmadıklarını görselleştirmenin ve kontrol etmenin en iyi yolu nedir?
A standard method is to generate three standard normals and construct a unit vector from them. That is, when $X_i \sim N(0,1)$ and $\lambda^2 = X_1^2 + X_2^2 + X_3^2$, then $(X_1/\lambda, X_2/\lambda, X_3/\lambda)$ is uniformly distributed on the sphere. This method works well for $d$-dimensional spheres, too. In 3D you can use rejection sampling: draw $X_i$ from a uniform$[-1,1]$ distribution until the length of $(X_1, X_2, X_3)$ is less than or equal to 1, then--just as with the preceding method--normalize the vector to unit length. The expected number of trials per spherical point equals $2^3/(4 \pi / 3)$ = 1.91. In higher dimensions the expected number of trials gets so large this rapidly becomes impracticable. There are many ways to check uniformity. A neat way, although somewhat computationally intensive, is with Ripley's K function. The expected number of points within (3D Euclidean) distance $\rho$ of any location on the sphere is proportional to the area of the sphere within distance $\rho$, which equals $\pi\rho^2$. By computing all interpoint distances you can compare the data to this ideal. General principles of constructing statistical graphics suggest a good way to make the comparison is to plot variance-stabilized residuals $e_i(d_{[i]} - e_i)$ against $i = 1, 2, \ldots, n(n-1)/2=m$ where $d_{[i]}$ is the $i^\text{th}$ smallest of the mutual distances and $e_i = 2\sqrt{i/m}$. The plot should be close to zero.
Standart bir yöntem üç standart normal üretmek ve bunlardan bir birim vektör oluşturmaktır. Yani, $X_i \sim N(0,1)$ ve $\lambda^2 = X_1^2 + X_2^2 + X_3^2$ olduğunda, $(X_1/\lambda, X_2/\lambda, X_3/\lambda)$ küre üzerinde düzgün olarak dağıtılır. Bu yöntem $d$ boyutlu küreler için de iyi çalışır. 3B'de reddetme örneklemesi kullanabilirsiniz: $(X_1, X_2, X_3)$'ün uzunluğu 1'den küçük veya ona eşit olana kadar $X_i$'yi uniform$[-1,1]$ dağılımından çizin, ardından -tıpkı önceki yöntemde olduğu gibi- vektörü birim uzunluğa normalleştirin. Küresel nokta başına beklenen deneme sayısı $2^3/(4 \pi / 3)$ = 1,91'e eşittir. Daha yüksek boyutlarda beklenen deneme sayısı o kadar büyük olur ki bu hızla uygulanamaz hale gelir. Tekdüzeliği kontrol etmenin birçok yolu vardır. Hesaplama açısından biraz yoğun olsa da düzgün bir yol Ripley'nin K fonksiyonudur. Küre üzerinde herhangi bir konumdan (3B Öklid) mesafe $\rho$ içindeki beklenen nokta sayısı, mesafe $\rho$ içindeki kürenin alanıyla orantılıdır ve bu da $\pi\rho^2$'ye eşittir. Tüm nokta arası mesafeleri hesaplayarak verileri bu ideal ile karşılaştırabilirsiniz. İstatistiksel grafikler oluşturmanın genel ilkeleri, karşılaştırmayı yapmanın iyi bir yolunun varyans sabitlenmiş artıklar $e_i(d_{[i]} - e_i)$'yi $i = 1, 2, \ldots, n(n-1)/2=m$ için çizmek olduğunu gösterir, burada $d_{[i]}$ karşılıklı mesafelerin $i^\text{th}$ en küçüğüdür ve $e_i = 2\sqrt{i/m}$'dir. Grafik sıfıra yakın olmalıdır.
42
In Shutter Island, at the end of the movie Teddy had a chat with Chuck, in that scene Teddy told to Chuck as, Which would be worse: To live as a monster, or to die as a good man? What's the implicit meaning of this dialogue? Who's the monster as Teddy mentioned? And, who's a good man?
Shutter Island filminde filmin sonunda Teddy, Chuck ile bir sohbet eder ve o sahnede Teddy, Chuck'a şöyle der: Hangisi daha kötü olurdu: Canavar olarak yaşamak mı yoksa iyi bir adam olarak ölmek mi? Bu diyaloğun örtük anlamı nedir? Teddy'nin bahsettiği canavar kimdir? Ve iyi adam kimdir?
To Live as a Monster If he accepts his guilt and becomes sane he will become the Monster. His delusions are his brains way of removing this guilt and hiding the fact that he ignored his family, did not act on his wife's mental illness, allowed her to murder their children and then murdered her. By accepting what the doctors are telling him he will need to go on living in the knowledge that he allowed terrible things to happen and did terrible things. The doctors will be able to treat him without a lobotomy but he will be fully aware of the crimes he committed. To die as a good man In his delusion he is a good man. He truly believes that he is on the side of law and order and that he is doing right. If he chooses to continue to believe this he will be lobotomised and will no longer have relevant brain function to question what he did or did not do. The death is not literal as the other answer suggests. It is about the fact that if he continues to believe he is this good man he will be lobotomised and effectively "die" believing in this. He will not die in a literal sense until later, but he will do so in the belief he was a good man. What is most exciting and cathartic about this decision is that this appears to be a moment of lucidity where he understands what has happened and is not in thrall of his delusions. He at this point of lucidity makes the decision that he can not live with his crimes and would prefer to lie to his doctor as he knows this will result in his lobotomy. By making the statement to his doctor he makes him aware of this also and by virtue of this you could also argue that he is being a good man by electing to be punished as well as the belief in his delusion that he is good.
Canavar Olarak Yaşamak Suçunu kabul eder ve aklı başına gelirse Canavar olacaktır. Yanılsamaları, beyninin bu suçluluk duygusunu ortadan kaldırma ve ailesini görmezden geldiği, eşinin akıl hastalığına müdahale etmediği, çocuklarını öldürmesine izin verdiği ve sonra da onu öldürdüğü gerçeğini gizleme yoludur. Doktorların söylediklerini kabul ederek, korkunç şeylerin olmasına izin verdiği ve korkunç şeyler yaptığı bilinciyle yaşamaya devam etmesi gerekecektir. Doktorlar onu lobotomi yapmadan tedavi edebileceklerdir ancak işlediği suçların tamamen farkında olacaktır. İyi Bir Adam Olarak Ölmek Yanılsamasında iyi bir adamdır. Gerçekten de kanun ve düzenin yanında olduğuna ve doğru olanı yaptığını düşünmektedir. Buna inanmaya devam etmeyi seçerse lobotomi yapılacak ve yaptıklarını veya yapmadıklarını sorgulayacak ilgili beyin fonksiyonlarına sahip olmayacaktır. Diğer cevabın öne sürdüğü gibi ölüm gerçek değildir. Eğer iyi bir adam olduğuna inanmaya devam ederse lobotomi yapılacak ve buna inanarak etkili bir şekilde "öleceği" gerçeğiyle ilgilidir. Gerçek anlamda daha sonra ölecektir ancak iyi bir adam olduğuna inanarak ölecektir. Bu kararla ilgili en heyecan verici ve arındırıcı olan şey, bunun olanları anladığı ve yanılsamalarının esiri olmadığı bir berraklık anı gibi görünmesidir. Bu berraklık noktasında suçlarıyla yaşayamayacağına karar verir ve doktoruna yalan söylemeyi tercih eder çünkü bunun lobotomiyle sonuçlanacağını bilir. Doktoruna açıklama yaparak onu da bundan haberdar eder ve bu nedenle iyi bir adam olduğuna dair yanılsamasına inanmasının yanı sıra cezalandırılmayı seçerek de iyi bir adam olduğunu savunabilirsiniz.
43
To set the minimal distance between flexbox items I'm using ```margin: 0 5px``` on ```.item``` and ```margin: 0 -5px``` on container. For me it seems like a hack, but I can't find any better way to do this. ```#box { display: flex; width: 100px; margin: 0 -5px; } .item { background: gray; width: 50px; height: 50px; margin: 0 5px; }``` ``` ```
Flexbox öğeleri arasındaki minimum mesafeyi ayarlamak için ```.item``` üzerinde ```margin: 0 5px``` ve kapsayıcı üzerinde ```margin: 0 -5px``` kullanıyorum. Bana bir hile gibi görünüyor, ancak bunu yapmanın daha iyi bir yolunu bulamıyorum. ```#box { display: flex; width: 100px; margin: 0 -5px; } .item { background: gray; width: 50px; height: 50px; margin: 0 5px; }```
This solution will work for all cases even if there are multiple rows or any number of elements. But the count of the section should be same you want 4 in first row and 3 is second row it won't work that way the space for the 4th content will be blank the container won't fill. We are using ```display: grid;``` and its properties. ```#box { display: grid; width: 100px; grid-gap: 5px; /* Space between items */ grid-template-columns: repeat(4,1fr); /* Decide the number of columns(4) and size(1fr | 1 Fraction | you can use pixels and other values also) */ } .item { background: gray; width: 100%; /* width is not necessary only added this to understand that width works as 100% to the grid template allocated space **DEFAULT WIDTH WILL BE 100%** */ height: 50px; }``` ``` ``` The Downside of this method is in Mobile Opera Mini will not be supported and in PC this works only after IE10. Note for complete browser compatability including IE11 please use Autoprefixer OLD ANSWER Don't think of it as an old solution, it's still one of the best if you only want single row of elements and it will work with all the browsers. This method is used by CSS sibling combination, so you can manipulate it many other ways also, but if your combination is wrong it may cause issues also. ```.item+.item{ margin-left: 5px; } ``` The below code will do the trick. In this method, there is no need to give ```margin: 0 -5px;``` to the ```#box``` wrapper. A working sample for you: ```#box { display: flex; width: 100px; } .item { background: gray; width: 22px; height: 50px; } .item+.item{ margin-left: 5px; }``` ``` ```
Bu çözüm, birden fazla satır veya herhangi bir sayıda öğe olsa bile tüm durumlar için çalışır. Ancak bölüm sayısı aynı olmalıdır, ilk satırda 4 ve ikinci satırda 3 istiyorsanız bu şekilde çalışmaz, 4. içerik için boşluk boş kalır ve kapsayıcı dolmaz. ```display: grid;``` ve özelliklerini kullanıyoruz. ```#box { display: grid; width: 100px; grid-gap: 5px; /* Öğeler arasındaki boşluk */ grid-template-columns: repeat(4,1fr); /* Sütun sayısına (4) ve boyuta (1fr | 1 Kesir | piksel ve diğer değerleri de kullanabilirsiniz) karar verin */ } .item { background: gray; width: 100%; /* genişlik gerekli değildir, yalnızca genişliğin ızgara şablonuna ayrılan alana %100 olarak çalıştığını anlamak için eklenmiştir **STANDART GENİŞLİK %100 OLACAKTIR** */ height: 50px; }``` ``` ``` Bu yöntemin dezavantajı, Mobil Opera Mini'de desteklenmemesidir ve PC'de yalnızca IE10'dan sonra çalışır. IE11 dahil olmak üzere tam tarayıcı uyumluluğu için lütfen Autoprefixer'ı kullanın ESKİ CEVAP Bunu eski bir çözüm olarak düşünmeyin, yalnızca tek bir öğe satırı istiyorsanız hala en iyilerden biridir ve tüm tarayıcılarla çalışır. Bu yöntem CSS kardeş kombinasyonu tarafından kullanılır, bu nedenle onu başka birçok şekilde de değiştirebilirsiniz, ancak kombinasyonunuz yanlışsa sorunlara da neden olabilir. ```.item+.item{ margin-left: 5px; } ``` Aşağıdaki kod işe yarayacaktır. Bu yöntemde ```#box``` sarmalayıcıya ```margin: 0 -5px;``` verilmesine gerek yoktur. Sizin için çalışan bir örnek: ```#box { display: flex; width: 100px; } .item { background: gray; width: 22px; height: 50px; } .item+.item{ margin-left: 5px; }``` ``` ```
44
Is there a Git for data? The key improvement I'd want is to Diff/Merge more intelligently. e.g. in CSV rather than line vs line comparison, it would do cell vs cell. And ordering is usually not significant, e.g. rows in a CSV, whereas Git does care and presents the user with 'conflicts'.
Veriler için bir Git var mı? İstediğim en önemli geliştirme, daha akıllıca Farklılaştırma/Birleştirme yapmaktır. Örneğin, satır satır karşılaştırma yerine CSV'de hücre hücre karşılaştırma yapar. Ve sıralama genellikle önemli değildir, örneğin bir CSV'deki satırlar, Git ise önem verir ve kullanıcıya 'çatışmalar' sunar.
Please note that ```git``` has two configuration commands: ```git config filter..clean git config filter..smudge ``` The ```clean``` filter can be used e.g. to sort all records in a CSV file except the top row, thus making re-ordering irrelevant. Quoting ```gitattributes(5)``` : A filter driver consists of a clean command and a smudge command, either of which can be left unspecified. Upon checkout, when the smudge command is specified, the command is fed the blob object from its standard input, and its standard output is used to update the worktree file. Similarly, the clean command is used to convert the contents of worktree file upon checkin. A missing filter driver definition in the config is not an error but makes the filter a no-op passthru. The content filtering is done to massage the content into a shape that is more convenient for the platform, filesystem, and the user to use. The key phrase here is &quot;more convenient&quot; and not &quot;turning something unusable into usable&quot;. In other words, the intent is that if someone unsets the filter driver definition, or does not have the appropriate filter program, the project should still be usable.
Lütfen ```git```'in iki yapılandırma komutu olduğunu unutmayın: ```git config filter..clean git config filter..smudge ``` ```clean``` filtresi, örneğin bir CSV dosyasındaki tüm kayıtları en üst satır hariç sıralamak için kullanılabilir, böylece yeniden sıralama önemsiz hale gelir. ```gitattributes(5)```'ten alıntı: Bir filtre sürücüsü, her ikisi de belirtilmemiş bırakılabilen bir temizleme komutu ve bir bulaştırma komutundan oluşur. Ödeme sırasında, bulaştırma komutu belirtildiğinde, komuta standart girdisinden blob nesnesi beslenir ve standart çıktısı çalışma ağacı dosyasını güncellemek için kullanılır. Benzer şekilde, temizleme komutu, check-in sırasında çalışma ağacı dosyasının içeriğini dönüştürmek için kullanılır. Yapılandırmadaki eksik bir filtre sürücüsü tanımı bir hata değildir ancak filtreyi bir işlem geçirmeyen geçiş yapar. İçerik filtrelemesi, içeriği platform, dosya sistemi ve kullanıcı için kullanımı daha uygun bir şekle dönüştürmek için yapılır. Buradaki anahtar ifade "daha uygun"dur ve "kullanılamaz bir şeyi kullanılabilir hale getirmek" değildir. Başka bir deyişle, amaç, birisi filtre sürücüsü tanımını ayarlarsa veya uygun filtre programına sahip değilse, projenin yine de kullanılabilir olmasıdır.
45
I have been puzzling over where to put the submit button, on the left or the right. In researching, I noticed that many sites put buttons on the bottom right in dialogue boxes, and on the bottom left in forms. It makes sense: in a dialogue box it seems to denote finality, being in the endpoint of the window for left–right readers; in a form, the bottom right could be in a different position relative to the rest of the form if the window is resized. It seems to be a convention, but should the OK/Cancel buttons be aligned right or centered? Should the OK/Cancel buttons be aligned right or centered?
Gönder düğmesinin nereye konulacağı konusunda, sola mı yoksa sağa mı, kafam karıştı. Araştırma yaparken, birçok sitenin iletişim kutularında düğmeleri sağ alta, formlarda ise sol alta koyduğunu fark ettim. Bu mantıklı: Bir iletişim kutusunda, sol-sağ okuyucular için pencerenin bitiş noktasında olduğu için kesinliği ifade ediyor gibi görünüyor; bir formda, pencere yeniden boyutlandırılırsa sağ alt, formun geri kalanına göre farklı bir konumda olabilir. Bir gelenek gibi görünüyor, ancak Tamam/İptal düğmeleri sağa mı yoksa ortaya mı hizalanmalı? Tamam/İptal düğmeleri sağa mı yoksa ortaya mı hizalanmalı?
Where to put the submit button should be decided in order to meet user expectations, it was best to put the button in the place that users expect to find it in the context of the form or dialogue they are using and with regard to the window size. Forms tend to be left justified while the browser window can leave a ton of white space to fill up a large monitor (especially in full-screen mode). Since the users' eyes never leave the left portion of the window, we place the button on the bottom left. This is especially important for forms that use the field name above the field, with most fields lying flush left on the form (as opposed to fields to the right of their names). Small Dialogue & Modal Windows are fixed width and tend to be small. Most contain simple phrases or questions, read right to left: having a button on the bottom right feels like both the most progressive position and the final resting place for the eye. Were the modal window large enough to contain a long form, we would probably follow the first principal for forms. In the end, the heuristic is this: * Large Windows & Forms get the button on the bottom left. * Small Windows & Dialogues get the button on the bottom right. Note the buttons on stackexchange sites: * Post Your Answer button at the bottom-left of the longer form * Add Comment button to the right of a small field Furthermore, with mobile-first responsive being the new law of the land, the button placement varies even more based on context and user expectation. Sometimes, it's in the middle, too! We're now starting to just put buttons on the left for even small forms if they're inline … and more forms are showing up inline through javascript.
Gönder düğmesinin nereye konulacağına, kullanıcı beklentilerini karşılamak için karar verilmelidir, düğmeyi kullanıcıların form veya kullandıkları diyalog bağlamında bulmayı bekledikleri yere ve pencere boyutuna göre koymak en iyisidir. Formlar genellikle sola yaslı olma eğilimindeyken, tarayıcı penceresi büyük bir monitörü doldurmak için bir ton boşluk bırakabilir (özellikle tam ekran modunda). Kullanıcıların gözleri pencerenin sol kısmından hiç ayrılmadığından, düğmeyi sol alta yerleştiriyoruz. Bu, alan adını alanın üzerinde kullanan ve çoğu alanın formda sola yaslı olduğu formlar için özellikle önemlidir (adlarının sağındaki alanların aksine). Küçük Diyalog ve Modal Pencereler sabit genişliktedir ve küçük olma eğilimindedir. Çoğu basit ifadeler veya sorular içerir, sağdan sola okunur: alt sağda bir düğme olması hem en ilerici konum hem de göz için son dinlenme yeri gibi hissettirir. Modal pencere uzun bir form içerecek kadar büyük olsaydı, muhtemelen formlar için ilk ilkeyi izlerdik. Sonuçta, sezgisel yöntem şudur: * Büyük Pencereler ve Formlar düğmeyi sol alta alır. * Küçük Pencereler ve Diyaloglar düğmeyi sağ alta alır. Stackexchange sitelerindeki düğmelere dikkat edin: * Uzun formun sol altındaki Cevabınızı Gönder düğmesi * Küçük bir alanın sağındaki Yorum Ekle düğmesi Dahası, mobil öncelikli duyarlılığın ülkenin yeni yasası olmasıyla birlikte, düğme yerleşimi bağlama ve kullanıcı beklentisine göre daha da değişmektedir. Bazen ortada da olur! Artık küçük formlar için bile satır içi iseler düğmeleri sola koymaya başlıyoruz... ve daha fazla form javascript aracılığıyla satır içi olarak görünüyor.
46
Is it at all possible to update object's properties with ```setState```? Something like: ```this.state = { jasper: { name: 'jasper', age: 28 }, } ``` I have tried: ```this.setState({jasper.name: 'someOtherName'}); ``` and this: ```this.setState({jasper: {name: 'someothername'}}) ``` The first results in a syntax error and the second just does nothing. Any ideas?
Bir nesnenin özelliklerini ```setState``` ile güncellemek mümkün mü? Şuna benzer bir şey: ```this.state = { jasper: { name: 'jasper', age: 28 }, } ``` Şunları denedim: ```this.setState({jasper.name: 'someOtherName'}); ``` ve bunu: ```this.setState({jasper: {name: 'someothername'}}) ``` İlk deneme söz dizimi hatasıyla sonuçlandı ve ikinci deneme hiçbir şey yapmadı. Fikirleriniz neler?
There are multiple ways of doing this, since state update is a async operation, so to update the state object, we need to use updater function with ```setState```. 1- Simplest one: First create a copy of ```jasper``` then do the changes in that: ```this.setState(prevState => { let jasper = Object.assign({}, prevState.jasper); // creating copy of state variable jasper jasper.name = 'someothername'; // update the name property, assign a new value return { jasper }; // return new object jasper object }) ``` Instead of using ```Object.assign``` we can also write it like this: ```let jasper = { ...prevState.jasper }; ``` 2- Using spread syntax: ```this.setState(prevState => ({ jasper: { // object that we want to update ...prevState.jasper, // keep all other key-value pairs name: 'something' // update the value of specific key } })) ``` Note: ```Object.assign``` and ```Spread Operator``` creates only shallow copy, so if you have defined nested object or array of objects, you need a different approach. Updating nested state object: Assume you have defined state as: ```this.state = { food: { sandwich: { capsicum: true, crackers: true, mayonnaise: true }, pizza: { jalapeno: true, extraCheese: false } } } ``` To update extraCheese of pizza object: ```this.setState(prevState => ({ food: { ...prevState.food, // copy all other key-value pairs of food object pizza: { // specific object of food object ...prevState.food.pizza, // copy all pizza key-value pairs extraCheese: true // update value of specific key } } })) ``` Updating array of objects: Lets assume you have a todo app, and you are managing the data in this form: ```this.state = { todoItems: [ { name: 'Learn React Basics', status: 'pending' }, { name: 'Check Codebase', status: 'pending' } ] } ``` To update the status of any todo object, run a map on the array and check for some unique value of each object, in case of ```condition=true```, return the new object with updated value, else same object. ```let key = 2; this.setState(prevState => ({ todoItems: prevState.todoItems.map( el => el.key === key? { ...el, status: 'done' }: el ) })) ``` Suggestion: If object doesn't have a unique value, then use array index.
Bunu yapmanın birden fazla yolu vardır, çünkü durum güncellemesi bir async işlemdir, bu nedenle durum nesnesini güncellemek için ```setState``` ile güncelleyici işlevini kullanmamız gerekir. 1- En basit olanı: Önce ```jasper```'ın bir kopyasını oluşturun, ardından değişiklikleri orada yapın: ```this.setState(prevState => { let jasper = Object.assign({}, prevState.jasper); // durum değişkeni jasper'ın kopyasını oluşturma jasper.name = 'someothername'; // name özelliğini güncelleme, yeni bir değer atama return { jasper }; // yeni nesne jasper nesnesini döndürme }) ``` ```Object.assign``` kullanmak yerine bunu şu şekilde de yazabiliriz: ```let jasper = { ...prevState.jasper }; ``` 2- Yayılma söz dizimini kullanma: ```this.setState(prevState => ({ jasper: { // güncellemek istediğimiz nesne ...prevState.jasper, // diğer tüm anahtar-değer çiftlerini tutma name: 'something' // belirli bir anahtarın değerini güncelleme } })) ``` Not: ```Object.assign``` ve ```Yayılma İşleci``` yalnızca yüzeysel kopya oluşturur, bu nedenle iç içe geçmiş nesne veya nesne dizisi tanımladıysanız farklı bir yaklaşıma ihtiyacınız vardır. İç içe geçmiş durum nesnesini güncelleme: Durumu şu şekilde tanımladığınızı varsayalım: ```this.state = { food: { sandwich: { capsicum: true, crackers: true, mayonnaise: true }, pizza: { jalapeno: true, extraCheese: false } } } ``` Pizza nesnesinin extraCheese'ini güncellemek için: ```this.setState(prevState => ({ food: { ...prevState.food, // food nesnesinin diğer tüm anahtar-değer çiftlerini kopyalama pizza: { // food nesnesinin belirli nesnesi ...prevState.food.pizza, // tüm pizza anahtar-değer çiftlerini kopyalama extraCheese: true // belirli bir anahtarın değerini güncelleme } } })) ``` Nesne dizisini güncelleme: Bir todo uygulamanız olduğunu ve verileri şu biçimde yönettiğinizi varsayalım: ```this.state = { todoItems: [ { name: 'React Temellerini Öğren', status: 'bekliyor' }, { name: 'Kod Tabanını Kontrol Et', status: 'bekliyor' } ] } ``` Herhangi bir todo nesnesinin durumunu güncellemek için dizide bir eşleme çalıştırın ve her nesnenin benzersiz bir değerini kontrol edin, ```condition=true``` durumunda güncellenmiş değerle yeni nesneyi döndürün, aksi takdirde aynı nesneyi döndürün. ```let key = 2; this.setState(prevState => ({ todoItems: prevState.todoItems.map( el => el.key === key? { ...el, status: 'done' }: el ) })) ``` Öneri: Nesnenin benzersiz bir değeri yoksa dizi indeksini kullanın.
47
What is the difference between Non-Player Characters (NPCs) and bots in video games?
Video oyunlarındaki Oyuncu Olmayan Karakterler (NPC'ler) ile botlar arasındaki fark nedir?
The key distinction is that a Bot represents an automated player; an NPC, by contrast, isn't playing the game at all. In general, an NPC is a part of the game; a placed object which is designed by the creator and exists to interact with the player. Examples would include vendors, quest givers, or enemies. In some games, (particularly RPG's), the term is also used to refer to characters under the control of, but not generated by the player. They are often distinguished by having distinct personalities and dialog, whereas a ""Player Character"" is meant as more of an extension of the player themselves. Think of the companion party members in the Mass Effect series for an example. A Bot, by contrast, is essentially a player of the game controlled by a computer. This can be populated within a single instance, as a feature in some games (i.e. AI opponents in a normally multiplayer game), or, in some cases, actually represents a separate instance of the application running on a networked computer and being controlled by some manner of AI script (as is common in many MMO's, much to the dismay of the communities playing the game). The term 'Bot' is also often used to refer to software used to enhance or replace the skills of a human player of the game; for example, an 'Aim-Bot' that handles targeting, or a 'Farming Bot' in an MMO that performs tedious or menial tasks. Such bots are usually (though not always), considered cheating and a violation of the Terms of Service of the game in question.
Temel ayrım, bir Bot'un otomatik bir oyuncuyu temsil etmesidir; bir NPC ise oyunun hiçbir yerinde oynamaz. Genel olarak, bir NPC oyunun bir parçasıdır; yaratıcı tarafından tasarlanmış ve oyuncuyla etkileşime girmek için var olan yerleştirilmiş bir nesnedir. Örnekler arasında satıcılar, görev verenler veya düşmanlar sayılabilir. Bazı oyunlarda (özellikle RPG'lerde), terim aynı zamanda oyuncunun kontrolü altında olan ancak oyuncu tarafından oluşturulmayan karakterleri ifade etmek için de kullanılır. Genellikle belirgin kişilikleri ve diyalogları ile ayırt edilirler, oysa ""Oyuncu Karakteri"" oyuncunun kendisinin bir uzantısı olarak düşünülür. Örnek olarak Mass Effect serisindeki yoldaş parti üyelerini düşünün. Buna karşılık bir Bot, esasen bir bilgisayar tarafından kontrol edilen oyunun bir oyuncusudur. Bu, bazı oyunlarda bir özellik olarak tek bir örnek içinde doldurulabilir (yani normalde çok oyunculu bir oyundaki AI rakipleri) veya bazı durumlarda, ağa bağlı bir bilgisayarda çalışan ve bir tür AI komut dosyası tarafından kontrol edilen uygulamanın ayrı bir örneğini temsil eder (çoğu MMO'da olduğu gibi, oyunu oynayan toplulukların dehşetine). 'Bot' terimi aynı zamanda oyunun insan oyuncusunun becerilerini geliştirmek veya değiştirmek için kullanılan yazılımları ifade etmek için de kullanılır; örneğin, hedeflemeyi ele alan bir 'Aim-Bot' veya bir MMO'da sıkıcı veya basit görevleri yerine getiren bir 'Farming Bot'. Bu tür botlar genellikle (her zaman olmasa da) hile olarak kabul edilir ve söz konusu oyunun Hizmet Şartları'nın ihlalidir.
48
Is there anything like ```static class``` in java? What is the meaning of such a class. Do all the methods of the static class need to be ```static``` too? Is it required the other way round, that if a class contains all the static methods, shall the class be static too? What are static classes good for?
Java'da ```static class``` gibi bir şey var mı? Böyle bir sınıfın anlamı nedir? Statik sınıfın tüm yöntemlerinin de ```static``` olması gerekir mi? Bunun tersi de geçerli midir, yani bir sınıf tüm statik yöntemleri içeriyorsa, sınıf da statik olmalıdır? Statik sınıflar ne işe yarar?
Java has static nested classes but it sounds like you're looking for a top-level static class. Java has no way of making a top-level class static but you can simulate a static class like this: * Declare your class ```final``` - Prevents extension of the class since extending a static class makes no sense * Make the constructor ```private``` - Prevents instantiation by client code as it makes no sense to instantiate a static class * Make all the members and functions of the class ```static``` - Since the class cannot be instantiated no instance methods can be called or instance fields accessed * Note that the compiler will not prevent you from declaring an instance (non-static) member. The issue will only show up if you attempt to call the instance member Simple example per suggestions from above: ```public class TestMyStaticClass { public static void main(String []args){ MyStaticClass.setMyStaticMember(5); System.out.println("Static value: " + MyStaticClass.getMyStaticMember()); System.out.println("Value squared: " + MyStaticClass.squareMyStaticMember()); // MyStaticClass x = new MyStaticClass(); // results in compile time error } } // A top-level Java class mimicking static class behavior public final class MyStaticClass { private MyStaticClass () { // private constructor myStaticMember = 1; } private static int myStaticMember; public static void setMyStaticMember(int val) { myStaticMember = val; } public static int getMyStaticMember() { return myStaticMember; } public static int squareMyStaticMember() { return myStaticMember * myStaticMember; } } ``` What good are static classes? A good use of a static class is in defining one-off, utility and/or library classes where instantiation would not make sense. A great example is the Math class that contains some mathematical constants such as PI and E and simply provides mathematical calculations. Requiring instantiation in such a case would be unnecessary and confusing. See the ```Math``` class and source code. Notice that it is ```final``` and all of its members are ```static```. If Java allowed top-level classes to be declared ```static``` then the Math class would indeed be static.
Java'da statik iç içe geçmiş sınıflar vardır ancak en üst düzey statik bir sınıf arıyormuşsunuz gibi görünüyor. Java'da en üst düzey bir sınıfı statik yapmanın bir yolu yoktur ancak statik bir sınıfı şu şekilde simüle edebilirsiniz: * Sınıfınızı ```final``` olarak bildirin - Statik bir sınıfı genişletmek mantıklı olmadığından sınıfın genişletilmesini önler * Oluşturucuyu ```private``` yapın - Statik bir sınıfı örneklendirmek mantıklı olmadığından istemci kodu tarafından örneklendirmeyi önler * Sınıfın tüm üyelerini ve işlevlerini ```static``` yapın - Sınıf örneklendirilemediğinden hiçbir örnek yöntemi çağrılamaz veya örnek alanlarına erişilemez * Derleyicinin örnek (statik olmayan) bir üye bildirmenizi engellemeyeceğini unutmayın. Sorun yalnızca örnek üyeyi çağırmaya çalışırsanız ortaya çıkar Yukarıdaki önerilere göre basit bir örnek: ```public class TestMyStaticClass { public static void main(String []args){ MyStaticClass.setMyStaticMember(5); System.out.println("Statik değer: " + MyStaticClass.getMyStaticMember()); System.out.println("Karesi: " + MyStaticClass.squareMyStaticMember()); // MyStaticClass x = new MyStaticClass(); // derleme zamanı hatasına neden olur } } // Statik sınıf davranışını taklit eden en üst düzey bir Java sınıfı public final class MyStaticClass { private MyStaticClass () { // özel oluşturucu myStaticMember = 1; } private static int myStaticMember; public static void setMyStaticMember(int val) { myStaticMember = val; } public static int getMyStaticMember() { return myStaticMember; } public static int squareMyStaticMember() { return myStaticMember * myStaticMember; } } ``` Statik sınıflar ne işe yarar? Statik bir sınıfın iyi bir kullanımı, örneklendirmenin mantıklı olmayacağı tek seferlik yardımcı program ve/veya kitaplık sınıflarını tanımlamaktır. PI ve E gibi bazı matematiksel sabitleri içeren ve yalnızca matematiksel hesaplamalar sağlayan Math sınıfı harika bir örnektir. Böyle bir durumda örneklendirme gerektirmek gereksiz ve kafa karıştırıcı olacaktır. ```Math``` sınıfına ve kaynak koduna bakın. ```final``` olduğunu ve tüm üyelerinin ```static``` olduğunu unutmayın. Java, en üst düzey sınıfların ```static``` olarak bildirilmesine izin verseydi, Math sınıfı gerçekten statik olurdu.
49
The Episode IV-VI movies never mention the Emperor's name. In Episodes I-III, we can guess that Darth Sidious will be the emperor, but what about Chancellor Palpatine? If the audience didn't know that he was Sidious, the impact of the reveal would be far different than if they did. But I did. In all the novels and comics that came out after "Return of the Jedi", the Emperor's name was stated plainly: Palpatine. So when I saw the prologue movies, for the life of me I couldn't figure out: was I supposed to know that Palpatine was the villain? Maybe the filmmakers figured that most of the moviegoing public never got into the Expanded Universe. But they had to know that the hardcore fans would know. Or maybe when you watched the movie, even if you hadn't heard of Palpatine, it was supposed to be obvious? What was the intent?
IV-VI Bölümleri İmparator'un adından hiç bahsetmez. I-III Bölümlerinde Darth Sidious'un imparator olacağını tahmin edebiliriz, peki ya Şansölye Palpatine? İzleyiciler onun Sidious olduğunu bilmeseydi, ortaya çıkmasının etkisi bilselerdikinden çok daha farklı olurdu. Ama ben biliyordum. "Jedi'ın Dönüşü"nden sonra çıkan tüm roman ve çizgi romanlarda İmparator'un adı açıkça belirtilmişti: Palpatine. Bu yüzden önsöz filmlerini izlediğimde, hayatım boyunca anlayamadım: Palpatine'in kötü adam olduğunu bilmem mi gerekiyordu? Belki de film yapımcıları sinemaya giden halkın çoğunun Genişletilmiş Evrene hiç girmediğini düşünmüşlerdi. Ama sıkı hayranların bileceğini biliyor olmalılardı. Ya da belki filmi izlerken, Palpatine'i hiç duymamış olsanız bile, bunun açık olması gerekiyordu? Amaç neydi?
Palpatine's name was first given in the prologue to Alan Dean Foster's novelization of Star Wars (it was credited to Lucas, but he didn't write it), which came out in November 1976, six months before the May 25, 1977 release of the actual film. So Palpatine being the Emperor was literally known before the public ever saw a Star Wars movie. It was, in fact, one of the very first things people could find out about the Star Wars universe. The point of the films wasn't to conceal the fact Palpatine would end up the Emperor (or was Darth Sidious), it was to show that he was a masterful chessmaster who conned everyone, and that in large part it was the good guys responsible for his rise because of their own blindness. Amidala initiated the vote that removed his predecessor. Jar-Jar initiated the vote that gave him emergency powers. The Jedi Council allowed him to operate under their noses. Anakin never suspected he was being manipulated until too late, and so on. Just as the trilogy was meant as a tragedy showing Anakin Skywalker's rise and fall, it was an additional tragedy in that the person responsible for the whole mess was standing right there the entire time, in the case of the celebration at the end of The Phantom Menace quite literally.
Palpatine'in adı ilk olarak Alan Dean Foster'ın Star Wars romanının önsözünde verilmiştir (Lucas'a atfedilmiştir ancak o yazmamıştır) ve 25 Mayıs 1977'de filmin gerçek çıkışından altı ay önce, Kasım 1976'da yayınlanmıştır. Yani Palpatine'in İmparator olduğu, halk bir Star Wars filmi görmeden önce biliniyordu. Aslında, insanların Star Wars evreni hakkında öğrenebilecekleri ilk şeylerden biriydi. Filmlerin amacı, Palpatine'in İmparator olacağı (veya Darth Sidious olduğu) gerçeğini gizlemek değil, herkesi kandıran usta bir satranç ustası olduğunu ve büyük ölçüde kendi körlükleri nedeniyle yükselişinden sorumlu olanların iyi adamlar olduğunu göstermekti. Amidala, selefini görevden alan oylamayı başlattı. Jar-Jar, ona olağanüstü yetkiler veren oylamayı başlattı. Jedi Konseyi, onun burunlarının dibinde faaliyet göstermesine izin verdi. Anakin, çok geç olana kadar manipüle edildiğinden şüphelenmedi vb. Üçlemenin Anakin Skywalker'ın yükselişini ve düşüşünü gösteren bir trajedi olarak tasarlandığı gibi, tüm karmaşadan sorumlu kişinin tüm zaman boyunca orada durması, The Phantom Menace'in sonundaki kutlamada tam anlamıyla bir trajediydi.
50
So, students in Gryffindor are supposed to represent bravery. How does Neville represent bravery, to the point in being accepted into the house. I've always thought of his strongest traits being things like loyalty, willingness to work hard, etc, and these things would tend to put him in Hufflepuff.
Yani, Gryffindor'daki öğrencilerin cesareti temsil etmesi gerekiyor. Neville, eve kabul edilecek kadar cesareti nasıl temsil ediyor? Onun en güçlü özelliklerinin sadakat, sıkı çalışma isteği gibi şeyler olduğunu ve bu şeylerin onu Hufflepuff'a koyma eğiliminde olacağını her zaman düşünmüşümdür.
First of all, in the first 4 years, it isn't really shown that Neville is NOT brave - the only thing he's really afraid of is his Grandmother and maybe Snape during Potions. With good reason. :) You may be confusing a lack of confidence/assertiveness with not being brave, but they are not the same (for a good in-universe illustration of the opposite, think Prof. Lockhart). First four books, he's clumsy, and is not yet showing any magical talent. Starting with the fifth year, Neville is shown to have been changed, and repeatedly proves his bravery and willingness to fight. NOTE: He first shows bravery in the First Year (see System's great answer for details), but the real Gryffindor-y Neville emerges in the Fifth year. There's another instance of him showing a Gryffindor quality - more specifically, integrity. He argued with the Hat to sort him into Hufflepuff (src: Pottermore), because he felt he wasn't brave enough to be a Gryffindor. Fifth year * He joins DA * He shows marked and significant improvement in his magical abilities while in DA * He voluntarily joins the DA members who accompany Harry to Ministry of Magic battle in the end of OoP, even arguing with Harry about it: Neville: &quot;We were all in the D.A. together. It was all supposed to be about fighting You-Know-Who, wasn't it? And this is the first chance we've had to do something real — or was that all just a game or something?&quot; Harry: &quot;No — of course it wasn't —&quot; Neville: &quot;Then we should come too. We want to help.&quot; * During the battle at the Ministry, he refused to leave as per Harry's suggestion after Dolohov broke Neville's nose and wand. * When being threatened and tortured by Death Eaters, he told Harry not to give them the Prophecy Sixth year * participated in the Battle of the Astronomy Tower. Along with Luna Lovegood, he was the only member of Dumbledore's Army to reply to the summons via the coins. Seventh year * Neville got in trouble with the Carrows for refusing to practise the Cruciatus Curse on other students as a method of punishment, as well as for standing up against their bigotry and cruelty. * along with Ginny and Luna, restarted Dumbledore's Army. * attempted to steal Godric Gryffindor's Sword from Snape's office * Neville was eventually left alone to lead the rebellion efforts (Luna and Ginny were not in Hogwarts anymore). When avoiding the Death Eaters at one point, Neville stumbled into the Room of Requirement, which he was able to turn into a hiding place for the D.A., and to connect to the Hog's Head in order to get food from Aberforth Dumbledore. By May, most of the D.A. had taken to living there. * During the first round of battle, Neville used various plants to attack Death Eaters, and helped transport the injured and dead when a temporary cease-fire was called. * When the Death Eaters approached with a &quot;dead&quot; Harry, Neville stood up in defiance of Voldemort. He was subsequently forced to wear the Sorting Hat as it burned because he refused to join Voldemort. Fortunately, due to Harry's sacrifice, Neville was able to shrug off the Full Body-Bind Curse. * Because of his tremendous bravery shown on the battlefield, Neville was able to pull Godric Gryffindor's Sword from the burning hat, in the process proving himself a true Gryffindor, something that was doubted constantly throughout due to his apparently weak-willed, shy, and bumbling nature. In a single stroke, he killed Nagini, destroying Voldemort's last remaining Horcrux. * Neville subsequently teamed up with Ron Weasley as the defenders of Hogwarts and Death Eaters were forced into the Great Hall and defeated Fenrir Greyback. All in all, pretty convincing evidence of someone's bravery.
Her şeyden önce, ilk 4 yılda Neville'in cesur OLMADIĞI gerçekten gösterilmiyor - gerçekten korktuğu tek şey büyükannesi ve belki de İksir dersinde Snape. İyi bir sebeple. :) Kendine güven eksikliğini/iddialı olmamayı cesur olmamakla karıştırıyor olabilirsiniz, ancak bunlar aynı şey değildir (evrende bunun tam tersine iyi bir örnek için Profesör Lockhart'ı düşünün). İlk dört kitapta sakardır ve henüz herhangi bir büyülü yetenek göstermemektedir. Beşinci yıldan itibaren Neville'in değiştiği gösterilir ve cesaretini ve savaşma isteğini defalarca kanıtlar. NOT: İlk Yılda ilk cesaretini gösterir (ayrıntılar için Sistemin harika cevabına bakın), ancak gerçek Gryffindor-vari Neville Beşinci yılda ortaya çıkar. Gryffindor niteliği gösterdiği başka bir örnek daha var - daha spesifik olarak bütünlük. Şapkayla tartışarak onu Hufflepuff'a ayırmasını istedi (kaynak: Pottermore), çünkü bir Gryffindor olmak için yeterince cesur olmadığını hissetti. Beşinci yıl * DA'ya katılır * DA'dayken büyülü yeteneklerinde belirgin ve önemli bir gelişme gösterir * OoP'nin sonunda Harry'ye Sihir Bakanlığı savaşına eşlik eden DA üyelerine gönüllü olarak katılır, hatta Harry ile bu konuda tartışır: Neville: "Hepimiz DA'daydık. Her şeyin Voldemort'la savaşmakla ilgili olması gerekiyordu, değil mi? Ve bu, gerçek bir şey yapma şansımızın olduğu ilk fırsat - yoksa bu sadece bir oyun muydu?" Harry: "Hayır - tabii ki değil -" Neville: "O zaman biz de gelmeliyiz. Yardım etmek istiyoruz." * Bakanlıktaki savaş sırasında, Dolohov Neville'in burnunu ve asasını kırdıktan sonra Harry'nin önerisi üzerine ayrılmayı reddetti. * Ölüm Yiyenler tarafından tehdit edilip işkence gördüğünde Harry'ye Kehaneti vermemesini söyledi Altıncı yıl * Gökbilim Kulesi Savaşı'na katıldı. Luna Lovegood ile birlikte, Dumbledore'un Ordusu'nun paralarıyla çağrıya cevap veren tek üyesiydi. Yedinci yıl * Neville, ceza olarak diğer öğrencilere Cruciatus Laneti uygulamayı reddettiği ve bağnazlıklarına ve zulümlerine karşı çıktığı için Carrow'larla başını derde soktu. * Ginny ve Luna ile birlikte Dumbledore'un Ordusu'nu yeniden başlattı. * Snape'in ofisinden Godric Gryffindor'un Kılıcını çalmaya çalıştı * Neville sonunda isyan çabalarına liderlik etmek için yalnız bırakıldı (Luna ve Ginny artık Hogwarts'ta değildi). Bir noktada Ölüm Yiyenlerden kaçınırken Neville, DA için bir saklanma yerine dönüştürebildiği ve yiyecek almak için Hog's Head'e bağlanabildiği İhtiyaç Odası'na rastladı. Aberforth Dumbledore'dan. Mayıs ayına kadar DA'nın çoğu orada yaşamaya başlamıştı. * Savaşın ilk turunda Neville, Ölüm Yiyenlere saldırmak için çeşitli bitkiler kullandı ve geçici bir ateşkes ilan edildiğinde yaralıları ve ölüleri taşımaya yardım etti. * Ölüm Yiyenler "ölü" bir Harry ile yaklaştığında Neville, Voldemort'a meydan okuyarak ayağa kalktı. Daha sonra Voldemort'a katılmayı reddettiği için yanan Sıralama Şapkasını takmaya zorlandı. Neyse ki Harry'nin fedakarlığı sayesinde Neville, Vücut Bağlama Laneti'ni üzerinden atabildi. * Savaş alanında gösterdiği muazzam cesaret sayesinde Neville, Godric Gryffindor'un Kılıcını yanan şapkadan çekebildi ve bu süreçte kendini gerçek bir Gryffindor olduğunu kanıtladı, bu da görünüşte zayıf iradeli, utangaç ve sakar doğası nedeniyle sürekli şüphe duyulan bir şeydi. Tek bir vuruşta Nagini'yi öldürdü ve Voldemort'un son kalan Hortkuluk'unu yok etti. * Neville daha sonra Hogwarts'ın savunucuları olarak Ron Weasley ile takım kurdu ve Ölüm Yiyenler Büyük Salon'a zorlandı ve Fenrir Greyback'i yendi. Sonuç olarak, birinin cesaretinin oldukça ikna edici kanıtı.
51
This claim was made popular by being said in the movie The Social Network. It exactly says: > Did you know there are more people with genius IQs living in China than there are people of any kind living in the United States?
Bu iddia, Sosyal Ağ filminde söylenerek popüler hale getirildi. Tam olarak şöyle diyor: > Amerika Birleşik Devletleri'nde yaşayan her türden insandan daha fazla dahi IQ'lu insanın Çin'de yaşadığını biliyor muydunuz?
This claim can actually be tested very easily. Others have done it, e.g. Brian Dickerson: The perils of repeating political nonsense and came to the conclusion that the claim was wrong. You just need the chance a random person from a large group has a genius level IQ, then multiply it with the number of people in China and compare the result with the number of people in the USA. The IQ follows a Gaussian distribution where 100 is the mean by definition and a standard deviation (SD) of 15 (after Wechsler) or 16 (after Stanford-Binet). The rarity of a particular IQ can be calculated easily and are listed by the IQ Comparison Site. These numbers give the percentage of people with an IQ equal or lower than the given IQ and the rarity of this occurring. The main question actually is what an genius level IQ is. There is no definite answer. According to the IQ Comparison Site, it is 140 or higher ("Genius or near genius") while another source states it as at least 160. The rarity of such an IQ is 1/261 (with a SD of 15) or 1/161 (SD=16) for an IQ of 140 and 1/31,560 (SD=15) or 1/11,307 (SD=16) for an IQ of 160 according to Wikipedia. The population of USA for 2012 is about 313,221,000 according to the U.S. Census Bureau. The population of China for 2011 is about 1,370,537,000. Taking the lowest rarity of 1/161 from above then there are about 1,370,537,000/161 = about 8,513,000 geniuses in China, which is significantly less then the 313,221,000 Americans. If you take the 15 SD value of 1/261 then you get only about 5,251,000 Chinese geniuses. With the 160 IQ points, which are more realistic to indicate a real genius, the numbers are even smaller (about 43,400 or 12,100). Note that 1,370,537,000/313,221,000 = 4.375, so in order for this claim to be true actually one of every four (or say five) Chinese would need to be a Genius. Even without the numbers above, it can be easily understood that this is not the case. Conclusion: This claim is wrong according to the definition and probabilities of the IQ. Supplement: It has been pointed out, that there are published research results showing that China and other Asian countries have a higher average IQ of about 106 (or even as high as 115) as the normed average of 100. This would increase the number of geniuses in China: The above factor of 1/161 would drop to about 1/60 or, for a Chinese average of 115, even to about 1/17. These numbers can be easily calculated using the standard deviation, e.g. using MS Excel's function ```NORM.DIST(140, 106, 16, TRUE)```. However, both these factors are not in any way close to the US/Chinese population ratio of about 1/4.375, so the original conclusion still holds.
Bu iddia aslında çok kolay bir şekilde test edilebilir. Başkaları bunu yaptı, örneğin Brian Dickerson: Siyasi saçmalıkları tekrarlamanın tehlikeleri ve iddianın yanlış olduğu sonucuna vardı. Sadece büyük bir gruptan rastgele bir kişinin dahi seviyesinde bir IQ'ya sahip olma şansına ihtiyacınız var, ardından bunu Çin'deki insan sayısıyla çarpın ve sonucu ABD'deki insan sayısıyla karşılaştırın. IQ, tanımı gereği ortalaması 100 olan ve standart sapması (SS) 15 (Wechsler'e göre) veya 16 (Stanford-Binet'e göre) olan bir Gauss dağılımını takip eder. Belirli bir IQ'nun nadirliği kolayca hesaplanabilir ve IQ Karşılaştırma Sitesi tarafından listelenmiştir. Bu sayılar, verilen IQ'ya eşit veya daha düşük bir IQ'ya sahip olan kişilerin yüzdesini ve bunun meydana gelme nadirliğini verir. Asıl soru aslında dahi seviyesinde bir IQ'nun ne olduğudur. Kesin bir cevap yok. IQ Karşılaştırma Sitesine göre, 140 veya daha yüksek ("Dahi veya dahiye yakın") iken başka bir kaynak bunu en az 160 olarak belirtiyor. Wikipedia'ya göre 140 IQ için bu tür bir IQ'nun nadirliği 1/261 (SS=15) veya 1/161 (SS=16) ve 160 IQ için 1/31.560 (SS=15) veya 1/11.307'dir (SS=16). ABD Nüfus Sayım Bürosu'na göre 2012 yılı ABD nüfusu yaklaşık 313.221.000'dir. 2011 yılı Çin nüfusu yaklaşık 1.370.537.000'dir. Yukarıdan en düşük nadirlik olan 1/161'i alırsak, Çin'de yaklaşık 1.370.537.000/161 = yaklaşık 8.513.000 dahi var, bu da 313.221.000 Amerikalıdan önemli ölçüde daha az. 15 SS değeri olan 1/261'i alırsanız, yalnızca yaklaşık 5.251.000 Çinli dahi elde edersiniz. Gerçek bir dehayı göstermek için daha gerçekçi olan 160 IQ puanı ile sayılar daha da küçüktür (yaklaşık 43.400 veya 12.100). 1.370.537.000/313.221.000 = 4,375 olduğunu unutmayın, bu nedenle bu iddianın doğru olması için aslında her dört (veya beş) Çinliden birinin Dahi olması gerekir. Yukarıdaki sayılar olmasa bile bunun böyle olmadığı kolayca anlaşılabilir. Sonuç: Bu iddia, IQ'nun tanımı ve olasılıklarına göre yanlıştır. Ek: Çin ve diğer Asya ülkelerinin 100'lük norm ortalamasına göre yaklaşık 106 (hatta 115 kadar yüksek) daha yüksek bir ortalama IQ'ya sahip olduğunu gösteren yayınlanmış araştırma sonuçlarının olduğu belirtilmiştir. Bu, Çin'deki dahilerin sayısını artıracaktır: Yukarıdaki 1/161 faktörü yaklaşık 1/60'a veya Çin ortalaması 115 için yaklaşık 1/17'ye düşecektir. Bu sayılar, örneğin MS Excel'in ```NORM.DIST(140, 106, 16, TRUE)``` işlevini kullanarak standart sapma kullanılarak kolayca hesaplanabilir. Ancak, bu faktörlerin ikisi de hiçbir şekilde yaklaşık 1/4,375 olan ABD/Çin nüfus oranına yakın değildir, bu nedenle orijinal sonuç hala geçerlidir.
52
I am trying to get my program to print out ```"banana"``` from the dictionary. What would be the simplest way to do this? This is my dictionary: ```prices = { "banana" : 4, "apple" : 2, "orange" : 1.5, "pear" : 3 } ```
Programımın sözlükten ```"banana"``` yazdırmasını sağlamaya çalışıyorum. Bunu yapmanın en basit yolu nedir? İşte sözlüğüm: ```prices = { "banana" : 4, "apple" : 2, "orange" : 1.5, "pear" : 3 } ```
As of Python 3.7, insertion order is maintained, so you don't need an ```OrderedDict``` here. You can use the below approaches with a normal ```dict``` Changed in version 3.7: Dictionary order is guaranteed to be insertion order. This behavior was an implementation detail of CPython from 3.6. source Python 3.6 and earlier* If you are talking about a regular ```dict```, then the &quot;first key&quot; doesn't mean anything. The keys are not ordered in any way you can depend on. If you iterate over your ```dict``` you will likely not get ```&quot;banana&quot;``` as the first thing you see. If you need to keep things in order, then you have to use an ```OrderedDict``` and not just a plain dictionary. ```import collections prices = collections.OrderedDict([ (&quot;banana&quot;, 4), (&quot;apple&quot;, 2), (&quot;orange&quot;, 1.5), (&quot;pear&quot;, 3), ]) ``` If you then wanted to see all the keys in order you could do so by iterating through it ```for k in prices: print(k) ``` You could, alternatively put all of the keys into a list and then work with that ```keys = list(prices) print(keys[0]) # will print &quot;banana&quot; ``` A faster way to get the first element without creating a list would be to call ```next``` on the iterator. This doesn't generalize nicely when trying to get the ```nth``` element though ```>>> next(iter(prices)) 'banana' ``` * CPython had guaranteed insertion order as an implementation detail in 3.6.
Python 3.7'den itibaren ekleme sırası korunur, bu nedenle burada bir ```OrderedDict```'e ihtiyacınız yoktur. Normal bir ```dict``` ile aşağıdaki yaklaşımları kullanabilirsiniz Sürüm 3.7'de değişti: Sözlük sırasının ekleme sırası olması garanti edilir. Bu davranış, 3.6'dan itibaren CPython'un bir uygulama ayrıntısıydı. kaynak Python 3.6 ve öncesi* Normal bir ```dict```'ten bahsediyorsanız, o zaman "ilk anahtar" hiçbir şey ifade etmez. Anahtarlar, güvenebileceğiniz herhangi bir şekilde sıralanmaz. ```dict```'iniz üzerinde yineleme yaparsanız, muhtemelen ilk gördüğünüz şey olarak ```&quot;banana&quot;```'yı almazsınız. Her şeyi sırayla tutmanız gerekiyorsa, o zaman sadece düz bir sözlük değil, bir ```OrderedDict``` kullanmanız gerekir. ```import collections prices = collections.OrderedDict([ (&quot;banana&quot;, 4), (&quot;apple&quot;, 2), (&quot;orange&quot;, 1.5), (&quot;pear&quot;, 3), ]) ``` Ardından tüm anahtarları sırayla görmek isterseniz, yineleyerek bunu yapabilirsiniz ```for k in prices: print(k) ``` Alternatif olarak, tüm anahtarları bir listeye koyabilir ve ardından onunla çalışabilirsiniz ```keys = list(prices) print(keys[0]) # &quot;banana&quot; yazdıracaktır ``` Bir liste oluşturmadan ilk öğeyi almanın daha hızlı bir yolu, yineleyici üzerinde ```next```'i çağırmaktır. Ancak bu, ```nth``` öğesini almaya çalışırken güzel bir şekilde genellemez ```>>> next(iter(prices)) 'banana' ``` * CPython, 3.6'da bir uygulama ayrıntısı olarak ekleme sırasını garanti etmişti.
53
Different coffee packets advertise different amounts of 'Robusta' and 'Arabica'? What do these terms refer to, and how does it affect the taste of the coffee?
Farklı kahve paketleri farklı miktarlarda 'Robusta' ve 'Arabica' ilan ediyor? Bu terimler neyi ifade ediyor ve kahvenin tadını nasıl etkiliyor?
* One reason that the taste isn't as good for Robusta is that it has more caffeine compared to Arabica. Which may sound like a positive thing but caffeine carries a bitter taste which makes it an unpleasant drink. In fact the Robusta bean has 2.7% caffeine content, almost double the 1.5% of Arabica. * Arabica contains almost 60% more lipids and almost twice the concentration of sugar than Robusta. This factor also probably has a big impact on why we prefer the taste of Arabica. * From a price perspective, green beans of Robusta is about half the price of Arabica green beans on the commodity market. * Robusta is easier to tend to on the farm, has a higher yield and is less sensitive to insects - the extra caffeine is a chemical defense for the coffee seed as the quantity in the Robusta is toxic to bugs. All of these factors help bring up the supply and lower the input costs for farmers to produce. With this more attractive price point, a lot of roasters back in the day would add Robusta to their blend in an attempt to reduce their costs and increase their profits. When coffee was initially sold in the 1900s the quality of coffee slowly and slowly deteriorated in an effort for companies to squeeze the most profit. Where you’ll find it: Nowadays, it’s not often you’ll find Robusta in a coffee blends or in coffee shop. If you’re drinking instant coffee? Well, that’s probably all Robusta… but you probably don’t care very much about taste. In your espresso blend? That’s a mixed bag. Literally. Oddly enough, Robusta is still widely used as part of espresso blends – specifically Italian style blends. It is said to help improve the crema. One thing to note is despite the association with Arabica of being higher quality, and Robusta as being lower quality, it’s not always the case. Top notch specialty Robusta coffee will usually taste as good as or better than low end Arabica. However, high end Robusta isn’t widely used or available. Rather, Robusta is usually used as a filler or cost reducer. * Robusta beans are much more circular, whereas Arabica are more oval. * Chlorogenic acid is a significant antioxidant and an insect deterrent. Robusta is 7-10% CGA and Arabica has 5.5-8% CGA.
* Robusta'nın tadının Arabica kadar iyi olmamasının bir nedeni, Arabica'ya kıyasla daha fazla kafein içermesidir. Bu olumlu bir şey gibi gelebilir ancak kafein acı bir tada sahiptir ve bu da onu hoş olmayan bir içecek haline getirir. Aslında Robusta çekirdeği %2,7 kafein içeriğine sahiptir ve bu, Arabica'nın %1,5'inin neredeyse iki katıdır. * Arabica, Robusta'dan neredeyse %60 daha fazla lipit ve neredeyse iki kat daha fazla şeker konsantrasyonu içerir. Bu faktör muhtemelen Arabica'nın tadını neden tercih ettiğimiz konusunda büyük bir etkiye sahiptir. * Fiyat açısından, Robusta'nın yeşil çekirdekleri, emtia piyasasında Arabica yeşil çekirdeklerinin fiyatının yaklaşık yarısıdır. * Robusta'ya çiftlikte bakmak daha kolaydır, daha yüksek verime sahiptir ve böceklere karşı daha az hassastır - ekstra kafein, Robusta'daki miktar böcekler için toksik olduğundan kahve çekirdeği için kimyasal bir savunmadır. Tüm bu faktörler, çiftçilerin üretmek için arzı artırmalarına ve girdi maliyetlerini düşürmelerine yardımcı olur. Bu daha cazip fiyat noktasıyla, geçmişte birçok kavurucu, maliyetlerini düşürmek ve karlarını artırmak için harmanlarına Robusta eklerdi. Kahve ilk olarak 1900'lerde satıldığında, şirketlerin en fazla karı elde etme çabasıyla kahvenin kalitesi yavaş yavaş bozuldu. Nerede bulacaksınız: Günümüzde, bir kahve harmanında veya kahve dükkanında Robusta bulmanız pek sık rastlanan bir durum değildir. Hazır kahve mi içiyorsunuz? Pekala, muhtemelen hepsi Robusta... ama muhtemelen tadı pek umursamıyorsunuzdur. Espresso harmanınızda mı? Bu karışık bir durum. Gerçekten de. Garip bir şekilde, Robusta hala espresso harmanlarının bir parçası olarak yaygın olarak kullanılmaktadır - özellikle İtalyan tarzı harmanlar. Kremayı iyileştirmeye yardımcı olduğu söylenir. Dikkat edilmesi gereken bir şey, Arabica'nın daha yüksek kaliteli, Robusta'nın daha düşük kaliteli olmasıyla ilişkilendirilmesine rağmen, durumun her zaman böyle olmadığıdır. Birinci sınıf özel Robusta kahvesi genellikle düşük kaliteli Arabica kadar iyi veya daha iyi bir tada sahip olacaktır. Ancak, yüksek kaliteli Robusta yaygın olarak kullanılmaz veya bulunmaz. Bunun yerine, Robusta genellikle dolgu maddesi veya maliyet düşürücü olarak kullanılır. * Robusta çekirdekleri çok daha daireseldir, Arabica ise daha ovaldir. * Klorojenik asit önemli bir antioksidandır ve böcekleri uzak tutar. Robusta %7-10 CGA ve Arabica %5,5-8 CGA içerir.
54
So whenever we want to shoot our flash before taking a photo. we have to charge it first. What is the point of the charging our flashes? Aren't their power directly supplied by the battery of our camera? Please answer for the built in flash on the 2000D and the traditional hot shoe Xenon flashes. Perhaps these hot shoe xenon flashes have their own batteries charged by the slow hot shoe port. Who knows?
Bu yüzden bir fotoğraf çekmeden önce flaşımızı ateşlemek istediğimizde, önce onu şarj etmemiz gerekir. Flaşlarımızı şarj etmenin amacı nedir? Güçleri doğrudan kameramızın pilinden sağlanmıyor mu? Lütfen 2000D'deki dahili flaş ve geleneksel kızaklı Xenon flaşlar için cevap verin. Belki de bu kızaklı xenon flaşların, yavaş kızaklı port tarafından şarj edilen kendi pilleri vardır. Kim bilir?
The peak power at work when a flash is being discharged is extreme. Example: a classic Metz 45CT (a large but still handheld unit) on full manual power delivers around 90 watt-seconds of electrical output to the flash tube in 1/300s. That means there are 27000 watts at work for a short time. A 27000 watt lightbulb (BTW, your flash is much brighter than that - more efficient!) would need the ampacity of around eight european household sockets (230V, fused at 13 or 16 amps) to operate, since it would draw around 120 ampere from them. At the voltage levels xenon flash tubes typically operate at, around 80 amperes will flow; if you wanted to pull that energy "live" from a 5-6V battery, you'd need to pull around 5000 amperes AND instantaneously convert them to around 80 amperes at high voltage. Batteries that could deliver 5000 amps - while not wasting most of the power as heat generated across their internal resistance - for a short duration and live certainly exist - you are looking at starter batteries for big lorries, which are rather inconvenient to lug around. Also, a 5000 ampere current pulse is quite a magnetic nuisance if there is anything either ferromagnetic or intended as an electrical conductor near the conductors used. Your average "big" speedlite, btw, will be around half the power described here (but might in some cases reach the same or higher peak currents in order to discharge even faster), an in-camera flash will be a fraction of these numbers - but still inconvenient to build any other way. If you need a short, massive current pulse, the best energy source available in engineering is a previously charged capacitor (metal-paper or electrolytic type, not dual-layer "supercap"). This energy storage device is large for its storage capacity if you compare it to a battery - but able to respond far quicker to high current demand, since a) there is no chemical energy conversion involved in its operation, b) the relevant current path only involves metallic, very conductive parts instead of ionic conductors (aka electrolytes. An electrolytic capacitor, btw, does use its electrolyte for chemical self-upkeep, not for chemical energy storage or electrical connectivity). Also, since the charge in a a capacitor is limited, it allows portioning total energy to what the flashlamp can safely take. This allows a flash in manual mode to just completely discharge the capacitor until it is nearly empty (when the remaining charge can only deliver voltage below the quench voltage of the flashlamp) without complex control circuitry - and at the same time gives you a safety fallback when working with dynamically controlled power levels (telecomputer or TTL mode), leaving no way for catastrophic circuit failure in combination with several kilowatts of constant power available turning into a massive safety hazard. A handheld-sized efficient electrical near point light source with 27000W input, driven constantly, would first severely damage your eyes and then self destroy violently (think of a welding arc - dangerously bright, and it melts metal).
Bir flaş boşaltılırken işlenen tepe güç aşırıdır. Örnek: tam manuel güçte klasik bir Metz 45CT (büyük ama yine de elde taşınabilir bir ünite), 1/300sn'de flaş tüpüne yaklaşık 90 watt-saniye elektriksel çıkış sağlar. Bu, kısa bir süre için 27000 watt'ın çalıştığı anlamına gelir. 27000 watt'lık bir ampul (BTW, flaşınız bundan çok daha parlaktır - daha verimli!), yaklaşık 120 amper çekeceği için çalışmak için yaklaşık sekiz Avrupa ev prizinin (230V, 13 veya 16 amper sigortalı) amper kapasitesine ihtiyaç duyar. Ksenon flaş tüplerinin tipik olarak çalıştığı voltaj seviyelerinde yaklaşık 80 amper akacaktır; bu enerjiyi 5-6V'luk bir aküden "canlı" çekmek isterseniz, yaklaşık 5000 amper çekmeniz ve bunları anında yüksek voltajda yaklaşık 80 ampere dönüştürmeniz gerekir. 5000 amper sağlayabilen piller - çoğu gücü dahili dirençlerinde oluşan ısı olarak boşa harcamazken - kısa bir süre için ve canlı olarak kesinlikle mevcuttur - etrafta taşıması oldukça zahmetli olan büyük kamyonlar için marş akülerine bakıyorsunuz. Ayrıca, kullanılan iletkenlerin yakınında ferromanyetik veya elektrik iletkeni olarak tasarlanmış bir şey varsa, 5000 amperlik bir akım darbesi oldukça manyetik bir sıkıntıdır. Ortalama "büyük" hız ışığınız, btw, burada açıklanan gücün yaklaşık yarısı olacaktır (ancak bazı durumlarda daha da hızlı boşalmak için aynı veya daha yüksek tepe akımlarına ulaşabilir), bir kamera içi flaş bu sayıların bir kısmı olacaktır - ancak yine de başka bir şekilde inşa etmek sakıncalıdır. Kısa, büyük bir akım darbesine ihtiyacınız varsa, mühendislikte mevcut olan en iyi enerji kaynağı önceden şarj edilmiş bir kondansatördür (metal-kağıt veya elektrolitik tip, çift katmanlı "süperkap" değil). Bu enerji depolama cihazı, bir bataryayla karşılaştırdığınızda depolama kapasitesi için büyüktür - ancak yüksek akım talebine çok daha hızlı yanıt verebilir, çünkü a) çalışmasında kimyasal enerji dönüşümü yoktur, b) ilgili akım yolu, iyonik iletkenler yerine yalnızca metalik, çok iletken parçalar içerir (yani elektrolitler. Bir elektrolitik kondansatör, btw, elektrolitini kimyasal enerji depolama veya elektriksel bağlantı için değil, kimyasal kendi kendine bakım için kullanır). Ayrıca, bir kondansatördeki yük sınırlı olduğundan, toplam enerjinin flaş lambasının güvenli bir şekilde alabileceği şekilde bölünmesine izin verir. Bu, manuel moddaki bir flaşın, karmaşık kontrol devresi olmadan, kalan yük yalnızca flaş lambasının söndürme voltajının altındaki voltajı sağlayabildiğinde (neredeyse boş olana kadar) kondansatörü tamamen boşaltmasına izin verir - ve aynı zamanda dinamik olarak kontrol edilen güç seviyeleriyle (telebilgisayar veya TTL modu) çalışırken size bir güvenlik geri dönüşü sağlar ve sürekli olarak mevcut olan birkaç kilovatlık gücün bir güvenlik tehlikesine dönüşmesiyle birlikte feci devre arızasına yol açmaz. Sürekli olarak sürülen, 27000W girişli, elde taşınabilir boyutlu, verimli bir elektriksel yakın nokta ışık kaynağı, önce gözlerinize ciddi şekilde zarar verir ve ardından kendini şiddetli bir şekilde yok eder (bir kaynak arkını düşünün - tehlikeli derecede parlak ve metali eritir).
55
What are some strategies to maintain morale and productivity after massive layoffs? I am not in a managerial role, just a lead role, and am asking for myself and my fellow employees.
Toplu işten çıkarmaların ardından moral ve verimliliği korumak için bazı stratejiler nelerdir? Yönetici bir rolde değilim, sadece bir lider rolündeyim ve kendim ve meslektaşlarım için soruyorum.
The situation you're describing is tough. Layoffs have a very real impact on both the individuals that are let go and those that remain. I'm sorry you're experiencing this. Here are some things to consider that may help you and your colleagues cope with the added stress and emotions following a layoff: * Acknowledge the layoff and the feelings of your colleagues. Avoiding the topic can extend negative feelings and disenfranchise those most impacted. You should find an opportunity to connect with your colleagues for an honest conversation about your feelings following the layoff. Perhaps reach out to hold a number of 1-on-1 conversations, or gather your team for an off-site lunch and prompt the discussion. * Acknowledge that everyone will be impacted differently. Some of your colleagues will feel totally okay and ready to get back to work. Others will feel anxious and worried in a way that prevents them from performing the same way they did before the layoff. There is no right or "professional" reaction to a layoff. Be open to the feelings and reactions of all of your colleagues equally. * Create practical solutions to new processes and responsibilities. If your team now has a greater workload, be a generator of solutions. Try out ideas for making processes in your team more efficient and predictable. * Create transparency about the state of the business and potential future staff changes. Layoffs are a clear indication of business trouble. Facilitate sharing facts about the state of the business and actively work to eliminate rumors. Additionally, layoffs will likely cause shifts in responsibility as roles are consolidated or reorganized. Make clear who has specific responsibilities both inside and outside of your team. Actively eliminate any sources of uncertainty and anxiety that you can. * Be a role model. Don't participate in gossip or complaining about the layoff. Don't disparage management or other colleagues in casual conversation. Be a model for professionalism and caring. * Maintain work standards and a caring meritocracy. A layoff isn't an excuse for allowing work quality to decline. Additionally, differences in productivity and quality between team members should be consistently and fairly addressed. If a team member is underperforming following the layoff, provide direct feedback and ask what you can do to help.
Anlattığınız durum zor. İşten çıkarmalar hem işten çıkarılanlar hem de kalanlar üzerinde çok gerçek bir etkiye sahip. Bunu yaşadığınız için üzgünüm. Bir işten çıkarmanın ardından ek stres ve duygularla başa çıkmanıza ve iş arkadaşlarınıza yardımcı olabilecek bazı hususlar şunlardır: * İşten çıkarmaları ve iş arkadaşlarınızın duygularını kabul edin. Konudan kaçınmak olumsuz duyguları uzatabilir ve en çok etkilenenleri dışlayabilir. İşten çıkarmanın ardından duygularınız hakkında dürüst bir konuşma yapmak için iş arkadaşlarınızla bağlantı kurma fırsatı bulmalısınız. Belki de bire bir görüşmeler yapmak veya ekibinizi dışarıda bir öğle yemeğine davet etmek ve tartışmayı başlatmak için iletişime geçebilirsiniz. * Herkesin farklı şekilde etkileneceğini kabul edin. İş arkadaşlarınızdan bazıları tamamen iyi hissedecek ve işe geri dönmeye hazır olacak. Diğerleri işten çıkarılmadan önce yaptıkları gibi performans göstermelerini engelleyen bir şekilde endişeli ve kaygılı hissedecekler. İşten çıkarmalara karşı doğru veya "profesyonel" bir tepki yoktur. Tüm iş arkadaşlarınızın duygularına ve tepkilerine eşit derecede açık olun. * Yeni süreçler ve sorumluluklar için pratik çözümler oluşturun. Ekibinizin şimdi daha fazla iş yükü varsa, çözüm üretin. Ekibinizdeki süreçleri daha verimli ve öngörülebilir hale getirmek için fikirler deneyin. * İşletmenin durumu ve olası gelecekteki personel değişiklikleri hakkında şeffaflık yaratın. İşten çıkarmalar, işletme sorunlarının açık bir göstergesidir. İşletmenin durumu hakkında gerçekleri paylaşmayı kolaylaştırın ve söylentileri ortadan kaldırmak için aktif olarak çalışın. Ayrıca, işten çıkarmalar, roller birleştirildikçe veya yeniden düzenlendikçe sorumluluklarda değişikliklere neden olacaktır. Ekibinizin içinde ve dışında kimin belirli sorumlulukları olduğunu açıkça belirtin. Mümkün olan her türlü belirsizlik ve endişe kaynağını aktif olarak ortadan kaldırın. * Rol model olun. Dedikodulara katılmayın veya işten çıkarmalar hakkında şikayet etmeyin. Rahat konuşmalarda yönetimi veya diğer iş arkadaşlarını küçümsemeyin. Profesyonellik ve şefkat için bir model olun. * İş standartlarını ve şefkatli bir liyakati koruyun. İşten çıkarma, iş kalitesinin düşmesine izin vermek için bir bahane değildir. Ayrıca, ekip üyeleri arasındaki verimlilik ve kalite farklılıkları tutarlı ve adil bir şekilde ele alınmalıdır. Bir ekip üyesi işten çıkarmanın ardından yetersiz performans gösteriyorsa, doğrudan geri bildirimde bulunun ve yardım etmek için neler yapabileceğinizi sorun.
56
Could you please clearly explain what is the difference between correlation and convolution that is done by a filter on an image? I mean in terms of signal processing definition I know that convolution describes the output of an LTI system, that is if an LTI system produces an output due to convolution with an input system then the output signal can be described as the result of convolution of the input signal and the impulse response of the LTI system. As for the correlation, it describes the similarities between to signals. But how does convolution and correlation effect on a image and how different are they in terms of effects? Thanks
Bir görüntü üzerinde bir filtre tarafından yapılan korelasyon ve evrişim arasındaki farkın ne olduğunu açıklayabilir misiniz? Sinyal işleme tanımı açısından evrişimin LTI sisteminin çıktısını tanımladığını biliyorum, yani bir LTI sistemi bir giriş sistemiyle evrişim nedeniyle bir çıktı üretirse, çıkış sinyali giriş sinyalinin evrişiminin ve LTI sisteminin dürtü tepkisinin sonucu olarak tanımlanabilir. Korelasyona gelince, iki sinyal arasındaki benzerlikleri tanımlar. Ancak evrişim ve korelasyon bir görüntü üzerinde nasıl etki eder ve etkileri açısından ne kadar farklıdır? Teşekkürler
Convolution is correlation with the filter rotated 180 degrees. This makes no difference, if the filter is symmetric, like a Gaussian, or a Laplacian. But it makes a whole lot of difference, when the filter is not symmetric, like a derivative. The reason we need convolution is that it is associative, while correlation, in general, is not. To see why this is true, remember that convolution is multiplication in the frequency domain, which is obviously associative. On the other hand, correlation in the frequency domain is multiplication by the complex conjugate, which is not associative. The associativity of convolution is what allows you to "pre-convolve" the filters, so that you only need to convolve the image with a single filter. For example, let's say you have an image $f$, which you need to convolve with $g$ and then with $h$. $f * g * h = f * (g * h)$. That means you can convolve $g$ and $h$ first into a single filter, and then convolve $f$ with it. This is useful, if you need to convolve many images with $g$ and $h$. You can pre-compute $k = g * h$, and then reuse $k$ multple times. So if you are doing template matching, i. e. looking for a single template, correlation is sufficient. But if you need to use multiple filters in succession, and you need to perform this operation on multiple images, it makes sense to convolve the multiple filters into a single filter ahead of time.
Konvolüsyon, 180 derece döndürülmüş filtreyle korelasyondur. Filtre, bir Gauss veya bir Laplasyen gibi simetrikse bu bir fark yaratmaz. Ancak filtre simetrik değilse, bir türev gibi, büyük bir fark yaratır. Konvolüsyona ihtiyaç duymamızın nedeni, onun birleştirici olmasıdır, oysa korelasyon genel olarak birleştirici değildir. Bunun neden doğru olduğunu görmek için, konvolüsyonun frekans alanında çarpım olduğunu ve bunun açıkça birleştirici olduğunu unutmayın. Öte yandan, frekans alanındaki korelasyon, birleştirici olmayan karmaşık eşlenikle çarpmadır. Konvolüsyonun birleştiriciliği, filtreleri "önceden konvolüe etmenize" olanak tanır, böylece görüntüyü yalnızca tek bir filtreyle konvolüe etmeniz gerekir. Örneğin, $f$ görüntünüz olduğunu ve bunu önce $g$ ile sonra da $h$ ile konvolüe etmeniz gerektiğini varsayalım. $f * g * h = f * (g * h)$. Bu, önce $g$ ve $h$'yi tek bir filtrede konvolüe edebileceğiniz ve ardından $f$'yi onunla konvolüe edebileceğiniz anlamına gelir. Bu, birçok görüntüyü $g$ ve $h$ ile konvolüe etmeniz gerekiyorsa kullanışlıdır. $k = g * h$ değerini önceden hesaplayabilir ve ardından $k$'yı birden çok kez yeniden kullanabilirsiniz. Yani şablon eşleştirmesi yapıyorsanız, yani tek bir şablon arıyorsanız, korelasyon yeterlidir. Ancak ardışık olarak birden fazla filtre kullanmanız ve bu işlemi birden fazla görüntü üzerinde gerçekleştirmeniz gerekiyorsa, birden fazla filtreyi önceden tek bir filtrede konvolüe etmek mantıklıdır.
57
24601 has developed into being an iconic part of both the Les Miserables book and musical. Was that number special to him, or was it simply a random number he chose (I doubt it)?
24601 hem Sefiller kitabının hem de müzikalinin ikonik bir parçası haline geldi. Bu sayı onun için özel miydi yoksa sadece rastgele seçtiği bir sayı mıydı (bundan şüpheliyim)?
Yes: it corresponds to the date of Hugo's conception. This is part of a pattern of similarities between the character of Jean Valjean and the author himself: both are of similar age, have similar habits and similarly austere lifestyles, and even share the same dreams. This is according to David Bellos's The Novel of the Century: The Extraordinary Adventure of Les Misérables, which concludes Part Three with: But Hugo put in a secret sign to remind himself and maybe those who knew him well that there were deep links of identity between the dutiful and persistent ex-convict and himself. Hugo was born on 26 February 1802, but because he was a slightly premature baby, he always believed he had been conceived on 24 June 1801. Valjean's prison number on his first incarceration at Toulon is 24601. -- p. 162 (emphasis mine) As a bonus, Valjean's second prisoner number was apparently also chosen for its special significance to Hugo: it refers to the month of his daughter Léopoldine's death. From footnote 46 in Kathryn Grossman's Figuring Transcendence in Les Miserables: Hugo's Romantic Sublime: Gaudon demonstrates that this image, which represents genius in one of the poet's earliest carnets (8 July 1820), is a sign of his &quot;deep identification&quot; with Valjean (Temps 547). As further evidence that the hero is an alter ego, Gohin cites the two numbers assigned to him in prison. The first, 24601, refers to the supposed date of Hugo's conception (24 June 1801), while the second, 9430, alludes to Léopoldine's death in September 1843 (&quot;Une histoire&quot; 47; see also 52). -- p. 165 (emphasis mine)
Evet: Hugo'nun gebe kalma tarihine denk geliyor. Bu, Jean Valjean karakteri ile yazarın kendisi arasındaki benzerliklerin bir parçası: ikisi de benzer yaşta, benzer alışkanlıklara ve benzer şekilde sade yaşam tarzlarına sahip ve hatta aynı hayalleri paylaşıyorlar. Bu, David Bellos'un Yüzyılın Romanı: Sefillerin Olağanüstü Macerası'na göre, Üçüncü Bölüm'ü şu şekilde bitiriyor: Ancak Hugo, kendisine ve onu iyi tanıyanlara, görev bilinci olan ve ısrarcı eski mahkum ile kendisi arasında derin kimlik bağları olduğunu hatırlatmak için gizli bir işaret koydu. Hugo 26 Şubat 1802'de doğdu, ancak biraz erken doğduğu için her zaman 24 Haziran 1801'de gebe kaldığına inandı. Valjean'ın Toulon'daki ilk hapishanede tutuklu numarası 24601'dir. -- s. 162 (vurgu benim) Bir bonus olarak, Valjean'ın ikinci tutuklu numarası da görünüşe göre Hugo için özel önemi nedeniyle seçilmişti: kızının Léopoldine'in ölüm ayına atıfta bulunuyor. Kathryn Grossman'ın Sefiller'de Aşkınlığı Şekillendirme: Hugo'nun Romantik Yüceliği adlı kitabının 46. dipnotundan: Gaudon, şairin en eski defterlerinden birinde (8 Temmuz 1820) dehayı temsil eden bu imgenin, Valjean ile &quot;derin özdeşleşmesinin&quot; bir işareti olduğunu gösteriyor (Temps 547). Kahramanın bir alter ego olduğuna dair daha fazla kanıt olarak Gohin, hapishanede kendisine verilen iki numarayı gösteriyor. İlki, 24601, Hugo'nun gebe kalma tarihine (24 Haziran 1801) atıfta bulunurken, ikincisi, 9430, Léopoldine'in Eylül 1843'teki ölümüne gönderme yapıyor (&quot;Une histoire&quot; 47; ayrıca bkz. 52). -- s. 165 (vurgu benim)
58
Why does Michael Crichton use US Customary measurements in hard sci-fi?
Michael Crichton neden sert bilim kurguda ABD'nin geleneksel ölçü birimlerini kullanıyor?
Crichton used both imperial and metric, depending on the context. In the course of one paragraph in The Sphere, he managed to use both! > "Pacific coral grows two-and-a-half centimeters a year, and the object-- whatever it is-- is covered in about five meters of coral. That's a lot of coral. Of course, coral doesn't grow at a depth of a thousand feet, which means that the present shelf collapsed to a lower depth at some point in the past." When the character (Barnes, a Navy captain) is talking about precise measurements, he uses metric. When he's being more general, he uses imperial. The main character Norman (a psychologist, not exactly the most mathematically intensive field) uses imperial when thinking to himself. > He climbed up through the submarine and into a round steel cylinder approximately eight feet in diameter. But later, when the astrophysicist Ted is giving officialish measurements the titular sphere, he uses metric: > "This object is a burnished sphere approximately ten meters in a diameter, no solid, and composed of a dense metal alloy." So the short answer is that Crichton is an American writing American characters for a predominantly American audience. He uses imperial units for clarity, but metric when it would realistically be used.
Crichton, bağlama göre hem emperyal hem de metrik birimleri kullanmıştır. The Sphere'deki bir paragrafta ikisini de kullanmayı başarmıştır! > "Pasifik mercanı yılda iki buçuk santimetre büyür ve nesne -her neyse- yaklaşık beş metre mercanla kaplıdır. Bu çok fazla mercan. Elbette mercan bin fit derinlikte büyümez, bu da şu anki rafın geçmişte bir noktada daha düşük bir derinliğe çöktüğü anlamına gelir." Karakter (Donanma kaptanı Barnes) kesin ölçülerden bahsederken metrik birimleri kullanır. Daha genel konuşurken emperyal birimleri kullanır. Ana karakter Norman (bir psikolog, tam olarak matematiksel olarak en yoğun alan değil) kendi kendine düşünürken emperyal birimleri kullanır. > Denizaltıdan yukarı tırmandı ve yaklaşık sekiz fit çapında yuvarlak bir çelik silindire girdi. Ancak daha sonra, astrofizikçi Ted, başlıktaki küre için resmi ölçümler verirken metrik birimleri kullanır: > "Bu nesne, yaklaşık on metre çapında, katı olmayan ve yoğun bir metal alaşımından oluşan cilalı bir küredir." Yani kısa cevap, Crichton'un ağırlıklı olarak Amerikalı bir kitle için Amerikalı karakterler yazan bir Amerikalı olduğudur. Netlik için emperyal birimleri kullanır, ancak gerçekçi bir şekilde kullanılacağı zaman metrik birimleri kullanır.
59
How can horns, most of which have only three buttons, play all their notes?
Çoğu sadece üç düğmeye sahip olan kornalar, tüm notalarını nasıl çalabilir?
Put as simply as possible, horns are tubes. Blowing in special ways makes certain notes sound from those tubes. By changing one's embouchure, those notes start at a fundamental, then gradually go up in harmonics. The first notes (in key C) would be C, G, C, E, G.Those notes are the ones we hear when a bugle is played - Reveille, Last Post, etc. Bugles only play the harmonic series of notes, and can't play the ones in between. Read on. On a trumpet, for starters, there are three valves. One drops any open note played by one semitone, another by two semitones, and the other by three semitones. So using a combination of valves, you can lower any open note by up to six semitones. Let's take the first G note. To get F♯, press the semitone valve. To get F, press the tone valve. To get E, press two valves to drop a tone and a half. (there's one valve alone that can do this). To play E♭, press the two valves that drop two tones. To get D, press the two valves to drop two and a half tones. And to get C♯, press all three. That's the more complicated bit, as between the open notes, there's more semitones than anywhere else further up in pitch. Notice that between G and the next C, there are only two tones. So at this point, not so many notes are needed, so the valve pressing is more simple. Next, between that C and the E, there's even fewer, so again, not so many valve changes are needed. Now, onto trombone. There are actually valve trombones, which work the same as trumpets, etc., but for the standard trombone, imagine those extra lengths of tube brought into play by pressing valves are now a single continuum of tubing, operated by the slide. At various places along that slide, there are all the notes found similarly to pressing valves. There's also loads of extra notes that are going to be out of tune!
Mümkün olduğunca basit bir şekilde ifade etmek gerekirse, borular tüplerdir. Özel şekillerde üflemek, bu tüplerden belirli notaların çıkmasını sağlar. Embüşür değiştirilerek bu notalar temel bir notadan başlar ve kademeli olarak armonik olarak yükselir. İlk notalar (C anahtarında) C, G, C, E, G olur. Bu notalar, bir borazan çalındığında duyduğumuz notalardır - Reveille, Last Post, vb. Borazanlar yalnızca notaların harmonik serisini çalar ve aralarındakileri çalamaz. Okumaya devam edin. Öncelikle bir trompette üç valf vardır. Biri çalınan herhangi bir açık notayı bir yarı ton düşürür, diğeri iki yarı ton, diğeri de üç yarı ton düşürür. Bu nedenle, valflerin bir kombinasyonunu kullanarak herhangi bir açık notayı altı yarı tona kadar düşürebilirsiniz. İlk G notasını alalım. F♯ elde etmek için yarı ton valfine basın. F elde etmek için ton valfine basın. E elde etmek için bir ton ve yarım düşürmek için iki valfe basın. (Bunu yapabilen tek bir valf vardır). E♭ çalmak için iki ton düşüren iki valfe basın. D elde etmek için iki ve yarım ton düşürmek için iki valfe basın. Ve C♯ elde etmek için üçüne de basın. Bu daha karmaşık bir kısımdır, çünkü açık notalar arasında, perdede başka herhangi bir yerden daha fazla yarı ton vardır. G ile bir sonraki C arasında yalnızca iki ton olduğunu unutmayın. Bu nedenle, bu noktada çok fazla notaya ihtiyaç duyulmaz, bu nedenle valf basma işlemi daha basittir. Ardından, o C ile E arasında daha da az nota vardır, bu nedenle yine çok fazla valf değişikliğine ihtiyaç duyulmaz. Şimdi trombona geçelim. Aslında trompetler vb. ile aynı şekilde çalışan valfli trombonlar vardır, ancak standart trombon için valflere basılarak devreye sokulan bu ekstra boru uzunluklarının artık slaytla çalıştırılan tek bir sürekli boru olduğunu düşünün. Bu slayt boyunca çeşitli yerlerde, valflere basmaya benzer şekilde bulunan tüm notalar vardır. Ayrıca akort dışı olacak bir sürü ekstra nota da vardır!
60
I am a big fan of worldbuilding. A common sight in science fiction is that aliens pretend to be human (For example in Third Rock from the Sun). Obviously if the aliens are advanced enough to disguise themselves as another species, there are much easier, simpler and less expensive methods to destroy humanity, so why else would an advanced alien civilization waste time, energy and resources to disguise themselves as humans? What possible scientific, cultural or commercial use could such an expensive procedure have?
Dünya inşasının büyük bir hayranıyım. Bilim kurgu da sıkça görülen bir şey uzaylıların insan gibi davranmasıdır (Örneğin Third Rock from the Sun). Uzaylılar kendilerini başka bir tür olarak gizleyecek kadar gelişmişlerse, insanlığı yok etmenin çok daha kolay, basit ve ucuz yolları varken, neden gelişmiş bir uzaylı medeniyet zamanını, enerjisini ve kaynaklarını insan gibi görünmek için harcasın? Bu kadar pahalı bir prosedürün olası bilimsel, kültürel veya ticari kullanımı ne olabilir?
Aliens are alien, without a common background their motives may be incomprehensible. If we assume that these aliens are Hollywood aliens (ie humans with odd-looking rubber bits stuck on their faces) then there are all of the reasons that humans from one culture spend time in another culture and try and learn to fit in: * Anthropology; studying how a different culture has developed to better understand the developmental processes that influenced your own. Iain M. Banks wrote Inversions (two anthropologists from the Culture investigating a Renaissance-era world) and The State of the Art (a Culture Contact team on Earth ca 1970) in this vein. * Tourism; experiencing a culture that is vastly different from your previous experiences. * Reality TV; Bear Grylls. * Method Acting; preparing for a role in their own entertainment channels that involves playing the part of a member of an Information Age society. * Challenge; because they can. * Hermitage; there are people here on Earth who prefer to step away from the rat race and all the newfangled gadgets and live as their ancestors did, but usually not all the way back to stone tools. Selecting a developing world and fitting in gives them access to a level of technology between their home culture and being trapped on a desert island. * Camouflage; they are being sought by members of their home culture and it's easier to hide and survive amongst us than in their own milieu. There are a lot of examples of this in fiction already: For Richer or Poorer, Men in Black II and it's analogous to fleeing the law and retiring to a country without an extradition treaty. * Crash Landing, or a failure that prevents them from going home; if they came on an FTL ship that doesn't have FTL communications they may be waiting a long time for spare parts or updated navigational maps, or if they brought Gilligan who proceeded to ruin all of their plans to return home, or they may have arrived on a slower-than-light colony ship and would prefer to stay here and fit in amongst us rather than try and find another prospective colony. * Uplift; meddling to steer us onto the "right" path of development and prevent us from immolating ourselves (or vice versa if your species doesn't like the competition).
Uzaylılar uzaylıdır, ortak bir geçmişleri olmadığından amaçları anlaşılmaz olabilir. Bu uzaylıların Hollywood uzaylıları olduğunu varsayarsak (yani yüzlerine yapışmış garip görünümlü kauçuk parçaları olan insanlar), o zaman bir kültürden gelen insanların başka bir kültürde zaman geçirmesinin ve uyum sağlamaya çalışmasının tüm nedenleri vardır: * Antropoloji; kendi gelişiminizi etkileyen gelişimsel süreçleri daha iyi anlamak için farklı bir kültürün nasıl geliştiğini incelemek. Iain M. Banks, bu damarda Inversions'ı (Kültür'den iki antropologun Rönesans dönemi dünyasını araştırması) ve The State of the Art'ı (1970 civarında Dünya'da bir Kültür İletişim ekibi) yazdı. * Turizm; önceki deneyimlerinizden çok farklı bir kültürü deneyimlemek. * Gerçeklik TV; Bear Grylls. * Yöntem Oyunculuğu; Bilgi Çağı toplumunun bir üyesini oynamayı içeren kendi eğlence kanallarında bir rol için hazırlanmak. * Meydan okuma; çünkü yapabilirler. * İnziva; Dünya'da sıçan yarışından ve tüm yeni moda aletlerden uzaklaşmayı ve atalarının yaptığı gibi yaşamayı tercih eden insanlar var, ancak genellikle taş aletlere kadar geri dönmüyorlar. Gelişmekte olan bir dünya seçmek ve uyum sağlamak, onlara kendi kültürleri ile ıssız bir adada mahsur kalmak arasında bir teknoloji seviyesine erişim sağlar. * Kamuflaj; kendi kültürlerinden üyeler tarafından aranıyorlar ve kendi ortamlarında olduğundan aramızda saklanmak ve hayatta kalmak daha kolay. Bunun kurguda birçok örneği var: For Richer or Poorer, Men in Black II ve bu, yasadan kaçıp iade anlaşması olmayan bir ülkeye emekli olmaya benziyor. * Kaza İnişi veya eve dönmelerini engelleyen bir arıza; FTL iletişimleri olmayan bir FTL gemisinde geldiyseler, yedek parça veya güncellenmiş navigasyon haritaları için uzun süre beklemeleri gerekebilir veya eve dönme planlarını mahvetmeye devam eden Gilligan'ı getirdilerse veya ışıktan daha yavaş bir koloni gemisinde gelmiş olabilirler ve başka bir olası koloni aramaya çalışmaktansa burada kalmayı ve aramıza uyum sağlamayı tercih edebilirler. * Yükseltme; bizi gelişimin "doğru" yoluna yönlendirmek ve kendimizi yok etmemizi önlemek için karışmak (veya türünüz rekabeti sevmiyorsa tam tersi).
61
I've taken a look at the list of surveys taken on scala-lang.org and noticed a curious question: "Can you name all the uses of “_”?". Can you? If yes, please do so here. Explanatory examples are appreciated.
scala-lang.org'da yapılan anketlerin listesine göz attım ve ilginç bir soru fark ettim: ""_"'nin tüm kullanımlarını sayabilir misiniz?". Siz sayabilir misiniz? Evet ise, lütfen burada yapın. Açıklayıcı örnekler takdir edilir.
The following is an explanation of the uses of the underscore is Scala _ [underscore] magic. Examples: ``` def matchTest(x: Int): String = x match { case 1 => "one" case 2 => "two" case _ => "anything other than one and two" } expr match { case List(1,_,_) => " a list with three element and the first element is 1" case List(_*) => " a list with zero or more elements " case Map[_,_] => " matches a map with any key type and any value type " case _ => } List(1,2,3,4,5).foreach(print(_)) // Doing the same without underscore: List(1,2,3,4,5).foreach( a => print(a)) ``` In Scala, ```_``` acts similar to ```*``` in Java while importing packages. ```// Imports all the classes in the package matching import scala.util.matching._ // Imports all the members of the object Fun (static import in Java). import com.test.Fun._ // Imports all the members of the object Fun but renames Foo to Bar import com.test.Fun.{ Foo => Bar , _ } // Imports all the members except Foo. To exclude a member rename it to _ import com.test.Fun.{ Foo => _ , _ } ``` In Scala, a getter and setter will be implicitly defined for all non-private vars in a object. The getter name is same as the variable name and ```_=``` is added for the setter name. ```class Test { private var a = 0 def age = a def age_=(n:Int) = { require(n>0) a = n } } ``` Usage: ```val t = new Test t.age = 5 println(t.age) ``` If you try to assign a function to a new variable, the function will be invoked and the result will be assigned to the variable. This confusion occurs due to the optional braces for method invocation. We should use _ after the function name to assign it to another variable. ```class Test { def fun = { // Some code } val funLike = fun _ } ```
Aşağıda Scala'daki alt çizginin kullanımlarının açıklaması yer almaktadır _ [alt çizgi] büyüsü. Örnekler: ``` def matchTest(x: Int): String = x match { case 1 => "one" case 2 => "two" case _ => "anything other than one and two" } expr match { case List(1,_,_) => " a list with three element and the first element is 1" case List(_*) => " a list with zero or more elements " case Map[_,_] => " matches a map with any key type and any value type " case _ => } List(1,2,3,4,5).foreach(print(_)) // Aynısını alt çizgi olmadan yapmak: List(1,2,3,4,5).foreach( a => print(a)) ``` Scala'da ```_```, paketleri içe aktarırken Java'daki ```*``` ile benzer şekilde davranır. ```// Eşleşen paketteki tüm sınıfları içe aktarır import scala.util.matching._ // Fun nesnesinin tüm üyelerini içe aktarır (Java'da statik içe aktarma). import com.test.Fun._ // Fun nesnesinin tüm üyelerini içe aktarır ancak Foo'yu Bar olarak yeniden adlandırır import com.test.Fun.{ Foo => Bar , _ } // Foo hariç tüm üyeleri içe aktarır. Bir üyeyi hariç tutmak için onu _ olarak yeniden adlandırın import com.test.Fun.{ Foo => _ , _ } ``` Scala'da, bir nesnedeki tüm özel olmayan değişkenler için bir getter ve setter örtük olarak tanımlanır. Getter adı değişken adıyla aynıdır ve setter adı için ```_=``` eklenir. ```class Test { private var a = 0 def age = a def age_=(n:Int) = { require(n>0) a = n } } ``` Kullanım: ```val t = new Test t.age = 5 println(t.age) ``` Bir fonksiyonu yeni bir değişkene atamayı denerseniz, fonksiyon çağrılacak ve sonuç değişkene atanacaktır. Bu karışıklık, metot çağrısı için isteğe bağlı parantezler nedeniyle oluşur. Fonksiyonu başka bir değişkene atamak için fonksiyon adından sonra _ kullanmalıyız. ```class Test { def fun = { // Bazı kod } val funLike = fun _ } ```
62
My university usually asks that we book a flight via a travel agent, but the prices he gives me are about $50 higher than the prices I can get by online booking in the flight company's website. Why would a company want me to book a flight via a travel agent if it is more expensive?
Üniversitem genellikle bir seyahat acentesi aracılığıyla uçuş rezervasyonu yapmamızı ister, ancak bana verdiği fiyatlar, uçuş şirketinin web sitesinden çevrimiçi rezervasyon yaparak alabileceğim fiyatlardan yaklaşık 50 dolar daha yüksek. Bir şirket, daha pahalıysa neden bir seyahat acentesi aracılığıyla uçuş rezervasyonu yapmamı istesin ki?
There are several reasons why such internal policies exist: * Your institution may get a discount on certain services of the travel agent if it buys enough from the agent * By having a contract with a reasonably-priced travel agent, they make sure that no employee books the flight with a very pricey agent or with a travel agent that happens to be a relative of the traveller * The travel agency offers easy methods to verify expense information and thus may lower the workload of your local administrative personnel. This especially holds if the payment is routed directly from the institution to the travel agent, which also makes sure that the flyer does not get credit card bonus points for the booking. * Your institution may have an agreement with the travel agent that they manually check if members of your institution are not unnecessarily booking expensive booking classes (in order to get more airline bonus miles) * Some insurances that your institution bought may only work if the ticket is bought directly from the institution and not by the flyer, and they elected the agent to handle such bookings. Which of these reasons is the one why this policy exists can only be answered by the responsible employees of your institution.
Bu tür iç politikaların var olmasının birkaç nedeni vardır: * Kurumunuz, seyahat acentesinden yeterince satın alırsa, seyahat acentesinin belirli hizmetlerinde indirim alabilir * Uygun fiyatlı bir seyahat acentesiyle sözleşme yaparak, hiçbir çalışanın uçuşu çok pahalı bir acenteden veya tesadüfen yolcunun akrabası olan bir seyahat acentesinden ayırt ettiğinden emin olurlar * Seyahat acentesi, gider bilgilerini doğrulamanın kolay yöntemlerini sunar ve böylece yerel idari personelin iş yükünü azaltabilir. Bu özellikle ödeme doğrudan kurumdan seyahat acentesine yönlendirilirse geçerlidir, bu da ayrıca uçan kişinin rezervasyon için kredi kartı bonus puanı almadığından emin olur. * Kurumunuzun, kurumunuzun üyelerinin gereksiz yere pahalı rezervasyon sınıfları (daha fazla havayolu bonus mili almak için) ayırt edip etmediğini manuel olarak kontrol eden seyahat acentesiyle bir anlaşması olabilir * Kurumunuzun satın aldığı bazı sigortalar, bilet doğrudan kurumdan satın alınır ve uçan kişi tarafından satın alınmazsa ve bu tür rezervasyonları yapmak için acenteyi seçmişlerse çalışabilir. Bu politikanın var olmasının nedenlerinden hangisinin geçerli olduğunu yalnızca kurumunuzun sorumlu çalışanları cevaplayabilir.
63
Layman's explanation of encryption backdoors
Şifreleme arka kapılarının amatörce açıklaması
There are two somewhat orthogonal concepts in backdooring encryption algorithms: * The backdoor can be explicit or implicit. An explicit backdoor is one that everybody knows it is there. An implicit backdoor strives at remaining undetected by the algorithm owners. Of course, when there is an explicit backdoor, people tend to avoid the algorithm altogether, so explicit backdoors may hope to work only in the presence of a legal framework that forces implementers to use the backdoored system. An example of an explicit backdoor is the Clipper chip (which was ultimately abandoned). The backdoor is not really in the algorithm, more in the assembly of algorithms into a protocol, and technically it was an automatic key escrowing method. For an implicit backdoor, see the Dual EC DRBG as a famous example: it worked only as long as nobody was aware that it was backdoored. * The backdoor's security may be quantifiable, or not. In the case of Dual EC DRBG, the mechanism uses well-trodden mathematical paths: the NSA knew that exploiting the backdoor required knowledge of an internal secret key, based on discrete logarithm (on elliptic curves). A non-quantifiable security is what happens when you try to push, for instance, a voluntarily flawed algorithm, or one for which you know of a cryptanalytic method that you did not publish. This is a very dangerous game for a spy agency, because you cannot really know whether third parties could find the flaw or not. Such backdooring tends to backfire in the long term. Interestingly, the NSA tends not to use non-quantifiable backdoors. A good example is DES. At the time it was designed, the NSA believed that it could tackle an upfront 256 exhaustive search, and that nobody else (in particular the Soviets) had the technology and budget for that. The NSA also knew of a novel cryptanalytic method (differential cryptanalysis). So when the NSA intervened in the design of DES, it insisted on shortening the key from 64 to 56 bits (that's addition of a quantifiable backdoor, and it was rather obvious, so quasi-explicit), and also on strengthening the design against differential cryptanalysis. This is a good example about how NSA consciously refrained from a non-quantifiable backdoor. There is only one thing that spy agencies fear more than not being able to spy: it is the idea that other competing spy agencies may also spy. So a real, good backdoor is one that uses maths to offer quantifiable security against unauthorized usage of the backdoor. It is extremely difficult to have quantifiable security without making the backdoor explicit. The "best in class" in that area is Dual EC DRBG, and even before the Snowden business, cryptographers were already finding it weird and strongly suspected foul play (see the analyses back in 2007, 6 years before Snowden).
Arka kapı şifreleme algoritmalarında birbirine dik iki kavram vardır: * Arka kapı açık veya örtük olabilir. Açık arka kapı, herkesin varlığını bildiği arka kapıdır. Örtük arka kapı, algoritma sahipleri tarafından tespit edilmemeye çalışır. Elbette açık bir arka kapı olduğunda, insanlar algoritmadan tamamen kaçınma eğilimindedir, bu nedenle açık arka kapılar yalnızca uygulayıcıları arka kapılı sistemi kullanmaya zorlayan yasal bir çerçeve varlığında çalışmayı umabilir. Açık bir arka kapının bir örneği, (sonunda terk edilen) Clipper çipidir. Arka kapı aslında algoritmada değil, algoritmaların bir protokole montajında daha fazladır ve teknik olarak otomatik bir anahtar emanet etme yöntemiydi. Örtük bir arka kapı için ünlü bir örnek olarak Dual EC DRBG'ye bakın: yalnızca arka kapı olduğu kimsenin farkında olmadığı sürece çalıştı. * Arka kapının güvenliği ölçülebilir veya ölçülemez olabilir. Dual EC DRBG durumunda, mekanizma iyi bilinen matematiksel yollar kullanır: NSA, arka kapıyı kullanmanın eliptik eğriler üzerindeki ayrık logaritmaya dayalı dahili bir gizli anahtar bilgisi gerektirdiğini biliyordu. Ölçülemez güvenlik, örneğin gönüllü olarak kusurlu bir algoritmayı veya yayınlamadığınız kriptoanalitik bir yöntem bildiğiniz bir algoritmayı zorlamaya çalıştığınızda ortaya çıkar. Bu, bir casusluk ajansı için çok tehlikeli bir oyundur, çünkü üçüncü tarafların kusuru bulup bulamayacağını gerçekten bilemezsiniz. Bu tür arka kapılar uzun vadede ters tepebilir. İlginç bir şekilde, NSA ölçülemez arka kapılar kullanma eğiliminde değildir. İyi bir örnek DES'tir. Tasarlandığı sırada NSA, 256 bitlik bir kapsamlı aramayla başa çıkabileceğine ve başka kimsenin (özellikle Sovyetler'in) bunun için teknoloji ve bütçeye sahip olmadığına inanıyordu. NSA ayrıca yeni bir kriptoanalitik yöntem (farklı kriptoanaliz) biliyordu. Bu nedenle NSA, DES'in tasarımına müdahale ettiğinde, anahtarı 64'ten 56 bite kısaltmakta ısrar etti (bu, ölçülebilir bir arka kapının eklenmesidir ve oldukça açıktı, bu nedenle yarı açık) ve ayrıca tasarımı farklı kriptoanalize karşı güçlendirdi. Bu, NSA'nın ölçülemez bir arka kapıdan bilinçli olarak nasıl kaçındığına dair iyi bir örnektir. Casusluk kurumlarının casusluk yapamamaktan korktuğu tek bir şey vardır: o da diğer rakip casusluk kurumlarının da casusluk yapabileceği fikridir. Bu nedenle gerçek, iyi bir arka kapı, arka kapının yetkisiz kullanılmasına karşı ölçülebilir güvenlik sağlamak için matematik kullanan arka kapıdır. Arka kapıyı açık hale getirmeden ölçülebilir güvenliğe sahip olmak son derece zordur. Bu alandaki "en iyisi", Dual EC DRBG'dir ve Snowden olayından önce bile kriptograflar bunu garip buluyor ve şüpheli bir oyun olduğundan şüpheleniyorlardı (Snowden'dan 6 yıl önce 2007'deki analizlere bakın).
64
I have a page where a scroll bar containing table rows with divs in them is dynamically generated from the database. Each table row acts like a link, sort of like you'd see on a YouTube playlist next to the video player. When a user visits the page, the option they are on is supposed to go to the top of the scrolling div. This functionality is working. The issue is that it goes just a tad too far. Like the option they are on is about 10px too high. So, the page is visited, the url is used to identify which option was selected and then scrolls that option to the top of the scrolling div. Note: This is not the scroll bar for the window, it is a div with a scrollbar. I am using this code to make it move the selected option to the top of the div: ```var pathArray = window.location.pathname.split( '/' ); var el = document.getElementById(pathArray[5]); el.scrollIntoView(true); ``` It moves it to the top of the div but about 10 pixels too far up. how to fix that?
Veritabanından dinamik olarak divler içeren tablo satırlarını içeren bir kaydırma çubuğunun bulunduğu bir sayfam var. Her tablo satırı, video oynatıcının yanında bir YouTube oynatma listesinde göreceğiniz gibi bir bağlantı gibi davranır. Bir kullanıcı sayfayı ziyaret ettiğinde, üzerinde bulundukları seçenek kayan div'in en üstüne gitmelidir. Bu işlev çalışıyor. Sorun, biraz fazla ileri gitmesidir. Üzerinde bulundukları seçenek yaklaşık 10 piksel çok yüksek. Bu nedenle, sayfa ziyaret edilir, hangi seçeneğin seçildiğini belirlemek için url kullanılır ve ardından bu seçenek kayan div'in en üstüne kaydırılır. Not: Bu, pencere için kaydırma çubuğu değil, kaydırma çubuğu olan bir div'dir. Seçili seçeneği div'in en üstüne taşımak için bu kodu kullanıyorum: ```var pathArray = window.location.pathname.split( '/' ); var el = document.getElementById(pathArray[5]); el.scrollIntoView(true); ``` Div'in en üstüne taşıyor ancak yaklaşık 10 piksel çok yukarıda. Bunu nasıl düzeltebilirim?
CSS ```scroll-margin``` and ```scroll-padding``` You might want to have a look at new CSS properties ```scroll-padding``` and ```scroll-margin```. You can use ```scroll-padding``` for the scrolling container (```html``` in this case), and ```scroll-margin``` for the element within the container. For your example, you would want to add ```scroll-margin-top``` for the element that you want to scroll into view, like this: ```.example { scroll-margin-top: 10px; } ``` This affects ```scrollIntoView``` code, like this code: ```const el = document.querySelector(&quot;.example&quot;); el.scrollIntoView({block: &quot;start&quot;, behavior: &quot;smooth&quot;}); ``` This will cause the viewport to scroll to align the top border of the viewport with the top border of the element, but with 10px of additional space. In other words, these properties of the element are taken into account: * ```padding-top``` * ```border-top``` * ```scroll-margin-top``` * (and not ```margin-top```) In addition, if the ```html``` element has ```scroll-padding-top``` set, then that is taken into account too. If you're using a framework like Vue, you might want to make sure that all changes to the DOM are finished before running `scrollIntoView` by using something like `Vue.nextTick(() => el.scrollIntoView())`
CSS ```scroll-margin``` ve ```scroll-padding``` Yeni CSS özellikleri ```scroll-padding``` ve ```scroll-margin```'e göz atmak isteyebilirsiniz. ```scroll-padding```'i kaydırma kabı (bu durumda ```html```) için ve ```scroll-margin```'i kaptaki öğe için kullanabilirsiniz. Örneğiniz için, görünümde kaydırmak istediğiniz öğe için ```scroll-margin-top``` eklemek isteyebilirsiniz, şöyle: ```.example { scroll-margin-top: 10px; } ``` Bu, ```scrollIntoView``` kodunu şu kod gibi etkiler: ```const el = document.querySelector(&quot;.example&quot;); el.scrollIntoView({block: &quot;start&quot;, behavior: &quot;smooth&quot;}); ``` Bu, görünüm alanının kaydırılmasına neden olarak görünüm alanının üst kenarını öğenin üst kenarıyla hizalar, ancak 10 piksel ek boşluk bırakır. Başka bir deyişle, öğenin şu özellikleri dikkate alınır: * ```padding-top``` * ```border-top``` * ```scroll-margin-top``` * (ve ```margin-top``` değil) Ayrıca, ```html``` öğesinin ```scroll-padding-top``` ayarı varsa, bu da dikkate alınır. Vue gibi bir çerçeve kullanıyorsanız, `Vue.nextTick(() => el.scrollIntoView())` gibi bir şey kullanarak `scrollIntoView`'u çalıştırmadan önce DOM'daki tüm değişikliklerin tamamlandığından emin olmak isteyebilirsiniz.
65
Suppose I have the geographic coordinates of &quot;Saratoga, California, USA&quot; as ```Latitude: 37°15.8298′ N Longitude: 122° 1.3806′ W ``` I know from here that in the case of latitude ```1° ≈ 69 miles``` and that longitude varies: ```1° longitude = cosine (latitude) * length of degree (miles) at Equator. ``` How many miles is 1° longitude at ```longitude: 122°1.3806′ W```?
Diyelim ki "Saratoga, Kaliforniya, ABD"nin coğrafi koordinatları şu şekilde: ```Enlem: 37°15.8298′ K Boylam: 122° 1.3806′ B ``` Buradan enlem durumunda ```1° ≈ 69 mil``` olduğunu ve boylamın değiştiğini biliyorum: ```1° boylam = kosinüs (enlem) * Ekvator'daki derece uzunluğu (mil). ``` ```boylam: 122°1.3806′ B``` noktasında 1° boylam kaç mildir?
It doesn't matter at what longitude you are. What matters is what latitude you are. Length of ```1 degree of Longitude``` = ```cosine (latitude in radians) * length of degree (miles) at equator```. Convert your latitude into decimal degrees ~ 37.26383 Convert your decimal degrees into radians ~ 0.65038 Take the cosine of the value in radians ~ 0.79585 1 degree of Longitude = ~0.79585 * 69.172 = ~ 55.051 miles More useful information from the about.com website: Degrees of latitude are parallel so the distance between each degree remains almost constant but since degrees of longitude are farthest apart at the equator and converge at the poles, their distance varies greatly. Each degree of latitude is approximately 69 miles (111 kilometers) apart. The range varies (due to the earth's slightly ellipsoid shape) from 68.703 miles (110.567 km) at the equator to 69.407 (111.699 km) at the poles. This is convenient because each minute (1/60th of a degree) is approximately one [nautical] mile. A degree of longitude is widest at the equator at 69.172 miles (111.321) and gradually shrinks to zero at the poles. At 40° north or south the distance between a degree of longitude is 53 miles (85 km) Note that the original site (about.com) erroneously omitted the &quot;nautical&quot; qualifier.
Hangi boylamda olduğunuzun bir önemi yok. Önemli olan hangi enlemde olduğunuzdur. ```1 boylam derecesinin uzunluğu``` = ```(radyan cinsinden enlem) * ekvatordaki derece uzunluğu (mil)```. Enleminizi ondalık dereceye dönüştürün ~ 37.26383 Ondalık derecenizi radyana dönüştürün ~ 0.65038 Radyandaki değerin kosinüsünü alın ~ 0.79585 1 boylam derecesi = ~0.79585 * 69.172 = ~ 55.051 mil about.com web sitesinden daha faydalı bilgiler: Enlem dereceleri paraleldir, bu nedenle her derece arasındaki mesafe neredeyse sabit kalır ancak boylam dereceleri ekvatorda en uzakta olduğu ve kutuplarda birleştiği için mesafeleri büyük ölçüde değişir. Her enlem derecesi yaklaşık 69 mil (111 kilometre) aralıklıdır. Aralık (dünyanın hafif elipsoid şeklinden dolayı) ekvatorda 68.703 mil (110.567 km) ile kutuplarda 69.407 (111.699 km) arasında değişir. Bu kullanışlıdır çünkü her dakika (bir derecenin 1/60'ı) yaklaşık bir [deniz] milidir. Bir boylam derecesi ekvatorda 69.172 mil (111.321) en geniştir ve kutuplarda kademeli olarak sıfıra düşer. 40° kuzey veya güneyde bir boylam derecesi arasındaki mesafe 53 mil (85 km)'dir. Orijinal sitenin (about.com) "deniz" niteleyicisini yanlışlıkla atladığını unutmayın.
66
I have read numerous times that some Norse warriors, upon death, would go in Fólkvangr, while some others would go to Valhalla. How was it decided which warrior would go to which place? Why did the need to have many "paradises" (whatever you many call it) exist? Citing Wikipedia: > In Norse mythology, Fólkvangr (Old Norse "field of the host" or "people-field" or "army-field") is a meadow or field ruled over by the goddess Freyja where half of those that die in combat go upon death, while the other half go to the god Odin in Valhalla.
Bazı İskandinav savaşçılarının ölümden sonra Fólkvangr'a giderken bazılarının da Valhalla'ya gideceğini defalarca okudum. Hangi savaşçının hangi yere gideceğine nasıl karar veriliyordu? Neden birçok "cennet"e (her ne adlandırıyorsanız) ihtiyaç duyuluyordu? Wikipedia'dan alıntı: > İskandinav mitolojisinde Fólkvangr (Eski İskandinavca "ordunun alanı" veya "halk alanı" veya "ordu alanı"), savaşta ölenlerin yarısının ölümden sonra gittiği, diğer yarısının ise Valhalla'da tanrı Odin'e gittiği, tanrıça Freyja tarafından yönetilen bir çayır veya alandır.
The Norse mythological texts record three primary places where the dead were perceived to go: Helheim (Old Norse Helheimr, “the home of the goddess Hel“), Valhalla (Old Norse Valhöll, “the hall of the fallen”), and Folkvang (Old Norse Fólkvangr, “the field of the people” or “the field of warriors”). But they're indistinguishable and don't have any major differences between them. Valhalla is presided over by Odin, and to gain entrance to it, one must be chosen by him and his valkyries, the “choosers of the fallen.” Similarily, entrance to Folkvang is dependent upon being selected by Freya. Valhalla is often depicted as a realm where distinguished warriors engage in a continuous battle, and just such a place is described, in important early sources, as being located beneath the ground – and, intriguingly, without the name “Valhalla” or a cognate anywhere in the account. source: Ellis, Hilda Roderick. 1968. The Road to Hel: A Study of the Conception of the Dead in Old Norse Literature. p. 85-86. * Folkvang is the ninth, and there Freyia arranges the choice of seats in the hall; half the slain she chooses every day, and half Odin owns. source: 1996 Carolyne Larrington in The Poetic Edda “Grimnir’s Sayings” The only difference that is pointed out, is in the way that the dead are chosen to stay. Odin chooses for Valhalla, while Freya chooses for Folkvang. Coming to the second part of the question: And why did the need to have many "paradises" (whatever you many call it) exist? Hel is a place where all humans have to go after their death: “For there is a time when every man shall journey hence to Hel." Fáfnismál 10 So before the dead finally reach Hel, Odin and Freyja select the ones who are worthy of living in Valhalla and Folkvang. Therefore, * Valhalla receives distinguished warriors. * Folkvangr receives the rest of the warriors. * Hel receives the rest of the dead. source: Norse-Mythology.org
İskandinav mitolojik metinleri, ölülerin gidebileceği üç ana yeri kaydeder: Helheim (Eski İskandinavca Helheimr, "Hel tanrıçasının evi"), Valhalla (Eski İskandinavca Valhöll, "düşmüşlerin salonu") ve Folkvang (Eski İskandinavca Fólkvangr, "halkın tarlası" veya "savaşçıların tarlası"). Ancak bunlar ayırt edilemez ve aralarında büyük farklar yoktur. Valhalla'ya Odin başkanlık eder ve buraya girmek için kişinin kendisi ve "düşmüşlerin seçicileri" olan valkyrileri tarafından seçilmesi gerekir. Benzer şekilde, Folkvang'a giriş, Freya tarafından seçilmeye bağlıdır. Valhalla genellikle seçkin savaşçıların sürekli bir savaşa girdiği bir alem olarak tasvir edilir ve böyle bir yer, önemli erken kaynaklarda, yerin altında ve ilginç bir şekilde "Valhalla" adı veya herhangi bir yerde bir benzeri olmadan tanımlanır. kaynak: Ellis, Hilda Roderick. 1968. Hel'e Giden Yol: Eski İskandinav Edebiyatında Ölü Kavramı Üzerine Bir Çalışma. s. 85-86. * Folkvang dokuzuncu ve orada Freyia salonda koltukların seçimini ayarlar; her gün öldürülenlerin yarısını o seçer ve yarısı Odin'e aittir. kaynak: 1996 Carolyne Larrington, Şiirsel Edda'da "Grimnir'in Sözleri" Belirtlen tek fark, ölülerin kalmak üzere seçilme şeklidir. Odin Valhalla için seçerken, Freya Folkvang için seçer. Sorunun ikinci kısmına gelince: Ve neden birçok "cennet"e (ne derseniz deyin) sahip olma ihtiyacı vardı? Hel, tüm insanların ölümden sonra gitmek zorunda olduğu bir yerdir: "Çünkü bir zaman vardır her insanın buradan Hel'e yolculuk edeceği." Fáfnismál 10 Bu nedenle, ölüler nihayet Hel'e ulaşmadan önce Odin ve Freyja, Valhalla ve Folkvang'da yaşamaya layık olanları seçerler. Bu nedenle, * Valhalla seçkin savaşçıları alır. * Folkvangr savaşçıların geri kalanını alır. * Hel ölülerin geri kalanını alır. kaynak: Norse-Mythology.org
67
I noticed that there is a binary executable ```/bin/echo``` on my Ubuntu MATE 17.04 system. I thought, that's odd, because ```$ type echo echo is a shell builtin``` Cursory testing suggests that ```/bin/echo``` does the same sort of thing as the Bash builtin ```echo```: ```$ /bin/echo foo foo $ /bin/echo $USER zanna ``` So, why is there another version of ```echo``` separate from the Bash program, and why or when would I want to use it?
Ubuntu MATE 17.04 sistemimde ```/bin/echo``` adında ikili bir yürütülebilir dosya olduğunu fark ettim. Bu tuhaf diye düşündüm, çünkü ```$ type echo echo bir kabuk yerleşiktir``` Geçici testler, ```/bin/echo```'nun Bash yerleşik ```echo```'suyla aynı türden şeyleri yaptığını gösteriyor: ```$ /bin/echo foo foo $ /bin/echo $USER zanna ``` Öyleyse, Bash programından ayrı neden başka bir ```echo``` sürümü var ve neden veya ne zaman kullanmak isterim?
If you open up a ```bash``` prompt and type in an ```echo``` command, that uses a shell builtin rather than running ```/bin/echo```. The reasons it is still important for ```/bin/echo``` to exist are: * You're not always using a shell. Under a variety of circumstances, you run an executable directly and not through a shell. * At least in theory, some shells don't have an ```echo``` builtin. This is not actually required. To expand on #1, suppose you wanted to move all the regular files whose names started with ```abc``` anywhere in ```src``` to ```dest```. There are several ways to do that but one of them is: ```find src -name 'abc*' -type f -exec mv -nv {} dest/ \; ``` But suppose, rather than just running that, you want to see every command that will be run first. Well, then you can prepend ```echo``` to the command, just as you might in other contexts: ```find src -name 'abc*' -type f -exec echo mv -nv {} dest/ \; ``` But ```find``` doesn't use a shell. That runs ```/bin/echo```. Besides ```find``` with ```-exec``` or ```-execdir```, the ```/bin/echo``` executable will be called by other programs that themselves run programs but not through a shell. This happens with the ```xargs``` command (which is related to ```find```), as well as in a number of other contexts, such as the ```Exec=``` line of a ```.desktop``` file. Another example is when you run ```sudo echo```, which can be handy for testing if ```sudo``` is working. Similarly, some shells have a ```printf``` builtin but ```/usr/bin/printf``` also exists. A less common possible reason you might deliberately use ```/bin/echo``` is if you were relying on the differences between it and the ```echo``` command provided by your shell. ```man echo``` documents ```/bin/echo```; ```help echo``` in ```bash``` documents the ```bash``` builtin. ```echo``` is not very portable, because different implementations--both across operating systems and across shells on the same operating system--support different options (e.g., ```-e```) and differ in their treatment of backslashes. Of course, it's better to avoid relying on such details, and use ```printf``` instead, which is far more portable. In ```bash```, you can make the ```type``` builtin show ```/bin/echo``` as well--assuming ```/bin``` is in your ```$PATH``` as it always should be--by passing it the ```-a``` flag: ```$ type -a echo echo is a shell builtin echo is /bin/echo ```
Bir ```bash``` komut istemini açıp bir ```echo``` komutu yazarsanız, bu ```/bin/echo``` çalıştırmak yerine bir kabuk yerleşik birimini kullanır. ```/bin/echo```'nun var olmasının hâlâ önemli olmasının nedenleri şunlardır: * Her zaman bir kabuk kullanmazsınız. Çeşitli koşullar altında, bir yürütülebilir dosyayı doğrudan ve bir kabuk aracılığıyla değil çalıştırırsınız. * En azından teoride, bazı kabukların ```echo``` yerleşik birimi yoktur. Bu aslında gerekli değildir. 1 numaralı maddeyi genişletmek için, adları ```abc``` ile başlayan tüm normal dosyaları ```src```'nin herhangi bir yerinden ```dest```'e taşımak istediğinizi varsayalım. Bunu yapmanın birkaç yolu vardır ancak bunlardan biri şudur: ```find src -name 'abc*' -type f -exec mv -nv {} dest/ \; ``` Ancak bunu çalıştırmak yerine, önce çalıştırılacak her komutu görmek istiyorsanız, tıpkı diğer bağlamlarda yapabileceğiniz gibi komuta ```echo``` ekleyebilirsiniz: ```find src -name 'abc*' -type f -exec echo mv -nv {} dest/ \; ``` Ancak ```find``` bir kabuk kullanmaz. Bu ```/bin/echo``` çalıştırır. ```-exec``` veya ```-execdir``` ile ```find```'ın yanı sıra, ```/bin/echo``` yürütülebilir dosyası, programları bir kabuk aracılığıyla değil kendileri çalıştıran diğer programlar tarafından çağrılacaktır. Bu, ```xargs``` komutuyla (```find``` ile ilgilidir) ve ```.desktop``` dosyasının ```Exec=``` satırı gibi bir dizi başka bağlamda gerçekleşir. ```sudo echo``` çalıştırdığınızda, ```sudo```'nun çalışıp çalışmadığını test etmek için kullanışlı olabilecek başka bir örnektir. Benzer şekilde, bazı kabukların ```printf``` yerleşik birimi vardır ancak ```/usr/bin/printf``` de vardır. ```/bin/echo```'yu kasıtlı olarak kullanmanızın daha az yaygın bir olası nedeni, kabuğunuzun sağladığı ```echo``` komutu ile arasındaki farklara güvenmenizdir. ```man echo```, ```/bin/echo```'yu belgeler; ```bash```'deki ```help echo```, ```bash``` yerleşik birimini belgeler. ```echo``` çok taşınabilir değildir, çünkü hem işletim sistemleri hem de aynı işletim sistemindeki kabuklar arasında farklı uygulamalar farklı seçenekleri (ör. ```-e```) destekler ve ters çizgilerle ilgili işlemlerinde farklılık gösterir. Elbette bu tür ayrıntılara güvenmekten kaçınmak ve bunun yerine çok daha taşınabilir olan ```printf```'i kullanmak daha iyidir. ```bash```'de, ```/bin``` her zaman olması gerektiği gibi ```$PATH```'inizde olduğunu varsayarak, ```type``` yerleşik biriminin ```/bin/echo```'yu da göstermesini sağlayabilirsiniz; ona ```-a``` bayrağını geçirin: ```$ type -a echo echo is a shell builtin echo is /bin/echo ```
68
what's the difference between JavaScript objects, classes and functions?
JavaScript nesneleri, sınıfları ve fonksiyonları arasındaki fark nedir?
As you must already be aware by now there are no classes in JavaScript. Instead functions in JavaScript may be made to behave like constructors by preceding a function call with the ```new``` keyword. This is known as the constructor pattern. In JavaScript everything is an object except for the primitive data types (boolean, number and string), and ```undefined```. On the other hand ```null``` is actually an object reference even though you may at first believe otherwise. This is the reason ```typeof null``` returns ```&quot;object&quot;```. Functions in JavaScript are similar to functables in Lua (i.e. they are callable objects). Hence a function can be used in place of an object. Similarly arrays are also objects in JavaScript. On the other hand objects can be thought of as associative arrays. The most important point however is that there are no classes in JavaScript because JavaScript is a prototypal object oriented language. This means that objects in JavaScript directly inherit from other objects. Hence we don't need classes. All we need is a way to create and extend objects.
Şu ana kadar farkında olduğunuz gibi JavaScript'te sınıflar yoktur. Bunun yerine JavaScript'teki fonksiyonlar, bir fonksiyon çağrısına ```new``` anahtar kelimesi eklenerek yapıcı gibi davranmaya zorlanabilir. Bu, yapıcı kalıbı olarak bilinir. JavaScript'te ilkel veri türleri (boolean, sayı ve dize) ve ```undefined``` hariç her şey bir nesnedir. Öte yandan ```null```, ilk başta başka türlü düşünebilseniz de aslında bir nesne referansıdır. ```typeof null```'un ```&quot;object&quot;``` döndürmesinin nedeni budur. JavaScript'teki fonksiyonlar, Lua'daki fonksiyonlara benzer (yani çağrılabilir nesnelerdir). Bu nedenle bir fonksiyon, bir nesne yerine kullanılabilir. Benzer şekilde diziler de JavaScript'te nesnelerdir. Öte yandan nesneler ilişkisel diziler olarak düşünülebilir. Ancak en önemli nokta, JavaScript'te sınıfların olmamasıdır çünkü JavaScript prototip tabanlı bir nesne yönelimli dildir. Bu, JavaScript'teki nesnelerin doğrudan diğer nesnelerden devralındığı anlamına gelir. Bu nedenle sınıflara ihtiyacımız yok. Tek ihtiyacımız olan nesneler oluşturmanın ve genişletmenin bir yoludur.
69
In most introductory algorithm classes, notations like $O$ (Big O) and $\Theta$ are introduced, and a student would typically learn to use one of these to find the time complexity. However, there are other notations, such as $o$, $\Omega$ and $\omega$. Are there any specific scenarios where one notation would be preferable to another?
Çoğu giriş algoritması dersinde, $O$ (Büyük O) ve $\Theta$ gibi gösterimler tanıtılır ve bir öğrenci tipik olarak zaman karmaşıklığını bulmak için bunlardan birini kullanmayı öğrenir. Ancak, $o$, $\Omega$ ve $\omega$ gibi başka gösterimler de vardır. Bir gösterimin diğerine tercih edileceği belirli senaryolar var mıdır?
You are referring to the Landau notation. They are not different symbols for the same thing but have entirely different meanings. Which one is "preferable" depends entirely on the desired statement. $f \in \cal{O}(g)$ means that $f$ grows at most as fast as $g$, asymptotically and up to a constant factor; think of it as a $\leq$. $f \in o(g)$ is the stricter form, i.e. $ $f \in \Omega(g)$ has the symmetric meaning: $f$ grows at least as fast as $g$. $\omega$ is its stricter cousin. You can see that $f \in \Omega(g)$ is equivalent to $g \in \cal{O}(f)$. $f \in \Theta(g)$ means that $f$ grows about as fast as $g$; formally $f \in \cal{O}(g) \cap \Omega(g)$. $f \sim g$ (asymptotic equality) is its stronger form. We often mean $\Theta$ when we use $\cal{O}$. Note how $\cal{O}(g)$ and its siblings are function classes. It is important to be very aware of this and their precise definitions -- which can differ depending on who is talking -- when doing "arithmetics" with them. When proving things, take care to work with your precise definition. There are many definitions for Landau symbols around (all with the same basic intuition), some of which are equivalent on some sets on functions but not on others. If you are interested in using Landau notation in a rigorous and sound manner, you may be interested in a work by Rutanen et al.. They formulate necessary and sufficient criteria for asymptotic notation as we use them in algorithmics, show that the common definition fails to meet them and provide a (the, in fact) workable definition. * A general definition of the O-notation for algorithm analysis by K. Rutanen et al. (2015)
Landau gösterimine atıfta bulunuyorsunuz. Bunlar aynı şey için farklı semboller değil, tamamen farklı anlamlara sahiptir. Hangisinin "tercih edilebilir" olduğu tamamen istenen ifadeye bağlıdır. $f \in \cal{O}(g)$, $f$'nin asimptotik olarak ve sabit bir faktöre kadar en fazla $g$ kadar büyüdüğü anlamına gelir; bunu bir $\leq$ olarak düşünün. $f \in o(g)$, daha katı bir biçimdir, yani $f \in \Omega(g)$, simetrik bir anlama sahiptir: $f$, en az $g$ kadar büyür. $\omega$, onun daha katı kuzenidir. $f \in \Omega(g)$'nin $g \in \cal{O}(f)$ ile eşdeğer olduğunu görebilirsiniz. $f \in \Theta(g)$, $f$'nin yaklaşık olarak $g$ kadar büyüdüğü anlamına gelir; resmi olarak $f \in \cal{O}(g) \cap \Omega(g)$. $f \sim g$ (asimptotik eşitlik), onun daha güçlü biçimidir. $\cal{O}$'yu kullandığımızda genellikle $\Theta$'yı kastediyoruz. $\cal{O}(g)$ ve kardeşlerinin fonksiyon sınıfları olduğuna dikkat edin. Onlarla "aritmetik" yaparken bunun ve konuşmacıya bağlı olarak değişebilen kesin tanımlarının çok farkında olmak önemlidir. Bir şeyleri kanıtlarken, kesin tanımınızla çalışmaya özen gösterin. Landau sembolleri için (hepsi aynı temel sezgiye sahip) birçok tanım vardır, bunlardan bazıları bazı fonksiyon kümelerinde eşdeğerdir ancak diğerlerinde değildir. Landau gösterimini titiz ve sağlam bir şekilde kullanmakla ilgileniyorsanız, Rutanen ve diğerlerinin bir çalışması ilginizi çekebilir. Algoritmikte kullandığımız gibi asimptotik gösterim için gerekli ve yeterli kriterler formüle ederler, yaygın tanımın bunları karşılamadığını gösterirler ve uygulanabilir bir tanım (aslında) sağlarlar. * K. Rutanen ve diğerleri tarafından algoritma analizi için O-gösteriminin genel bir tanımı (2015)
70
Why is Gaia operating around Earth orbit? Why not send it to Neptune's orbit?
Gaia neden Dünya yörüngesinde çalışıyor? Neden Neptün yörüngesine gönderilmiyor?
Well, you thought about the spatial aspect of a parallax measurement, but not about the temporal one. Gaia's intention is to measure 3D positions as well as 3D velocities. For the distance, you need accurate parallactic measurement, which come in with your orbital period. For a typical Gaia-star with several measurement per year, you'll get 5 values of the parallax after 5 years of time, which you then average. If you'd send Gaia towards Neptune (besides the fact that no one has ever sent an orbiter, to say nothing of a L2 mission that far out) that has a period of 168 years, then after 5 years you'd get... 5/168 th of one paralactic measurement. It simply couldn't achieve its science goals if put around the L2 behind Neptune. Also no one on this planet has any experience in putting something into a outer system L2 point. This is different than putting it into Earth's L2, because reaching the L2 around one of the giants has vast and very precise $\Delta v$ requirements. This would be a massive technological leap, and things don't work that way in space. Small, incremental technological steps are required in an anyways unfriendly environment, to make sure everything works properly and no millions of dollars have been wasted. Compare that to Gaia's predecessor, the Hipparcos satellite, which was parked in geostationary orbit. Now you could still say, why not use Jupiter hypothetically anyways. Well, the orbital period there is still 11 years, and Jupiter's L2 still suffers from the intense radiation environment that is provided by Jupiter's magnetosphere. This would lead to rapid degradation of the CCDs used for scanning across the sky.
Uzayda paralaks ölçümünün yönünü düşündünüz ama zamansal yönünü düşünmediniz. Gaia'nın amacı 3 boyutlu konumları ve 3 boyutlu hızları ölçmektir. Mesafe için yörünge periyodunuzla gelen doğru paralaks ölçümüne ihtiyacınız vardır. Yılda birkaç ölçüm yapılan tipik bir Gaia yıldızı için, 5 yıllık bir süreden sonra paralaksın 5 değerini elde edersiniz ve ardından ortalamasını alırsınız. Gaia'yı Neptün'e doğru gönderirseniz (hiç kimsenin bir yörünge aracı göndermemiş olması ve bu kadar uzakta bir L2 görevi hakkında hiçbir şey söylememesi gerçeğinin yanı sıra) 168 yıllık bir periyodu vardır, o zaman 5 yıl sonra... bir paralaks ölçümünün 5/168'ini elde edersiniz. Neptün'ün arkasındaki L2'nin etrafına yerleştirilse bilimsel hedeflerine ulaşamazdı. Ayrıca bu gezegende hiç kimse bir şeyi dış sistem L2 noktasına yerleştirme konusunda deneyime sahip değil. Bu, onu Dünya'nın L2'sine yerleştirmekten farklıdır, çünkü devlerden birinin etrafındaki L2'ye ulaşmak çok büyük ve çok hassas Δv gereksinimlerine sahiptir. Bu büyük bir teknolojik sıçrama olurdu ve uzayda işler bu şekilde işlemez. Her şeyin düzgün çalışmasını ve milyonlarca doların boşa gitmemesini sağlamak için her zaman düşmanca bir ortamda küçük, artan teknolojik adımlar gerekir. Bunu, jeostasyon yörüngeye park edilmiş olan Gaia'nın selefi Hipparcos uydusuyla karşılaştırın. Şimdi yine de neden Jüpiter'i varsayımsal olarak kullanmayalım diyebilirsiniz. Oradaki yörünge periyodu hala 11 yıldır ve Jüpiter'in L2'si hala Jüpiter'in manyetosferinin sağladığı yoğun radyasyon ortamından muzdariptir. Bu, gökyüzünde tarama için kullanılan CCD'lerin hızla bozulmasına yol açacaktır.
71
I have a string representing a unix timestamp (i.e. &quot;1284101485&quot;) in Python, and I'd like to convert it to a readable date. When I use ```time.strftime```, I get a ```TypeError```: ```>>>import time >>>print time.strftime(&quot;%B %d %Y&quot;, &quot;1284101485&quot;) Traceback (most recent call last): File &quot;&quot;, line 1, in TypeError: argument must be 9-item sequence, not str ```
Python'da bir unix zaman damgasını (ör. "1284101485") temsil eden bir dizim var ve bunu okunabilir bir tarihe dönüştürmek istiyorum. ```time.strftime``` kullandığımda bir ```TypeError``` alıyorum: ```>>>import time >>>print time.strftime("%B %d %Y", "1284101485") Traceback (most recent call last): File "", line 1, in TypeError: argument must be 9-item sequence, not str ```
There are two parts here: * Convert the unix timestamp ("seconds since epoch") to the local time * Display the local time in the desired format. A portable way to get the local time that works even if the local time zone had a different utc offset in the past and python has no access to the tz database is to use a ```pytz``` timezone: ```#!/usr/bin/env python from datetime import datetime import tzlocal # $ pip install tzlocal unix_timestamp = float("1284101485") local_timezone = tzlocal.get_localzone() # get pytz timezone local_time = datetime.fromtimestamp(unix_timestamp, local_timezone) ``` To display it, you could use any time format that is supported by your system e.g.: ```print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f%z (%Z)")) print(local_time.strftime("%B %d %Y")) # print date in your format ``` If you do not need a local time, to get a readable UTC time instead: ```utc_time = datetime.utcfromtimestamp(unix_timestamp) print(utc_time.strftime("%Y-%m-%d %H:%M:%S.%f+00:00 (UTC)")) ``` If you don't care about the timezone issues that might affect what date is returned or if python has access to the tz database on your system: ```local_time = datetime.fromtimestamp(unix_timestamp) print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f")) ``` On Python 3, you could get a timezone-aware datetime using only stdlib (the UTC offset may be wrong if python has no access to the tz database on your system e.g., on Windows): ```#!/usr/bin/env python3 from datetime import datetime, timezone utc_time = datetime.fromtimestamp(unix_timestamp, timezone.utc) local_time = utc_time.astimezone() print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f%z (%Z)")) ``` Functions from the ```time``` module are thin wrappers around the corresponding C API and therefore they may be less portable than the corresponding ```datetime``` methods otherwise you could use them too: ```#!/usr/bin/env python import time unix_timestamp = int("1284101485") utc_time = time.gmtime(unix_timestamp) local_time = time.localtime(unix_timestamp) print(time.strftime("%Y-%m-%d %H:%M:%S", local_time)) print(time.strftime("%Y-%m-%d %H:%M:%S+00:00 (UTC)", utc_time)) ```
Burada iki kısım var: * Unix zaman damgasını ("epoch'ten bu yana geçen saniyeler") yerel zamana dönüştürün * Yerel zamanı istenen biçimde görüntüleyin. Yerel saat diliminin geçmişte farklı bir utc ofseti olması ve python'un tz veritabanına erişimi olmaması durumunda bile çalışan yerel saati almanın taşınabilir bir yolu ```pytz``` saat dilimini kullanmaktır: ```#!/usr/bin/env python from datetime import datetime import tzlocal # $ pip install tzlocal unix_timestamp = float("1284101485") local_timezone = tzlocal.get_localzone() # get pytz timezone local_time = datetime.fromtimestamp(unix_timestamp, local_timezone) ``` Görüntülemek için sisteminiz tarafından desteklenen herhangi bir zaman biçimini kullanabilirsiniz, örneğin: ```print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f%z (%Z)")) print(local_time.strftime("%B %d %Y")) # tarihi kendi biçiminizde yazdırın ``` Yerel bir zamana ihtiyacınız yoksa, bunun yerine okunabilir bir UTC zamanı almak için: ```utc_time = datetime.utcfromtimestamp(unix_timestamp) print(utc_time.strftime("%Y-%m-%d %H:%M:%S.%f+00:00 (UTC)")) ``` Hangi tarihin döndürüleceğini etkileyebilecek saat dilimi sorunlarını önemsemiyorsanız veya python'un sisteminizdeki tz veritabanına erişimi varsa: ```local_time = datetime.fromtimestamp(unix_timestamp) print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f")) ``` Python 3'te, yalnızca stdlib kullanarak saat dilimi farkında bir datetime alabilirsiniz (python'un sisteminizdeki tz veritabanına erişimi yoksa, örneğin Windows'ta, UTC ofseti yanlış olabilir): ```#!/usr/bin/env python3 from datetime import datetime, timezone utc_time = datetime.fromtimestamp(unix_timestamp, timezone.utc) local_time = utc_time.astimezone() print(local_time.strftime("%Y-%m-%d %H:%M:%S.%f%z (%Z)")) ``` ```time``` modülündeki fonksiyonlar, karşılık gelen C API'sinde ince sarmalayıcılar olduğundan, aksi takdirde karşılık gelen ```datetime``` yöntemlerinden daha az taşınabilir olabilirler: ```#!/usr/bin/env python import time unix_timestamp = int("1284101485") utc_time = time.gmtime(unix_timestamp) local_time = time.localtime(unix_timestamp) print(time.strftime("%Y-%m-%d %H:%M:%S", local_time)) print(time.strftime("%Y-%m-%d %H:%M:%S+00:00 (UTC)", utc_time)) ```
72
In Django, the convention is to put all of your static files (i.e css, js) specific to your app into a folder called static. So the structure would look like this: ```mysite/ manage.py mysite/ --> (settings.py, etc) myapp/ --> (models.py, views.py, etc) static/ ``` In ```mysite/settings.py``` I have: ```STATIC_ROOT = 'staticfiles' ``` So when I run the command: ```python manage.py collectstatic ``` It creates a folder called ```staticfiles``` at the root level (so same directory as ```myapp/```) What's the point of this? Isn't it just creating a copy of all my static files?
Django'da, uygulamanıza özel tüm statik dosyalarınızı (yani css, js) static adlı bir klasöre koyma geleneği vardır. Bu nedenle yapı şu şekilde görünür: ```mysite/ manage.py mysite/ --> (settings.py, vb.) myapp/ --> (models.py, views.py, vb.) static/ ``` ```mysite/settings.py``` dosyasında şunlar var: ```STATIC_ROOT = 'staticfiles' ``` Bu nedenle şu komutu çalıştırdığımda: ```python manage.py collectstatic ``` ```staticfiles``` adında bir klasör kök düzeyde oluşturur (yani ```myapp/``` ile aynı dizin) Bunun amacı nedir? Bu, tüm statik dosyalarımın bir kopyasını oluşturmak değil mi?
## Collect static files from multiple apps into a single path A single Django project may use several apps, so while there you only have one ```myapp```, it may actually be ```myapp1```, ```myapp2```, etc By copying them from inside the individual apps into a single folder, you can point your frontend web server (e.g. nginx) to that single folder ```STATIC_ROOT``` and serve static files from a single location, rather than configure your web server to serve static files from multiple paths. ## Persistent URLs with ManifestStaticFilesStorage A note about the MD5 hash being appended to the filename for versioning: It's not part of the default behavior of ```collectstatic```, as ```settings.STATICFILES_STORAGE``` defaults to ```StaticFilesStorage``` (which doesn't do that) The MD5 hash will kick in e.g. if you set it to use ```ManifestStaticFilesStorage```, which adds that behavior. > The purpose of this storage is to keep serving the old files in case some pages still refer to those files, e.g. because they are cached by you or a 3rd party proxy server. Additionally, it’s very helpful if you want to apply far future Expires headers to the deployed files to speed up the load time for subsequent page visits.
## Statik dosyaları birden fazla uygulamadan tek bir yola toplayın Tek bir Django projesi birden fazla uygulama kullanabilir, bu nedenle orada yalnızca bir ```myapp```'ınız olsa da aslında ```myapp1```, ```myapp2``` vb. olabilir. Bunları tek tek uygulamaların içinden tek bir klasöre kopyalayarak, ön uç web sunucunuzu (ör. nginx) bu tek klasöre ```STATIC_ROOT``` yönlendirebilir ve statik dosyaları tek bir konumdan sunabilirsiniz, web sunucunuzu birden fazla yoldan statik dosyalar sunacak şekilde yapılandırmak yerine. ## ManifestStaticFilesStorage ile Kalıcı URL'ler Sürüm oluşturma için dosya adına eklenen MD5 karma değeri hakkında bir not: ```collectstatic```'in varsayılan davranışının bir parçası değildir, çünkü ```settings.STATICFILES_STORAGE``` varsayılan olarak ```StaticFilesStorage```'a (bunu yapmayan) varsayılan olarak ayarlanmıştır. MD5 karma değeri, örneğin ```ManifestStaticFilesStorage```'ı kullanmak üzere ayarladığınızda devreye girecektir, bu da bu davranışı ekler. > Bu depolamanın amacı, bazı sayfalar hala bu dosyalara başvurduğu için eski dosyaları sunmaya devam etmektir, örneğin sizin veya üçüncü taraf bir proxy sunucusu tarafından önbelleğe alındıkları için. Ayrıca, sonraki sayfa ziyaretleri için yükleme süresini hızlandırmak üzere dağıtılan dosyalara çok uzak gelecekte Son Kullanma Tarihi üstbilgileri uygulamak istiyorsanız çok faydalıdır.
73
I am used to thinking of finite-differences as a special case of finite-elements, on a very constrained grid. What are criteria to choose between finite-differences and finite-elements
Sonlu farkları, çok kısıtlı bir ızgara üzerinde sonlu elemanların özel bir durumu olarak düşünmeye alışkınım. Sonlu farklar ve sonlu elemanlar arasında seçim yapmak için kriterler nelerdir?
It is possible to write most specific finite difference methods as Petrov-Galerkin finite element methods with some choice of local reconstruction and quadrature, and most finite element methods can also be shown to be algebraically equivalent to some finite difference method. Therefore, we should choose a method based on which analysis framework we want to use, which terminology we like, which system for extensibility we like, and how we would like to structure software. The following generalizations hold true in the vast majority of variations in practical use, but many points can be circumvented. Finite Difference Pros * efficient quadrature-free implementation * aspect ratio independence and local conservation for certain schemes (e.g. MAC for incompressible flow) * robust nonlinear methods for transport (e.g. ENO/WENO) * M-matrix for some problems * discrete maximum principle for some problems (e.g. mimetic finite differences) * diagonal (usually identity) mass matrix * inexpensive nodal residual permits efficient nonlinear multigrid (FAS) * cell-wise Vanka smoothers give efficient matrix-free smoothers for incompressible flow Cons * more difficult to implement "physics" * staggered grids are sometimes quite technical * higher than second order on unstructured grids is difficult * no Galerkin orthogonality, so convergence may be more difficult to prove * not a Galerkin method, so discretization and adjoints do not commute (relevant to optimization and inverse problems) * self-adjoint continuum problems often yield non-symmetric matrices * solution is only defined pointwise, so reconstruction at arbitrary locations is not uniquely defined * boundary conditions tend to be complicated to implement * discontinuous coefficients usually make the methods first order * stencil grows if physics includes "cross terms" Finite Element Pros * Galerkin orthogonality (discrete solution to coercive problems is within a constant of the best solution in the space) * simple geometric flexibility * discontinuous Galerkin offers robust transport algorithm, arbitrary order on unstructured grids * cellwise entropy inequality guaranteeing $L^2$ stability holds independent of mesh, dimension, order of accuracy, and presence of discontinuous solutions, without needing nonlinear limiters * easy of implementing boundary conditions * can choose conservation statement by choosing test space * discretization and adjoints commute (for Galerkin methods) * elegant foundation in functional analysis * at high order, local kernels can exploit tensor product structure that is missing with FD * Lobatto quadrature can make methods energy-conserving (assuming a symplectic time integrator) * high order accuracy even with discontinuous coefficients, as long as you can align to boundaries * discontinuous coefficients inside elements can be accommodated with XFEM * easy to handle multiple inf-sup conditions Cons * many elements have trouble at high aspect ratio * continuous FEM has trouble with transport (SUPG is diffusive and oscillatory) * DG usually has more degrees of freedom for same accuracy (though HDG is much better) * continuous FEM does not provide cheap nodal problems, so nonlinear smoothers have much poorer constants * usually more nonzeros in assembled matrices * have to choose between consistent mass matrix (some nice properties, but has full inverse, thus requiring an implicit solve per time step) and lumped mass matrix.
Çoğu özel sonlu fark yöntemini, bazı yerel yeniden yapılandırma ve kareleme seçimleriyle Petrov-Galerkin sonlu eleman yöntemleri olarak yazmak mümkündür ve çoğu sonlu eleman yöntemi de cebirsel olarak bazı sonlu fark yöntemlerine eşdeğer olduğu gösterilebilir. Bu nedenle, hangi analiz çerçevesini kullanmak istediğimize, hangi terminolojiyi sevdiğimize, hangi genişletilebilirlik sistemini sevdiğimize ve yazılımı nasıl yapılandırmak istediğimize göre bir yöntem seçmeliyiz. Aşağıdaki genellemeler, pratik kullanımda çok sayıda varyasyonda geçerlidir ancak birçok nokta atlanabilir. Sonlu Fark Artıları * verimli kareleme içermeyen uygulama * belirli şemalar için en boy oranı bağımsızlığı ve yerel koruma (ör. sıkıştırılamaz akış için MAC) * taşıma için sağlam doğrusal olmayan yöntemler (ör. ENO/WENO) * bazı problemler için M matrisi * bazı problemler için ayrık maksimum ilke (ör. taklitçi sonlu farklar) * diyagonal (genellikle özdeşlik) kütle matrisi * ucuz düğümsel artık, verimli doğrusal olmayan çoklu ızgara (FAS) sağlar * hücresel Vanka yumuşatıcıları, sıkıştırılamaz akış için verimli matris içermeyen yumuşatıcılar sağlar Eksileri * "fizik" uygulamak daha zordur * kademeli ızgaralar bazen oldukça tekniktir * yapılandırılmamış ızgaralarda ikinci dereceden daha yüksek olmak zordur * Galerkin ortogonalliği yoktur, bu nedenle yakınsamanın kanıtlanması daha zor olabilir * Galerkin yöntemi değildir, bu nedenle ayrıklaştırma ve yardımcılar değişmez (optimizasyon ve ters problemlerle ilgilidir) * kendi kendine bağlı süreklilik problemleri genellikle simetrik olmayan matrisler üretir * çözüm yalnızca nokta nokta tanımlanır, bu nedenle keyfi konumlarda yeniden yapılandırma benzersiz bir şekilde tanımlanmaz * sınır koşullarının uygulanması karmaşık olma eğilimindedir * süreksiz katsayılar genellikle yöntemleri birinci dereceden yapar * fizik "çapraz terimler" içeriyorsa şablon büyür Sonlu Eleman Artıları * Galerkin ortogonalliği (zorlayıcı problemlere yönelik ayrık çözüm, uzaydaki en iyi çözümün bir sabiti içindedir) * basit geometrik esneklik * süreksiz Galerkin, yapılandırılmamış ızgaralarda keyfi düzende sağlam bir taşıma algoritması sunar * $L^2$ kararlılığını garanti eden hücresel entropi eşitsizliği, doğrusal olmayan sınırlayıcılara ihtiyaç duymadan ızgara, boyut, doğruluk düzeni ve süreksiz çözümlerin varlığından bağımsız olarak geçerlidir * sınır koşullarını uygulamanın kolaylığı * test uzayını seçerek koruma ifadesini seçebilir * ayrıklaştırma ve yardımcılar değişir (Galerkin yöntemleri için) * fonksiyonel analizde zarif temel * yüksek düzende, yerel çekirdekler FD ile eksik olan tensör ürün yapısından yararlanabilir * Lobatto kareleme, yöntemleri enerji tasarruflu hale getirebilir (semplektik bir zaman integratörü varsayarak) * sınırlarla hizalanabildiğiniz sürece, süreksiz katsayılarla bile yüksek düzen doğruluğu * elemanlar içindeki süreksiz katsayılar XFEM ile karşılanabilir * birden fazla inf-sup koşulunu işlemek kolaydır Eksileri * birçok eleman yüksek en boy oranında sorun yaşar * sürekli FEM'in taşıma ile ilgili sorunları vardır (SUPG yayıcı ve salınımlıdır) * DG genellikle aynı doğruluk için daha fazla serbestlik derecesine sahiptir (ancak HDG çok daha iyidir) * sürekli FEM ucuz düğümsel problemler sağlamaz, bu nedenle doğrusal olmayan yumuşatıcıların çok daha zayıf sabitleri vardır * genellikle birleştirilmiş matrislerde daha fazla sıfır olmayan değer bulunur * tutarlı kütle matrisi (bazı güzel özellikler, ancak tam tersi vardır, bu nedenle zaman adımı başına örtük bir çözüm gerektirir) ve toplanmış kütle matrisi arasında seçim yapmak zorundadır.
74
How important is multithreading in the current software industry?
Mevcut yazılım endüstrisinde çoklu iş parçacığı ne kadar önemlidir?
It is extremely important. What is more important though is to understand that multithreading is just one way to solve the asynchrony problem. The technical environment in which many people are now writing software differs from the historical software development environment (of monolithic applications performing batch computations) in two key ways: * Many-core machines are now common. We can no longer expect clock speeds or transistor densities to increase by orders of magnitude. The price of computation will continue to fall, but it will fall because of lots of parallelism. We're going to have to find a way to take advantage of that power. * Computers are now heavily networked and modern applications rely upon being able to fetch rich information from a variety of sources. From a computational standpoint, these two factors essentially boil down to the same core idea: information increasingly will be available in an asynchronous fashion. Whether the information you need is being computed on another chip in your machine or on a chip halfway around the world doesn't really matter. Either way, your processor is sitting there burning billions of cycles a second waiting for information when it could be doing useful work. So what matters now, and what will matter even more in the future, is not multithreading per se, but rather, dealing with asynchrony. Multithreading is just one way to do that -- a complicated, error-prone way that is only going to get more complicated and more error-prone as weak-memory-model chips become more widely used. The challenge for tools vendors is to come up with some way better than multithreading for our customers to deal with the asynchronous infrastructure they'll be using in the future.
Bu son derece önemlidir. Ancak daha da önemlisi, çoklu iş parçacığının eşzamanlılık sorununu çözmenin sadece bir yolu olduğunu anlamaktır. Günümüzde birçok kişinin yazılım yazdığı teknik ortam, geçmişteki yazılım geliştirme ortamından (toplu hesaplamalar yapan yekpare uygulamalar) iki temel şekilde farklılık göstermektedir: * Çok çekirdekli makineler artık yaygındır. Artık saat hızlarının veya transistör yoğunluklarının büyüklük sıralarında artmasını bekleyemeyiz. Hesaplama fiyatı düşmeye devam edecek, ancak bu çok fazla paralellik nedeniyle düşecektir. Bu gücün avantajını kullanmanın bir yolunu bulmamız gerekecek. * Bilgisayarlar artık yoğun bir şekilde ağa bağlıdır ve modern uygulamalar çeşitli kaynaklardan zengin bilgiler alabilmeye dayanmaktadır. Hesaplama açısından, bu iki faktör esasen aynı temel fikre indirgenmektedir: bilgiler giderek artan bir şekilde eşzamanlı bir şekilde kullanılabilir hale gelecektir. İhtiyacınız olan bilginin makinenizdeki başka bir çipte mi yoksa dünyanın diğer ucundaki bir çipte mi hesaplandığı gerçekten önemli değildir. Her iki durumda da işlemciniz orada oturup faydalı işler yapabilecekken saniyede milyarlarca döngü yakmaktadır. Bu nedenle, şimdi önemli olan ve gelecekte daha da önemli olacak olan şey, çoklu iş parçacığının kendisi değil, eşzamanlılıkla başa çıkmaktır. Çoklu iş parçacığı bunu yapmanın sadece bir yoludur -- zayıf bellek modeli çipleri daha yaygın olarak kullanıldıkça daha da karmaşık ve daha fazla hataya açık hale gelecek karmaşık, hataya açık bir yoldur. Araç satıcıları için zorluk, müşterilerimizin gelecekte kullanacakları eşzamanlı altyapıyla başa çıkmaları için çoklu iş parçacığından daha iyi bir yol bulmaktır.
75
Is it true that the price of diamonds is based on a monopoly? And who actually runs/owns this supposed monopoly? Is this likely to affect diamond prices if I am interested in purchasing?
Elmasların fiyatının bir tekele dayandığı doğru mu? Ve bu sözde tekeli kim yönetiyor/sahip oluyor? Satın almakla ilgileniyorsam bunun elmas fiyatlarını etkilemesi muhtemel mi?
Yes, the De Beers Group of Companies is a diamond cartel that had complete control of the diamond market for most of the 20th century. They still control a sizable portion of the market and their effort at marketing (particularly with the slogan "A Diamond is Forever") has done much to inflate the market for diamonds in our society. The intrinsic value of diamonds is much lower than the market prices currently reflect, but with the caveat that there is a rarity factor which does drive up the price of larger diamonds. The larger the diamond, the more likely it is to have flaws, so when it comes to diamonds that are 5 carats or greater, you are not as likely to see a new supply of diamonds disrupt the prices of those larger stones. Some other ways that high end jewelers and suppliers are differentiating themselves is by patenting a specific cut that they design. This is another barrier to entry that works to create some artificial price inflation. One common example is the Lucida cut sometimes referred to as the Tiffany cut. Diamonds can also be manufactured. The same carbon structure can be grown in a lab. These stones have the same carbon structure as natural diamonds but without the flaws and visible impurities. Most manufactured diamonds are used industrially, but processes have improved sufficiently to allow for gemstone quality synthetic diamonds. They sell at a decent discount, so that might be an option to consider if you want a substitute. In the years to come, you can expect prices for synthetic diamonds to continue to decrease which will probably put some further downward pressure on jewelers' prices.
Evet, De Beers Şirketler Grubu, 20. yüzyılın büyük bir bölümünde elmas piyasasına tam kontrol sağlamış bir elmas kartelidir. Hâlâ piyasanın önemli bir kısmını kontrol etmektedirler ve pazarlama çabaları (özellikle "Bir Elmas Sonsuza Kadardır" sloganıyla) toplumumuzda elmas piyasasını şişirmek için çok şey yapmıştır. Elmasların içsel değeri, piyasa fiyatlarının şu anda yansıttığından çok daha düşüktür, ancak daha büyük elmasların fiyatını yükselten bir nadirlik faktörü olduğu uyarısıyla. Elmas ne kadar büyükse, kusurlu olma olasılığı o kadar yüksektir, bu nedenle 5 karat veya daha büyük elmaslar söz konusu olduğunda, yeni bir elmas arzının bu daha büyük taşların fiyatlarını bozmasını görme olasılığınız daha düşük olur. Lüks kuyumcuların ve tedarikçilerin kendilerini farklılaştırdıkları diğer bazı yollar, tasarladıkları belirli bir kesimi patentleyerektir. Bu, yapay fiyat enflasyonu yaratmak için çalışan başka bir giriş engeldir. Yaygın bir örnek, bazen Tiffany kesimi olarak da anılan Lucida kesimidir. Elmaslar da üretilebilir. Aynı karbon yapısı bir laboratuvarda yetiştirilebilir. Bu taşlar, doğal elmaslarla aynı karbon yapısına sahiptir ancak kusurları ve görünür kirlilikleri yoktur. Üretilen elmasların çoğu endüstriyel olarak kullanılır, ancak süreçler mücevher kalitesinde sentetik elmaslara izin verecek kadar iyileştirilmiştir. Uygun bir indirimle satılırlar, bu nedenle bir ikame istiyorsanız dikkate alınabilecek bir seçenek olabilir. Önümüzdeki yıllarda, sentetik elmasların fiyatlarının düşmeye devam etmesini bekleyebilirsiniz, bu da muhtemelen kuyumcuların fiyatlarına daha fazla aşağı yönlü baskı uygulayacaktır.
76
Normal filesystem images can be easily mounted: ```mount system.img /mnt ``` Examined, and modified. But when I try this with a Raspberry Pi system image (e.g. raspbian), I get: ```mount: unknown filesystem type '(null)' ``` And no matter what I try with ```-t```, it won't work. How can I mount this image?
Normal dosya sistemi imajları kolayca bağlanabilir: ```mount system.img /mnt ``` İncelendi ve değiştirildi. Ancak bunu bir Raspberry Pi sistem imajıyla (ör. raspbian) denediğimde şu hatayı alıyorum: ```mount: bilinmeyen dosya sistemi türü '(null)' ``` Ve ```-t``` ile ne denersem deneyeyim çalışmıyor. Bu imajı nasıl bağlayabilirim?
You can't mount the image as a whole because it actually contains two partitions and a boot sector. However, you can mount the individual partitions in the image if you know their offset inside the file. To find them, examine the image as a block device with ```fdisk -l whatever.img```. The output should include a table like this: ```Device Boot Start End Blocks Id System whatever.img1 8192 122879 57344 c W95 FAT32 (LBA) whatever.img2 122880 5785599 2831360 83 Linux ``` These are the two partitions. The first one is labelled "FAT32", and the other one "Linux". Above this table, there's some other information about the device as a whole, including: ```Units: sectors of 1 * 512 = 512 bytes ``` We can find the offset in bytes by multiplying this unit size by the ```Start``` block of the partition: * 1st partition 512 * 8192 = 4194304 * 2nd partition 512 * 122880 = 62914560 These can be used with the ```offset``` option of the ```mount``` command. We also have a clue about the type of each partition from ```fdisk```. So, presuming we have directories ```/mnt/img/one``` and ```/mnt/img/two``` available as mount points: ```mount -v -o offset=4194304 -t vfat whatever.img /mnt/img/one mount -v -o offset=62914560 -t ext4 whatever.img /mnt/img/two ``` If you get an "overlapping loop" error here, your version of ```mount``` requires you to specify the size as well as the offset of the first partition. Unmount that, and use the number of blocks (57344) * 512 (= 29360128): ```mount -v -o offset=4194304,sizelimit=29360128 \ -t vfat whatever.img /mnt/img/one ``` The second partition doesn't need a sizelimit since there's nothing after it in the image. You can now access the two partitions. If you do not intend to change anything in them, use the ```-r``` (read-only) switch too. If you do change anything, those changes will be included in the ```.img``` file. Note that the first partition is probably mounted on ```/boot``` in the second partition when the system is running.
Görüntüyü bir bütün olarak bağlayamazsınız çünkü aslında iki bölüm ve bir önyükleme sektörü içerir. Ancak, dosyadaki ofsetlerini biliyorsanız görüntüdeki tek tek bölümleri bağlayabilirsiniz. Bunları bulmak için görüntüyü ```fdisk -l whatever.img``` ile bir blok aygıtı olarak inceleyin. Çıktı şu şekilde bir tablo içermelidir: ```Aygıt Önyükleme Başlangıç Bitiş Bloklar Kimlik Sistem whatever.img1 8192 122879 57344 c W95 FAT32 (LBA) whatever.img2 122880 5785599 2831360 83 Linux ``` Bunlar iki bölümdür. Birincisi "FAT32" olarak etiketlenmiştir ve diğeri "Linux". Bu tablonun üzerinde, aygıtın bir bütün olarak bazı başka bilgileri de dahil olmak üzere: ```Birimler: 1 * 512 = 512 baytlık sektörler ``` Bu birim boyutunu bölümün ```Başlangıç``` bloğuyla çarparak ofseti bayt cinsinden bulabiliriz: * 1. bölüm 512 * 8192 = 4194304 * 2. bölüm 512 * 122880 = 62914560 Bunlar ```mount``` komutunun ```offset``` seçeneğiyle kullanılabilir. Ayrıca ```fdisk```'ten her bir bölümün türü hakkında bir ipucu da aldık. Bu nedenle, ```/mnt/img/one``` ve ```/mnt/img/two``` dizinlerinin bağlama noktası olarak mevcut olduğunu varsayarsak: ```mount -v -o offset=4194304 -t vfat whatever.img /mnt/img/one mount -v -o offset=62914560 -t ext4 whatever.img /mnt/img/two ``` Burada bir "örtüşen döngü" hatası alırsanız, ```mount``` sürümünüzün ilk bölümün ofsetinin yanı sıra boyutunu da belirtmenizi gerektirir. Bunu çıkarın ve blok sayısını (57344) * 512 (= 29360128) kullanın: ```mount -v -o offset=4194304,sizelimit=29360128 \ -t vfat whatever.img /mnt/img/one ``` İkinci bölümün, görüntüde kendisinden sonra hiçbir şey olmadığı için bir sizelimit'e ihtiyacı yoktur. Artık iki bölüme de erişebilirsiniz. İçlerinde bir şey değiştirmeyi düşünmüyorsanız, ```-r``` (salt okunur) anahtarını da kullanın. Bir şey değiştirirseniz, bu değişiklikler ```.img``` dosyasına dahil edilecektir. Sistem çalışırken ilk bölümün muhtemelen ikinci bölümdeki ```/boot``` üzerine bağlandığını unutmayın.
77
How does immersion passively help with learning a language?
Daldırma, bir dili öğrenmeye pasif olarak nasıl yardımcı olur?
There are a few reasons why immersion helps you learn a language without you actively trying: * You encounter the language more often. When you are immersed in a language, you don't go to class and do homework for a few hours a week, but rather use the language the entire day. You depend on the language to survive—to buy groceries, to talk to employers and customers, to ask for directions, etc. Being forced to use the language means you learn it even when you're not actively trying to. It becomes a way of life. * You learn the language in more than one way. Classroom learning focuses on specific activities at a time and generally is oriented around learning vocabulary and grammar. Immersion implicitly forces you to learn vocabulary (if you don't know a word, you simply can't communicate) and grammar (people will probably correct you if you say something incorrectly). You will learn these things whether you're trying to or not. In addition you will learn how to carry on a conversation, both by listening and participating in your own. This is something that simple exercises can very rarely accomplish. * You begin to think in the language. If you use the language enough you'll start to get good enough at it that you won't have time to think in your native language and translate. Immersion spurs this on because native speakers talk relatively quickly, signs you read may pass by in a moment, and you may quickly need to say "excuse me" or ask for help. Because you can't afford long delays, you'll begin to skip the translation step. This helps you use the language as a native speaker would. * Culture reinforces language learning. When you are immersed in a language, you often encounter the culture and traditions associated with speakers of that language. Your brain will retain the new knowledge and experiences you acquire better because it is different than what you are used to, and if the language is part of that cultural experience, you will remember it better. For example, you might remember an idiom or a joke that only exists in the language you are learning. This will expand your ability to communicate in that language.
Daldırmanın aktif olarak çaba göstermeden bir dili öğrenmenize yardımcı olmasının birkaç nedeni vardır: * Dille daha sık karşılaşırsınız. Bir dile daldığınızda, haftada birkaç saat derse gidip ödev yapmazsınız, bunun yerine dili tüm gün kullanırsınız. Hayatta kalmak için dile bağımlısınızdır; market alışverişi yapmak, işverenler ve müşterilerle konuşmak, yol tarifi istemek vb. Dili kullanmaya zorlanmak, aktif olarak çaba göstermeseniz bile onu öğrendiğiniz anlamına gelir. Bir yaşam biçimi haline gelir. * Dili birden fazla şekilde öğrenirsiniz. Sınıf ortamında öğrenme, bir seferde belirli etkinliklere odaklanır ve genellikle kelime dağarcığı ve dil bilgisi öğrenmeye yöneliktir. Daldırma, sizi kelime dağarcığı öğrenmeye (bir kelimeyi bilmiyorsanız, iletişim kuramazsınız) ve dil bilgisine (bir şeyi yanlış söylerseniz insanlar muhtemelen sizi düzeltir) dolaylı olarak zorlar. İster çabalayın ister çabalamayın bu şeyleri öğreneceksiniz. Ayrıca hem dinleyerek hem de kendi konuşmalarınıza katılarak bir sohbeti nasıl sürdüreceğinizi öğreneceksiniz. Bu, basit alıştırmaların çok nadiren başarabileceği bir şeydir. * Dilde düşünmeye başlarsınız. Dili yeterince kullanırsanız, ana dilinizde düşünmek ve çeviri yapmak için zamanınız olmayacak kadar iyi olmaya başlarsınız. Daldırma bunu teşvik eder çünkü ana dili konuşanlar nispeten hızlı konuşur, okuduğunuz işaretler bir anda geçebilir ve "affedersiniz" demeniz veya yardım istemeniz gerekebilir. Uzun gecikmelere katlanamadığınız için çeviri adımını atlamaya başlarsınız. Bu, dili ana dili konuşan biri gibi kullanmanıza yardımcı olur. * Kültür, dil öğrenimini pekiştirir. Bir dile daldığınızda, genellikle o dili konuşanlarla ilişkili kültür ve geleneklerle karşılaşırsınız. Beyniniz, alıştığınızdan farklı olduğu için edindiğiniz yeni bilgileri ve deneyimleri daha iyi koruyacaktır ve dil o kültürel deneyimin bir parçasıysa, onu daha iyi hatırlayacaksınız. Örneğin, yalnızca öğrendiğiniz dilde var olan bir deyimi veya şakayı hatırlayabilirsiniz. Bu, o dilde iletişim kurma yeteneğinizi genişletecektir.
78
I have a script, that does not exit when I want it to. An example script with the same error is: ```#!/bin/bash function bla() { return 1 } bla || ( echo '1' ; exit 1 ) echo '2' ``` I would assume to see the output: ```:~$ ./test.sh 1 :~$ ``` But I actually see: ```:~$ ./test.sh 1 2 :~$ ``` Does the ```()``` command chaining somehow create a scope? What is ```exit``` exiting out of, if not the script?
Çıkmasını istediğimde çıkmayan bir betiğim var. Aynı hataya sahip örnek bir betik: ```#!/bin/bash function bla() { return 1 } bla || ( echo '1' ; exit 1 ) echo '2' ``` Çıktının şu şekilde olmasını beklerdim: ```:~$ ./test.sh 1 :~$ ``` Ama aslında şu şekilde görüyorum: ```:~$ ./test.sh 1 2 :~$ ``` ```()``` komut zincirlemesi bir şekilde bir kapsam mı oluşturuyor? ```exit``` betik değilse neyin dışına çıkıyor?
```()``` runs commands in the subshell, so by ```exit``` you are exiting from subshell and returning to the parent shell. Use braces ```{}``` if you want to run commands in the current shell. From bash manual: (list) list is executed in a subshell environment. Variable assignments and builtin commands that affect the shell's environment do not remain in effect after the command completes. The return status is the exit status of list. { list; } list is simply executed in the current shell environment. list must be terminated with a newline or semicolon. This is known as a group command. The return status is the exit status of list. Note that unlike the metacharacters ( and ), { and } are reserved words and must occur where a reserved word is permitted to be recognized. Since they do not cause a word break, they must be separated from list by whitespace or another shell metacharacter. It's worth mentioning that the shell syntax is quite consistent and the subshell participates also in the other ```()``` constructs like command substitution (also with the old-style ````..```` syntax) or process substitution, so the following won't exit from the current shell either: ```echo $(exit) cat <(exit) ``` While it may be obvious that subshells are involved when commands are placed explicitly inside ```()```, the less visible fact is that they are also spawned in these other structures: * command started in the background ```exit & ``` doesn't exit the current shell because (after ```man bash```) If a command is terminated by the control operator &, the shell executes the command in the background in a subshell. The shell does not wait for the command to finish, and the return status is 0. * the pipeline ```exit | echo foo ``` still exits only from the subshell. However different shells behave differently in this regard. For example ```bash``` puts all components of the pipeline into separate subshells (unless you use the ```lastpipe``` option in invocations where job control is not enabled), but AT&T ```ksh``` and ```zsh``` run the last part inside the current shell (both behaviours are allowed by POSIX). Thus ```exit | exit | exit ``` does basically nothing in bash, but exits from the zsh because of the last ```exit```. * ```coproc exit``` also runs ```exit``` in a subshell.
```()``` alt kabukta komutları çalıştırır, bu nedenle ```exit``` ile alt kabuktan çıkıp ana kabuğa dönersiniz. Komutları geçerli kabukta çalıştırmak istiyorsanız süslü parantez ```{}``` kullanın. Bash kılavuzundan: (liste) liste bir alt kabuk ortamında yürütülür. Kabuğun ortamını etkileyen değişken atamaları ve yerleşik komutlar, komut tamamlandıktan sonra etkili olmaz. Dönüş durumu, listenin çıkış durumudur. { liste; } liste, geçerli kabuk ortamında basitçe yürütülür. Liste, yeni bir satır veya noktalı virgül ile sonlandırılmalıdır. Buna grup komutu denir. Dönüş durumu, listenin çıkış durumudur. ( ve ) meta karakterlerinin aksine, { ve } ayrılmış sözcükler olduğunu ve ayrılmış bir sözcüğün tanınmasına izin verilen yerde bulunması gerektiğini unutmayın. Sözcük kesintisi oluşturmadıkları için liste ile boşluk veya başka bir kabuk meta karakteri ile ayrılmaları gerekir. Kabuk sözdiziminin oldukça tutarlı olduğunu ve alt kabuğun komut ikamesi (aynı zamanda eski stil ````..```` sözdizimiyle) veya işlem ikamesi gibi diğer ```()``` yapılarında da yer aldığını belirtmekte fayda var, bu nedenle aşağıdakiler de geçerli kabuktan çıkmaz: ```echo $(exit) cat <(exit) ``` Komutlar açıkça ```()``` içine yerleştirildiğinde alt kabukların dahil olduğu açık olsa da, daha az görünen gerçek şu ki, bu diğer yapılarda da oluşturulurlar: * Arka planda başlatılan komut ```exit & ``` geçerli kabuktan çıkmaz çünkü (```man bash```'ten sonra) Bir komut kontrol operatörü & ile sonlandırılırsa, kabuk komutu bir alt kabukta arka planda yürütür. Kabuk, komutun bitmesini beklemez ve dönüş durumu 0'dır. * Boru hattı ```exit | echo foo ``` yine de yalnızca alt kabuktan çıkar. Ancak farklı kabuklar bu konuda farklı davranır. Örneğin ```bash```, boru hattının tüm bileşenlerini ayrı alt kabuklara koyar (iş kontrolünün etkinleştirilmediği çağrılarda ```lastpipe``` seçeneğini kullanmadığınız sürece), ancak AT&T ```ksh``` ve ```zsh``` son kısmı geçerli kabuk içinde çalıştırır (her iki davranış da POSIX tarafından izin verilir). Böylece ```exit | exit | exit ``` bash'te temelde hiçbir şey yapmaz, ancak son ```exit``` nedeniyle zsh'den çıkar. * ```coproc exit``` ayrıca ```exit```'i bir alt kabukta çalıştırır.
79
Adding a new swap file. How to edit fstab to enable swap after reboot?
Yeni bir takas dosyası ekleme. Yeniden başlatma sonrasında takası etkinleştirmek için fstab nasıl düzenlenir?
These ares the steps to create a swap on a file: 1. Create a large file e.g. with ```sudo mkdir -p /var/cache/swap/ # create a directory that holds the swap file sudo dd if=/dev/zero of=/var/cache/swap/myswap bs=1M count=4096 # for 4 GByte ``` Of course any other method of creating a file of defined size would do. 2. Announce swap to the system ```sudo chmod 0600 /var/cache/swap/myswap # only root should have access sudo mkswap /var/cache/swap/myswap # format as swap sudo swapon /var/cache/swap/myswap # announce to system ``` Insert the following line in ```/etc/fstab``` for swap from the next boot: ```/var/cache/swap/myswap none swap sw 0 0 ``` Note: 1. In case you have your system files on a SSD you may want to consider to hold your swap file on a hard disk location. 2. You can not use a swap file for hibernation (see Ubuntu SwapFaq) 3. Additional note for Ubuntu >= 17.04: A swap on file ```/swapfile``` is created by default in a new installation (when no swap partition was present). We can manually create a swap partition later if we prefer. In case we want to replace an existing swap (e.g. partition) with another swap (e.g. on file) we need to remove the old swap with ```sudo swapoff -a # for all ``` Then remove the swap entry from ```/etc/fstab``` or replace it with the new swap respectively.
Bir dosyada takas alanı oluşturma adımları şunlardır: 1. Büyük bir dosya oluşturun, örneğin ```sudo mkdir -p /var/cache/swap/ # takas dosyasını tutacak bir dizin oluşturun sudo dd if=/dev/zero of=/var/cache/swap/myswap bs=1M count=4096 # 4 GB için ``` Elbette tanımlanmış boyutta bir dosya oluşturmanın başka yöntemleri de işe yarayacaktır. 2. Takası sisteme bildirin ```sudo chmod 0600 /var/cache/swap/myswap # yalnızca kök erişime sahip olmalıdır sudo mkswap /var/cache/swap/myswap # takas olarak biçimlendirin sudo swapon /var/cache/swap/myswap # sisteme bildirin ``` Sonraki önyükleme için ```/etc/fstab``` dosyasına aşağıdaki satırı ekleyin: ```/var/cache/swap/myswap none swap sw 0 0 ``` Not: 1. Sistem dosyalarınız bir SSD'de ise takas dosyanızı bir sabit disk konumunda tutmayı düşünebilirsiniz. 2. Hazırda bekletme için bir takas dosyası kullanamazsınız (Ubuntu SwapFaq'a bakın) 3. Ubuntu >= 17.04 için ek not: ```/swapfile``` dosyasında bir takas alanı, yeni bir kurulumda varsayılan olarak oluşturulur (takas bölümü mevcut değilse). İstersek daha sonra manuel olarak bir takas bölümü oluşturabiliriz. Mevcut bir takası (ör. bölüm) başka bir takasla (ör. dosyada) değiştirmek istersek eski takası şu şekilde kaldırmamız gerekir: ```sudo swapoff -a # tümü için ``` Ardından takas girişini ```/etc/fstab``` dosyasından kaldırın veya sırasıyla yeni takasla değiştirin.
80
How do I add a validation to make sure the date string being passed to the method is in the ffg. format: ```'YYYY-MM-DD' ``` if it's not, method should raise some sort of error
Yönteme geçirilen tarih dizesinin ffg. biçiminde olduğundan emin olmak için nasıl doğrulama eklerim: ```'YYYY-MM-DD' ``` değilse, yöntem bir tür hata vermelidir
The Python ```dateutil``` library is designed for this (and more). It will automatically convert this to a ```datetime``` object for you and raise a ```ValueError``` if it can't. As an example: ```>>> from dateutil.parser import parse >>> parse("2003-09-25") datetime.datetime(2003, 9, 25, 0, 0) ``` This raises a ```ValueError``` if the date is not formatted correctly: ``` ValueError: day is out of range for month ``` ```dateutil``` is also extremely useful if you start needing to parse other formats in the future, as it can handle most known formats intelligently and allows you to modify your specification: ```dateutil``` parsing examples. It also handles timezones if you need that. Update based on comments: ```parse``` also accepts the keyword argument ```dayfirst``` which controls whether the day or month is expected to come first if a date is ambiguous. This defaults to False. E.g. ```>>> parse('11/12/2001') >>> datetime.datetime(2001, 11, 12, 0, 0) # Nov 12 >>> parse('11/12/2001', dayfirst=True) >>> datetime.datetime(2001, 12, 11, 0, 0) # Dec 11 ```
Python ```dateutil``` kütüphanesi bunun (ve daha fazlası) için tasarlanmıştır. Bunu sizin için otomatik olarak bir ```datetime``` nesnesine dönüştürecek ve dönüştüremezse bir ```ValueError``` oluşturacaktır. Örnek olarak: ```>>> from dateutil.parser import parse >>> parse("2003-09-25") datetime.datetime(2003, 9, 25, 0, 0) ``` Tarih doğru biçimlendirilmemişse bu bir ```ValueError``` oluşturur: ``` ValueError: day is out of range for month ``` ```dateutil```, çoğu bilinen biçimi akıllıca işleyebildiği ve belirtmenizi değiştirmenize izin verdiği için gelecekte başka biçimleri ayrıştırmaya başlamanız gerektiğinde de son derece kullanışlıdır: ```dateutil``` ayrıştırma örnekleri. İhtiyacınız varsa saat dilimlerini de işler. Yorumlara dayalı güncelleme: ```parse``` ayrıca bir tarihin belirsiz olması durumunda günün veya ayın önce gelmesinin beklenip beklenmediğini kontrol eden ```dayfirst``` anahtar sözcük argümanını da kabul eder. Bu varsayılan olarak False'tur. Örneğin: ```>>> parse('11/12/2001') >>> datetime.datetime(2001, 11, 12, 0, 0) # 12 Kasım >>> parse('11/12/2001', dayfirst=True) >>> datetime.datetime(2001, 12, 11, 0, 0) # 11 Aralık ```
81
When to use UICollectionView instead of UITableView?
UICollectionView yerine UITableView ne zaman kullanılmalıdır?
That depends on the requirements. How the application flows determines which type of UI to integrate into the application. People mainly use the ```UICollectionview``` for creating types of UIs with multiple images shown in a grid. This would have complex logic using ```UITableView```, but with ```UICollectionview```, it would be easy. When using ```UICollectionview```, you don't need to set buttons with tags or other things by getting selected items values. You can simply get ```-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath``` and in ```UITableViewDelegate```: ````-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath` ``` You get the selected row instead of the item, so for creating grid or modified items, using ```UICollectionview``` is best. For the listing details of each item, people use ```UITableView``` because it shows more info on each item. Apple Docs: UICollectionView Class Reference The UICollectionView class manages an ordered collection of data items and presents them using customizable layouts. Collection views provide the same general function as table views except that a collection view is able to support more than just single-column layouts. Collection views support customizable layouts that can be used to implement multi-column grids, tiled layouts, circular layouts, and many more. You can even change the layout of a collection view dynamically if you want. UITableView Class Reference A table view displays a list of items in a single column. UITableView is a subclass of UIScrollView, which allows users to scroll through the table, although UITableView allows vertical scrolling only. The cells comprising the individual items of the table are UITableViewCell objects; UITableView uses these objects to draw the visible rows of the table. Cells have content—titles and images—and can have, near the right edge, accessory views. Standard accessory views are disclosure indicators or detail disclosure buttons; the former leads to the next level in a data hierarchy and the latter leads to a detailed view of a selected item. Accessory views can also be framework controls, such as switches and sliders, or can be custom views. Table views can enter an editing mode where users can insert, delete, and reorder rows of the table.
Bu, gereksinimlere bağlıdır. Uygulamanın akışı, uygulamaya entegre edilecek kullanıcı arayüzü türünü belirler. İnsanlar çoğunlukla bir ızgarada gösterilen birden fazla resimle kullanıcı arayüzü türleri oluşturmak için ```UICollectionview``` kullanır. Bu, ```UITableView``` kullanarak karmaşık bir mantığa sahip olurdu ancak ```UICollectionview``` ile kolay olurdu. ```UICollectionview``` kullanırken, seçili öğe değerlerini alarak düğmeleri etiketlerle veya başka şeylerle ayarlamanıza gerek yoktur. ```-(void)collectionView:(UICollectionView *)collectionView didSelectItemAtIndexPath:(NSIndexPath *)indexPath``` ve ```UITableViewDelegate``` içinde ```-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath``` öğesini alabilirsiniz. Öğe yerine seçili satırı alırsınız, bu nedenle ızgara veya değiştirilmiş öğeler oluşturmak için ```UICollectionview``` kullanmak en iyisidir. Her öğenin listeleme ayrıntıları için insanlar ```UITableView``` kullanır çünkü her öğe hakkında daha fazla bilgi gösterir. Apple Belgeleri: UICollectionView Sınıfı Başvurusu UICollectionView sınıfı, bir veri öğeleri koleksiyonunu yönetir ve bunları özelleştirilebilir düzenler kullanarak sunar. Koleksiyon görünümleri, tablo görünümleriyle aynı genel işlevi sağlar ancak bir koleksiyon görünümü yalnızca tek sütunlu düzenleri destekleyemez. Koleksiyon görünümleri, çok sütunlu ızgaraları, döşenmiş düzenleri, dairesel düzenleri ve daha fazlasını uygulamak için kullanılabilecek özelleştirilebilir düzenleri destekler. İsterseniz bir koleksiyon görünümünün düzenini dinamik olarak bile değiştirebilirsiniz. UITableView Sınıfı Başvurusu Bir tablo görünümü, tek bir sütunda bir öğe listesi görüntüler. UITableView, kullanıcıların tabloda kaydırmasına izin veren UIScrollView'un bir alt sınıfıdır, ancak UITableView yalnızca dikey kaydırmaya izin verir. Tablonun tek tek öğelerini oluşturan hücreler UITableViewCell nesneleridir; UITableView, tablonun görünür satırlarını çizmek için bu nesneleri kullanır. Hücrelerin içeriği vardır (başlıklar ve resimler) ve sağ kenarın yakınında ek görünümler olabilir. Standart ek görünümler açıklama göstergeleri veya ayrıntı açıklama düğmeleridir; ilki bir veri hiyerarşisindeki bir sonraki düzeye, ikincisi ise seçili bir öğenin ayrıntılı görünümüne yol açar. Ek görünümler ayrıca anahtarlar ve kaydırıcılar gibi çerçeve denetimleri veya özel görünümler olabilir. Tablo görünümleri, kullanıcıların tablonun satırlarını ekleyebileceği, silebileceği ve yeniden sıralayabileceği bir düzenleme moduna girebilir.
82
On my branch I had some files in .gitignore On a different branch those files are not. I want to merge the different branch into mine, and I don't care if those files are no longer ignored or not. Unfortunately I get this: The following untracked working tree files would be overwritten by merge How would I modify my pull command to overwrite those files, without me having to find, move or delete those files myself?
Dalımda .gitignore içinde bazı dosyalar vardı Farklı bir dalda bu dosyalar yok. Farklı dalı benim dalımla birleştirmek istiyorum ve bu dosyaların artık göz ardı edilip edilmediğini umursamıyorum. Ne yazık ki şunu alıyorum: Birleştirmeyle aşağıdaki izlenmeyen çalışma ağacı dosyaları üzerine yazılacak Bu dosyaları kendim bulmak, taşımak veya silmek zorunda kalmadan, bu dosyaların üzerine yazmak için çekme komutumu nasıl değiştiririm?
Safely remove/overwrite only bothersome files When you want to ```merge```: ```git checkout -f donor-branch # replace bothersome files with tracked versions git checkout receiving-branch # tracked bothersome files disappear git merge donor-branch # merge works ``` When you want to ```pull```: ```git fetch git checkout -f origin/mybranch # replace bothersome files with tracked versions git checkout mybranch # tracked bothersome files disappear git pull origin/mybranch # pull works ``` That's all you need to know to use this. Below is an explanation. Detailed explanation The Bothersome Files that we are going to remove: * exist in the donor branch (for ```git pull```: the upstream branch), * do not exist in the receiving branch, * and are blocking the merge because they are present and untracked in your working directory. ```git merge -f``` and ```git pull -f``` do not exist, but ```git checkout -f``` does. We will use ```git checkout -f``` + ```git checkout``` to track + remove the Bothersome Files, and then your merge can proceed normally. Step 1. This step forcibly replaces untracked Bothersome Files with tracked versions of the donor branch (it also checks out the donor branch, and updates the rest of the working dir). ```git checkout -f donor-branch ``` Step 2. This step removes the Bothersome Files because they they are tracked in our current (donor) branch, and absent in the ```receiving-branch``` we switch to. ```git checkout receiving-branch ``` Step 3. Now that the Bothersome Files are absent, merging in the donor branch will not overwrite any untracked files, so we get no errors. ```git merge donor-branch ```
Sadece rahatsız edici dosyaları güvenli bir şekilde kaldırın/üzerine yazın ```merge``` işlemi yapmak istediğinizde: ```git checkout -f donor-branch # rahatsız edici dosyaları izlenen sürümlerle değiştirin git checkout receiving-branch # izlenen rahatsız edici dosyalar kaybolur git merge donor-branch # birleştirme çalışır ``` ```pull``` işlemi yapmak istediğinizde: ```git fetch git checkout -f origin/mybranch # rahatsız edici dosyaları izlenen sürümlerle değiştirin git checkout mybranch # izlenen rahatsız edici dosyalar kaybolur git pull origin/mybranch # çekme çalışır ``` Bunu kullanmak için bilmeniz gereken her şey bu. Aşağıda bir açıklama verilmiştir. Ayrıntılı açıklama Kaldıracağımız Rahatsız Edici Dosyalar: * bağışçı dalında bulunur (```git pull``` için: yukarı akış dalı), * alıcı dalında bulunmaz, * çalışma dizininizde mevcut ve izlenmediği için birleştirmeyi engeller. ```git merge -f``` ve ```git pull -f``` yoktur, ancak ```git checkout -f``` vardır. Rahatsız Edici Dosyaları izlemek + kaldırmak için ```git checkout -f``` + ```git checkout``` kullanacağız ve ardından birleştirmeniz normal şekilde devam edebilir. 1. Adım. Bu adım, izlenmeyen Rahatsız Edici Dosyaları bağışçı dalının izlenen sürümleriyle zorla değiştirir (aynı zamanda bağışçı dalını kontrol eder ve çalışma dizininin geri kalanını günceller). ```git checkout -f donor-branch ``` 2. Adım. Bu adım, Rahatsız Edici Dosyaları kaldırır çünkü bunlar geçerli (bağışçı) dalımızda izlenir ve geçtiğimiz ```receiving-branch```'te yoktur. ```git checkout receiving-branch ``` 3. Adım. Rahatsız Edici Dosyalar artık olmadığına göre, bağışçı dalını birleştirmek izlenmeyen dosyaların üzerine yazmaz, bu nedenle hata almayız. ```git merge donor-branch ```
83
Since long time ago I have been thinking in two problems that I have not been able to solve. It seems that one of them was recently solved. I have been thinking a lot about the motivation and its consequences. Mostly because people used to motivate one of them with some very interesting implications. My conclusion however, is that there is a mistake in the motivation of the problem, and that, while being a really interesting result, it does not make any sense in the setting in which is formulated. As my opinion is not relevant compared to one of the experts in the area, I do not say anything. My question is if you can provide me some examples of conjectures that were believed to be interesting in the mathematical community because of a specific reason, but that once having the proof, people realized that the reason to motivate the problem was not truly related to its solution. Or in other words, the solution of the problem gives no clues about the original motivation.
Uzun zamandır çözemediğim iki problem üzerinde düşünüyorum. Görünüşe göre bunlardan biri yakın zamanda çözüldü. Motivasyon ve sonuçları hakkında çok düşündüm. Çoğunlukla insanlar bunlardan birini çok ilginç çıkarımlarla motive ettikleri için. Ancak benim sonucum, problemin motivasyonunda bir hata olduğu ve gerçekten ilginç bir sonuç olsa da formüle edildiği ortamda hiçbir anlam ifade etmediğidir. Benim fikrim, bu alandaki uzmanlardan birine kıyasla önemli olmadığı için hiçbir şey söylemiyorum. Sormak istediğim, matematik camiasında belirli bir nedenden dolayı ilginç olduğuna inanılan ancak kanıtlandıktan sonra insanların problemi motive etme nedeninin çözümüyle gerçekten ilgili olmadığını fark ettikleri varsayımlara dair bazı örnekler verebilir misiniz? Ya da başka bir deyişle, problemin çözümü, orijinal motivasyon hakkında hiçbir ipucu vermiyor.
The three-body problem is one of the most famous problems in the history of mathematics, which also has an important application in science: it was supposed to explain the Moon's motion, among other things. Enormous effort was spent on this problem by many famous mathematicians of the 18th and 19th centuries. Since Newton's time it was clear that there was no simple closed form solution. (The problem also had an important practical application in 18th century, namely to navigation. If you can predict the motion of the Moon for few years ahead with sufficient accuracy, you can determine longitude at sea without a chronometer, just by observing Moon's position with respect to the stars). In the middle of the 19th century, an exact mathematical formulation of what was desired was achieved: to express the motions of the bodies in the form of convergent series of functions of time, valid for all times. Few people remember nowadays that in this precise form the problem was actually solved (by Sundman, at the very end of the 19th century). This solution can be found in Siegel's book on celestial mechanics. But by that time it was already understood that this solution was useless for practical purposes, namely for prediction of the Moon's motion over long time periods. It was also useless for understanding the qualitative features of the motion.
Üç cisim problemi, matematik tarihindeki en ünlü problemlerden biridir ve bilimde de önemli bir uygulama alanı vardır: Ay'ın hareketini açıklaması bekleniyordu. 18. ve 19. yüzyılın birçok ünlü matematikçisi bu problem üzerinde çok çalıştı. Newton'dan beri basit bir kapalı form çözümünün olmadığı açıktı. (Problem aynı zamanda 18. yüzyılda, özellikle navigasyonda önemli bir pratik uygulamaya sahipti. Ay'ın hareketini birkaç yıl önceden yeterli doğrulukla tahmin edebilirseniz, bir kronometre olmadan sadece Ay'ın yıldızlara göre konumunu gözlemleyerek denizdeki boylamı belirleyebilirsiniz). 19. yüzyılın ortalarında, istenen şeyin tam bir matematiksel formülasyonu elde edildi: Cisimlerin hareketlerini, tüm zamanlar için geçerli olan, zamanın fonksiyonlarının yakınsak serileri şeklinde ifade etmek. Günümüzde çok az kişi, problemin bu kesin biçimde aslında çözüldüğünü (19. yüzyılın sonlarında Sundman tarafından) hatırlamaktadır. Bu çözüm, Siegel'in gök mekaniği kitabında bulunabilir. Ancak o zamana kadar bu çözümün pratik amaçlar için, yani Ay'ın hareketinin uzun zaman dilimleri boyunca tahmin edilmesi için işe yaramadığı anlaşılmıştı. Hareketin nitel özelliklerini anlamak için de işe yaramadı.
84
How do GPS receivers communicate with satellites?
GPS alıcıları uydularla nasıl iletişim kurar?
The first thing to know is the communication is one-way. There's a satellite-to-receiver transmission, nothing going in the opposite direction. So your cell phone doesn't have to find the radio power to send a signal all the way to space! (exceptions: The decommissioned Chinese BeiDou-1 system - and any products where the GPS receiver chip is used alongside a satellite transmitter, like a Cospas-Sarsat emergency locator beacon) The signal from GPS satellites is very faint - each satellite has to broadcast a signal to about half the planet, powered only by some solar panels! So the broadcast signal is modulated using a 'Gold Code' (in the case of the oldest public GPS signal) where part of the signal transmitted by the satellite is already known by the receiver - the GPS receiver can pick out the signal despite how faint it is, by tracking the cross-correlation between the received and expected signals. This also means multiple satellites can transmit their signals at the same frequency - so long as they use different gold codes, the receiver can track both signals independently. Newer GNSS signals replace gold codes with newer techniques - like 'multiplexed binary offset carriers' - which perform better, but do basically the same thing.
Bilinmesi gereken ilk şey, iletişimin tek yönlü olduğudur. Uydudan alıcıya bir iletim vardır, ters yönde hiçbir şey gitmez. Yani cep telefonunuzun bir sinyal göndermek için uzaya kadar tüm yolu bulacak radyo gücüne sahip olması gerekmez! (istisnalar: Kullanımdan kaldırılmış Çin BeiDou-1 sistemi - ve GPS alıcı çipinin bir Cospas-Sarsat acil durum yer belirleyici işaretçisi gibi bir uydu vericisiyle birlikte kullanıldığı tüm ürünler) GPS uydularından gelen sinyal çok zayıftır - her uydu, yalnızca birkaç güneş paneliyle güçlendirilerek gezegenin yaklaşık yarısına bir sinyal yayınlamak zorundadır! Bu nedenle yayın sinyali, uydu tarafından iletilen sinyalin bir kısmının alıcı tarafından zaten bilindiği bir 'Altın Kod' (en eski halka açık GPS sinyali durumunda) kullanılarak modüle edilir - GPS alıcı, alınan ve beklenen sinyaller arasındaki çapraz korelasyonu izleyerek sinyalin ne kadar zayıf olursa olsun onu seçebilir. Bu aynı zamanda birden fazla uydunun sinyallerini aynı frekansta iletebileceği anlamına gelir - farklı altın kodlar kullandıkları sürece alıcı her iki sinyali de bağımsız olarak izleyebilir. Daha yeni GNSS sinyalleri, altın kodların yerini daha iyi performans gösteren ancak temelde aynı şeyi yapan 'çoklanmış ikili ofset taşıyıcılar' gibi daha yeni tekniklerle alır.
85
Why is iceberg lettuce bad for rabbits?
Buzdağı marulu tavşanlar için neden kötüdür?
In short, iceberg lettuce is mostly water with little to no nutrient value. A rabbit can fill up on it (because of the bulk), but still need food because they didn't get enough calories, vitamins, minerals, etc. If you look at the USDA's webpage on iceberg lettuce. You'll notice that water makes up just about 95% of the nutrients, leaving 5% to be divided up between every other nutrient. Protein is a little less than 1%, Carbohydrates less than 3%, and sugars less than 2%. Most importantly, you want to pay attention to the vitamin and calorie content. Iceberg lettuce has only 14 calories per 100 grams (2 calories or less in each leaf), and 18mg of calcium. Other effects to consider, is when fed straight from the fridge, lettuce will be cold and wet, both are conditions that can upset a pet's stomach. In addition, since most rabbit breeders do not feed lettuce to their baby rabbits, it is an unfamiliar food and if the rabbit owner does not add lettuce to the diet gradually, it will cause stomach upset. Finally, it is often believed amoung rabbit breeders that Rabbits should not eat some lettuces (such as iceberg) as they contain a substance called laudanum which can be harmful in large quantities. RSPCA: Rabbit Diet Myths But this is disputed because Lettuce does not contain laudanum. Edible lettuce does contain a chemical called lactucin which is a component of lactucarian. Lactucarian is the milky fluid found in some species of lettuce and occurs in much larger amounts in wild lettuce, Lactuca virosa. Lactucarium has sedative and analgesic effects. It creates a sense of mild euphoria. The milky exudate resembles that of opium and it can also be reduced to a thick substance which can be smoked in the same way as opium. As a result of which it acquired the name ‘lettuce opium’. Edible lettuce, Lactuca sativa, does not even contain lactucarium although it does contain lactucin which is in lactucarium. Lettuce for Rabbits and Guinea Pigs (note that rabbits and guinea pigs have different digestive systems, this link is included for the information on lettuce composition). It is not known if lactucin turns into lactucarium during the digestive process in the rabbit, there are some accounts of rabbits appearing sedated after ingesting large quantities of lettuce. Regardless of the laudanum/lactucin status, there's no reason to feed iceberg because of the low nutrient value. The House Rabbit Society's website has even more details on what foods are good for rabbits and why.
Kısacası, buzdağı marulu çoğunlukla çok az besin değeri olan sudur. Bir tavşan (hacim nedeniyle) onunla dolabilir, ancak yine de yeterli kalori, vitamin, mineral vb. almadıkları için yiyeceğe ihtiyaç duyarlar. USDA'nın buzdağı marulu hakkındaki web sayfasına bakarsanız. Suyun besinlerin yaklaşık %95'ini oluşturduğunu, %5'in diğer tüm besinler arasında bölündüğünü fark edeceksiniz. Protein %1'den biraz daha az, Karbonhidratlar %3'ten az ve şekerler %2'den azdır. En önemlisi, vitamin ve kalori içeriğine dikkat etmek istersiniz. Buzdağı marulunda 100 gramda sadece 14 kalori (her yaprağında 2 kalori veya daha az) ve 18 mg kalsiyum bulunur. Dikkat edilmesi gereken diğer etkiler, doğrudan buzdolabından beslendiğinde marulun soğuk ve ıslak olacağıdır, her ikisi de bir evcil hayvanın midesini bozabilecek koşullardır. Ayrıca, çoğu tavşan yetiştiricisi bebek tavşanlarına marul vermediğinden, bu tanıdık olmayan bir yiyecektir ve tavşan sahibi diyete yavaş yavaş marul eklemezse mide rahatsızlığına neden olur. Son olarak, tavşan yetiştiricileri arasında genellikle şu inanılır: Tavşanlar, büyük miktarlarda zararlı olabilecek laudanum adı verilen bir madde içerdikleri için bazı marulları (buz dağı gibi) yememelidir. RSPCA: Tavşan Diyeti Efsaneleri Ancak bu tartışmalıdır çünkü Marul laudanum içermez. Yenilebilir marul, lactucarian'ın bir bileşeni olan lactucin adı verilen bir kimyasal içerir. Lactucarian, bazı marul türlerinde bulunan sütlü sıvıdır ve yabani marulda, Lactuca virosa'da çok daha büyük miktarlarda bulunur. Lactucarium yatıştırıcı ve analjezik etkilere sahiptir. Hafif bir öfori hissi yaratır. Sütlü özüt afyonunkine benzer ve aynı zamanda afyonla aynı şekilde içilebilen kalın bir maddeye indirgenebilir. Sonuç olarak 'marul afyonu' adını almıştır. Yenilebilir marul, Lactuca sativa, lactucarium içermez ancak lactucariumda bulunan lactucin içerir. Tavşanlar ve Gine Domuzları İçin Marul (tavşanların ve gine domuzlarının farklı sindirim sistemlerine sahip olduğunu unutmayın, bu bağlantı marul bileşimi hakkındaki bilgiler için eklenmiştir). Lactucin'in tavşanın sindirim süreci sırasında lactucariuma dönüşüp dönüşmediği bilinmemektedir, büyük miktarlarda marul yedikten sonra tavşanların sakinleştiği bazı anlatımlar vardır. Laudanum/lactucin durumuna bakılmaksızın, düşük besin değeri nedeniyle buzdağı beslemenin bir nedeni yoktur. The House Rabbit Society'nin web sitesinde tavşanlar için hangi yiyeceklerin iyi olduğu ve neden olduğu hakkında daha fazla ayrıntı vardır.
86
How do I open the JavaScript console in different browsers?
Farklı tarayıcılarda JavaScript konsolunu nasıl açarım?
Chrome Opening the “Console” panel of Chrome’s DevTools: * Windows and Linux: Ctrl + Shift + J * Mac OS: Cmd + Opt + J Note: In addition to the “Console” panel, there also exists a smaller slide-up console which can be toggled via Esc while any of the other panels is active. Firefox Opening the “Console” panel in Firefox’s Developer Tools: * Windows: Ctrl + Shift + K * Mac OS: Cmd + Opt + K Note: In addition to the “Console” panel, there also exists a smaller slide-up console which can be toggled via Esc while any of the other panels is active. Internet Explorer Opening the “Console” panel in Internet Explorer’s F12 Developer Tools: * F12, then click on the “Console” tab Note: In addition to the “Console” panel, there also exists a smaller slide-up console which can be toggled via Ctrl + ` while any of the other panels is active. Safari Note: In order to view the console in Safari, you have to enable the “Show Develop menu in menu bar” setting in the “Advanced” pane of Safari’s preferences (screenshot). Opening the “Console” panel in Safari’s Web Inspector: * Cmd + Opt + C Note: In addition to the “Console” panel, there also exists a smaller slide-up console which can be toggled via Esc while any of the other panels is active. Opera * Windows and Linux: Ctrl + Shift + I * Mac : ⌘+⌥+I
Chrome Chrome'un DevTools'unun "Konsol" panelini açma: * Windows ve Linux: Ctrl + Shift + J * Mac OS: Cmd + Opt + J Not: "Konsol" paneline ek olarak, diğer panellerden herhangi biri etkin durumdayken Esc tuşuyla açılıp kapatılabilen daha küçük bir kayar konsol da vardır. Firefox Firefox'un Geliştirici Araçları'nda "Konsol" panelini açma: * Windows: Ctrl + Shift + K * Mac OS: Cmd + Opt + K Not: "Konsol" paneline ek olarak, diğer panellerden herhangi biri etkin durumdayken Esc tuşuyla açılıp kapatılabilen daha küçük bir kayar konsol da vardır. Internet Explorer Internet Explorer'ın F12 Geliştirici Araçları'nda "Konsol" panelini açma: * F12 tuşuna basın, ardından "Konsol" sekmesine tıklayın Not: "Konsol" paneline ek olarak, diğer panellerden herhangi biri etkin durumdayken Ctrl + ` tuşlarıyla açılıp kapatılabilen daha küçük bir kayar konsol da vardır. Safari Not: Safari'de konsolu görüntülemek için Safari tercihlerinin "Gelişmiş" bölmesinde "Geliştirme menüsünü menü çubuğunda göster" ayarını etkinleştirmeniz gerekir (ekran görüntüsü). Safari'nin Web Denetleyicisi'nde "Konsol" panelini açma: * Cmd + Opt + C Not: "Konsol" paneline ek olarak, diğer panellerden herhangi biri etkin durumdayken Esc tuşuyla açılıp kapatılabilen daha küçük bir kayar konsol da vardır. Opera * Windows ve Linux: Ctrl + Shift + I * Mac: ⌘+⌥+I
87
I have Ubuntu 10 as the guest OS on a Windows 7 machine. I have been trying to setup shares through VirtualBox, but nothing is working. First, I create the share in VirtualBox and point it to a Windows folder. Then I try to mount the drive in Linux, but I keep getting ```/sbin/mount.vboxsf: mounting failed with the error: Protocol error ``` I have read so many solutions to this, but none seem to work. I have tried: * Using the mount.vboxsf syntax * Reinstalling VBox additions * Rebooting * Enabling and trying as root account I made a share called &quot;Test&quot; in VBox Shared folders. Then I made a directory in ubuntu named &quot;test2&quot;. Then I tried to execute this command: ```sudo mount -t vboxsf Test /mnt/test2 ``` Any other ideas?
Windows 7 makinesinde konuk işletim sistemi olarak Ubuntu 10 kullanıyorum. VirtualBox üzerinden paylaşım ayarlamaya çalışıyorum ancak hiçbir şey çalışmıyor. Öncelikle VirtualBox'ta paylaşım oluşturup bir Windows klasörüne yönlendiriyorum. Ardından Linux'ta sürücüyü bağlamaya çalışıyorum ancak sürekli şu hatayı alıyorum: ```/sbin/mount.vboxsf: mounting failed with the error: Protocol error ``` Bu konuyla ilgili birçok çözüm okudum ancak hiçbiri işe yaramıyor. Şunları denedim: * mount.vboxsf sözdizimini kullanma * VBox eklentilerini yeniden yükleme * Yeniden başlatma * Etkinleştirme ve kök hesap olarak deneme VBox Paylaşılan klasörlerde "Test" adında bir paylaşım oluşturdum. Ardından Ubuntu'da "test2" adında bir dizin oluşturdum. Sonra şu komutu çalıştırmayı denedim: ```sudo mount -t vboxsf Test /mnt/test2 ``` Başka fikirleriniz var mı?
In order to use shared folder functionality few prerequisites need to be met: * Make sure that Guest Additions are properly installed on the guest OS. * Users in a guest Ubuntu must be in the group ```vboxsf``` to be able to access shares. * Define a directory on the host that will be used in the virtual machine using the settings dialogue of Virtual Box. Depending on host or guest OS the following may also be needed: * Do not share personal folders like ```/home/username``` or ```My Documents``` * Avoid special characters or empty spaces in the path to the shared folder, especially if the host or VM is a Windows machine * Use different names for share and mountpoint * Create a mountpoint on the guest OS (best in your HOME directory). Testing shared folders functionality can be done by creating a shared directory on the host (e.g. ```C:\myshare```), define this as a shared folder for your guest system in Virtual Box settings (e.g. ```share```), create a mount point in your guest os (e.g. ```mkdir /home/username/host```) and mount this in the guest OS with the command: ```sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/username/host ``` where the option -o makes sure that you will have access to the mount (that will otherwise be owned by root). For further information on shared folders see also the Virtual Box User Manual. Files or directories can also be shared over the network by using Samba on the host and the guest.
Paylaşılan klasör işlevini kullanmak için birkaç ön koşulun karşılanması gerekir: * Konuk işletim sistemine Guest Additions'ın düzgün bir şekilde yüklendiğinden emin olun. * Konuk Ubuntu'daki kullanıcıların paylaşımlara erişebilmek için ```vboxsf``` grubunda olması gerekir. * Virtual Box'ın ayarlar iletişim kutusunu kullanarak sanal makinede kullanılacak ana bilgisayarda bir dizin tanımlayın. Ana bilgisayar veya konuk işletim sistemine bağlı olarak aşağıdakiler de gerekebilir: * ```/home/kullanıcıadı``` veya ```Belgelerim``` gibi kişisel klasörleri paylaşmayın * Paylaşılan klasöre giden yolda özellikle ana bilgisayar veya sanal makine bir Windows makinesiyse özel karakterlerden veya boşluklardan kaçının * Paylaşım ve bağlama noktası için farklı adlar kullanın * Konuk işletim sisteminde bir bağlama noktası oluşturun (en iyisi ANA DİZİNİNİZDE). Paylaşılan klasör işlevini test etmek, ana bilgisayarda bir paylaşılan dizin oluşturarak (ör. ```C:\myshare```), bunu Virtual Box ayarlarında konuk sisteminiz için paylaşılan bir klasör olarak tanımlayarak (ör. ```share```), konuk işletim sisteminizde bir bağlama noktası oluşturarak (ör. ```mkdir /home/kullanıcıadı/host```) ve bunu konuk işletim sisteminde şu komutla bağlayarak yapılabilir: ```sudo mount -t vboxsf -o uid=1000,gid=1000 share /home/kullanıcıadı/host ``` burada -o seçeneği bağlama noktasına erişiminiz olduğundan emin olur (aksi takdirde kök tarafından sahip olunur). Paylaşılan klasörler hakkında daha fazla bilgi için Virtual Box Kullanım Kılavuzu'na da bakın. Dosyalar veya dizinler, ana bilgisayar ve konukta Samba kullanılarak ağ üzerinden de paylaşılabilir.
88
What does %~dp0 mean, and how does it work? I'd also like to know if it is a documented feature, or something prone to be deprecated.
%~dp0 ne anlama gelir ve nasıl çalışır? Ayrıca bunun belgelenmiş bir özellik mi yoksa kullanımdan kaldırılabilecek bir şey mi olduğunu da bilmek istiyorum.
Calling `for /?` in the command-line gives help about this syntax (which can be used outside FOR, too, this is just the place where help can be found). > In addition, substitution of FOR variable references has been enhanced. You can now use the following optional syntax: ```%~I - expands %I removing any surrounding quotes (") %~fI - expands %I to a fully qualified path name %~dI - expands %I to a drive letter only %~pI - expands %I to a path only %~nI - expands %I to a file name only %~xI - expands %I to a file extension only %~sI - expanded path contains short names only %~aI - expands %I to file attributes of file %~tI - expands %I to date/time of file %~zI - expands %I to size of file %~$PATH:I - searches the directories listed in the PATH environment variable and expands %I to the fully qualified name of the first one found. If the environment variable name is not defined or the file is not found by the search, then this modifier expands to the empty string ``` The modifiers can be combined to get compound results: ```%~dpI - expands %I to a drive letter and path only %~nxI - expands %I to a file name and extension only %~fsI - expands %I to a full path name with short names only %~dp$PATH:I - searches the directories listed in the PATH environment variable for %I and expands to the drive letter and path of the first one found. %~ftzaI - expands %I to a DIR like output line ``` In the above examples %I and PATH can be replaced by other valid values. The %~ syntax is terminated by a valid FOR variable name. Picking upper case variable names like %I makes it more readable and avoids confusion with the modifiers, which are not case sensitive. There are different letters you can use like ```f``` for "full path name", ```d``` for drive letter, ```p``` for path, and they can be combined. ```%~``` is the beginning for each of those sequences and a number ```I``` denotes it works on the parameter ```%I``` (where ```%0``` is the complete name of the batch file, just like you assumed).
Komut satırında `for /?` çağrısı yapmak bu söz dizimi hakkında yardım sağlar (bu, FOR dışında da kullanılabilir, yardımın bulunabileceği yer burasıdır). > Ayrıca, FOR değişken referanslarının ikamesi geliştirildi. Artık aşağıdaki isteğe bağlı söz dizimini kullanabilirsiniz: ```%~I - %I'ı çevreleyen tırnak işaretlerini (") kaldırarak genişletir %~fI - %I'ı tam nitelikli bir yol adına genişletir %~dI - %I'ı yalnızca bir sürücü harfine genişletir %~pI - %I'ı yalnızca bir yola genişletir %~nI - %I'ı yalnızca bir dosya adına genişletir %~xI - %I'ı yalnızca bir dosya uzantısına genişletir %~sI - genişletilmiş yol yalnızca kısa adlar içerir %~aI - %I'ı dosyanın dosya özniteliklerine genişletir %~tI - %I'ı dosyanın tarihine/saatine genişletir %~zI - %I'ı dosyanın boyutuna genişletir %~$PATH:I - PATH ortam değişkeninde listelenen dizinleri arar ve %I'ı bulunan ilk dizinin tam nitelikli adına genişletir. Ortam değişkeni adı tanımlanmamışsa veya dosya arama ile bulunmamışsa, bu değiştirici boş dizeye genişler ``` Birleşik sonuçlar elde etmek için değiştiriciler birleştirilebilir: ```%~dpI - %I'ı yalnızca bir sürücü harfi ve yola genişletir %~nxI - %I'ı yalnızca bir dosya adına ve uzantısına genişletir %~fsI - %I'ı yalnızca kısa adlar içeren tam bir yol adına genişletir %~dp$PATH:I - %I için PATH ortam değişkeninde listelenen dizinleri arar ve bulunan ilk dizinin sürücü harfi ve yoluna genişletir. %~ftzaI - %I'ı DIR benzeri bir çıktı satırına genişletir ``` Yukarıdaki örneklerde %I ve PATH diğer geçerli değerlerle değiştirilebilir. %~ söz dizimi geçerli bir FOR değişken adıyla sonlandırılır. %I gibi büyük harfli değişken adları seçmek, okunabilirliği artırır ve harf büyük/küçük duyarlılığı olmayan değiştiricilerle karışıklığı önler. "Tam yol adı" için ```f```, sürücü harfi için ```d```, yol için ```p``` gibi kullanabileceğiniz farklı harfler vardır ve bunlar birleştirilebilir. ```%~``` bu dizilerin her birinin başlangıcıdır ve bir sayı ```I```, ```%I``` parametresi üzerinde çalıştığını belirtir (burada ```%0```, varsaydığınız gibi toplu iş dosyasının tam adıdır).
89
Should a tester feel bad about finding too many defects/bugs in the product?
Bir testçi, üründe çok fazla hata/böcek bulduğu için kendini kötü hissetmeli mi?
If this is a medical application you are talking about it is serious stuff. What if the bugs affected real users? Developers would be much less happy if they put in life threat someone or if management has to retire a product or make public excuses. Nowadays it is pretty standard for software having minor bugs, but a medical application should be as much as bug-free as possible. A good developer should not be angry about bugs, but rather be happy, and a good manager already know how software development work so should not put under too much pressure its team unless really necessary: * It has been caught before product release * It is pretty standard for a programmer fixing bugs daily * If you have to focus on programming it is hard also to focus on testing * A tester Always reports bugs * A regular user usually not (unless particularly angry or determined) * If the user is your client, he will report bugs and he will not be happy if the project already cost him much money or required a good amount of time. Literally a project for which bugs are not reported at least on a weekly basis: * Too simple project: no value every other company could easily create a better clone * Not much-used project: maybe there are bugs but no one incurred in them * Bad management: if there are no bugs it's time to move on further work (extra features or different projects). * Bug fixes should drive development, they give a correct idea of what should work and is not working, this allows to manage priorities between fixes and features * In important projects it makes sense adding automated testing so that every fix and feature comes with new tests that avoid breaking pre-existing functionality
Eğer bahsettiğiniz şey tıbbi bir uygulamaysa bu ciddi bir şeydir. Ya hatalar gerçek kullanıcıları etkilerse? Geliştiriciler, birinin hayatını tehlikeye atacak bir şey yaparlarsa veya yönetim bir ürünü geri çekmek veya kamuoyuna özür dilemek zorunda kalırsa çok daha az mutlu olurlar. Günümüzde yazılımlarda küçük hataların olması oldukça standarttır ancak tıbbi bir uygulama mümkün olduğunca hatasız olmalıdır. İyi bir geliştirici hatalar yüzünden kızmamalı, bunun yerine mutlu olmalıdır ve iyi bir yönetici yazılım geliştirmenin nasıl işlediğini zaten bilmelidir, bu nedenle ekibine gerçekten gerekli olmadıkça çok fazla baskı uygulamamalıdır: * Ürün piyasaya sürülmeden önce yakalandı * Bir programcının günlük olarak hataları düzeltmesi oldukça standarttır * Programlamaya odaklanmanız gerekiyorsa, test etmeye odaklanmak da zordur * Bir test uzmanı her zaman hataları bildirir * Normal bir kullanıcı genellikle bildirmez (özellikle kızgın veya kararlı olmadığı sürece) * Kullanıcı sizin müşterinizse hataları bildirecektir ve proje ona zaten çok paraya mal olmuşsa veya iyi bir zaman gerektiriyorsa mutlu olmayacaktır. Kelimenin tam anlamıyla hataların en azından haftalık olarak bildirilmediği bir proje: * Çok basit proje: Herhangi bir değeri yok, başka bir şirket kolayca daha iyi bir klon oluşturabilir * Çok kullanılmayan proje: Belki hatalar vardır ancak kimse bunlarla karşılaşmamıştır * Kötü yönetim: Hata yoksa daha fazla işe (ek özellikler veya farklı projeler) geçme zamanı gelmiştir. * Hata düzeltmeleri geliştirmeyi yönlendirmelidir, neyin çalışması gerektiği ve neyin çalışmadığı konusunda doğru bir fikir verir, bu da düzeltmeler ve özellikler arasındaki öncelikleri yönetmeye olanak tanır * Önemli projelerde, her düzeltme ve özelliğin önceden var olan işlevselliği bozmamasını sağlayan yeni testlerle birlikte gelmesi için otomatik test eklemek mantıklıdır
90
Millions of colors in the visible spectrum can be generated by mixing red, green and blue - the RGB color system. Is there a basic set of smells that, when mixed, can yield all, or nearly all detectable smells ?
Görünür spektrumdaki milyonlarca renk, kırmızı, yeşil ve mavinin karıştırılmasıyla oluşturulabilir - RGB renk sistemi. Karıştırıldığında tüm veya neredeyse tüm algılanabilir kokuları verebilecek temel bir koku seti var mı?
There are about 100 (Purves, 2001) to 400 (Zozulya et al., 2001) functional olfactory receptors in man. While the total tally of olfactory receptor genes exceeds 1000, more than half of them are inactive pseudogenes. The combined activity of the expressed functional receptors accounts for the number of distinct odors that can be discriminated by the human olfactory system, which is estimated to be about 10,000 (Purves, 2001). Different receptors are sensitive to subsets of chemicals that define a “tuning curve.” Depending on the particular olfactory receptor molecules they contain, some olfactory receptor neurons exhibit marked selectivity to particular chemical stimuli, whereas others are activated by a number of different odorant molecules. In addition, olfactory receptor neurons can exhibit different thresholds for a particular odorant. How these olfactory responses encode a specific odorant is a complex issue that is unlikely to be explained at the level of the primary neurons (Purves, 2001). So in a way, the answer to your question is yes, as there are approximately 100 to 400 olfactory receptors. Just like the photoreceptors in the visual system, each sensory neuron in the olfactory epithelium in the nose expresses only a single receptor gene (Kimball). In the visual system for color vision there are just three (red, green and blue cones - RGB) types of sensory neurons, so it's a bit more complicated in olfaction. References - Purves et al, Neuroscience, 2nd ed. Sunderland (MA): Sinauer Associates; 2001 - Zozulya et al., Genome Biol (2001); 2(6): research0018.1–0018.12 Sources - Kimball's Biology Pages
İnsanda yaklaşık 100 (Purves, 2001) ila 400 (Zozulya ve ark., 2001) işlevsel koku alıcı reseptörü vardır. Toplam koku alıcı geni sayısı 1000'i aşarken, bunların yarısından fazlası aktif olmayan psödogenlerdir. İfade edilen işlevsel reseptörlerin birleşik aktivitesi, insan koku alma sistemi tarafından ayırt edilebilen ve yaklaşık 10.000 olduğu tahmin edilen farklı koku sayısını oluşturur (Purves, 2001). Farklı reseptörler, bir "ayarlama eğrisi" tanımlayan kimyasal alt kümelere karşı hassastır. İçerdikleri özel koku alıcı reseptör moleküllerine bağlı olarak, bazı koku alıcı nöronlar belirli kimyasal uyaranlara karşı belirgin bir seçicilik gösterirken, diğerleri bir dizi farklı koku molekülü tarafından aktive edilir. Ek olarak, koku alıcı nöronlar belirli bir koku maddesi için farklı eşikler gösterebilir. Bu koku tepkilerinin belirli bir koku maddesini nasıl kodladığı, birincil nöronlar düzeyinde açıklanması pek mümkün olmayan karmaşık bir konudur (Purves, 2001). Yani bir bakıma sorunuzun cevabı evet, çünkü yaklaşık 100 ila 400 koku alıcı reseptörü var. Görsel sistemdeki fotoreseptörler gibi, burundaki koku alma epitelindeki her duyusal nöron yalnızca tek bir reseptör geni ifade eder (Kimball). Renk görüşü için görsel sistemde sadece üç (kırmızı, yeşil ve mavi koniler - RGB) duyusal nöron türü vardır, bu nedenle koku alma duyusunda biraz daha karmaşıktır. Referanslar - Purves ve ark., Nörobilim, 2. baskı. Sunderland (MA): Sinauer Associates; 2001 - Zozulya ve ark., Genome Biol (2001); 2(6): research0018.1–0018.12 Kaynaklar - Kimball's Biology Pages
91
Do you bleed to death after your penis is cut off?
Penisin kesildikten sonra kan kaybından ölür müsün?
Assuming the person is not taking anticoagulants, it's actually quite difficult to bleed to death from dismemberment of small members (hands, feet, penis, ears, nose, etc). Even large members such as arms and legs are often survivable because the body is very good at protecting itself from blood loss. For example, transected arteries will spasm and clamp off blood flow, and loss of blood will cause the body to divert blood flow away from the extremities and to the vital organs, thereby slowing the bleeding and allowing it to clot. In fact, the whole shock process can be viewed as a set of defensive measures by the body to ensure survival in the face of serious injury. This was a bitter lesson learned by emergency medicine only fairly recently. The standard practice used to be to infuse hypovolemic patients with fluids to maintain normal blood pressure. The trouble is, a normal blood pressure prevents the body from realizing it has inadequate blood volume and turns off its defensive measures, thus allowing the bleeding to continue unabated. Left to fend for himself, a healthy adult would almost certainly survive having his penis removed. With modern medical care, that becomes a certainty. Could he still urinate? Sure, as long as the urethra wasn't blocked. It could become blocked by clotted blood, but eventually the pressure of a full bladder would overcome the blockage. Downvoter, care to comment?
Kişinin antikoagülan almadığını varsayarsak, küçük uzuvların (eller, ayaklar, penis, kulaklar, burun vb.) parçalanmasından ölmek aslında oldukça zordur. Kollar ve bacaklar gibi büyük uzuvlar bile genellikle hayatta kalınabilir çünkü vücut kendini kan kaybından korumakta çok iyidir. Örneğin, kesilen atardamarlar spazm yapar ve kan akışını keser ve kan kaybı vücudun kan akışını ekstremitelerden hayati organlara yönlendirmesine neden olur, böylece kanamayı yavaşlatır ve pıhtılaşmasına izin verir. Aslında, tüm şok süreci, vücudun ciddi yaralanmalara karşı hayatta kalmasını sağlamak için bir dizi savunma önlemi olarak görülebilir. Bu, acil tıp tarafından nispeten yakın zamanda öğrenilen acı bir dersti. Normal kan basıncını korumak için hipovolemik hastalara sıvı verilmesi standart uygulamaydı. Sorun şu ki, normal bir kan basıncı vücudun yetersiz kan hacmine sahip olduğunu anlamasını engeller ve savunma önlemlerini kapatır, böylece kanama durmadan devam eder. Sağlıklı bir yetişkin, kendi kendine bakmaya bırakılırsa, penisinin alınmasından neredeyse kesinlikle sağ çıkacaktır. Modern tıbbi bakımla bu bir kesinlik haline gelir. Hala idrar yapabilir mi? Elbette, üretra tıkanmadığı sürece. Pıhtılaşmış kanla tıkanabilir, ancak sonunda dolu bir mesanenin basıncı tıkanıklığı aşacaktır. Oy veren, yorum yapmak ister misiniz?
92
In Swift, is there a clever way of using the higher order methods on Array to return the 5 first objects? The obj-c way of doing it was saving an index, and for-loop through the array incrementing index until it was 5 and returning the new array. Is there a way to do this with ```filter```, ```map``` or ```reduce```?
Swift'te, Array'deki yüksek mertebeden yöntemleri kullanarak ilk 5 nesneyi döndürmenin akıllıca bir yolu var mı? Obj-c'de bunu yapmanın yolu bir indeks kaydetmek ve indeks 5 olana kadar diziyi for döngüsüyle yineleyerek yeni diziyi döndürmekti. Bunu ```filter```, ```map``` veya ```reduce``` ile yapmanın bir yolu var mı?
With Swift 5, according to your needs, you may choose one of the 6 following Playground codes in order to solve your problem. #1. Using ```subscript(_:)``` subscript ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array[..<5] //let arraySlice = array[0..<5] // also works //let arraySlice = array[0...4] // also works //let arraySlice = array[...4] // also works let newArray = Array(arraySlice) print(newArray) // prints: ["A", "B", "C", "D", "E"] ``` #2. Using ```prefix(_:)``` method Complexity: O(1) if the collection conforms to ```RandomAccessCollection```; otherwise, O(k), where k is the number of elements to select from the beginning of the collection. ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array.prefix(5) let newArray = Array(arraySlice) print(newArray) // prints: ["A", "B", "C", "D", "E"] ``` Apple states for ```prefix(_:)```: If the maximum length exceeds the number of elements in the collection, the result contains all the elements in the collection. #3. Using ```prefix(upTo:)``` method Complexity: O(1) ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array.prefix(upTo: 5) let newArray = Array(arraySlice) print(newArray) // prints: ["A", "B", "C", "D", "E"] ``` Apple states for ```prefix(upTo:)```: Using the ```prefix(upTo:)``` method is equivalent to using a partial half-open range as the collection's subscript. The subscript notation is preferred over ```prefix(upTo:)```. #4. Using ```prefix(through:)``` method ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array.prefix(through: 4) let newArray = Array(arraySlice) print(newArray) // prints: ["A", "B", "C", "D", "E"] ``` #5. Using ```removeSubrange(_:)``` method Complexity: O(n), where n is the length of the collection. ```var array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] array.removeSubrange(5...) print(array) // prints: ["A", "B", "C", "D", "E"] ``` #6. Using ```dropLast(_:)``` method Complexity: O(1) if the collection conforms to ```RandomAccessCollection```; otherwise, O(k), where k is the number of elements to drop. ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let distance = array.distance(from: 5, to: array.endIndex) let arraySlice = array.dropLast(distance) let newArray = Array(arraySlice) print(newArray) // prints: ["A", "B", "C", "D", "E"] ```
Swift 5 ile, ihtiyaçlarınıza göre, probleminizi çözmek için aşağıdaki 6 Playground kodundan birini seçebilirsiniz. #1. ```subscript(_:)``` dizinini kullanma ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array[..<5] //let arraySlice = array[0..<5] // ayrıca çalışır //let arraySlice = array[0...4] // ayrıca çalışır //let arraySlice = array[...4] // ayrıca çalışır let newArray = Array(arraySlice) print(newArray) // ["A", "B", "C", "D", "E"] yazdırır ``` #2. ```prefix(_:)``` yöntemini kullanma Karmaşıklık: Koleksiyon ```RandomAccessCollection``` ile uyumluysa O(1); aksi takdirde, O(k), burada k koleksiyonun başlangıcından seçilecek elemanların sayısıdır. ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array.prefix(5) let newArray = Array(arraySlice) print(newArray) // ["A", "B", "C", "D", "E"] yazdırır ``` Apple, ```prefix(_:)``` için şunları belirtir: Maksimum uzunluk koleksiyonun eleman sayısını aşarsa, sonuç koleksiyonun tüm elemanlarını içerir. #3. ```prefix(upTo:)``` yöntemini kullanma Karmaşıklık: O(1) ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array.prefix(upTo: 5) let newArray = Array(arraySlice) print(newArray) // ["A", "B", "C", "D", "E"] yazdırır ``` Apple, ```prefix(upTo:)``` için şunları belirtir: ```prefix(upTo:)``` yöntemini kullanmak, koleksiyonun dizini olarak kısmi yarı açık bir aralık kullanmaya eşdeğerdir. Dizin gösterimi ```prefix(upTo:)``` yerine tercih edilir. #4. ```prefix(through:)``` yöntemini kullanma ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let arraySlice = array.prefix(through: 4) let newArray = Array(arraySlice) print(newArray) // ["A", "B", "C", "D", "E"] yazdırır ``` #5. ```removeSubrange(_:)``` yöntemini kullanma Karmaşıklık: O(n), burada n koleksiyonun uzunluğudur. ```var array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] array.removeSubrange(5...) print(array) // ["A", "B", "C", "D", "E"] yazdırır ``` #6. ```dropLast(_:)``` yöntemini kullanma Karmaşıklık: Koleksiyon ```RandomAccessCollection``` ile uyumluysa O(1); aksi takdirde, O(k), burada k atılacak elemanların sayısıdır. ```let array = ["A", "B", "C", "D", "E", "F", "G", "H", "I", "J", "K", "L"] let distance = array.distance(from: 5, to: array.endIndex) let arraySlice = array.dropLast(distance) let newArray = Array(arraySlice) print(newArray) // ["A", "B", "C", "D", "E"] yazdırır ```
93
What's the simplest way to get an environment variable from a docker container that has not been declared in the Dockerfile? For instance, an environment variable that has been set through some ```docker exec container /bin/bash``` session? I can do ```docker exec container env | grep ENV_VAR```, but I would prefer something that just returns the value. I've tried using ```docker exec container echo "$ENV_VAR"```, but the substitution seems to happen outside of the container, so I don't get the env var from the container, but rather the env var from my own computer. Thanks.
Dockerfile'da bildirilmemiş bir docker kabından bir ortam değişkeni almanın en basit yolu nedir? Örneğin, ```docker exec container /bin/bash``` oturumu aracılığıyla ayarlanmış bir ortam değişkeni? ```docker exec container env | grep ENV_VAR``` yapabilirim, ancak yalnızca değeri döndüren bir şey tercih ederim. ```docker exec container echo "$ENV_VAR"``` kullanmayı denedim, ancak ikame işlemi konteynerin dışında gerçekleşiyor gibi görünüyor, bu nedenle konteynerden ortam değişkenini değil, kendi bilgisayarımdan ortam değişkenini alıyorum. Teşekkürler.
The downside of using ```docker exec``` is that it requires a running container, so ```docker inspect -f``` might be handy if you're unsure a container is running. Example #1. Output a list of space-separated environment variables in the specified container: ```docker inspect -f \ '{{range $index, $value := .Config.Env}}{{$value}} {{end}}' container_name ``` the output will look like this: ```ENV_VAR1=value1 ENV_VAR2=value2 ENV_VAR3=value3 ``` Example #2. Output each env var on new line and ```grep``` the needed items, for example, the mysql container's settings could be retrieved like this: ```docker inspect -f \ '{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' \ container_name | grep MYSQL_ ``` will output: ```MYSQL_PASSWORD=secret MYSQL_ROOT_PASSWORD=supersecret MYSQL_USER=demo MYSQL_DATABASE=demodb MYSQL_MAJOR=5.5 MYSQL_VERSION=5.5.52 ``` Example #3. Let's modify the example above to get a bash friendly output which can be directly used in your scripts: ```docker inspect -f \ '{{range $index, $value := .Config.Env}}export {{$value}}{{println}}{{end}}' \ container_name | grep MYSQL ``` will output: ```export MYSQL_PASSWORD=secret export MYSQL_ROOT_PASSWORD=supersecret export MYSQL_USER=demo export MYSQL_DATABASE=demodb export MYSQL_MAJOR=5.5 export MYSQL_VERSION=5.5.52 ``` If you want to dive deeper, then go to Go’s text/template package documentation with all the details of the format.
```docker exec``` kullanmanın dezavantajı, çalışan bir kapsayıcı gerektirmesidir, bu nedenle bir kapsayıcının çalışıp çalışmadığından emin değilseniz ```docker inspect -f``` kullanışlı olabilir. Örnek #1. Belirtilen kapsayıcıdaki boşlukla ayrılmış ortam değişkenlerinin bir listesini çıktı olarak verin: ```docker inspect -f \ '{{range $index, $value := .Config.Env}}{{$value}} {{end}}' container_name ``` çıktı şu şekilde görünecektir: ```ENV_VAR1=value1 ENV_VAR2=value2 ENV_VAR3=value3 ``` Örnek #2. Her bir ortam değişkenini yeni bir satıra yazdırın ve ```grep``` ile gerekli öğeleri alın, örneğin, mysql kapsayıcısının ayarları şu şekilde alınabilir: ```docker inspect -f \ '{{range $index, $value := .Config.Env}}{{println $value}}{{end}}' \ container_name | grep MYSQL_ ``` çıktı şu şekilde olacaktır: ```MYSQL_PASSWORD=secret MYSQL_ROOT_PASSWORD=supersecret MYSQL_USER=demo MYSQL_DATABASE=demodb MYSQL_MAJOR=5.5 MYSQL_VERSION=5.5.52 ``` Örnek #3. Yukarıdaki örneği, doğrudan komut dosyalarınızda kullanılabilecek bash dostu bir çıktı elde etmek için değiştirelim: ```docker inspect -f \ '{{range $index, $value := .Config.Env}}export {{$value}}{{println}}{{end}}' \ container_name | grep MYSQL ``` çıktı şu şekilde olacaktır: ```export MYSQL_PASSWORD=secret export MYSQL_ROOT_PASSWORD=supersecret export MYSQL_USER=demo export MYSQL_DATABASE=demodb export MYSQL_MAJOR=5.5 export MYSQL_VERSION=5.5.52 ``` Daha derine inmek istiyorsanız, formatın tüm ayrıntılarıyla Go'nun text/template paket belgelerine gidin.
94
I am confused about the use cases for both ```InputStream``` and ```OutputStream```. Please include a snippet of code to go along with your explanation.
Hem ```InputStream``` hem de ```OutputStream``` için kullanım durumları konusunda kafam karıştı. Açıklamanızla birlikte bir kod parçası ekleyin.
InputStream is used for reading, OutputStream for writing. They are connected as decorators to one another such that you can read/write all different types of data from all different types of sources. For example, you can write primitive data to a file: ```File file = new File("C:/text.bin"); file.createNewFile(); DataOutputStream stream = new DataOutputStream(new FileOutputStream(file)); stream.writeBoolean(true); stream.writeInt(1234); stream.close(); ``` To read the written contents: ```File file = new File("C:/text.bin"); DataInputStream stream = new DataInputStream(new FileInputStream(file)); boolean isTrue = stream.readBoolean(); int value = stream.readInt(); stream.close(); System.out.printlin(isTrue + " " + value); ``` You can use other types of streams to enhance the reading/writing. For example, you can introduce a buffer for efficiency: ```DataInputStream stream = new DataInputStream( new BufferedInputStream(new FileInputStream(file))); ``` You can write other data such as objects: ```MyClass myObject = new MyClass(); // MyClass have to implement Serializable ObjectOutputStream stream = new ObjectOutputStream( new FileOutputStream("C:/text.obj")); stream.writeObject(myObject); stream.close(); ``` You can read from other different input sources: ```byte[] test = new byte[] {0, 0, 1, 0, 0, 0, 1, 1, 8, 9}; DataInputStream stream = new DataInputStream(new ByteArrayInputStream(test)); int value0 = stream.readInt(); int value1 = stream.readInt(); byte value2 = stream.readByte(); byte value3 = stream.readByte(); stream.close(); System.out.println(value0 + " " + value1 + " " + value2 + " " + value3); ``` For most input streams there is an output stream, also. You can define your own streams to reading/writing special things and there are complex streams for reading complex things (for example there are Streams for reading/writing ZIP format).
InputStream okuma için, OutputStream yazma için kullanılır. Birbirlerine dekoratör olarak bağlanırlar, böylece her türlü kaynaktan her türlü veriyi okuyabilir/yazabilirsiniz. Örneğin, ilkel verileri bir dosyaya yazabilirsiniz: ```File file = new File("C:/text.bin"); file.createNewFile(); DataOutputStream stream = new DataOutputStream(new FileOutputStream(file)); stream.writeBoolean(true); stream.writeInt(1234); stream.close(); ``` Yazılan içeriği okumak için: ```File file = new File("C:/text.bin"); DataInputStream stream = new DataInputStream(new FileInputStream(file)); boolean isTrue = stream.readBoolean(); int value = stream.readInt(); stream.close(); System.out.printlin(isTrue + " " + value); ``` Okuma/yazmayı geliştirmek için başka tür akışlar kullanabilirsiniz. Örneğin, verimlilik için bir arabellek ekleyebilirsiniz: ```DataInputStream stream = new DataInputStream( new BufferedInputStream(new FileInputStream(file))); ``` Nesneler gibi başka veriler yazabilirsiniz: ```MyClass myObject = new MyClass(); // MyClass'ın Serializable'ı uygulaması gerekir ObjectOutputStream stream = new ObjectOutputStream( new FileOutputStream("C:/text.obj")); stream.writeObject(myObject); stream.close(); ``` Farklı giriş kaynaklarından okuyabilirsiniz: ```byte[] test = new byte[] {0, 0, 1, 0, 0, 0, 1, 1, 8, 9}; DataInputStream stream = new DataInputStream(new ByteArrayInputStream(test)); int value0 = stream.readInt(); int value1 = stream.readInt(); byte value2 = stream.readByte(); byte value3 = stream.readByte(); stream.close(); System.out.println(value0 + " " + value1 + " " + value2 + " " + value3); ``` Çoğu giriş akışı için bir çıkış akışı da vardır. Özel şeyleri okumak/yazmak için kendi akışlarınızı tanımlayabilirsiniz ve karmaşık şeyleri okumak için karmaşık akışlar vardır (örneğin, ZIP formatını okumak/yazmak için Akışlar vardır).
95
What is the difference between: ```npm install [package_name] ``` and: ```npm install [package_name] --save ``` and: ```npm install [package_name] --save-dev ``` What does this mean? And what is really the effect of ```--save``` and ```-dev``` keywords?
Aşağıdakiler arasındaki fark nedir: ```npm install [paket_adı] ``` ve: ```npm install [paket_adı] --save ``` ve: ```npm install [paket_adı] --save-dev ``` Bunun anlamı nedir? Ve ```--save``` ve ```-dev``` anahtar kelimelerinin gerçek etkisi nedir?
The difference between ```--save``` and ```--save-dev``` may not be immediately noticeable if you have tried them both on your own projects. So here are a few examples... Let's say you were building an app that used the moment package to parse and display dates. Your app is a scheduler so it really needs this package to run, as in: cannot run without it. In this case you would use ```npm install moment --save ``` This would create a new value in your package.json ```&quot;dependencies&quot;: { ... &quot;moment&quot;: &quot;^2.17.1&quot; } ``` When you are developing, it really helps to use tools such as test suites and may need jasmine-core and karma. In this case you would use ```npm install jasmine-core --save-dev npm install karma --save-dev ``` This would also create a new value in your package.json ```&quot;devDependencies&quot;: { ... &quot;jasmine-core&quot;: &quot;^2.5.2&quot;, &quot;karma&quot;: &quot;^1.4.1&quot;, } ``` You do not need the test suite to run the app in its normal state, so it is a ```--save-dev``` type dependency, nothing more. You can see how if you do not understand what is really happening, it is a bit hard to imagine. Taken directly from NPM docs docs#dependencies > Dependencies > Dependencies are specified in a simple object that maps a package name to a version range. The version range is a string that has one or more space-separated descriptors. Dependencies can also be identified with a tarball or git URL. Please do not put test harnesses or transpilers in your dependencies object. See devDependencies, below. Even in the docs, it asks you to use ```--save-dev``` for modules such as test harnesses.
```--save``` ve ```--save-dev``` arasındaki fark, ikisini de kendi projelerinizde denediyseniz hemen fark edilmeyebilir. İşte birkaç örnek... Moment paketini tarihleri ayrıştırmak ve görüntülemek için kullanan bir uygulama oluşturduğunuzu varsayalım. Uygulamanız bir zamanlayıcıdır, bu nedenle bu paketin çalışması için gerçekten ihtiyacı vardır: onsuz çalışamaz. Bu durumda şunu kullanırsınız: ```npm install moment --save ``` Bu, package.json'ınızda yeni bir değer oluşturur ```&quot;dependencies&quot;: { ... &quot;moment&quot;: &quot;^2.17.1&quot; } ``` Geliştirirken, test takımları gibi araçları kullanmak gerçekten yardımcı olur ve jasmine-core ve karma'ya ihtiyaç duyabilirsiniz. Bu durumda şunu kullanırsınız: ```npm install jasmine-core --save-dev npm install karma --save-dev ``` Bu ayrıca package.json'ınızda yeni bir değer oluşturur ```&quot;devDependencies&quot;: { ... &quot;jasmine-core&quot;: &quot;^2.5.2&quot;, &quot;karma&quot;: &quot;^1.4.1&quot;, } ``` Uygulamayı normal durumunda çalıştırmak için test takımına ihtiyacınız yoktur, bu nedenle bu bir ```--save-dev``` türü bağımlılıktır, daha fazlası değil. Gerçekte ne olduğunu anlamazsanız, hayal etmenin biraz zor olduğunu görebilirsiniz. Doğrudan NPM belgelerinden alınmıştır docs#dependencies > Bağımlılıklar > Bağımlılıklar, bir paket adını bir sürüm aralığına eşleyen basit bir nesnede belirtilir. Sürüm aralığı, bir veya daha fazla boşlukla ayrılmış tanımlayıcıya sahip bir dizedir. Bağımlılıklar ayrıca bir tarball veya git URL'si ile de tanımlanabilir. Lütfen test koşum takımlarını veya transpilerleri bağımlılık nesnenize koymayın. Aşağıda devDependencies'e bakın. Belgelerde bile test koşum takımları gibi modüller için ```--save-dev``` kullanmanız istenir.
96
pod install -bash: pod: command not found
pod install -bash: pod: komut bulunamadı
Please follow the following steps to install Pod: 1. Open terminal and type: ```sudo gem install cocoapods ``` Gem will get installed in Ruby inside the System library. Or try on 10.11 Mac OSX El Capitan, type: ```sudo gem install -n /usr/local/bin cocoapods ``` If there is an error &quot;activesupport requires Ruby version >= 2.xx&quot;, then install the latest active support first by typing in the terminal. ```sudo gem install activesupport -v 4.2.6 ``` 2. After installation, there will be a lot of messages, read them and if no error found, it means cocoa pod installation is done. Next, you need to set up the cocoa pod master repo. Type in terminal: ```pod setup ``` And wait it will download the master repo. The size is very big (370.0MB in Dec 2016). So it can be a while. You can track the download by opening Activity and go to the Network tab and search for git-remote-https. Alternatively, you can try adding verbose to the command like so: ```pod setup --verbose ``` 3. Once done it will output &quot;Setup Complete&quot;, and you can create your XCode project and save it. 4. Then in a terminal cd to &quot;your XCode project root directory&quot; (where your .xcodeproj file resides) and type: ```pod init ``` 5. Then open your project's podfile by typing in terminal: ```open -a Xcode Podfile ``` 6. Your Podfile will get open in text mode. Initially, there will be some default commands in there. Here is where you add your project's dependencies. For example, in the podfile, type ```/****** These are Third party pods names ******/ pod 'OpenSSL-Universal' pod 'IQKeyboardManager' pod 'FTPopOverMenu' pod 'TYMActivityIndicatorView' pod 'SCSkypeActivityIndicatorView' pod 'Google/SignIn' pod 'UPStackMenu' ``` (this is For example of adding library to your project). When you are done editing the podfile, save it and close XCode. 7. Then install pods into your project by typing in terminal: ```pod install ``` Depending on how many libraries you added to your podfile for your project, the time to complete this varies. Once completed, there will be a message that says &quot;Pod installation complete! There are X dependencies from the Podfile and X total pods installed.&quot;
Pod'u yüklemek için lütfen aşağıdaki adımları izleyin: 1. Terminali açın ve yazın: ```sudo gem install cocoapods ``` Gem, Sistem kitaplığı içindeki Ruby'ye yüklenecektir. Veya 10.11 Mac OSX El Capitan'da deneyin, yazın: ```sudo gem install -n /usr/local/bin cocoapods ``` "activesupport Ruby sürümü >= 2.xx gerektirir" hatası varsa, önce terminale yazarak en son aktif desteği yükleyin. ```sudo gem install activesupport -v 4.2.6 ``` 2. Yüklemeden sonra, bir sürü mesaj olacak, bunları okuyun ve hata bulunmazsa, bu kakao pod kurulumunun yapıldığı anlamına gelir. Ardından, kakao pod ana deposunu ayarlamanız gerekir. Terminale yazın: ```pod setup ``` Ve ana deponun indirilmesini bekleyin. Boyutu çok büyük (Aralık 2016'da 370,0 MB). Yani bir süre alabilir. Etkinliği açarak ve Ağ sekmesine giderek ve git-remote-https'yi arayarak indirmeyi takip edebilirsiniz. Alternatif olarak, komuta ayrıntılı bilgi eklemeyi deneyebilirsiniz: ```pod setup --verbose ``` 3. İşlem tamamlandığında "Kurulum Tamamlandı" çıktısı verecek ve XCode projenizi oluşturabilir ve kaydedebilirsiniz. 4. Ardından bir terminalde "XCode proje kök dizininize" (xcodeproj dosyanızın bulunduğu yere) cd yapın ve yazın: ```pod init ``` 5. Ardından projenizin pod dosyasını terminale yazarak açın: ```open -a Xcode Podfile ``` 6. Pod dosyanız metin modunda açılacaktır. Başlangıçta, orada bazı varsayılan komutlar olacaktır. Projenizin bağımlılıklarını eklediğiniz yer burasıdır. Örneğin, pod dosyasında yazın ```/****** Bunlar Üçüncü taraf pod adlarıdır ******/ pod 'OpenSSL-Universal' pod 'IQKeyboardManager' pod 'FTPopOverMenu' pod 'TYMActivityIndicatorView' pod 'SCSkypeActivityIndicatorView' pod 'Google/SignIn' pod 'UPStackMenu' ``` (Bu, projenize kitaplık ekleme örneğidir). Pod dosyasını düzenlemeyi tamamladığınızda, kaydedin ve XCode'u kapatın. 7. Ardından terminale yazarak pod'ları projenize yükleyin: ```pod install ``` Pod dosyanıza projeniz için kaç tane kitaplık eklediğinize bağlı olarak, bunu tamamlama süresi değişir. Tamamlandığında, "Pod kurulumu tamamlandı! Pod dosyasından X bağımlılık ve toplam X pod yüklendi." diyen bir mesaj olacaktır.
97
I read in the Essential C# 3.0 and .NET 3.5 book that: GetHashCode()’s returns over the life of a particular object should be constant (the same value), even if the object’s data changes. In many cases, you should cache the method return to enforce this. Is this a valid guideline? I have tried a couple built-in types in .NET and they didn't behave like this.
Essential C# 3.0 ve .NET 3.5 kitabında şunu okudum: GetHashCode()'in belirli bir nesnenin ömrü boyunca döndürdüğü değer, nesnenin verileri değişse bile sabit (aynı değer) olmalıdır. Birçok durumda, bunu uygulamak için yöntem dönüşünü önbelleğe almalısınız. Bu geçerli bir kılavuz mu? .NET'te birkaç yerleşik tür denedim ve bu şekilde davranmadılar.
The answer is mostly, it is a valid guideline, but perhaps not a valid rule. It also doesn't tell the whole story. The point being made is that for mutable types, you cannot base the hash code on the mutable data because two equal objects must return the same hash code and the hash code has to be valid for the lifetime of the object. If the hash code changes, you end up with an object that gets lost in a hashed collection because it no longer lives in the correct hash bin. For example, object A returns hash of 1. So, it goes in bin 1 of the hash table. Then you change object A such that it returns a hash of 2. When a hash table goes looking for it, it looks in bin 2 and can't find it - the object is orphaned in bin 1. This is why the hash code must not change for the lifetime of the object, and just one reason why writing GetHashCode implementations is a pain in the butt. A guideline is just a guide, not a rule. In reality, ```GetHashCode``` only has to follow these guidelines when things expect the object to follow the guidelines, such as when it is being stored in a hash table. If you never intend to use your objects in hash tables (or anything else that relies on the rules of ```GetHashCode```), your implementation doesn't need to follow the guidelines. When you see "for the lifetime of the object", you should read "for the time the object needs to co-operate with hash tables" or similar. Like most things, ```GetHashCode``` is about knowing when to break the rules.
Cevap çoğunlukla geçerli bir kılavuzdur, ancak belki de geçerli bir kural değildir. Ayrıca tüm hikayeyi anlatmaz. Vurgulanan nokta, değişken türler için, karma kodunu değişken verilere dayandıramayacağınızdır çünkü iki eşit nesne aynı karma kodunu döndürmelidir ve karma kodu nesnenin ömrü boyunca geçerli olmalıdır. Karma kodu değişirse, artık doğru karma bölmesinde yaşamadığı için karma bir koleksiyonda kaybolan bir nesneyle karşılaşırsınız. Örneğin, nesne A, 1 karma değeri döndürür. Bu nedenle, karma tablosunun 1. bölmesine gider. Ardından, nesne A'yı 2 karma değeri döndürecek şekilde değiştirirsiniz. Bir karma tablosu onu aradığında, 2. bölmeye bakar ve bulamaz - nesne 1. bölmede yetim kalır. Bu nedenle karma kodu nesnenin ömrü boyunca değişmemelidir ve GetHashCode uygulamalarını yazmanın can sıkıcı olmasının nedenlerinden sadece biridir. Bir kılavuz sadece bir kılavuzdur, bir kural değildir. Gerçekte, ```GetHashCode``` yalnızca bir karma tablosunda saklandığı gibi nesnenin kılavuzları izlemesini beklediğinde bu kılavuzları takip etmek zorundadır. Nesnelerinizi asla karma tablolarında (veya ```GetHashCode``` kurallarına dayanan başka bir şeyde) kullanmayı düşünmüyorsanız, uygulamanızın kılavuzları izlemesi gerekmez. "Nesnenin ömrü boyunca" ifadesini gördüğünüzde, "nesnenin karma tablolarıyla işbirliği yapması gereken süre" veya benzeri bir ifadeyi okumalısınız. Çoğu şey gibi, ```GetHashCode``` de kuralları ne zaman çiğneyeceğini bilmekle ilgilidir.
98
Especially in blitz or bullet games, it is possible that a player makes an illegal move, for example castles through check. * If the opponent does notice the illegal move, then as far as I know the first player is obliged to make a legal move with the same piece, if one exists. What if there are no legal moves? * What if the opponent, being in time pressure, doesn't notice the illegal move and makes a move. What happens after they realize that? Does the person who made the illegal move forfeit? Or is the whole game cancelled? Are there any standard rules for these kinds of situations?
Özellikle yıldırım veya mermi oyunlarında, bir oyuncunun yasa dışı bir hamle yapması mümkündür, örneğin şah çekerek kale yapmak. * Rakip yasa dışı hamleyi fark ederse, bildiğim kadarıyla ilk oyuncu aynı taşla yasal bir hamle yapmak zorundadır, eğer varsa. Ya yasal hamle yoksa? * Ya rakip, zaman baskısı altında olduğu için yasa dışı hamleyi fark etmezse ve bir hamle yaparsa. Bunu fark ettikten sonra ne olur? Yasa dışı hamleyi yapan kişi hükmen mi kaybeder? Yoksa tüm oyun iptal mi edilir? Bu tür durumlar için standart kurallar var mı?
This only really applies to over the board games (since online chess servers prevent illegal moves). In a standard time control game, under USCF rules, when the illegal move is noticed by one of the players, a few things happen. First, the illegal move must have been made within the last 10 moves. If not, then the current position stands, and play continues. Assuming that the move is recent, the position is restored to the position immediately before the illegal move. Then, the player that made the illegal move now must make a legal move with the same piece (if one exists). If there are no legal moves, then the player is free to make any move. This is due to the touch move rule. Finally, if the offending player has pressed the clock, a two minute &quot;bonus&quot; is added to the opponent's clock to compensate them for any time lost and to penalize the offending player. Here is the relevant passage from the USCF rulebook: 11A. Illegal move during last ten moves. If, during a game, it is found that one of either player's last ten moves was illegal, the position shall be reinstated to what it was before the illegal move. The game shall then continue by applying Rule 10, The Touched Piece, to the move replacing the illegal move. If the position cannot be reinstated, then the illegal move shall stand. Move counters on clocks that have them may by readjusted. 11D. Illegal move. If, a player completes an illegal move by pressing the clock, in addition to the usual obligation to make a legal move with the touched piece if possible, the standard penalty specified in rule 1C2a applies (i.e. two minutes added to the opponent's clock). In blitz chess, the rules are different. According to the WBCA (World Blitz Chess Association) rules, a player who makes an illegal move loses the game instantly. This rule is frequently enforced in casual games too. The most common way that this occurs is that one player doesn't notice that they are in check and makes a move that doesn't get out of check. Then the checking player simply captures the king and claims a victory. Because blitz is a much faster pace game, the illegal move must be noticed within two moves. If it is not, then the current position stands and play continues. At no point is the game cancelled due to an illegal move. Pretty much once a game starts and both players make a move, a result of win, loss, or draw will be recorded.
Bu durum yalnızca masa oyunları için geçerlidir (çünkü çevrimiçi satranç sunucuları yasa dışı hamleleri engeller). Standart bir zaman kontrolü oyununda, USCF kurallarına göre, yasa dışı hamle oyunculardan biri tarafından fark edildiğinde birkaç şey olur. İlk olarak, yasa dışı hamle son 10 hamle içinde yapılmış olmalıdır. Aksi takdirde, mevcut konum geçerliliğini korur ve oyun devam eder. Hamlenin yakın zamanda yapıldığını varsayarsak, konum yasa dışı hamleden hemen önceki konuma geri döndürülür. Ardından, yasa dışı hamleyi yapan oyuncu şimdi aynı taşla yasal bir hamle yapmak zorundadır (eğer varsa). Yasal hamle yoksa, oyuncu herhangi bir hamle yapma özgürlüğüne sahiptir. Bu, dokunma hamlesi kuralından kaynaklanmaktadır. Son olarak, suçlu oyuncu saati çalıştırdıysa, kaybedilen zamanı telafi etmek ve suçlu oyuncuyu cezalandırmak için rakibin saatine iki dakikalık bir "bonus" eklenir. İşte USCF kural kitabından ilgili bölüm: 11A. Son on hamle içinde yasa dışı hamle. Bir oyun sırasında, bir oyuncunun son on hamlesinden birinin yasa dışı olduğu tespit edilirse, konum yasa dışı hamleden önceki haline geri döndürülür. Oyun daha sonra, yasa dışı hamleyi değiştiren hamleye Dokunulan Taş Kuralı 10'u uygulayarak devam eder. Konum geri döndürülemezse, yasa dışı hamle geçerliliğini korur. Saati olan saatlerdeki hamle sayaçları yeniden ayarlanabilir. 11D. Yasa dışı hamle. Bir oyuncu, saati çalıştırarak yasa dışı bir hamleyi tamamlarsa, mümkünse dokunulan taşla yasal bir hamle yapma zorunluluğuna ek olarak, 1C2a kuralında belirtilen standart ceza uygulanır (yani rakibin saatine iki dakika eklenir). Şimşek satrançta kurallar farklıdır. WBCA'ya (Dünya Şimşek Satranç Birliği) göre, yasa dışı bir hamle yapan oyuncu oyunu anında kaybeder. Bu kural genellikle sıradan oyunlarda da uygulanır. Bunun meydana gelmesinin en yaygın yolu, bir oyuncunun şah çekildiğini fark etmemesi ve şah çekilmekten kurtulmayan bir hamle yapmasıdır. Ardından şah çeken oyuncu basitçe şahı alır ve zaferini ilan eder. Şimşek çok daha hızlı tempolu bir oyun olduğu için, yasa dışı hamle iki hamle içinde fark edilmelidir. Fark edilmezse, mevcut konum geçerliliğini korur ve oyun devam eder. Hiçbir noktada oyun yasa dışı bir hamle nedeniyle iptal edilmez. Bir oyun başladığında ve her iki oyuncu da bir hamle yaptığında, galibiyet, mağlubiyet veya beraberlik sonucu kaydedilir.
99
How to set button click effect in Android?
Android'de düğme tıklama efekti nasıl ayarlanır?
It is simpler when you have a lot of image buttons, and you don't want to write xml-s for every button. Kotlin Version: ```fun buttonEffect(button: View) { button.setOnTouchListener { v, event -> when (event.action) { MotionEvent.ACTION_DOWN -> { v.background.setColorFilter(-0x1f0b8adf, PorterDuff.Mode.SRC_ATOP) v.invalidate() } MotionEvent.ACTION_UP -> { v.background.clearColorFilter() v.invalidate() } } false } } ``` Java Version: ```public static void buttonEffect(View button){ button.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { v.getBackground().setColorFilter(0xe0f47521,PorterDuff.Mode.SRC_ATOP); v.invalidate(); break; } case MotionEvent.ACTION_UP: { v.getBackground().clearColorFilter(); v.invalidate(); break; } } return false; } }); } ```
Bir sürü resim düğmeniz olduğunda ve her düğme için xml yazmak istemediğinizde daha basittir. Kotlin Sürümü: ```fun buttonEffect(button: View) { button.setOnTouchListener { v, event -> when (event.action) { MotionEvent.ACTION_DOWN -> { v.background.setColorFilter(-0x1f0b8adf, PorterDuff.Mode.SRC_ATOP) v.invalidate() } MotionEvent.ACTION_UP -> { v.background.clearColorFilter() v.invalidate() } } false } } ``` Java Sürümü: ```public static void buttonEffect(View button){ button.setOnTouchListener(new OnTouchListener() { public boolean onTouch(View v, MotionEvent event) { switch (event.getAction()) { case MotionEvent.ACTION_DOWN: { v.getBackground().setColorFilter(0xe0f47521,PorterDuff.Mode.SRC_ATOP); v.invalidate(); break; } case MotionEvent.ACTION_UP: { v.getBackground().clearColorFilter(); v.invalidate(); break; } } return false; } }); } ```